2 Replies Latest reply on Apr 15, 2013 3:45 PM by kyanring

    DocumentAlreadyExists Search Query

      Hi everyone,

       

      I am developing a file upload plugin for Jive6 and I am trying to validate server-side if the document name entered is already taken or not in the space it is being created. I have come across the DocumentManager which has a the function .getDocuments(Container container) which returns a list of Documents within the container. However it seems this method has been deprecated in Jive6...

       

      I have not been successful in my research so far. I'm still looking, but in the meantime I was wondering if anyone has ever had experience with this and who would be willing to share their knowledge!

       

      Thanks a lot in advance

       

      Jive Plugin Developer

        • Re: DocumentAlreadyExists Search Query
          jrenaud

          I wonder if maybe Ryan King or Mark Weitzel are aware of a solution in the APIs that could allow checking if a document name is "available" and/or be accepted as valid in a given space, without having to actually try saving the file under that name?

           

          Or does this doesn't make sense at all?

          • Re: DocumentAlreadyExists Search Query

            Unfortunately, there is not DocumentManager-level method to determine whether a Document with a particular name exists within a place.  The Jive code that actually performs this check as part of the document creation process uses the getByDocumentTitle() method on the DocumentDAO class.

             

            DocumentBean getByDocumentTitle(int containerType, long containerID, String title) throws DAOException;
            

             

            It returns null if a document with that name does not exist in the place you specified.