|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
@PublicService public interface MultilingualContentService
The API to manage multilingual content and related structures.
| Method Summary | |
|---|---|
NodeRef |
addEmptyTranslation(NodeRef translationOfNodeRef,
java.lang.String name,
java.util.Locale locale)
Make a empty translation out of an existing pivot translation. |
void |
addTranslation(NodeRef newTranslationNodeRef,
NodeRef translationOfNodeRef,
java.util.Locale locale)
Make a translation out of an existing document. |
NodeRef |
copyTranslationContainer(NodeRef mlContainerNodeRef,
NodeRef newParentRef,
java.lang.String prefixName)
Copies the given cm:mlContainer. |
void |
deleteTranslationContainer(NodeRef mlContainerNodeRef)
Delete the given mlContainer and its translations. |
java.util.List |
getMissingTranslations(NodeRef localizedNodeRef,
boolean addThisNodeLocale)
Given a cm:mlDocument or cm:mlContainer this node returns each locale for which there isn't a translation. |
NodeRef |
getPivotTranslation(NodeRef nodeRef)
Given any node, this returns the pivot translation. |
NodeRef |
getTranslationContainer(NodeRef translationNodeRef)
Convenience method for super user. |
NodeRef |
getTranslationForLocale(NodeRef translationNodeRef,
java.util.Locale locale)
Given a cm:mlDocument, this method attempts to find the best translation for the given locale. |
java.util.Map |
getTranslations(NodeRef translationOfNodeRef)
Gets the set of sibling translations associated with the given cm:mlDocument or cm:mlContainer. |
boolean |
isTranslation(NodeRef contentNodeRef)
Checks whether an existing document is part of a translation group. |
void |
makeTranslation(NodeRef contentNodeRef,
java.util.Locale locale)
Make an existing document into a translation by adding the cm:mlDocument aspect and creating a cm:mlContainer parent. |
void |
moveTranslationContainer(NodeRef mlContainerNodeRef,
NodeRef newParentRef)
Moves the location of the given cm:mlContainer. |
void |
unmakeTranslation(NodeRef translationNodeRef)
Removes the node from any associated translations. |
| Method Detail |
|---|
@Auditable(key=ARG_0,
parameters="contentNodeRef")
boolean isTranslation(NodeRef contentNodeRef)
contentNodeRef - An existing cm:content
@Auditable(key=ARG_0,
parameters={"contentNodeRef", "locale"})
void makeTranslation(NodeRef contentNodeRef,
java.util.Locale locale)
contentNodeRef - An existing cm:contentContentModel.ASPECT_MULTILINGUAL_DOCUMENT
@Auditable(key=ARG_0,
parameters="translationNodeRef")
void unmakeTranslation(NodeRef translationNodeRef)
translationNodeRef - an existing cm:mlDocument
@Auditable(key=ARG_0,
parameters={"newTranslationNodeRef", "translationOfNodeRef", "locale"})
void addTranslation(NodeRef newTranslationNodeRef,
NodeRef translationOfNodeRef,
java.util.Locale locale)
newTranslationNodeRef - An existing cm:contenttranslationOfNodeRef - An existing cm:mlDocument
@Auditable(key=ARG_0,
parameters="translationNodeRef")
NodeRef getTranslationContainer(NodeRef translationNodeRef)
translationNodeRef - An existing cm:mlDocument
@Auditable(key=ARG_0,
parameters="translationOfNodeRef")
java.util.Map getTranslations(NodeRef translationOfNodeRef)
translationOfNodeRef - An existing cm:mlDocument or cm:mlContainer
@Auditable(key=ARG_0,
parameters={"translationNodeRef", "locale"})
NodeRef getTranslationForLocale(NodeRef translationNodeRef,
java.util.Locale locale)
partial match, then the
pivot translation is used. If that also gives no results
then the translation itself is returned.
translationNodeRef - the cm:mlDocumentlocale - the target locale
MultilingualContentService.getTranslations(NodeRef),
I18NUtil.getNearestLocale(Locale, Set)
@Auditable(key=ARG_0,
parameters={"localizedNodeRef", "addThisNodeLocale"})
java.util.List getMissingTranslations(NodeRef localizedNodeRef,
boolean addThisNodeLocale)
localizedNodeRef - the cm:mlDocument or cm:mlContaineraddThisNodeLocale - if true, add the locale of the given cm:mlDocument in the list.
@Auditable(key=ARG_0,
parameters="nodeRef")
NodeRef getPivotTranslation(NodeRef nodeRef)
nodeRef - a cm:mlDocument translation or cm:mlContainer translation
container
@Auditable(key=ARG_0,
parameters={"translationOfNodeRef", "name", "locale"})
NodeRef addEmptyTranslation(NodeRef translationOfNodeRef,
java.lang.String name,
java.util.Locale locale)
Document.txt --> Document_fr.txt
The necessary translation structures will be created as necessary.
translationOfNodeRef - An existing cm:mlDocumentname - The name of the file to create, or null to use
the default naming convention.
@Auditable(key=ARG_0,
parameters={"mlContainerNodeRef", "newParentRef"})
NodeRef copyTranslationContainer(NodeRef mlContainerNodeRef,
NodeRef newParentRef,
java.lang.String prefixName)
throws FileExistsException,
FileNotFoundException,
java.lang.Exception
This involves the copy of the cm:mlContainer node and the copy of its cm:mlDocument.
translationNodeRef - The cm:mlContainer to copynewParentRef - The new parent of the copied cm:mlDocumentprefixName - The prefix of the name of the copied translations. Can be null.
FileNotFoundException
FileExistsException
java.lang.Exception
@Auditable(key=ARG_0,
parameters={"mlContainerNodeRef", "newParentRef"})
void moveTranslationContainer(NodeRef mlContainerNodeRef,
NodeRef newParentRef)
throws FileExistsException,
FileNotFoundException
This not involves changing the cm:mlContainer node but moves its cm:mlDocument.
translationNodeRef - The cm:mlContainer to movenewParentRef - The new parent of the moved cm:mlDocument
FileExistsException
FileNotFoundException
@Auditable(key=ARG_0,
parameters="mlContainerNodeRef")
void deleteTranslationContainer(NodeRef mlContainerNodeRef)
mlContainerNodeRef - The cm:mlContainer to remove
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||