tag
JDITO-Funktionen für Tags
Methods
add
add(
pConfig):string
Adds a tag to an object. The tag is identified as a private or public tag by the tag type.
Parameters
Returns
stringThe Id of the newly created tagged object. If already existed, the id of the existing one. If there are more tagged objects in existence matching the config params, it will return an empty string.
Throws
May throw an exception.
createAddTagConfig
createAddTagConfig():
AddTagConfig
Creates a new config object for adding a tag.
Returns
the add-config object
createGetTagConfig
createGetTagConfig():
GetTagConfig
Creates a new config object for loading one tag by id.
Returns
the get-tag-config object
createGetTaggedObjectByDataConfig
createGetTaggedObjectByDataConfig():
GetTaggedObjectByDataConfig
Creates a new config object for loading one tagged object by its data.
Returns
the get-multiple-by-data-config object
createGetTaggedObjectByIdConfig
createGetTaggedObjectByIdConfig():
GetTaggedObjectByIdConfig
Creates a new config object for loading one tagged object by its id.
Returns
the get-tags-config object
createGetTaggedObjectsConfig
createGetTaggedObjectsConfig():
GetTaggedObjectsConfig
Creates a new config object for loading multiple tagged objects by data.
Returns
the get-multiple-by-data-config object
createGetTagsConfig
createGetTagsConfig():
GetTagsConfig
Creates a new config object for loading multiple tags containing a certain dataset.
Returns
the get-tags-config object
createSuggestTagConfig
createSuggestTagConfig():
SuggestTagConfig
Creates a new config object used to lookup for suggestions of hashtags.
Returns
the suggest-tag-config object
createUntagByContextConfig
createUntagByContextConfig():
UntagByContextConfig
Creates a new config object for untagging all objects of a certain context.
Returns
the untag-by-context-config object
createUntagByDataConfig
createUntagByDataConfig():
UntagByDataConfig
Creates a new config object for untagging all objects holding a certain dataset.
Returns
the untag-by-data-config object
createUntagByIdConfig
createUntagByIdConfig():
UntagByIdConfig
Creates a new config object for untagging one object by its id.
Returns
the untag-by-id-config object
createUntagMultipleByIdConfig
createUntagMultipleByIdConfig():
UntagMultipleByIdConfig
Creates a new config object for untagging multiple objects by its ids.
Returns
the remove-multiple-by-id-config object
getPublicTags
getPublicTags(
pConfig):Map<any,any>[]
Loads all public tags based on the parameterized config object. See parameter description for pConfig on which configs are allowed.
Parameters
Returns
Map<any, any>[]All tags with the given dataset stored in it.
Throws
May throw an exception.
getTagAlias
getTagAlias():
string
Gets the actual alias, where tag tables are stored.
Returns
stringthe name of the alias
getTaggedObjects
getTaggedObjects(
pConfig):Map<any,any>[]
Loads tagged objects based on the parameterized config object. See parameter description for pConfig on which configs are allowed.
Parameters
Config containing all required data to execute the operation. GetTaggedObjectByDataConfig/GetTaggedObjectByIdConfig/GetTaggedObjectsConfig
Returns
Map<any, any>[]All tagged objects of a user.
Throws
May throw an exception.
getTags
getTags(
pConfig):Map<any,any>[]
Loads all tags based on the parameterized config object. See parameter description for pConfig on which configs are allowed.
Parameters
Config containing all required data to execute the operation. GetGroupConfig/GetGroupsConfig
Returns
Map<any, any>[]All groups of the pUser with the given dataset stored in it.
Throws
May throw an exception.
lookupHashtags
lookupHashtags(
pInputPattern):string[]
Returns up to 10 suggestions of existing hashtags for the given input string.
NOTE: To use this feature, the index search must be enabled. Only suggestions for global tags that are also contained in the index are delivered.
Parameters
string | number | booleanThe input as String for which tags should be suggested.
Returns
string[]an Array of up to 10 suggestions of existing hashtags matching the given input.
Throws
May throw an exception.
Example
var suggestions = tag.lookupHashtags("d"); // ["Documentation", "Internal-Documentation", "done"]
suggestHashtags
suggestHashtags(
pTagConfig):Map<any,any>[]
Returns suggestions of existing hashtags for the given configuration.
NOTE: To use this feature, the index search must be enabled. Only suggestions for global tags that are also contained in the index are delivered.
Parameters
Returns
Map<any, any>[]an Array of upt to 10 suggestions of existing hashtags matching the given input.
Throws
May throw an exception.
Example
var stc = tag.createSuggestTagConfig()
.setPattern("adi")
.setLimit(3) // Sets max amount of returned suggestions. (Default is 10)
.setIncludeCounts(true); // Falg, which activates the determination of hashtag counts.
var res = tag.suggestHashtags(stc);
if( res.length > 0 )
{
var topTag = res[0].tag; // The suggested hashtag.
var weight = res[0].weight; // The relevance of the suggestion.
var count = res[0].count; // The usage of the tag. '-1' if disabled (default).
}
// Example of the returned array:
// [
// {
// "tag":"ADITO",
// "weight":10,
// "count":25
// },
// {
// "tag":"Neon ADITO",
// "weight":8,
// "count":7
// }
// ]
untag
untag(
pConfig):boolean
Untags all objects based on the config type. Use the untagBy* functions to create the desired config object. Resulting empty tags will be deleted too.
Parameters
Returns
booleantrue if successful, false if not
Throws
May throw an exception.
Properties
DEFAULT_FAVORITE_GROUP
stringThis type is used for the users main (default) favorites, without an explicitly added tag. Using this type, ignores the passed tag title in all methods.
FAVORITE_GROUP
stringThis type is used for the users private tags, so called favorites.
HASHTAG
stringThis type is used for system-wide cross-user tagging (similar to hashtags known from social media).