public class TaggingService extends JahiaService implements JahiaAfterInitializationService
| Modifier and Type | Field and Description |
|---|---|
static String |
J_TAG_LIST |
static String |
JMIX_TAGGED |
settingsBean| Constructor and Description |
|---|
TaggingService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
createTag(String tag,
String siteKey)
Deprecated.
the tags are no longer nodes, there are stored directly on the content
|
boolean |
deleteTag(String tag,
String siteKey)
Deprecated.
not relevant anymore, the tags are no longer nodes
|
<X> X |
deleteTagUnderPath(String startPath,
JCRSessionWrapper session,
String selectedTag,
TagActionCallback<X> callback)
Delete all occurrence of a specific tag under a given path
|
boolean |
exists(String tag,
String siteKey)
Deprecated.
not relevant anymore, the tags are no longer nodes, there are stored directly on the content,
Use
#getTagsSuggester().suggest(String, String, Long, Long, Long, boolean, org.jahia.services.content.JCRSessionWrapper) instead |
static TaggingService |
getInstance()
Get the tagging service instance
|
JCRNodeWrapper |
getTag(String tag,
String siteKey,
JCRSessionWrapper session)
Deprecated.
the tags are no longer nodes, there are stored directly on the content,
Use
#getTagsSuggester().suggest(String, String, Long, Long, Long, boolean, org.jahia.services.content.JCRSessionWrapper) instead |
long |
getTagCount(String tag,
String siteKey)
Deprecated.
Use
#getTagsSuggester().suggest(String, String, Long, Long, Long, boolean, org.jahia.services.content.JCRSessionWrapper) instead |
TagHandler |
getTagHandler() |
TagsSuggester |
getTagsSuggester() |
void |
init() |
void |
initAfterAllServicesAreStarted() |
void |
renameTag(JCRNodeWrapper node,
String selectedTag,
String tagNewName)
Rename a specific tag on a node
|
void |
renameTag(String nodePath,
String selectedTag,
String tagNewName,
JCRSessionWrapper session)
Rename a specific tag on a node
|
<X> X |
renameTagUnderPath(String startPath,
JCRSessionWrapper session,
String selectedTag,
String tagNewName,
TagActionCallback<X> callback)
Rename all occurrence of a specific tag under a given path
The session will be saved each 100 nodes processed
|
void |
setTagHandler(TagHandler tagHandler) |
void |
setTagsSuggester(TagsSuggester tagsSuggester) |
void |
start() |
void |
stop() |
List<String> |
tag(JCRNodeWrapper node,
List<String> tags)
Tag the specific node
|
List<String> |
tag(JCRNodeWrapper node,
String tag)
Tag the specific node
|
boolean |
tag(JCRNodeWrapper node,
String tag,
String siteKey,
boolean createTagIfNotExists)
Deprecated.
|
List<String> |
tag(String nodePath,
List<String> tags,
JCRSessionWrapper session)
Tag the specific node
|
List<String> |
tag(String nodePath,
String tag,
JCRSessionWrapper session)
Tag the specific node
|
boolean |
tag(String nodePath,
String tag,
String siteKey,
boolean createTagIfNotExists)
Deprecated.
|
boolean |
tag(String nodePath,
String tag,
String siteKey,
boolean createTagIfNotExists,
JCRSessionWrapper session)
Deprecated.
|
List<String> |
untag(JCRNodeWrapper node,
List<String> tags)
Untag the specific node
|
List<String> |
untag(JCRNodeWrapper node,
String tag)
Untag the specific node
|
List<String> |
untag(String nodePath,
List<String> tags,
JCRSessionWrapper session)
Untag the specific node
|
List<String> |
untag(String nodePath,
String tag,
JCRSessionWrapper session)
Untag the specific node
|
getSettingsBean, setSettingsBeanpublic static final String JMIX_TAGGED
public static final String J_TAG_LIST
public static TaggingService getInstance()
public void init()
throws javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.nodetype.NoSuchNodeTypeExceptionpublic void initAfterAllServicesAreStarted()
throws JahiaInitializationException
initAfterAllServicesAreStarted in interface JahiaAfterInitializationServiceJahiaInitializationException@Deprecated public boolean createTag(String tag, String siteKey) throws javax.jcr.RepositoryException
tag - the tag to createsiteKey - the site where the tag need to be createjavax.jcr.RepositoryException - in case of errors@Deprecated public boolean deleteTag(String tag, String siteKey) throws javax.jcr.RepositoryException
tag - the tag to deletesiteKey - the site where the tag need to be deletejavax.jcr.RepositoryException - in case of errors@Deprecated public boolean exists(String tag, String siteKey) throws javax.jcr.RepositoryException
#getTagsSuggester().suggest(String, String, Long, Long, Long, boolean, org.jahia.services.content.JCRSessionWrapper) insteadtag - the tag to test the existencesiteKey - the site where the tag need to be searchjavax.jcr.RepositoryException - in case of errors@Deprecated public JCRNodeWrapper getTag(String tag, String siteKey, JCRSessionWrapper session) throws javax.jcr.RepositoryException
#getTagsSuggester().suggest(String, String, Long, Long, Long, boolean, org.jahia.services.content.JCRSessionWrapper) insteadtag - the tag to retrievesiteKey - the site to search the tagsession - the session used to retrieve the tagjavax.jcr.RepositoryException - in case of errors@Deprecated public long getTagCount(String tag, String siteKey) throws javax.jcr.RepositoryException
#getTagsSuggester().suggest(String, String, Long, Long, Long, boolean, org.jahia.services.content.JCRSessionWrapper) insteadtag - the tag to retrievesiteKey - the site to search the tagjavax.jcr.RepositoryException - in case of errors@Deprecated public boolean tag(JCRNodeWrapper node, String tag, String siteKey, boolean createTagIfNotExists) throws javax.jcr.RepositoryException
tag(org.jahia.services.content.JCRNodeWrapper, String) insteadnode - the node to tagtag - the tag to apply on the nodesiteKey - the site where the tag is locatecreateTagIfNotExists - create the tag if not existjavax.jcr.RepositoryException - in case of errors@Deprecated public boolean tag(String nodePath, String tag, String siteKey, boolean createTagIfNotExists, JCRSessionWrapper session) throws javax.jcr.RepositoryException
tag(org.jahia.services.content.JCRNodeWrapper, String) insteadnodePath - the node to tagtag - the tag to apply on the nodesiteKey - the site where the tag is locatecreateTagIfNotExists - create the tag if not existsession - the session used to tag the contentjavax.jcr.RepositoryException - in case of errors@Deprecated public boolean tag(String nodePath, String tag, String siteKey, boolean createTagIfNotExists) throws javax.jcr.RepositoryException
tag(org.jahia.services.content.JCRNodeWrapper, String) insteadnodePath - the node to tagtag - the tag to apply on the nodesiteKey - the site where the tag is locatecreateTagIfNotExists - create the tag if not existjavax.jcr.RepositoryException - in case of errorspublic List<String> tag(JCRNodeWrapper node, List<String> tags) throws javax.jcr.RepositoryException
node - the node to tagtags - the tag list to apply on the nodejavax.jcr.RepositoryException - in case of JCR-related errorspublic List<String> tag(String nodePath, List<String> tags, JCRSessionWrapper session) throws javax.jcr.RepositoryException
nodePath - the path of the node to tagtags - the tag list to apply on the nodesession - the session used to perform the operationjavax.jcr.RepositoryException - in case of JCR-related errorspublic List<String> tag(JCRNodeWrapper node, String tag) throws javax.jcr.RepositoryException
node - the node to tagtag - the tag to apply on the nodejavax.jcr.RepositoryException - in case of JCR-related errorspublic List<String> tag(String nodePath, String tag, JCRSessionWrapper session) throws javax.jcr.RepositoryException
nodePath - the path of the node to tagtag - the tag to apply on the nodesession - the session used to perform the operationjavax.jcr.RepositoryException - in case of JCR-related errorspublic List<String> untag(JCRNodeWrapper node, List<String> tags) throws javax.jcr.RepositoryException
node - the node to untagtags - the tag list to remove from the nodejavax.jcr.RepositoryException - in case of JCR-related errorspublic List<String> untag(String nodePath, List<String> tags, JCRSessionWrapper session) throws javax.jcr.RepositoryException
nodePath - the path of the node to untagtags - the tag list to remove from the nodesession - the session used to perform the operationjavax.jcr.RepositoryException - in case of JCR-related errorspublic List<String> untag(JCRNodeWrapper node, String tag) throws javax.jcr.RepositoryException
node - the node to untagtag - the tag to remove from the nodejavax.jcr.RepositoryException - in case of JCR-related errorspublic List<String> untag(String nodePath, String tag, JCRSessionWrapper session) throws javax.jcr.RepositoryException
nodePath - the path of the node to untagtag - the tag to remove from the nodesession - the session used to perform the operationjavax.jcr.RepositoryException - in case of JCR-related errorspublic void renameTag(JCRNodeWrapper node, String selectedTag, String tagNewName) throws javax.jcr.RepositoryException
node - target nodeselectedTag - tag to renametagNewName - new tag namejavax.jcr.RepositoryException - in case of JCR-related errorspublic void renameTag(String nodePath, String selectedTag, String tagNewName, JCRSessionWrapper session) throws javax.jcr.RepositoryException
nodePath - target node pathselectedTag - tag to renametagNewName - new tag namesession - the session used to perform the operationjavax.jcr.RepositoryException - in case of JCR-related errorspublic <X> X renameTagUnderPath(String startPath, JCRSessionWrapper session, String selectedTag, String tagNewName, TagActionCallback<X> callback) throws javax.jcr.RepositoryException
startPath - the start path for the renamingsession - the session used to perform the operationselectedTag - tag to renametagNewName - new tag namecallback - an optional callback can be used to hook on the actions processedjavax.jcr.RepositoryException - in case of JCR-related errorspublic <X> X deleteTagUnderPath(String startPath, JCRSessionWrapper session, String selectedTag, TagActionCallback<X> callback) throws javax.jcr.RepositoryException
startPath - the start path for the deletingsession - the session used to perform the operationselectedTag - tag to deletecallback - an optional callback can be used to hook on the actions processedjavax.jcr.RepositoryException - in case of JCR-related errorspublic void setTagsSuggester(TagsSuggester tagsSuggester)
public TagHandler getTagHandler()
public void setTagHandler(TagHandler tagHandler)
public TagsSuggester getTagsSuggester()
public void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
throws JahiaException
stop in class JahiaServiceJahiaExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.