Class RestDocumentService
java.lang.Object
com.logicaldoc.webservice.AbstractService
com.logicaldoc.webservice.soap.endpoint.SoapDocumentService
com.logicaldoc.webservice.rest.endpoint.RestDocumentService
- All Implemented Interfaces:
- DocumentService,- DocumentService
- Direct Known Subclasses:
- RestDocumentSwagger
@Path("/")
@Consumes({"application/xml","application/json"})
@Produces("application/json")
public class RestDocumentService
extends SoapDocumentService
implements DocumentService
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassclassclassclassclass
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds a new note for the given documentvoidcheckin(String docId, String comment, String releaseStr, String filename, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Check-in an existing document Performs a check-in (commit) operation of new content over an existing document.voidcheckout(long docId) Executed the checkoutcopy(long docId, long folderId, boolean links, boolean notes, boolean security) Copies a document into another foldercreate(WSDocument document, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) Creates a new document using the metadata document object provided as JSON/XMLcreateAlias(long docId, long folderId, String type) Creates a new document alias for the given document inside a specified foldercreateDownloadTicket(long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads) Creates a new download ticketvoidCreates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happenvoidcreateThumbnail(long docId, String fileVersion, String type) Creates the thumbail of the given document; if the thumbnail was already created, nothing will happencreateViewTicket(long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads, Integer maxViews) Creates a new download ticketvoiddelete(long docId) Deletes a documentvoiddeleteLink(long id) Removes an existing linkvoiddeleteNote(long noteId) Deletes a new note by note identifierdeleteVersion(long docId, String version) Deletes a version by document identifier and version ID.getAccessControlList(long docId) Retrieves the access control listgetAliases(long docId) Gets the aliases of the given documentjakarta.activation.DataHandlergetContent(long docId) Retrieves the file content of a document.getDocument(long docId) Retrieves a document from the databasegetDocumentByCustomId(String customId) Gets document metadata of an existing document with the given custom identifiergetDocuments(List<Long> docIds) Gets document metadata of a collection of existing documents with the given identifiersgetExtractedText(long docId) Gets the document's text stored in the full-text indexgetLinks(long docId) Gets all the links of a specific documentgetNotes(long docId) Gets the notes for the given documentgetRatings(long docId) Gets all the ratings of the given documentgetRecentDocuments(Integer maxHits) Lists of last modified documents of the current sessionjakarta.activation.DataHandlergetResource(long docId, String fileVersion, String suffix) Gets the content of a resource associated to the given document.jakarta.ws.rs.core.ResponsegetThumbnail(String type, String docPath, List<jakarta.ws.rs.core.PathSegment> docPathList) Retrieves the thumbnail imagejakarta.activation.DataHandlergetVersionContent(long docId, String version) Retrieves the file content of a version.getVersions(long docId) Gets the version history of an existing document with the given identifierbooleanisDownload(long docId) Tests if a document is downloadable.booleanTests if the current user has a specific permission on a documentbooleanisRead(long docId) Tests if a document is readable.booleanisWrite(long docId) Tests if a document is writableCreates a new link between two documents.list(long folderId) Lists the documents in a folderlistDocuments(long folderId, String fileName) Lists the documents in a folderlistPaginated(long folderId, String fileName, String sort, Integer page, Integer max) Gets the documents in a specific foldervoidlock(long docId) Locks an existing document with the given identifier.voidmove(long docId, long folderId) Moves an existing document with the given identifiervoidpromoteVersion(long docId, String version) Promotes an old version to the current default one.rateDocument(long docId, int vote) Puts a new rating on the given documentvoidRe-indexes(or indexes from scratch) a documentvoidRenames the title of an existing document with the given identifier.voidreplaceFile(String docId, String fileVersion, String comment, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Replace the file of a version Replaces the file associated to a given version.voidrestore(long docId, long folderId) Restores a deleted documentAdds a new note for the given documentvoidSends a set of documents as mail attachmentsvoidsetAccessControlList(long docId, List<WSAccessControlEntry> acl) Sets the Access Control ListvoidsetPassword(long docId, String password) Puts a password protection to the documentvoidunlock(long docId) Unlocks an existing document with the given identifier.booleanUnprotects a document that is password protected.voidunsetPassword(long docId, String currentPassword) Removes the password protection from the documentvoidupdate(WSDocument document) Updates an existing document with the value object containing the document's metadata.upload(String docId, String folderId, String release, String filename, String language, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Uploads a document Creates or updates an existing document, if used in update mode docId must be provided, when used in create mode folderId is required.voiduploadResource(String docId, String fileVersion, String suffix, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) Uploads a new resource of the document Uploads a new resource attached to the given document.Methods inherited from class com.logicaldoc.webservice.soap.endpoint.SoapDocumentServiceaddNote, checkin, checkin, checkinDocument, checkinDocument, checkout, copy, create, create, createAlias, createDownloadTicket, createPdf, createThumbnail, createViewTicket, delete, deleteLink, deleteNote, deleteVersion, getAccessControlList, getAliases, getContent, getDocument, getDocumentByCustomId, getDocuments, getExtractedText, getLinks, getNotes, getRatings, getRecentDocuments, getResource, getVersion, getVersionContent, getVersions, isDownload, isGranted, isRead, isWrite, link, list, listDocuments, lock, move, promoteVersion, rateDocument, reindex, rename, replaceFile, restore, saveNote, sendEmail, setAccessControlList, setPassword, unlock, unprotect, unsetPassword, update, upload, uploadResourceMethods inherited from class com.logicaldoc.webservice.AbstractServiceconvertDateToString, convertStringToDate, getCurrentMessage, isValidateSession, setCurrentMessage, setValidateSession
- 
Constructor Details- 
RestDocumentServicepublic RestDocumentService()
 
- 
- 
Method Details- 
create@POST @Path("/create") @Consumes("multipart/form-data") @Produces("application/json") public WSDocument create(WSDocument document, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) Creates a new document using the metadata document object provided as JSON/XML- Specified by:
- createin interface- DocumentService
- Parameters:
- document- the document's metadata
- contentDetail- the file content
- Returns:
- the created document
 
- 
getDocument@GET @Path("/getDocument") @Produces({"application/json","application/xml"}) public WSDocument getDocument(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceRetrieves a document from the database- Specified by:
- getDocumentin interface- DocumentService
- Parameters:
- docId- identifier of the document
- Returns:
- the document object representation
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
checkout@POST @Path("/checkout") @Consumes("application/x-www-form-urlencoded") public void checkout(@FormParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceExecuted the checkout- Specified by:
- checkoutin interface- DocumentService
- Parameters:
- docId- identifier of the document
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
checkin@POST @Path("/checkin") @Consumes("multipart/form-data") public void checkin(String docId, String comment, String releaseStr, String filename, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Description copied from interface:DocumentServiceCheck-in an existing document Performs a check-in (commit) operation of new content over an existing document. The document must be in checked-out status- Specified by:
- checkinin interface- DocumentService
- Parameters:
- docId- identifier of the document
- comment- version comment
- releaseStr- it this is a major version or not
- filename- filename of the document
- filedataDetail- binary content of the file
 
- 
upload@POST @Path("/upload") @Consumes("multipart/form-data") public Long upload(String docId, String folderId, String release, String filename, String language, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Description copied from interface:DocumentServiceUploads a document Creates or updates an existing document, if used in update mode docId must be provided, when used in create mode folderId is required. Returns the ID of the created/updated document. <br/>Example: curl -u admin:admin -H ''Accept: application/json'' -X POST -F folderId=4 -F filename=newDoc.txt -F filedata=@newDoc.txt http://localhost:8080/services/rest/document/upload- Specified by:
- uploadin interface- DocumentService
- Parameters:
- docId- identifier of the document (string format)
- folderId- identifier of the folder
- release- if the upload must produce a major release or now
- filename- name of the file
- language- the document's language
- filedataDetail- the binary content
- Returns:
- identifier of the updated document
 
- 
replaceFile@POST @Path("/replaceFile") @Consumes("multipart/form-data") public void replaceFile(String docId, String fileVersion, String comment, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Replace the file of a version Replaces the file associated to a given version.- Specified by:
- replaceFilein interface- DocumentService
- Parameters:
- docId- identifier of the document
- fileVersion- the file version
- comment- version comment
- filedataDetail- binary content of the file
 
- 
delete@DELETE @Path("/delete") public void delete(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceDeletes a document- Specified by:
- deletein interface- DocumentService
- Parameters:
- docId- identifier of the document to delete
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
list@GET @Path("/list") @Produces("application/json") public List<WSDocument> list(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceLists the documents in a folder- Specified by:
- listin interface- DocumentService
- Parameters:
- folderId- identifier of the folder
- Returns:
- array of documents contained in the folder
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
listPaginated@GET @Path("/listPaginated") @Produces("application/json") public List<WSDocument> listPaginated(@QueryParam("folderId") long folderId, @QueryParam("fileName") String fileName, @QueryParam("sort") String sort, @QueryParam("page") Integer page, @QueryParam("max") Integer max) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Gets the documents in a specific folder- Specified by:
- listPaginatedin interface- DocumentService
- Parameters:
- folderId- The folder id
- fileName- Optional file name filter
- sort- Optional sort criteria
- page- Optional page number
- max- Optional maximum number of elements per page
- Returns:
- Collection of documents
- Throws:
- PersistenceException- Error in the database
- WebserviceException- Error in the webservice
- AuthenticationException- Invalid session
- PermissionException- The user does not have the required permission
 
- 
listDocuments@GET @Path("/listDocuments") public List<WSDocument> listDocuments(@QueryParam("folderId") long folderId, @QueryParam("fileName") String fileName) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceLists the documents in a folder- Specified by:
- listDocumentsin interface- DocumentService
- Parameters:
- folderId- identifier of the folder
- fileName- a file name to use as filter
- Returns:
- array of documents contained in the folder
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getContent@GET @Path("/getContent") @Produces("application/octet-stream") public jakarta.activation.DataHandler getContent(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentServiceRetrieves the file content of a document.- Specified by:
- getContentin interface- DocumentService
- Parameters:
- docId- identifier of the document
- Returns:
- the contents
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
 
- 
getVersionContent@GET @Path("/getVersionContent") @Produces("application/octet-stream") public jakarta.activation.DataHandler getVersionContent(@QueryParam("docId") long docId, @QueryParam("version") String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentServiceRetrieves the file content of a version.- Specified by:
- getVersionContentin interface- DocumentService
- Parameters:
- docId- identifier of the document
- version- version specification
- Returns:
- the contents
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
 
- 
deleteVersion@DELETE @Path("/deleteVersion") public String deleteVersion(@QueryParam("docId") long docId, @QueryParam("version") String version) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceDeletes a version by document identifier and version ID. You can not delete the latest version of a document- Specified by:
- deleteVersionin interface- DocumentService
- Parameters:
- docId- identifier of the document
- version- the document's version
- Returns:
- the latest version of the document
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
update@PUT @Path("/update") public void update(WSDocument document) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceUpdates an existing document with the value object containing the document's metadata.- Specified by:
- updatein interface- DocumentService
- Parameters:
- document- the document to update
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
addNote@POST @Path("/addNote") @Consumes("application/x-www-form-urlencoded") public WSNote addNote(@FormParam("docId") long docId, @FormParam("note") String note) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceAdds a new note for the given document- Specified by:
- addNotein interface- DocumentService
- Parameters:
- docId- identifier of the document
- note- the note to add
- Returns:
- the added note
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
deleteNote@DELETE @Path("/deleteNote") public void deleteNote(@QueryParam("noteId") long noteId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceDeletes a new note by note identifier- Specified by:
- deleteNotein interface- DocumentService
- Parameters:
- noteId- identifier of the note
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getNotes@GET @Path("/getNotes") public List<WSNote> getNotes(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceGets the notes for the given document- Specified by:
- getNotesin interface- DocumentService
- Parameters:
- docId- identifier of the document
- Returns:
- List of notes
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
rateDocument@PUT @Path("/rateDocument") public WSRating rateDocument(@QueryParam("docId") long docId, @QueryParam("vote") int vote) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServicePuts a new rating on the given document- Specified by:
- rateDocumentin interface- DocumentService
- Parameters:
- docId- identifier of the document
- vote- the vote
- Returns:
- the voted document
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
getRatings@GET @Path("/getRatings") public List<WSRating> getRatings(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceGets all the ratings of the given document- Specified by:
- getRatingsin interface- DocumentService
- Parameters:
- docId- identifier of the document
- Returns:
- the ratings
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
move@PUT @Path("/move") public void move(@QueryParam("docId") long docId, @QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceMoves an existing document with the given identifier- Specified by:
- movein interface- DocumentService
- Parameters:
- docId- The document id
- folderId- Identifier of the new document's folder
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The requested document does not exist
 
- 
copy@PUT @Path("/copy") @Produces("application/json") public WSDocument copy(@QueryParam("docId") long docId, @QueryParam("folderId") long folderId, @QueryParam("links") boolean links, @QueryParam("notes") boolean notes, @QueryParam("security") boolean security) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentServiceCopies a document into another folder- Specified by:
- copyin interface- DocumentService
- Parameters:
- docId- The document id
- folderId- Identifier of the new document's folder
- links- If links must be copied too
- notes- If notes and annotations must be copied too
- Returns:
- The new copy
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
 
- 
createThumbnail@PUT @Path("/createThumbnail") public void createThumbnail(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion, @QueryParam("type") String type) throws AuthenticationException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentServiceCreates the thumbail of the given document; if the thumbnail was already created, nothing will happen- Specified by:
- createThumbnailin interface- DocumentService
- Parameters:
- docId- The document id
- fileVersion- The specific file version(it can be empty)
- type- The thumbnail type(eg: thumbnail, tile, mobile)
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
 
- 
createPdf@PUT @Path("/createPdf") public void createPdf(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentServiceCreates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happen- Specified by:
- createPdfin interface- DocumentService
- Parameters:
- docId- The document id
- fileVersion- The specific file version(it can be empty)
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
 
- 
promoteVersion@PUT @Path("/promoteVersion") public void promoteVersion(@QueryParam("docId") long docId, @QueryParam("version") String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException, UnexistingResourceException Description copied from interface:DocumentServicePromotes an old version to the current default one. If you promote a prior version, what it does is make it the default version again. (regardless of there being many versions).- Specified by:
- promoteVersionin interface- DocumentService
- Parameters:
- docId- the document to be updated
- version- the version
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
- UnexistingResourceException- The specified document does not exist
 
- 
rename@PUT @Path("/rename") public void rename(@QueryParam("docId") long docId, @QueryParam("name") String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceRenames the title of an existing document with the given identifier.- Specified by:
- renamein interface- DocumentService
- Parameters:
- docId- The document id
- name- The new document filename
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
getVersions@GET @Path("/getVersions") public List<WSDocument> getVersions(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceGets the version history of an existing document with the given identifier- Specified by:
- getVersionsin interface- DocumentService
- Parameters:
- docId- The document id
- Returns:
- Array of versions
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
createAlias@POST @Path("/createAlias") @Consumes("application/x-www-form-urlencoded") public WSDocument createAlias(@FormParam("docId") long docId, @FormParam("folderId") long folderId, @FormParam("type") String type) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceCreates a new document alias for the given document inside a specified folder- Specified by:
- createAliasin interface- DocumentService
- Parameters:
- docId- The original document id
- folderId- Identifier of the folder in which will be stored the alias.
- type- Type of the alias
- Returns:
- The value object containing the document's metadata
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
createDownloadTicket@POST @Path("/createDownloadTicket") @Consumes("application/x-www-form-urlencoded") public String createDownloadTicket(@FormParam("docId") long docId, @FormParam("suffix") String suffix, @FormParam("expireHours") Integer expireHours, @FormParam("expireDate") String expireDate, @FormParam("maxDownloads") Integer maxDownloads) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentServiceCreates a new download ticket- Specified by:
- createDownloadTicketin interface- DocumentService
- Parameters:
- docId- identifier of the document
- suffix- can be null or 'conversion.pdf'
- expireHours- expiration time expressed in hours
- expireDate- exact expiration date expressed in the format yyyy-MM-dd
- maxDownloads- maximum number of admitted downloads
- Returns:
- the download ticket
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- PermissionException- The user does not have the download permission
 
- 
createViewTicket@POST @Path("/createViewTicket") @Consumes("application/x-www-form-urlencoded") public String createViewTicket(@FormParam("docId") long docId, @FormParam("suffix") String suffix, @FormParam("expireHours") Integer expireHours, @FormParam("expireDate") String expireDate, @FormParam("maxDownloads") Integer maxDownloads, @FormParam("maxViews") Integer maxViews) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentServiceCreates a new download ticket- Specified by:
- createViewTicketin interface- DocumentService
- Parameters:
- docId- identifier of the document
- suffix- can be null or 'conversion.pdf'
- expireHours- expiration time expressed in hours
- expireDate- exact expiration date expressed in the format yyyy-MM-dd
- maxDownloads- maximum number of admitted downloads
- maxViews- maximum number of admitted views
- Returns:
- the download ticket
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- PermissionException- The user does not have the download permission
 
- 
deleteLink@DELETE @Path("/deleteLink") public void deleteLink(@QueryParam("id") long id) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceRemoves an existing link- Specified by:
- deleteLinkin interface- DocumentService
- Parameters:
- id- ID of the link
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getAliases@GET @Path("/getAliases") public List<WSDocument> getAliases(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceGets the aliases of the given document- Specified by:
- getAliasesin interface- DocumentService
- Parameters:
- docId- The master document ID
- Returns:
- List of aliases
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getDocumentByCustomId@GET @Path("/getDocumentByCustomId") public WSDocument getDocumentByCustomId(@QueryParam("customId") String customId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceGets document metadata of an existing document with the given custom identifier- Specified by:
- getDocumentByCustomIdin interface- DocumentService
- Parameters:
- customId- The custom id
- Returns:
- A value object containing the document's metadata
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getDocuments@GET @Path("/getDocuments") public List<WSDocument> getDocuments(@QueryParam("docIds") List<Long> docIds) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceGets document metadata of a collection of existing documents with the given identifiers- Specified by:
- getDocumentsin interface- DocumentService
- Parameters:
- docIds- identifiers of the documents
- Returns:
- the list of documents
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getExtractedText@GET @Path("/getExtractedText") @Produces("text/plain") public String getExtractedText(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceGets the document's text stored in the full-text index- Specified by:
- getExtractedTextin interface- DocumentService
- Parameters:
- docId- The document id
- Returns:
- The requested document's text
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getRecentDocuments@GET @Path("/getRecentDocuments") public List<WSDocument> getRecentDocuments(@QueryParam("maxHits") Integer maxHits) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceLists of last modified documents of the current session- Specified by:
- getRecentDocumentsin interface- DocumentService
- Parameters:
- maxHits- Maximum number of returned records
- Returns:
- List of documents
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getLinks@GET @Path("/getLinks") public List<WSLink> getLinks(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceGets all the links of a specific document- Specified by:
- getLinksin interface- DocumentService
- Parameters:
- docId- ID of the document
- Returns:
- The new links of the document
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
getResource@GET @Path("/getResource") @Produces("application/octet-stream") public jakarta.activation.DataHandler getResource(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion, @QueryParam("suffix") String suffix) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentServiceGets the content of a resource associated to the given document.- Specified by:
- getResourcein interface- DocumentService
- Parameters:
- docId- The document id
- fileVersion- The specific file version(it can be empty)
- suffix- Suffix specification(it can be empty, conversion.pdf to get the PDF conversion)
- Returns:
- The requested resource's binary
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
 
- 
link@POST @Path("/link") @Consumes("application/x-www-form-urlencoded") public WSLink link(@FormParam("doc1") long doc1, @FormParam("doc2") long doc2, @FormParam("type") String type) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceCreates a new link between two documents.- Specified by:
- linkin interface- DocumentService
- Parameters:
- doc1- ID of document 1
- doc2- ID of document 2
- type- The link type(it can be empty)
- Returns:
- the new link
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
lock@PUT @Path("/lock") public void lock(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceLocks an existing document with the given identifier.- Specified by:
- lockin interface- DocumentService
- Parameters:
- docId- The document id
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
reindex@POST @Path("/reindex") @Consumes("application/x-www-form-urlencoded") public void reindex(@FormParam("doc1") long docId, @FormParam("content") String content) throws AuthenticationException, ParsingException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceRe-indexes(or indexes from scratch) a document- Specified by:
- reindexin interface- DocumentService
- Parameters:
- docId- The document id
- content- The content to be used (if null the file is parsed)
- Throws:
- AuthenticationException- Invalid credentials
- ParsingException- Error parsing the content
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
uploadResource@POST @Path("/uploadResource") @Consumes("multipart/form-data") public void uploadResource(String docId, String fileVersion, String suffix, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentServiceUploads a new resource of the document Uploads a new resource attached to the given document. If the resource already exists it is overwritten- Specified by:
- uploadResourcein interface- DocumentService
- Parameters:
- docId- identifier of the document
- fileVersion- version of the file
- suffix- suffix specification
- contentDetail- file content
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
 
- 
restore@PUT @Path("/restore") public void restore(@QueryParam("docId") long docId, @QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceRestores a deleted document- Specified by:
- restorein interface- DocumentService
- Parameters:
- docId- The document id
- folderId- Id of the folder in which the document must be restored
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
saveNote@POST @Path("/saveNote") @Consumes("application/x-www-form-urlencoded") public WSNote saveNote(@FormParam("docId") long docId, @FormParam("note") WSNote note) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceAdds a new note for the given document- Specified by:
- saveNotein interface- DocumentService
- Parameters:
- docId- identifier of the document
- note- the note to add
- Returns:
- the added note
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
sendEmail@POST @Path("/sendEmail") @Consumes("application/x-www-form-urlencoded") public void sendEmail(@FormParam("docIds") List<Long> docIds, @FormParam("recipients") String recipients, @FormParam("subject") String subject, @FormParam("message") String message) throws AuthenticationException, WebserviceException, PersistenceException, IOException, jakarta.mail.MessagingException Description copied from interface:DocumentServiceSends a set of documents as mail attachments- Specified by:
- sendEmailin interface- DocumentService
- Parameters:
- docIds- Set of document identifiers
- recipients- Set of recipients(comma separated)
- subject- The email subject
- message- The email message body
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
- jakarta.mail.MessagingException- Error in the communication with the mail server
 
- 
setPassword@POST @Path("/setPassword") @Consumes("application/x-www-form-urlencoded") public void setPassword(@FormParam("docId") long docId, @FormParam("password") String password) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServicePuts a password protection to the document- Specified by:
- setPasswordin interface- DocumentService
- Parameters:
- docId- identifier of the document
- password- the new password
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
unlock@PUT @Path("/unlock") public void unlock(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceUnlocks an existing document with the given identifier.- Specified by:
- unlockin interface- DocumentService
- Parameters:
- docId- identifier of the document
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
unsetPassword@POST @Path("/unsetPassword") @Consumes("application/x-www-form-urlencoded") public void unsetPassword(@FormParam("docId") long docId, @FormParam("currentPassword") String currentPassword) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentServiceRemoves the password protection from the document- Specified by:
- unsetPasswordin interface- DocumentService
- Parameters:
- docId- identifier of the document
- currentPassword- the password
- Throws:
- AuthenticationException- Invalid credentials
- PermissionException- The current user does not have enough permissions
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- UnexistingResourceException- The specified document does not exist
 
- 
unprotect@POST @Path("/unprotect") @Consumes("application/x-www-form-urlencoded") public boolean unprotect(@FormParam("docId") long docId, @FormParam("password") String password) throws PersistenceException, AuthenticationException, WebserviceException Description copied from interface:DocumentServiceUnprotects a document that is password protected. If the given password is right, the document remains unprotected for the duration of the session- Specified by:
- unprotectin interface- DocumentService
- Parameters:
- docId- identifier of the document
- password- the password
- Returns:
- was it uprotected?
- Throws:
- PersistenceException- Error in the database
- AuthenticationException- Invalid session
- WebserviceException- A generic error in the WebService
 
- 
getThumbnail@GET @Path("/thumbnail/{type}/{docpath:.*}") @Produces("image/png") public jakarta.ws.rs.core.Response getThumbnail(@PathParam("type") String type, @PathParam("docpath") String docPath, @PathParam("docpath") List<jakarta.ws.rs.core.PathSegment> docPathList) throws AuthenticationException, WebserviceException, PersistenceException, IOException, PermissionException Description copied from interface:DocumentServiceRetrieves the thumbnail image- Specified by:
- getThumbnailin interface- DocumentService
- Parameters:
- type- type of the thumbnail
- docPath- path of the document
- docPathList- path of the document
- Returns:
- image content
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
- IOException- I/O error
- PermissionException- The current user does not have enough permissions
 
- 
isRead@GET @Path("/isRead") public boolean isRead(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceTests if a document is readable.- Specified by:
- isReadin interface- DocumentService
- Parameters:
- docId- The document id
- Returns:
- True if the identifier denotes a readable document, otherwise false.
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
isDownload@GET @Path("/isDownload") public boolean isDownload(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceTests if a document is downloadable.- Specified by:
- isDownloadin interface- DocumentService
- Parameters:
- docId- The document id
- Returns:
- True if the identifier denotes a downloadable document, otherwise false.
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
isWrite@GET @Path("/isWrite") public boolean isWrite(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceTests if a document is writable- Specified by:
- isWritein interface- DocumentService
- Parameters:
- docId- The document id
- Returns:
- True if the identifier denotes a writable document, otherwise false
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
isGranted@GET @Path("/isGranted") public boolean isGranted(@QueryParam("docId") long docId, @QueryParam("permission") String permission) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentServiceTests if the current user has a specific permission on a document- Specified by:
- isGrantedin interface- DocumentService
- Parameters:
- docId- The document id
- permission- The permission to check (eg: 'read', 'write', ...)
- Returns:
- True if the identifier denotes a granted permission, otherwise false
- Throws:
- AuthenticationException- Invalid credentials
- WebserviceException- A generic error in the WebService
- PersistenceException- Error in the database
 
- 
setAccessControlList@PUT @Path("/setAccessControlList") public void setAccessControlList(@QueryParam("docId") long docId, List<WSAccessControlEntry> acl) throws PersistenceException, PermissionException, AuthenticationException, WebserviceException Description copied from interface:DocumentServiceSets the Access Control List- Specified by:
- setAccessControlListin interface- DocumentService
- Parameters:
- docId- Document id
- acl- the complete Access Control List
- Throws:
- PersistenceException- Error in the database
- PermissionException- The user does not have the required permission
- AuthenticationException- Invalid session
- WebserviceException- Error in the webservice
 
- 
getAccessControlList@GET @Path("/getAccessControlList") public List<WSAccessControlEntry> getAccessControlList(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentServiceRetrieves the access control list- Specified by:
- getAccessControlListin interface- DocumentService
- Parameters:
- docId- Document id
- Returns:
- 'error' if error occurred, the right objects collection
- Throws:
- AuthenticationException- Invalid session
- WebserviceException- Error in the webservice
- PersistenceException- Error in the database
- PermissionException- The permission has not been granted
 
 
-