public interface MultilingualContentService
Modifier and Type | Method and Description |
---|---|
org.alfresco.service.cmr.repository.NodeRef |
addEmptyTranslation(org.alfresco.service.cmr.repository.NodeRef translationOfNodeRef,
String name,
Locale locale)
Make a empty translation out of an existing pivot translation.
|
void |
addTranslation(org.alfresco.service.cmr.repository.NodeRef newTranslationNodeRef,
org.alfresco.service.cmr.repository.NodeRef translationOfNodeRef,
Locale locale)
Make a translation out of an existing document.
|
org.alfresco.service.cmr.repository.NodeRef |
copyTranslationContainer(org.alfresco.service.cmr.repository.NodeRef mlContainerNodeRef,
org.alfresco.service.cmr.repository.NodeRef newParentRef,
String prefixName)
Copies the given cm:mlContainer.
|
void |
deleteTranslationContainer(org.alfresco.service.cmr.repository.NodeRef mlContainerNodeRef)
Delete the given mlContainer and its translations.
|
List<Locale> |
getMissingTranslations(org.alfresco.service.cmr.repository.NodeRef localizedNodeRef,
boolean addThisNodeLocale)
Given a cm:mlDocument or cm:mlContainer this node returns each locale for
which there isn't a translation.
|
org.alfresco.service.cmr.repository.NodeRef |
getPivotTranslation(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Given any node, this returns the pivot translation.
|
org.alfresco.service.cmr.repository.NodeRef |
getTranslationContainer(org.alfresco.service.cmr.repository.NodeRef translationNodeRef)
Convenience method for super user.
|
org.alfresco.service.cmr.repository.NodeRef |
getTranslationForLocale(org.alfresco.service.cmr.repository.NodeRef translationNodeRef,
Locale locale)
Given a cm:mlDocument, this method attempts to find the best translation for the given
locale.
|
Map<Locale,org.alfresco.service.cmr.repository.NodeRef> |
getTranslations(org.alfresco.service.cmr.repository.NodeRef translationOfNodeRef)
Gets the set of sibling translations associated with the given cm:mlDocument or
cm:mlContainer.
|
boolean |
isTranslation(org.alfresco.service.cmr.repository.NodeRef contentNodeRef)
Checks whether an existing document is part of a translation group.
|
void |
makeTranslation(org.alfresco.service.cmr.repository.NodeRef contentNodeRef,
Locale locale)
Make an existing document into a translation by adding the cm:mlDocument aspect and
creating a cm:mlContainer parent.
|
void |
moveTranslationContainer(org.alfresco.service.cmr.repository.NodeRef mlContainerNodeRef,
org.alfresco.service.cmr.repository.NodeRef newParentRef)
Moves the location of the given cm:mlContainer.
|
void |
unmakeTranslation(org.alfresco.service.cmr.repository.NodeRef translationNodeRef)
Removes the node from any associated translations.
|
@Auditable(parameters="contentNodeRef") boolean isTranslation(org.alfresco.service.cmr.repository.NodeRef contentNodeRef)
contentNodeRef
- An existing cm:content@Auditable(parameters={"contentNodeRef","locale"}) void makeTranslation(org.alfresco.service.cmr.repository.NodeRef contentNodeRef, Locale locale)
contentNodeRef
- An existing cm:contentContentModel.ASPECT_MULTILINGUAL_DOCUMENT
@Auditable(parameters="translationNodeRef") void unmakeTranslation(org.alfresco.service.cmr.repository.NodeRef translationNodeRef)
translationNodeRef
- an existing cm:mlDocument@Auditable(parameters={"newTranslationNodeRef","translationOfNodeRef","locale"}) void addTranslation(org.alfresco.service.cmr.repository.NodeRef newTranslationNodeRef, org.alfresco.service.cmr.repository.NodeRef translationOfNodeRef, Locale locale)
newTranslationNodeRef
- An existing cm:contenttranslationOfNodeRef
- An existing cm:mlDocument@Auditable(parameters="translationNodeRef") org.alfresco.service.cmr.repository.NodeRef getTranslationContainer(org.alfresco.service.cmr.repository.NodeRef translationNodeRef)
translationNodeRef
- An existing cm:mlDocument@Auditable(parameters="translationOfNodeRef") Map<Locale,org.alfresco.service.cmr.repository.NodeRef> getTranslations(org.alfresco.service.cmr.repository.NodeRef translationOfNodeRef)
translationOfNodeRef
- An existing cm:mlDocument or cm:mlContainer@Auditable(parameters={"translationNodeRef","locale"}) org.alfresco.service.cmr.repository.NodeRef getTranslationForLocale(org.alfresco.service.cmr.repository.NodeRef translationNodeRef, 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 localegetTranslations(NodeRef)
,
I18NUtil.getNearestLocale(Locale, Set)
@Auditable(parameters={"localizedNodeRef","addThisNodeLocale"}) List<Locale> getMissingTranslations(org.alfresco.service.cmr.repository.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(parameters="nodeRef") org.alfresco.service.cmr.repository.NodeRef getPivotTranslation(org.alfresco.service.cmr.repository.NodeRef nodeRef)
nodeRef
- a cm:mlDocument translation or cm:mlContainer translation
container@Auditable(parameters={"translationOfNodeRef","name","locale"}) org.alfresco.service.cmr.repository.NodeRef addEmptyTranslation(org.alfresco.service.cmr.repository.NodeRef translationOfNodeRef, String name, Locale locale)
Document.txt --> Document_fr.txtThe 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(parameters={"mlContainerNodeRef","newParentRef"}) org.alfresco.service.cmr.repository.NodeRef copyTranslationContainer(org.alfresco.service.cmr.repository.NodeRef mlContainerNodeRef, org.alfresco.service.cmr.repository.NodeRef newParentRef, String prefixName) throws FileExistsException, FileNotFoundException, Exception
This involves the copy of the cm:mlContainer node and the copy of its cm:mlDocument.
mlContainerNodeRef
- The nodeRef to copynewParentRef
- The new parent of the copied cm:mlDocumentprefixName
- The prefix of the name of the copied translations. Can be null.FileNotFoundException
FileExistsException
Exception
@Auditable(parameters={"mlContainerNodeRef","newParentRef"}) void moveTranslationContainer(org.alfresco.service.cmr.repository.NodeRef mlContainerNodeRef, org.alfresco.service.cmr.repository.NodeRef newParentRef) throws FileExistsException, FileNotFoundException
This not involves changing the cm:mlContainer node but moves its cm:mlDocument.
mlContainerNodeRef
- The nodeRef> to movenewParentRef
- The new parent of the moved cm:mlDocumentFileExistsException
FileNotFoundException
@Auditable(parameters="mlContainerNodeRef") void deleteTranslationContainer(org.alfresco.service.cmr.repository.NodeRef mlContainerNodeRef)
mlContainerNodeRef
- The cm:mlContainer to removeCopyright © 2005–2017 Alfresco Software. All rights reserved.