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, saveEntity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDraftEntity, getBaseRelPath, getDisplayName, getDraftParent, getEntityByUid, getLabel, getMainNodeType, publishEntity, saveEntity
public Node publishEntity(Node parent, java.lang.String nodeType, Node srcNode, boolean removeSrcNode) throws RepositoryException
publishEntity
in interface AppService
publishEntity
in class AbstractAppService
RepositoryException
public java.lang.String getAppBaseName()
AppService
getAppBaseName
in interface AppService
public java.lang.String getDefaultRelPath(Node entity) throws RepositoryException
AppService
getDefaultRelPath
in interface AppService
RepositoryException
public java.lang.String getDefaultRelPath(Session session, java.lang.String nodeType, java.lang.String id)
AppService
getDefaultRelPath
in interface AppService
session
- TODOpublic boolean isKnownType(Node entity)
AppService
isKnownType
in interface AppService
public boolean isKnownType(java.lang.String nodeType)
AppService
isKnownType
in interface AppService
public java.lang.String getItemDefaultEnLabel(java.lang.String itemId)
ResourcesService
getItemDefaultEnLabel
in interface ResourcesService
public java.lang.String getItemLabel(java.lang.String itemName, java.lang.String langIso)
ResourcesService
getItemLabel
in interface ResourcesService
public java.util.List<java.lang.String> getTemplateCatalogue(Session session, java.lang.String templateId, java.lang.String propertyName, java.lang.String filter)
ResourcesService
getTemplateCatalogue
in interface ResourcesService
templateId
- generally, the corresponding NodeTypeList
of statuspublic java.util.List<java.lang.String> getTemplateCatalogue(Node node, java.lang.String propertyName, java.lang.String filter)
ResourcesService
getTemplateCatalogue
in interface ResourcesService
node
- the template, must not be nullList
of statuspublic Node getNodeTemplate(Session session, java.lang.String templateId)
getNodeTemplate
in interface ResourcesService
templateId
- 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 ResourcesService
templateId
- optional distinct id for this templatepublic NodeIterator getCatalogueValueInstances(Session session, java.lang.String entityType, java.lang.String propName, java.lang.String value)
ResourcesService
getCatalogueValueInstances
in interface ResourcesService
public void updateCatalogueValue(Node templateNode, java.lang.String taggableType, java.lang.String propertyName, java.lang.String oldValue, java.lang.String newValue)
ResourcesService
updateCatalogueValue
in interface ResourcesService
public 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 ResourcesService
session
- 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 ResourcesService
session
- 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)
ResourcesService
getTagLikeResourceParent
in interface ResourcesService
public Node registerTag(Session session, java.lang.String tagId, java.lang.String tagValue) throws RepositoryException
ResourcesService
registerTag
in interface ResourcesService
RepositoryException
public Node registerTag(Session session, java.lang.String tagId, java.lang.String tagCode, java.lang.String tagValue) throws RepositoryException
ResourcesService
registerTag
in interface ResourcesService
RepositoryException
public Node getRegisteredTag(Session session, java.lang.String tagId, java.lang.String instanceKey)
ResourcesService
getRegisteredTag
in interface ResourcesService
public Node getRegisteredTag(Node tagParent, java.lang.String instanceKey)
ResourcesService
getRegisteredTag
in interface ResourcesService
public java.lang.String getEncodedTagValue(Session session, java.lang.String tagId, java.lang.String code)
ResourcesService
getEncodedTagValue
in interface ResourcesService
public java.lang.String getEncodedTagCodeFromValue(Session session, java.lang.String tagId, java.lang.String value)
ResourcesService
ResourcesService.registerTag(Session session, String tagId, String
tagCode, String tagValue)
getEncodedTagCodeFromValue
in interface ResourcesService
public java.lang.String getEncodedTagValuesAsString(java.lang.String tagId, Node node, java.lang.String propertyName, java.lang.String separator)
ResourcesService
getEncodedTagValuesAsString
in interface ResourcesService
public NodeIterator getTaggedEntities(Session session, java.lang.String tagId, java.lang.String key)
ResourcesService
getTaggedEntities
in interface ResourcesService
key
- the code in case of an encoded tag, the value itself otherwisepublic NodeIterator getTaggedEntities(Node tagParent, java.lang.String key)
ResourcesService
getTaggedEntities
in interface ResourcesService
key
- the code in case of an encoded tag, the value itself otherwisepublic void refreshKnownTags(Session session, java.lang.String tagId)
ResourcesService
refreshKnownTags
in interface ResourcesService
public void refreshKnownTags(Node tagParent)
ResourcesService
refreshKnownTags
in interface ResourcesService
public boolean updateTag(Node tagInstance, java.lang.String newValue) throws RepositoryException
ResourcesService
updateTag
in interface ResourcesService
RepositoryException
public void unregisterTag(Session session, java.lang.String tagId, java.lang.String tag)
ResourcesService
unregisterTag
in interface ResourcesService
public long countMembers(Node tag)
ResourcesService
countMembers
in interface ResourcesService
public java.util.List<java.lang.String> getRegisteredTagValueList(Session session, java.lang.String tagId, java.lang.String filter)
getRegisteredTagValueList
in interface ResourcesService
protected java.lang.String getTagKeyPropName(Node tagParent)
public boolean canCreateTag(Session session)
canCreateTag
in interface ResourcesService
Copyright © 2007–2020. All rights reserved.