Package lumis.content.service
Class ContentService
- java.lang.Object
-
- lumis.portal.service.GenericService
-
- lumis.doui.service.DouiService
-
- lumis.content.service.ContentService
-
- All Implemented Interfaces:
IDouiService
,IHyperLinkResolver
,IService
,IServiceClockDefinitionProvider
- Direct Known Subclasses:
AnalyticsService
,AutoAdministrationService
,BlogService
,ChatRoomService
,ColService
,CommentService
,CommunityService
,ForumService
,HtmlContentService
,NavigationService
,PagePersonalizationService
,RssService
,SimpleContentService
,TagManagerService
,TagService
,WikiService
@StableMinor(version="15.0", sinceVersion="10.4") public class ContentService extends DouiService implements IServiceClockDefinitionProvider
Service with content capabilities base implementation.A content service extends the doui service including meta-data information to existing data.
The following are the standard meta-data extensions that content adds to the doui framework.
- publishToServiceInstances
- publishToPrincipals
- publishToSocialNetwork
- publishStartDate
- publishEndDate
- highlight
- highlightEndDate
- comments
- versioning
- multiLanguage
- workflow
- association
- lock
- tag
- Since:
- 4.0.0
- Version:
- $Revision: 25304 $ $Date: 2022-10-22 22:51:05 -0300 (Sat, 22 Oct 2022) $
-
-
Field Summary
-
Fields inherited from class lumis.doui.service.DouiService
EVENT_REST_CALL
-
Fields inherited from class lumis.portal.service.GenericService
serviceConfig
-
-
Constructor Summary
Constructors Constructor Description ContentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkFileAccess(FileConfig file)
Returns whether the current user has access to the given file.void
deleteContent(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction)
void
deserializeContent(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext)
Deserializes service instance Content.org.w3c.dom.Node
getClocks(SessionConfig sessionConfig, ServiceConfig config, ITransaction transaction)
org.w3c.dom.Element
getDefaultServiceInstanceMenu(ServiceInstanceConfig serviceInstance)
Returns the default service instance menu definition to use for a service instance.protected java.lang.String
getResourceClassName()
void
instanceAdded(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction)
Called by the service container to indicate that a service instance has been added.void
instanceDeleted(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction)
Called by the service container to indicate that a service instance is about to be deleted.void
instanceDeserialized(SessionConfig sessionConfig, java.lang.String serviceInstanceId, DeserializationConfig deserializationConfig, org.w3c.dom.Node node, ITransaction transaction)
Called after an service instance is deserialized.void
instanceDeserialized(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext)
Called after an service instance is deserialized.void
instanceSerialized(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.io.OutputStream outputStream, ITransaction transaction)
Called after the serialization of a service instance.void
instanceSerialized(ServiceInstanceSerializationContext serviceInstanceSerializationContext)
Called after the serialization of a service instance.void
postRegister(SessionConfig sessionConfig, ServiceConfig serviceConfig, ITransaction transaction)
Called by the service manager after a service definition is registered.void
preUnregister(SessionConfig sessionConfig, ITransaction transaction)
Called by the service manager when a service is about to be unregistered.protected void
registerActivityObjectTypes(ServiceConfig serviceConfig, org.w3c.dom.Node serviceDefinitionNode)
Registersobject types
of the activity stream framework that contents of this service are considered of.IServiceInterfaceUrl
resolveHyperLink(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction)
Resolves an hyperlink to the corresponding URL.Response
restLumGetContent(java.lang.String restShortName, java.lang.String restInterfaceName, @NotBlank java.lang.String sourceId, @NotBlank java.lang.String slug, HttpServletRequest servletRequest, UriInfo uriInfo)
Rest used to fetch a content by its friendly id.protected org.w3c.dom.Node
setMetaDataField(org.w3c.dom.Node source, java.lang.String metaDataAtributeName, java.lang.String fieldId, java.lang.String fieldName, java.lang.String fieldDataType, boolean display)
protected org.w3c.dom.Node
setMetaDataFieldIfRequested(java.lang.String propertyName, org.w3c.dom.Node source, org.w3c.dom.Node metaDataNode, java.lang.String metaDataAttributeName, java.lang.String fieldId, java.lang.String fieldName, java.lang.String fieldDataType)
protected void
setMetaDataFields(org.w3c.dom.Node douiDefinitionNode)
Detects the meta-data configurations and converts them to the appropriate source fields.protected void
setSourceFieldAttributes(SessionConfig sessionConfig, ServiceConfig serviceConfig, org.w3c.dom.Node douiDefinitionNode, ITransaction transaction)
protected void
unregisterActivityObjectTypes()
Unregisteractivity object types
.-
Methods inherited from class lumis.doui.service.DouiService
addDefaultDouiDefinitionValues, autoAddDependencies, getReturnType, hasHtmlField, restCallProcessAction, restDoProcessAction, restDoProcessActionWithActionId, restGetProcessActionRestHelp, restLumGetDataGet, restLumGetDataPost, setDataTypeAttributes, setDisplayAttributes, setIncludeAlwaysAttributes, setLookupAttributes, setPositionAttributes, setPriorityOptions, setValidationAttributes, usesDocumentService, usesFileManager, usesImageService, usesMediaRepository, usesWidgetRepository
-
Methods inherited from class lumis.portal.service.GenericService
instanceLoaded, instanceMoved, instanceMoved, instanceUnloaded, load, postUnregister, preRegister, unload
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.portal.service.IService
instanceLoaded, instanceMoved, instanceMoved, instanceMoved, instanceUnloaded, load, postUnregister, preRegister, unload
-
-
-
-
Method Detail
-
getClocks
public org.w3c.dom.Node getClocks(SessionConfig sessionConfig, ServiceConfig config, ITransaction transaction) throws PortalException
- Specified by:
getClocks
in interfaceIServiceClockDefinitionProvider
- Throws:
PortalException
-
preUnregister
public void preUnregister(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
Description copied from interface:IService
Called by the service manager when a service is about to be unregistered.- Specified by:
preUnregister
in interfaceIService
- Overrides:
preUnregister
in classDouiService
- Parameters:
sessionConfig
- the user session information.transaction
- transaction for persistence access.- Throws:
PortalException
-
unregisterActivityObjectTypes
protected void unregisterActivityObjectTypes() throws PortalException
Unregisteractivity object types
.Called by
preUnregister(SessionConfig, ITransaction)
.- Throws:
PortalException
- Since:
- 8.2.0
-
postRegister
public void postRegister(SessionConfig sessionConfig, ServiceConfig serviceConfig, ITransaction transaction) throws PortalException
Description copied from interface:IService
Called by the service manager after a service definition is registered. This method allows the Service implementation to perform any custom registration that the service may require.- Specified by:
postRegister
in interfaceIService
- Overrides:
postRegister
in classDouiService
- Throws:
PortalException
-
registerActivityObjectTypes
protected void registerActivityObjectTypes(ServiceConfig serviceConfig, org.w3c.dom.Node serviceDefinitionNode) throws PortalException
Registersobject types
of the activity stream framework that contents of this service are considered of.Called by
postRegister(SessionConfig, ServiceConfig, ITransaction)
.- Parameters:
serviceConfig
- the service being registered.serviceDefinitionNode
- the service definition node.- Throws:
PortalException
- Since:
- 8.2.0
-
getDefaultServiceInstanceMenu
public org.w3c.dom.Element getDefaultServiceInstanceMenu(ServiceInstanceConfig serviceInstance) throws PortalException
Description copied from interface:IService
Returns the default service instance menu definition to use for a service instance.This default is used if this service does not have a explicit menu definition in its
servicedefinition.xml
.- Specified by:
getDefaultServiceInstanceMenu
in interfaceIService
- Overrides:
getDefaultServiceInstanceMenu
in classDouiService
- Parameters:
serviceInstance
- the service instance.- Returns:
- the menu definition.
- Throws:
PortalException
- if the menu could not be generated.
-
instanceAdded
public void instanceAdded(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws ServiceException, PortalException
Description copied from interface:IService
Called by the service container to indicate that a service instance has been added. Dependencies between services must never be created inside this method. Dependencies must be created in theIService.autoAddDependencies(lumis.portal.authentication.SessionConfig, lumis.portal.serviceinstance.ServiceInstanceConfig, lumis.util.ITransaction)
method.- Specified by:
instanceAdded
in interfaceIService
- Overrides:
instanceAdded
in classDouiService
serviceInstanceConfig
- aServiceInstanceConfig
object containing the service's configuration- Throws:
ServiceException
PortalException
-
instanceDeleted
public void instanceDeleted(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction) throws ServiceException, PortalException
Description copied from interface:IService
Called by the service container to indicate that a service instance is about to be deleted.- Specified by:
instanceDeleted
in interfaceIService
- Overrides:
instanceDeleted
in classDouiService
config
- aServiceInstanceConfig
object containing the service's configuration- Throws:
ServiceException
PortalException
-
deleteContent
public void deleteContent(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
getResourceClassName
protected java.lang.String getResourceClassName()
- Overrides:
getResourceClassName
in classDouiService
-
setSourceFieldAttributes
protected void setSourceFieldAttributes(SessionConfig sessionConfig, ServiceConfig serviceConfig, org.w3c.dom.Node douiDefinitionNode, ITransaction transaction) throws PortalException
- Overrides:
setSourceFieldAttributes
in classDouiService
- Throws:
PortalException
-
setMetaDataFields
protected void setMetaDataFields(org.w3c.dom.Node douiDefinitionNode) throws PortalException
Detects the meta-data configurations and converts them to the appropriate source fields.The following is a list of fields that always are included for content data regardless of what meta-data is specified
- createdDate
- lastModifiedDate
- createdBy
- lastModifiedBy
- serviceInstanceId
- contentId
- serviceInstanceIsolation - serviceInstanceId
- publishToServiceInstances - publishToServiceInstances
- publishToPrincipals - publishToPrincipals
- publishStartDate - publishStartDate
- publishEndDate - publishEndDate
- highlight - highlight
- highlightEndDate - highlightEndDate
- comments - comments
- versioning - versionActive, versionNumber, versionContentId
- lock - content lock
- multiLanguage - language, languageContentId
- workflow - workflowState, workflowAssignedTo
- association - association
- tag - tag
- Parameters:
douiDefinitionNode
-- Throws:
PortalException
- Since:
- 4.0.0
-
setMetaDataFieldIfRequested
protected org.w3c.dom.Node setMetaDataFieldIfRequested(java.lang.String propertyName, org.w3c.dom.Node source, org.w3c.dom.Node metaDataNode, java.lang.String metaDataAttributeName, java.lang.String fieldId, java.lang.String fieldName, java.lang.String fieldDataType) throws PortalException
- Throws:
PortalException
-
setMetaDataField
protected org.w3c.dom.Node setMetaDataField(org.w3c.dom.Node source, java.lang.String metaDataAtributeName, java.lang.String fieldId, java.lang.String fieldName, java.lang.String fieldDataType, boolean display) throws PortalException
- Throws:
PortalException
-
instanceDeserialized
public void instanceDeserialized(SessionConfig sessionConfig, java.lang.String serviceInstanceId, DeserializationConfig deserializationConfig, org.w3c.dom.Node node, ITransaction transaction) throws PortalException
Description copied from interface:IService
Called after an service instance is deserialized.- Specified by:
instanceDeserialized
in interfaceIService
- Overrides:
instanceDeserialized
in classGenericService
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance id.deserializationConfig
- the deserialization configuration.node
- the deserialized acl node.transaction
- the transaction for persistence access.- Throws:
PortalException
- See Also:
IService.instanceSerialized(SessionConfig, String, OutputStream, ITransaction)
-
instanceSerialized
public void instanceSerialized(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.io.OutputStream outputStream, ITransaction transaction) throws PortalException
Description copied from interface:IService
Called after the serialization of a service instance. The service may add custom information on the output stream, and they will be available during#aclDeserialized
.- Specified by:
instanceSerialized
in interfaceIService
- Overrides:
instanceSerialized
in classGenericService
- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance id.outputStream
- the serialization outputStream.transaction
- the transaction for persistence access.- Throws:
PortalException
- See Also:
IService.instanceDeserialized(SessionConfig, String, DeserializationConfig, Node, ITransaction)
-
instanceDeserialized
public void instanceDeserialized(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext) throws PortalException
Description copied from interface:IService
Called after an service instance is deserialized.- Specified by:
instanceDeserialized
in interfaceIService
- Overrides:
instanceDeserialized
in classDouiService
- Throws:
PortalException
-
instanceSerialized
public void instanceSerialized(ServiceInstanceSerializationContext serviceInstanceSerializationContext) throws PortalException
Description copied from interface:IService
Called after the serialization of a service instance. The service may serialize additional structure or data- Specified by:
instanceSerialized
in interfaceIService
- Overrides:
instanceSerialized
in classGenericService
- Throws:
PortalException
-
deserializeContent
public void deserializeContent(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext) throws PortalException
Description copied from interface:IService
Deserializes service instance Content.- Specified by:
deserializeContent
in interfaceIService
- Overrides:
deserializeContent
in classGenericService
- Throws:
PortalException
-
resolveHyperLink
public IServiceInterfaceUrl resolveHyperLink(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction) throws PortalException
Description copied from class:DouiService
Resolves an hyperlink to the corresponding URL.DouiService delegates this resolution to a
DouiHyperLinkResolver
.- Specified by:
resolveHyperLink
in interfaceIHyperLinkResolver
- Overrides:
resolveHyperLink
in classDouiService
- Parameters:
sessionConfig
- the user session information.hyperLinkConfig
- hyperlink informationtransaction
- the transaction for persistence access.- Returns:
- the url, or null if the hyperlink could not be resolved.
- Throws:
PortalException
-
checkFileAccess
public boolean checkFileAccess(FileConfig file) throws PortalException
Description copied from interface:IService
Returns whether the current user has access to the given file.- Specified by:
checkFileAccess
in interfaceIService
- Parameters:
file
- the file.- Throws:
PortalException
-
restLumGetContent
@GET @Path("/lumgetdata/{restInterfaceName}/{sourceId}/{slug: .*}") @Produces({"application/json","application/xml"}) public final Response restLumGetContent(@PathParam("restShortName") java.lang.String restShortName, @PathParam("restInterfaceName") java.lang.String restInterfaceName, @PathParam("sourceId") @NotBlank @NotBlank java.lang.String sourceId, @PathParam("slug") @NotBlank @NotBlank java.lang.String slug, @Context HttpServletRequest servletRequest, @Context UriInfo uriInfo)
Rest used to fetch a content by its friendly id.- Parameters:
restShortName
- the rest short name of the desired service instancerestInterfaceName
- the rest interface namesourceId
- the source identifier of the desired contentslug
- the content's slugservletRequest
- the requesturiInfo
- the URL being called- Returns:
- a response
- Since:
- 14.1.0
- See Also:
DouiService.restLumGetDataGet(String, String, HttpServletRequest)
-
-