001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.interfaces;
034:
035: import com.flexive.shared.FxLanguage;
036: import com.flexive.shared.exceptions.FxApplicationException;
037:
038: import javax.ejb.Remote;
039: import java.util.List;
040:
041: /**
042: * [fleXive] language engine interface.
043: * This engine should not be used to load languages as they are available from the environment!
044: * Its purpose is to enable/disable, initially load and manage (position, etc.) languages
045: *
046: * @author Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
047: * @version $Rev
048: */
049: @Remote
050: public interface LanguageEngine {
051:
052: /**
053: * Loads a language defined by its unique id.
054: *
055: * @param languageId the unqiue id of the language to load
056: * @return the language object
057: * @throws FxApplicationException on errors
058: */
059: FxLanguage load(long languageId) throws FxApplicationException;
060:
061: /**
062: * Loads a language defined by is iso code.
063: *
064: * @param languageIsoCode the iso code of the language to load
065: * @return the language object
066: * @throws FxApplicationException on errors
067: */
068: FxLanguage load(String languageIsoCode)
069: throws FxApplicationException;
070:
071: /**
072: * Loads all available languages.
073: *
074: * @return an array with all available languages
075: * @throws FxApplicationException on errors
076: */
077: FxLanguage[] loadAvailable() throws FxApplicationException;
078:
079: /**
080: * Loads all disabled languages.
081: *
082: * @return a list with all disabled languages
083: * @throws FxApplicationException on errors
084: */
085: List<FxLanguage> loadDisabled() throws FxApplicationException;
086:
087: /**
088: * Loads all available languages.
089: *
090: * @param excludeSystemLanguage if true the system language is exluded from the result
091: * @return a array with all available language objects
092: * @throws FxApplicationException if the function fails
093: */
094: public List<FxLanguage> loadAvailable(boolean excludeSystemLanguage)
095: throws FxApplicationException;
096:
097: /**
098: * Returns true if the language referenced by its unique id is valid.
099: * <p/>
100: * A language is valid if it may be used according to the used license.
101: *
102: * @param languageId the unqique id of the language to check
103: * @return a array with all available language objects
104: */
105: boolean isValid(long languageId);
106:
107: /**
108: * Set all available languages
109: *
110: * @param available list containing all available languages
111: * @param ignoreUsage ignore if a language that is no longer available after calling this method is in use
112: * @throws FxApplicationException on errors
113: */
114: public void setAvailable(List<FxLanguage> available,
115: boolean ignoreUsage) throws FxApplicationException;
116: }
|