public class ResourcesServiceImpl extends AbstractAppService implements ResourcesService
ResourcesService| Constructor and Description |
|---|
ResourcesServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCreateTag(Session session) |
long |
countMembers(Node tag)
Count members that have such a tag in the corresponding taggable sub tree
|
Node |
createTagLikeResourceParent(Session session,
java.lang.String tagId,
java.lang.String tagInstanceType,
java.lang.String codePropName,
java.lang.String taggableParentPath,
java.lang.String taggableNodeType,
java.util.List<java.lang.String> taggablePropNames) |
Node |
createTagLikeResourceParent(Session session,
java.lang.String tagId,
java.lang.String tagInstanceType,
java.lang.String codePropName,
java.lang.String taggableParentPath,
java.lang.String taggableNodeType,
java.lang.String taggablePropName) |
Node |
createTemplateForType(Session session,
java.lang.String nodeType,
java.lang.String templateId) |
java.lang.String |
getAppBaseName()
Returns the current App name
|
NodeIterator |
getCatalogueValueInstances(Session session,
java.lang.String entityType,
java.lang.String propName,
java.lang.String value)
Retrieves all entities which property has the given value
|
java.lang.String |
getDefaultRelPath(Node entity)
Computes the App specific relative path for a known type based on properties
of the passed node
|
java.lang.String |
getDefaultRelPath(Session session,
java.lang.String nodeType,
java.lang.String id)
Computes the App specific relative path for this known node type based on the
passed id
|
java.lang.String |
getEncodedTagCodeFromValue(Session session,
java.lang.String tagId,
java.lang.String value)
Retrieves the code of an encoded tag given its English value or null if
no such tag exists.
|
java.lang.String |
getEncodedTagValue(Session session,
java.lang.String tagId,
java.lang.String code)
Retrieves the value of an encoded tag or null if such a tag has not yet
been registered
|
java.lang.String |
getEncodedTagValuesAsString(java.lang.String tagId,
Node node,
java.lang.String propertyName,
java.lang.String separator)
Shortcut to retrieve a string that concatenates the corresponding values
of a multi value property that refers to multiple encoded tags
|
java.lang.String |
getItemDefaultEnLabel(java.lang.String itemId)
Returns a canonical English label for each of the JCR Property or node
types defined in the current People Repository.
|
java.lang.String |
getItemLabel(java.lang.String itemName,
java.lang.String langIso)
Returns a label for each of the JCR property name or node type defined in
the current People Repository in a internationalised context.
|
Node |
getNodeTemplate(Session session,
java.lang.String templateId) |
Node |
getRegisteredTag(Node tagParent,
java.lang.String instanceKey)
Retrieves the instance node given its value or code if it is an
encodedTag or null if such a tag has not yet been registered
Comparison is case insensitive and a trim() is applied on the passed
String for not encoded tag
|
Node |
getRegisteredTag(Session session,
java.lang.String tagId,
java.lang.String instanceKey)
Retrieve the instance node given its value or code if it is an encodedTag
or null if such a tag has not yet been registered
Comparison is case insensitive and a trim() is applied on the passed
String for not encoded tag
|
java.util.List<java.lang.String> |
getRegisteredTagValueList(Session session,
java.lang.String tagId,
java.lang.String filter) |
NodeIterator |
getTaggedEntities(Node tagParent,
java.lang.String key)
Retrieves all entities that have this key
|
NodeIterator |
getTaggedEntities(Session session,
java.lang.String tagId,
java.lang.String key)
Retrieves all entities that have this tag key
|
protected java.lang.String |
getTagKeyPropName(Node tagParent) |
Node |
getTagLikeResourceParent(Session session,
java.lang.String tagId)
Retrieves the parent for tag instances that correspond to this ID or null
if non has been found
|
java.util.List<java.lang.String> |
getTemplateCatalogue(Node node,
java.lang.String propertyName,
java.lang.String filter)
Returns the predefined possible English values as defined in the passed
template node and that match the corresponding filter.
|
java.util.List<java.lang.String> |
getTemplateCatalogue(Session session,
java.lang.String templateId,
java.lang.String propertyName,
java.lang.String filter)
Returns the predefined possible English values of a property of a given
node type as defined in the current People Repository and that match the
corresponding filter.
|
boolean |
isKnownType(Node entity)
Simply checks if the passed entity has a primary or mixin type that is known
and thus can be managed by the this App
|
boolean |
isKnownType(java.lang.String nodeType)
Simply checks if the passed type is known and thus can be managed by the this
App.
|
Node |
publishEntity(Node parent,
java.lang.String nodeType,
Node srcNode,
boolean removeSrcNode) |
void |
refreshKnownTags(Node tagParent)
Browses the repository using the parameters stored in the tagParent node
and creates a new tag instance for all new value found in the taggable
property of one of the valid node.
|
void |
refreshKnownTags(Session session,
java.lang.String tagId)
Browses the repository using the parameters stored in the tagParent node
and creates a new tag instance for all new value found in the taggable
property of one of the valid node.
|
Node |
registerTag(Session session,
java.lang.String tagId,
java.lang.String tagValue)
Register a new tag if such a tag does not exist, does nothing otherwise.
|
Node |
registerTag(Session session,
java.lang.String tagId,
java.lang.String tagCode,
java.lang.String tagValue)
Register a new tag if a tag with such a code does not yet exist, returns
the existing one otherwise.
|
void |
unregisterTag(Session session,
java.lang.String tagId,
java.lang.String tag)
Unregister an existing tag and remove all references to this tag on all
nodes under the tagableParentPath that have this tag
|
void |
updateCatalogueValue(Node templateNode,
java.lang.String taggableType,
java.lang.String propertyName,
java.lang.String oldValue,
java.lang.String newValue)
Change the value of a given template catalogue.
|
boolean |
updateTag(Node tagInstance,
java.lang.String newValue)
Change the value of an already registered tag that does not rely on a
code (e.g.
|
createDraftEntity, getDisplayName, getDraftParent, getEntityByUid, saveEntityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDraftEntity, getBaseRelPath, getDisplayName, getDraftParent, getEntityByUid, getLabel, getMainNodeType, publishEntity, saveEntitypublic Node publishEntity(Node parent, java.lang.String nodeType, Node srcNode, boolean removeSrcNode) throws RepositoryException
publishEntity in interface AppServicepublishEntity in class AbstractAppServiceRepositoryExceptionpublic java.lang.String getAppBaseName()
AppServicegetAppBaseName in interface AppServicepublic java.lang.String getDefaultRelPath(Node entity) throws RepositoryException
AppServicegetDefaultRelPath in interface AppServiceRepositoryExceptionpublic java.lang.String getDefaultRelPath(Session session, java.lang.String nodeType, java.lang.String id)
AppServicegetDefaultRelPath in interface AppServicesession - TODOpublic boolean isKnownType(Node entity)
AppServiceisKnownType in interface AppServicepublic boolean isKnownType(java.lang.String nodeType)
AppServiceisKnownType in interface AppServicepublic java.lang.String getItemDefaultEnLabel(java.lang.String itemId)
ResourcesServicegetItemDefaultEnLabel in interface ResourcesServicepublic java.lang.String getItemLabel(java.lang.String itemName,
java.lang.String langIso)
ResourcesServicegetItemLabel in interface ResourcesServicepublic java.util.List<java.lang.String> getTemplateCatalogue(Session session, java.lang.String templateId, java.lang.String propertyName, java.lang.String filter)
ResourcesServicegetTemplateCatalogue in interface ResourcesServicetemplateId - generally, the corresponding NodeTypeList of statuspublic java.util.List<java.lang.String> getTemplateCatalogue(Node node, java.lang.String propertyName, java.lang.String filter)
ResourcesServicegetTemplateCatalogue in interface ResourcesServicenode - the template, must not be nullList of statuspublic Node getNodeTemplate(Session session, java.lang.String templateId)
getNodeTemplate in interface ResourcesServicetemplateId - the template ID, it is by default the nodeType of the node for
which this node is a templatepublic Node createTemplateForType(Session session, java.lang.String nodeType, java.lang.String templateId)
createTemplateForType in interface ResourcesServicetemplateId - optional distinct id for this templatepublic NodeIterator getCatalogueValueInstances(Session session, java.lang.String entityType, java.lang.String propName, java.lang.String value)
ResourcesServicegetCatalogueValueInstances in interface ResourcesServicepublic void updateCatalogueValue(Node templateNode, java.lang.String taggableType, java.lang.String propertyName, java.lang.String oldValue, java.lang.String newValue)
ResourcesServiceupdateCatalogueValue in interface ResourcesServicepublic Node createTagLikeResourceParent(Session session, java.lang.String tagId, java.lang.String tagInstanceType, java.lang.String codePropName, java.lang.String taggableParentPath, java.lang.String taggableNodeType, java.lang.String taggablePropName)
createTagLikeResourceParent in interface ResourcesServicesession - with write rightstagId - An optional ID to differentiate distinct parent that might be
similartagInstanceType - The node type of the corresponding resources. It defines the
created parent if tagId is nullcodePropName - The name of the property that provides the code in case the
string we store in the taggable multi value property is not
the label that has to be displayedtaggableParentPath - Absolute path to parent of the taggable nodestaggableNodeType - Node type of the taggable nodestaggablePropName - Name of the multi value property of the taggable node in which
the corresponding tag is storedpublic Node createTagLikeResourceParent(Session session, java.lang.String tagId, java.lang.String tagInstanceType, java.lang.String codePropName, java.lang.String taggableParentPath, java.lang.String taggableNodeType, java.util.List<java.lang.String> taggablePropNames)
createTagLikeResourceParent in interface ResourcesServicesession - with write rightstagId - An optional ID to differentiate distinct parent that might be
similartagInstanceType - The node type of the corresponding resources. It defines the
created parent if tagId is nullcodePropName - The name of the property that provides the code in case the
string we store in the taggable multi value property is not
the label that has to be displayedtaggableParentPath - Absolute path to parent of the taggable nodestaggableNodeType - Node type of the taggable nodestaggablePropNames - Names of the multi value property of the taggable node in
which the corresponding tag is storedpublic Node getTagLikeResourceParent(Session session, java.lang.String tagId)
ResourcesServicegetTagLikeResourceParent in interface ResourcesServicepublic Node registerTag(Session session, java.lang.String tagId, java.lang.String tagValue) throws RepositoryException
ResourcesServiceregisterTag in interface ResourcesServiceRepositoryExceptionpublic Node registerTag(Session session, java.lang.String tagId, java.lang.String tagCode, java.lang.String tagValue) throws RepositoryException
ResourcesServiceregisterTag in interface ResourcesServiceRepositoryExceptionpublic Node getRegisteredTag(Session session, java.lang.String tagId, java.lang.String instanceKey)
ResourcesServicegetRegisteredTag in interface ResourcesServicepublic Node getRegisteredTag(Node tagParent, java.lang.String instanceKey)
ResourcesServicegetRegisteredTag in interface ResourcesServicepublic java.lang.String getEncodedTagValue(Session session, java.lang.String tagId, java.lang.String code)
ResourcesServicegetEncodedTagValue in interface ResourcesServicepublic java.lang.String getEncodedTagCodeFromValue(Session session, java.lang.String tagId, java.lang.String value)
ResourcesServiceResourcesService.registerTag(Session session, String tagId, String
tagCode, String tagValue)getEncodedTagCodeFromValue in interface ResourcesServicepublic java.lang.String getEncodedTagValuesAsString(java.lang.String tagId,
Node node,
java.lang.String propertyName,
java.lang.String separator)
ResourcesServicegetEncodedTagValuesAsString in interface ResourcesServicepublic NodeIterator getTaggedEntities(Session session, java.lang.String tagId, java.lang.String key)
ResourcesServicegetTaggedEntities in interface ResourcesServicekey - the code in case of an encoded tag, the value itself otherwisepublic NodeIterator getTaggedEntities(Node tagParent, java.lang.String key)
ResourcesServicegetTaggedEntities in interface ResourcesServicekey - the code in case of an encoded tag, the value itself otherwisepublic void refreshKnownTags(Session session, java.lang.String tagId)
ResourcesServicerefreshKnownTags in interface ResourcesServicepublic void refreshKnownTags(Node tagParent)
ResourcesServicerefreshKnownTags in interface ResourcesServicepublic boolean updateTag(Node tagInstance, java.lang.String newValue) throws RepositoryException
ResourcesServiceupdateTag in interface ResourcesServiceRepositoryExceptionpublic void unregisterTag(Session session, java.lang.String tagId, java.lang.String tag)
ResourcesServiceunregisterTag in interface ResourcesServicepublic long countMembers(Node tag)
ResourcesServicecountMembers in interface ResourcesServicepublic java.util.List<java.lang.String> getRegisteredTagValueList(Session session, java.lang.String tagId, java.lang.String filter)
getRegisteredTagValueList in interface ResourcesServiceprotected java.lang.String getTagKeyPropName(Node tagParent)
public boolean canCreateTag(Session session)
canCreateTag in interface ResourcesServiceCopyright © 2007–2020. All rights reserved.