Class RestDocumentMetadataService
java.lang.Object
com.logicaldoc.webservice.AbstractService
com.logicaldoc.webservice.soap.endpoint.SoapDocumentMetadataService
com.logicaldoc.webservice.rest.endpoint.RestDocumentMetadataService
- All Implemented Interfaces:
DocumentMetadataService
,DocumentMetadataService
- Direct Known Subclasses:
RestDocumentMetadataSwagger
@Path("/")
@Consumes("application/json")
@Produces("application/json")
public class RestDocumentMetadataService
extends SoapDocumentMetadataService
implements DocumentMetadataService
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttributeOption
(long setId, String attribute, WSAttributeOption option) Add a new option for the given attributevoid
deleteAttributeSet
(long setId) Deletes an existing attribute set with the given identifier.void
deleteTemplate
(long templateId) Deletes an existing template with the given identifiergetAttributeOptions
(long setId, String attribute) Retrieves the options for the given attributegetAttributeSet
(String name) Gets attribute set's metadatagetAttributeSetById
(long setId) Gets attribute set's metadatagetTemplate
(String name) Gets template's metadatagetTemplateById
(long templateId) Gets template's metadataGets metadata of all existing attribute sets.Gets metadata of all existing templates.void
setAttributeOptions
(long setId, String attribute, List<WSAttributeOption> options) Saves the options for the given attributevoid
setAttributeOptionsPOST
(Long setId, String attribute, List<WSAttributeOption> options) Saves the options for the given attribute with a POST method.long
storeAttributeSet
(WSAttributeSet attributeSet) Create/Update an attribute set.long
storeTemplate
(WSTemplate template) Create/Update a template.Methods inherited from class com.logicaldoc.webservice.soap.endpoint.SoapDocumentMetadataService
addAttributeOption, deleteAttributeSet, deleteTemplate, getAccessControlList, getAttributeOptions, getAttributeOptionsByCategory, getAttributeSet, getAttributeSetById, getTemplate, getTemplateById, isReadable, isWritable, listAttributeSets, listTemplates, setAccessControlList, setAttributeOptions, storeAttributeSet, storeTemplate
Methods inherited from class com.logicaldoc.webservice.AbstractService
convertDateToString, convertStringToDate, getCurrentMessage, isValidateSession, setCurrentMessage, setValidateSession
-
Constructor Details
-
RestDocumentMetadataService
public RestDocumentMetadataService()
-
-
Method Details
-
setAttributeOptions
@PUT @Path("/setAttributeOptions") public void setAttributeOptions(@QueryParam("setId") long setId, @QueryParam("attribute") String attribute, @QueryParam("options") List<WSAttributeOption> options) throws WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Saves the options for the given attribute- Specified by:
setAttributeOptions
in interfaceDocumentMetadataService
- Parameters:
setId
- The attribute set's idattribute
- The attribute's nameoptions
- The attribute's options- Throws:
WebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
storeAttributeSet
@POST @Path("/storeAttributeSet") public long storeAttributeSet(WSAttributeSet attributeSet) throws WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Create/Update an attribute set. You can completely customize the attribute set through a value object containing the attribute set's metadata.- Specified by:
storeAttributeSet
in interfaceDocumentMetadataService
- Parameters:
attributeSet
- set's value object containing the attribute set's metadata- Returns:
- The ID of the new attribute set
- Throws:
WebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
storeTemplate
@POST @Path("/storeTemplate") public long storeTemplate(WSTemplate template) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Create/Update a template. You can completely customize the template through a value object.- Specified by:
storeTemplate
in interfaceDocumentMetadataService
- Parameters:
template
- value object containing the template's metadata- Returns:
- The ID of the new template
- Throws:
AuthenticationException
- Invalid sessionPermissionException
- The permission has not been grantedWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getAttributeSetById
@GET @Path("/getAttributeSetById") public WSAttributeSet getAttributeSetById(@QueryParam("setId") long setId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Gets attribute set's metadata- Specified by:
getAttributeSetById
in interfaceDocumentMetadataService
- Parameters:
setId
- The attribute set's id- Returns:
- the attribute set
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getAttributeSet
@GET @Path("/getAttributeSet") public WSAttributeSet getAttributeSet(@QueryParam("name") String name) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Gets attribute set's metadata- Specified by:
getAttributeSet
in interfaceDocumentMetadataService
- Parameters:
name
- The attribute set's name- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getTemplate
@GET @Path("/getTemplate") public WSTemplate getTemplate(@QueryParam("name") String name) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Gets template's metadata- Specified by:
getTemplate
in interfaceDocumentMetadataService
- Parameters:
name
- The template's name- Returns:
- A value object containing the template's metadata.
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getTemplateById
@GET @Path("/getTemplateById") public WSTemplate getTemplateById(@QueryParam("templateId") long templateId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Gets template's metadata- Specified by:
getTemplateById
in interfaceDocumentMetadataService
- Parameters:
templateId
- The template's id- Returns:
- A value object containing the template's metadata
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getAttributeOptions
@GET @Path("/getAttributeOptions") public List<String> getAttributeOptions(@QueryParam("setId") long setId, @QueryParam("attribute") String attribute) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Retrieves the options for the given attribute- Specified by:
getAttributeOptions
in interfaceDocumentMetadataService
- Parameters:
setId
- The attribute set's idattribute
- The attribute's name- Returns:
- the list of all the attribute's options
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
listAttributeSets
@GET @Path("/listAttributeSets") public List<WSAttributeSet> listAttributeSets() throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:DocumentMetadataService
Gets metadata of all existing attribute sets.- Specified by:
listAttributeSets
in interfaceDocumentMetadataService
- Returns:
- The list of all attribute sets
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
deleteAttributeSet
@DELETE @Path("/deleteAttributeSet") public void deleteAttributeSet(@QueryParam("setId") long setId) throws WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Deletes an existing attribute set with the given identifier.- Specified by:
deleteAttributeSet
in interfaceDocumentMetadataService
- Parameters:
setId
- The attribute set's id- Throws:
WebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
deleteTemplate
@DELETE @Path("/deleteTemplate") public void deleteTemplate(@QueryParam("templateId") long templateId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Deletes an existing template with the given identifier- Specified by:
deleteTemplate
in interfaceDocumentMetadataService
- Parameters:
templateId
- The template's id- Throws:
AuthenticationException
- Invalid sessionPermissionException
- The permission has not been grantedWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
listTemplates
@GET @Path("/listTemplates") public List<WSTemplate> listTemplates() throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:DocumentMetadataService
Gets metadata of all existing templates.- Specified by:
listTemplates
in interfaceDocumentMetadataService
- Returns:
- The list of all templates
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
setAttributeOptionsPOST
@POST @Consumes("multipart/form-data") @Path("/setAttributeOptionsPOST") public void setAttributeOptionsPOST(Long setId, String attribute, List<WSAttributeOption> options) throws WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Saves the options for the given attribute with a POST method. This is useful for very large lists of values- Specified by:
setAttributeOptionsPOST
in interfaceDocumentMetadataService
- Parameters:
setId
- The attribute set's idattribute
- The attribute's nameoptions
- The attribute's options- Throws:
WebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
addAttributeOption
@POST @Consumes("application/x-www-form-urlencoded") @Path("/addAttributeOption") public void addAttributeOption(@FormParam("setId") long setId, @FormParam("attribute") String attribute, @FormParam("option") WSAttributeOption option) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataService
Add a new option for the given attribute- Specified by:
addAttributeOption
in interfaceDocumentMetadataService
- Parameters:
setId
- Attribute set IDattribute
- Attribute nameoption
- Attribute option- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-