Phase one of merge of EC multilingual work

These files are their changes plus adjustments for formatting and immediate clashes
I anticipate that this will break the build, but there are too many changes coming to risk it.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5740 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-05-22 04:47:14 +00:00
parent 2f68bf73da
commit 2e79d2e6d2
33 changed files with 3885 additions and 197 deletions

View File

@@ -0,0 +1,115 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.service.cmr.ml;
import java.util.List;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.Auditable;
import org.alfresco.service.NotAuditable;
import org.alfresco.service.PublicService;
/**
* This service interface provides support for content filter languages .
*
* @author yanipig
*
*/
@PublicService
public interface ContentFilterLanguagesService
{
/**
* I18N message prefix to found the translation of a language label with a
* given lang code.
*/
public static final String MESSAGE_PREFIX = "content_filter_lang.";
/**
* Get the order of the specified language code
*
* @param code
* @return
* @throws AlfrescoRuntimeException if the code doesn't exist
*/
@NotAuditable
public int getOrderByCode(String code);
/**
* Get the language of the specified language code
*
* @param code
* @return
* @throws AlfrescoRuntimeException if the code doesn't exist
*/
@NotAuditable
public String getLabelByCode(String code);
/**
* Get ordered list of languages code
*
* @return the map of displays indexed by extension
*/
@Auditable
public List<String> getFilterLanguages();
/**
* Get the the odered filter which results form an extract of availableLanguages on the filterLanguages
*
* @param availableLanguages the languages list whose will be removed from the filterLanguages
* @return
*/
@Auditable
public List<String> getMissingLanguages(List<String> availableLanguages);
/**
* @return the default content filter language, null if it's not set.
*/
@Auditable
public String getDefaultLanguage();
/**
* Since <code>java.util.Locale</code> uses and returns <b>old</b> ISO code and the content-filter-lang.xml
* respects the <b>new ones</b>. This method convert new codes into old codes:
* <p>(he, yi, and id) new codes to (iw, ji, and in) old codes </p>
*
* @param code the ISO language code to convert
* @return the convertion of the codes he, yi, and id or the given code
*/
@NotAuditable
public String convertToOldISOCode(String code);
/**
* Since <code>java.util.Locale</code> uses and returns <b>old</b> ISO code and the content-filter-lang.xml
* respects the <b>new ones</b>. This method convert old codes into new codes:
* <p>(iw, ji, and in) old codes to (he, yi, and id) new codes </p>
*
* @param code the ISO language code to convert
* @return the convertion of the codes iw, ji, and in or the given code
*/
@NotAuditable
public String convertToNewISOCode(String code);
}

View File

@@ -24,6 +24,7 @@
*/
package org.alfresco.service.cmr.ml;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -117,4 +118,38 @@ public interface MultilingualContentService
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"translationNodeRef", "locale"})
NodeRef getTranslationForLocale(NodeRef translationNodeRef, Locale locale);
/**
* Given <b>cm:mlDocument</b> or a <b>cm:mlContainer</b>, this node returns each
* locale that the node hasn't a translation yet.
*
* @param localizedNodeRef the <b>cm:mlDocument</b> or the <b>cm:mlContainer</b>
* @param addThisNodeLocale if true, add the locale of the given <b>cm:mlDocument</b> in the list.
* @return
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"localizedNodeRef", "addThisNodeLocale"})
List<Locale> getMissingTranslations(NodeRef localizedNodeRef, boolean addThisNodeLocale);
/**
* Given any node, this returns the pivot translation. The pivot translation is the translation
* that its locale is referenced by the locale of the MLContainer. The translation can't be an
* empty translation.
*
* @param nodeRef the node to test
* @return the pivot translation
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"nodeRef"})
NodeRef getPivotTranslation(NodeRef nodeRef);
/**
* Make a empty translation out of an existing document. The necessary translation structures will be created
* as necessary.
*
* @param translationOfNodeRef An existing <b>cm:mlDocument</b> or <b>cm:mlContainer</b>
* @param name The name of the translation to create
* @return Returns the new created <b>cm:mlEmptyTranslation</b>
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"translationOfNodeRef", "name", "locale"})
NodeRef addEmptyTranslation(NodeRef translationOfNodeRef, String name, Locale locale);
}