public interface ResourceNLSManager
Modifier and Type | Method and Description |
---|---|
boolean |
containsLocale(java.util.Locale locale,
java.lang.String submitter)
Tests whether has defined NLS entry for specified locale in organization that
submitter belongs to.. |
java.util.Map<java.lang.String,java.lang.String> |
exportNLSDisplays(java.util.Locale locale,
java.lang.String submitter)
get NLS displays of whole resource tree for specified locale.
|
java.util.List<java.util.Locale> |
getAvailableLocales(java.lang.String submitter)
Gets all locales that has defined NLS entry in the organization that
submitter belongs to. |
java.util.List<TextNLSEntry> |
getNLSEntriesInPath(java.util.Locale locale,
java.lang.String path,
java.lang.String submitter)
get NLS entries under specified resource path for the locale.
|
TextNLSEntry |
getNLSEntry(java.util.Locale locale,
java.lang.String resourcePath,
java.lang.String submitter)
get NLS entry of specified resource for the locale.
|
TextNLSEntry |
getRootNLSEntry(java.util.Locale locale,
java.lang.String submitter)
get NLS entry of root node for the locale.
|
int |
importNLSDisplays(java.util.Locale locale,
java.util.Map<java.lang.String,java.lang.String> displays,
java.lang.String submitter)
update NLS displays of whole resource tree for specified locale.
|
boolean |
removeLocale(java.util.Locale locale,
java.lang.String submitter)
Removes a locale and all NLS entries bond with the locale in organization that
submitter belongs to. |
boolean |
removeNLSEntriesInPath(java.util.Locale locale,
java.lang.String path,
java.lang.String submitter)
remove NLS entries under specified path for the locale
|
boolean |
removeNLSEntry(java.util.Locale locale,
java.lang.String resourcePath,
java.lang.String submitter)
remove NLS entry of specified resource for the locale
|
boolean |
removeRootNLSEntry(java.util.Locale locale,
java.lang.String submitter)
remove NLS entry of root node for the locale
|
boolean |
updateNLSEntriesInPath(java.util.Locale locale,
java.lang.String path,
java.util.List<TextNLSEntry> entries,
java.lang.String submitter)
update NLS entries under specified path for the locale, this operation will clean all orginal
|
boolean |
updateNLSEntry(java.util.Locale locale,
java.lang.String resourcePath,
TextNLSEntry entry,
java.lang.String submitter)
update NLS entry of specified resource for the locale.
|
boolean |
updateRootNLSEntry(java.util.Locale locale,
TextNLSEntry entry,
java.lang.String submitter)
update NLS entry of root node for the locale.
|
java.util.List<java.util.Locale> getAvailableLocales(java.lang.String submitter) throws NoPrivilegeException
submitter
belongs to.submitter
- the submitter user id, should be an administrator or organization administrator (if specified
organization, otherwise will throw NoPrivilegeException
.NoPrivilegeException
- throws this exception if submitter
is not an administrator or organization administrator.boolean containsLocale(java.util.Locale locale, java.lang.String submitter) throws NoPrivilegeException
submitter
belongs to..locale
- The locale to test.submitter
- the submitter user id, should be an administrator or organization administrator.NoPrivilegeException
- throws this exception if submitter
is not an administrator or organization administrator.java.util.List<TextNLSEntry> getNLSEntriesInPath(java.util.Locale locale, java.lang.String path, java.lang.String submitter) throws NoPrivilegeException, UnknownResource
locale
- the localepath
- the resource path.submitter
- the submitter user id, should be an administrator or organization administrator.getAvailableLocales(String)
does not contain
specified locale
or path
does not indicate a folder, return null.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator (if the path
indicates a organization resource).UnknownResource
- throw this exception if path
does not exist.TextNLSEntry
TextNLSEntry getNLSEntry(java.util.Locale locale, java.lang.String resourcePath, java.lang.String submitter) throws NoPrivilegeException, UnknownResource
locale
- the localeresourcePath
- resource path that defined NLS entrysubmitter
- the submitter user id, should be an administrator or organization administrator.resourcePath
, if return value of getAvailableLocales(String)
does not contain specified locale
or no NLS entry defined on this resource, return null.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator (if the resourcePath
indicates a organization resource).UnknownResource
- throw this exception if path
does not exist.TextNLSEntry
TextNLSEntry getRootNLSEntry(java.util.Locale locale, java.lang.String submitter) throws NoPrivilegeException
locale
- the localesubmitter
- the submitter user id, should be an administrator or organization administrator.getAvailableLocales(String)
does not contain specified locale
or no NLS entry defined on it, return null.NoPrivilegeException
- throw this exception if submitter
is not an administrator.TextNLSEntry
boolean removeLocale(java.util.Locale locale, java.lang.String submitter) throws NoPrivilegeException
submitter
belongs to.locale
- The locale which you want to remove.submitter
- the submitter user id, should be an administrator or organization administrator.NoPrivilegeException
- throws this exception if submitter
is not an administrator or organization administrator.boolean removeNLSEntriesInPath(java.util.Locale locale, java.lang.String path, java.lang.String submitter) throws NoPrivilegeException, UnknownResource
locale
- the localepath
- the path, should be a folder.submitter
- the submitter user id, should be an administrator or organization administrator.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator (if the path
indicates a organization resource).UnknownResource
- throw this exception if path
does not exist.boolean removeNLSEntry(java.util.Locale locale, java.lang.String resourcePath, java.lang.String submitter) throws NoPrivilegeException, UnknownResource
locale
- the localeresourcePath
- resource path that defined NLS entry.submitter
- the submitter user id, should be an administrator or organization administrator.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator (if the resourcePath
indicates a organization resource).UnknownResource
- throw this exception if resourcePath
does not exist.boolean removeRootNLSEntry(java.util.Locale locale, java.lang.String submitter) throws NoPrivilegeException
locale
- the localesubmitter
- the submitter user id, should be an administrator.NoPrivilegeException
- throw this exception if submitter
is not an administrator.boolean updateNLSEntriesInPath(java.util.Locale locale, java.lang.String path, java.util.List<TextNLSEntry> entries, java.lang.String submitter) throws NoPrivilegeException, UnknownResource
locale
- the localepath
- the patch, should be a folderentries
- NLS entries that will update to.submitter
- the submitter user id, should be an administrator or organization administrator.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator (if the path
indicates a organization resource).UnknownResource
- throw this exception if path
does not exist.boolean updateNLSEntry(java.util.Locale locale, java.lang.String resourcePath, TextNLSEntry entry, java.lang.String submitter) throws NoPrivilegeException, UnknownResource
locale
- the localeresourcePath
- resource path that defined NLS entryentry
- NLS entry that will update tosubmitter
- the submitter user id, should be an administrator or organization administrator.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator (if the resourcePath
indicates a organization resource).UnknownResource
- throw this exception if resourcePath
does not exist.boolean updateRootNLSEntry(java.util.Locale locale, TextNLSEntry entry, java.lang.String submitter) throws NoPrivilegeException
locale
- the localeentry
- NLS entry that will update tosubmitter
- the submitter user id, should be an administrator.NoPrivilegeException
- throw this exception if submitter
is not an administrator.UnknownResource
- throw this exception if resourcePath
does not exist.java.util.Map<java.lang.String,java.lang.String> exportNLSDisplays(java.util.Locale locale, java.lang.String submitter) throws NoPrivilegeException
Map
object that
represents displays of resource tree belong to the same organization of submitter
, key
is resource path, value is display text.locale
- the localesubmitter
- the submitter user id, should be an administrator or organization administrator.Map
object which represents displays of resource tree, key is resource path, value is display text.
if not define display text of a resource path for the locale, value is empty string.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator.int importNLSDisplays(java.util.Locale locale, java.util.Map<java.lang.String,java.lang.String> displays, java.lang.String submitter) throws NoPrivilegeException
displays
is a Map
object that represents displays of resource tree, key is resource path, value is display text. if a resource path
does not exist or the resource path and submitter
do not belong to same organization, the item will be
ignore. Existing display text will be overwritten.locale
- the localedisplays
- a Map
object which represents displays of resource tree, key is resource path, value is display text.
if no display text of a resource path for the locale, value should be empty string.submitter
- the submitter user id, should be an administrator or organization administrator.NoPrivilegeException
- throw this exception if submitter
is not an administrator or
organization administrator.