Class Category
- All Implemented Interfaces:
Comparable<Category>
Category
represents a hierarchical entry of a category path and allows to
get locale specific information of such an entry, like a name
.
The locale specific information is stored in the CMS.
E.g. the name
of the category Finance/Invoices
is stored in the CMS
below /Categories/Finance/Invoices/name
.
Example:
ivy.case.setCategoryPath("Finance/Invoices");
ivy.case.getCategory().getName() = EN: "Invoices", DE: "Rechnungen"
ivy.case.getCategory().getPath() = EN: "Finance/Invoices", DE: "Finanzen/Rechnungen"
ivy.case.getCategory().getPath(":") = EN: "Finance:Invoices", DE: "Finanzen:Rechnungen"
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the CMS URI of this category.getLocalizedText
(String key) Returns the localized text from the CMS for the given key under this category.getLocalizedText
(String key, Locale locale) Returns the localized text from the CMS for the given key under this category.getName()
Returns the locale specific name of this category as defined in the CMS.Returns the name of this category as defined in the CMS for the given locale.Returns the parent Category ornull
it this is top categorygetParts()
Returns all category parts of this categorygetPath()
Returns the localized category path with default path separator "/".Returns the localized category path with the given separator.Returns the localized category path with the given separator and locale.Returns the localized category path with default path separator "/".
-
Method Details
-
getPath
Returns the localized category path with default path separator "/".- Returns:
- the localized category path with default path separator "/"
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getPath
Returns the localized category path with the given separator.- Parameters:
separator
- the separator between the parts of the path- Returns:
- the localized category path with the given separator
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getPath
Returns the localized category path with default path separator "/".- Parameters:
locale
- the requested locale- Returns:
- the localized category path with default path separator "/"
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getPath
Returns the localized category path with the given separator and locale.- Parameters:
separator
- the separator between the parts of the pathlocale
- the requested locale- Returns:
- the localized category path with the given separator and locale
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getName
Returns the locale specific name of this category as defined in the CMS.E.g. the
name
of the categoryFinance/Invoices
is stored in the CMS below/Categories/Finance/Invoices/name
.The locale is evaluated from the current context/user. If no CMS entry for the locale exists then the default CMS language is used.
If the CMS entry does not exists or is empty, the last part of the underlying
CategoryPath
is returned. E.g. for the categoryFinance/Invoices
the valueInvoices
will be returned.- Returns:
- the name of this category
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getName
Returns the name of this category as defined in the CMS for the given locale.E.g. the
name
of the categoryFinance/Invoices
is stored in the CMS below/Categories/Finance/Invoices/name
.If no entry for the given locale exists then the default CMS language is used.
If the CMS entry does not exists or the value is empty, the last part of the underlying
CategoryPath
is returned. E.g. for the categoryFinance/Invoices
the valueInvoices
will be returned.- Parameters:
locale
- the requested locale- Returns:
- the name of this category
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getLocalizedText
Returns the localized text from the CMS for the given key under this category.E.g. The key
tooltip
of the categoryFinance/Invoices
is stored in the CMS below/Categories/Finance/Invoices/tooltip
.The locale is evaluated from the current context/user. If no CMS entry for the locale exists then the default CMS language is used.
If the CMS entry does not exists then an empty string will be returned.
Example:
ivy.case.setCategoryPath("Finance/Invoices"); // Will request the CMS entry below 'Case/Categories/Finance/Invoices/tooltip' String categoryTooltip = ivy.case.getCategory().getLocalizedText("tooltip");
- Parameters:
key
- The key of the requested entry- Returns:
- the text for the given key of this category as defined in the CMS.
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getLocalizedText
Returns the localized text from the CMS for the given key under this category.E.g. The key
tooltip
of the categoryFinance/Invoices
is stored in the CMS below/Categories/Finance/Invoices/tooltip
.If no CMS entry for the locale exists then the default CMS language is used.
If the CMS entry does not exists then an empty string will be returned.
- Parameters:
key
- the key of the requested entrylocale
- the requested locale- Returns:
- the text for the given key of this category as defined in the CMS.
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getParts
Returns all category parts of this category- Returns:
- a list of
Categories
of this category beginning form the top category - API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getParent
Returns the parent Category ornull
it this is top categoryExample:
ivy.case.getCategory().getPath(); // returns: "foo/bar" ivy.case.getCategory().getParent().getPath(); // returns: "foo" ivy.case.getCategory().getParent().getParent(); // returns: null
- Returns:
- the parent Category or null
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getCmsUri
Returns the CMS URI of this category.E.g. For the category
Finance/Invoices
the path/Categories/Finance/Invoices
will be returned.- Returns:
- the CMS URI of this category.
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-