Implemented helper methods for retrieving translations

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4768 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-01-09 17:53:02 +00:00
parent 4805337905
commit 16261c92e5
3 changed files with 118 additions and 7 deletions

View File

@@ -16,10 +16,15 @@
*/
package org.alfresco.service.cmr.ml;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.alfresco.service.Auditable;
import org.alfresco.service.PublicService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
/**
@@ -79,4 +84,31 @@ public interface MultilingualContentService
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"mlContainerNodeRef", "translationNodeRef"})
void createEdition(NodeRef mlContainerNodeRef, NodeRef translationNodeRef);
/**
* Gets the set of sibling translations associated with the given <b>cm:mlDocument</b> or
* <b>cm:mlContainer</b>.
*
* @param translationOfNodeRef An existing <b>cm:mlDocument</b> or <b>cm:mlContainer</b>
* @return Returns a map of translation nodes keyed by locale
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"translationOfNodeRef"})
Map<Locale, NodeRef> getTranslations(NodeRef translationOfNodeRef);
/**
* Given a <b>cm:mlDocument</b>, this method attempts to find the best translation for the given
* locale. If there is not even a
* {@link org.alfresco.i18n.I18NUtil#getNearestLocale(Locale, Set) partial match}, then <tt>null</tt>
* is returned.
*
* @param translationNodeRef the <b>cm:mlDocument</b>
* @param locale the target locale
* @return Returns Returns the best match for the locale, or <tt>null</tt> if there
* is no near match.
*
* @see #getTranslations(NodeRef)
* @see org.alfresco.i18n.I18NUtil#getNearestLocale(Locale, Set)
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"translationNodeRef", "locale"})
NodeRef getTranslationForLocale(NodeRef translationNodeRef, Locale locale);
}