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
Nested ClassesModifier and TypeClassDescriptionclass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttributeOption(long setId, String attribute, WSAttributeOption option) Add a new option for the given attributevoiddeleteAttributeSet(long setId) Deletes an existing attribute set with the given identifier.voiddeleteTemplate(long templateId) Deletes an existing template with the given identifiergetAttributeOptions(long setId, String attribute) Retrieves the options for the given attributegetAttributeOptionsByCategory(long setId, String attribute, String category) Retrieves the options for the given attribute inside a given categorygetAttributeSet(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.voidsetAttributeOptions(long setId, String attribute, List<WSAttributeOption> options) Saves the options for the given attributevoidsetAttributeOptionsPOST(Long setId, String attribute, List<WSAttributeOption> options) Saves the options for the given attribute with a POST method.longstoreAttributeSet(WSAttributeSet attributeSet) Create/Update an attribute set.longstoreTemplate(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, storeTemplateMethods 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:DocumentMetadataServiceSaves the options for the given attribute- Specified by:
setAttributeOptionsin 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:DocumentMetadataServiceCreate/Update an attribute set. You can completely customize the attribute set through a value object containing the attribute set's metadata.- Specified by:
storeAttributeSetin 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:DocumentMetadataServiceCreate/Update a template. You can completely customize the template through a value object.- Specified by:
storeTemplatein 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:DocumentMetadataServiceGets attribute set's metadata- Specified by:
getAttributeSetByIdin 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:DocumentMetadataServiceGets attribute set's metadata- Specified by:
getAttributeSetin 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:DocumentMetadataServiceGets template's metadata- Specified by:
getTemplatein 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:DocumentMetadataServiceGets template's metadata- Specified by:
getTemplateByIdin 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:DocumentMetadataServiceRetrieves the options for the given attribute- Specified by:
getAttributeOptionsin 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
-
getAttributeOptionsByCategory
@GET @Path("/getAttributeOptionsByCategory") public List<WSAttributeOption> getAttributeOptionsByCategory(long setId, String attribute, String category) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentMetadataServiceRetrieves the options for the given attribute inside a given category- Specified by:
getAttributeOptionsByCategoryin interfaceDocumentMetadataService- Parameters:
setId- The attribute set's idattribute- The attribute's namecategory- The options category (not mandatory)- 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:DocumentMetadataServiceGets metadata of all existing attribute sets.- Specified by:
listAttributeSetsin 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:DocumentMetadataServiceDeletes an existing attribute set with the given identifier.- Specified by:
deleteAttributeSetin 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:DocumentMetadataServiceDeletes an existing template with the given identifier- Specified by:
deleteTemplatein 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:DocumentMetadataServiceGets metadata of all existing templates.- Specified by:
listTemplatesin 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:DocumentMetadataServiceSaves the options for the given attribute with a POST method. This is useful for very large lists of values- Specified by:
setAttributeOptionsPOSTin 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:DocumentMetadataServiceAdd a new option for the given attribute- Specified by:
addAttributeOptionin interfaceDocumentMetadataService- Parameters:
setId- Attribute set IDattribute- Attribute nameoption- Attribute option- Throws:
AuthenticationException- Invalid sessionWebserviceException- Error in the webservicePersistenceException- Error in the database
-