Class Project
- java.lang.Object
-
- com.aquima.interactions.project.impl.Project
-
- All Implemented Interfaces:
IProject
,Serializable
public class Project extends Object implements IProject
Implementation of the IProject interface.- Since:
- 7.1
- Author:
- O. Kerpershoek
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Project(IProjectDS datasource)
Constructs, initializes and validates the project using the provided data-source.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addConnection(ConnectionDefinition definition)
protected void
addExpander(ExpanderDefinition definition)
protected void
addFieldType(IFieldTypeDefinition fieldType)
protected void
addGlobalParameter(IGlobalParameterDefinition globalParameter)
protected void
addMessage(String key, IMultilingualText message)
protected void
addPortalMessage(PortalMessageDefinition definition)
protected void
addRole(IRole role)
protected void
addService(ServiceDefinition definition)
protected void
addValidator(ValidatorDefinition definition)
boolean
containsMessage(String id)
This method will check if a message exists for the specified id.ApplicationID
getApplicationId()
This method returns the id of the application.Channel[]
getChannels()
This method returns an array containing all the defined channels.IConnectionDefinition
getConnectionDefinition(String name, ConnectionType type)
This method returns the value connection definition for the specified name.IConnectionDefinition[]
getConnectionDefinitions(ConnectionType type)
This method returns an array containing the names of the connection definitions that are available.IConnectionManager
getConnectionManager()
This method returns the connection manager for this project.ILanguage
getDefaultLanguage()
Returns the default language for an application.Theme
getDefaultTheme()
Returns the default theme for an application.String
getDescription()
This method returns the description of the application.IExpanderDefinition
getExpanderByName(String expanderName)
This method returns the expander definition for the specified name.IFieldTypeDefinition
getFieldTypeByName(String name)
Returns the field type with the given name, if no field type exists anUnknownFieldTypeException
will be thrownIFieldTypeDefinition[]
getFieldTypes()
Returns an array with all the field types definition.IGlobalParameterDefinition
getGlobalParameterByName(String name)
Returns the global parameter with the given name, if no global parameter exists anUnknownGlobalParameterException
will be thrownIGlobalParameterDefinition[]
getGlobalParameters()
Returns an array with all the global parameters definition.ILanguage
getLanguageByCode(String code)
This method returns the language specified for the given language code.ILanguage
getLanguageByName(String languageName)
This method returns the language specified for the given name.ILanguage[]
getLanguages()
This method returns an array of all the languages that are defined to the application.IMultilingualText
getMessage(String id)
This method returns the message object belonging to the specified id.IMultilingualText
getMessage(String id, String[] parameters)
This method returns the message object belonging to the specified id.String
getName()
This method returns the (technical) name of the application for which the metamodel is defined.IPortalMessageDefinition
getPortalMessageDefinitionByName(String name)
Returns the portal message with the given name, if no portal message exists an UnknowPortalMessageException will be thrownIRole
getRoleByName(String name)
This method returns the role specified for the given name.IRole[]
getRoles()
This method returns an array containing all the defined roles.IServiceDefinition
getServiceByName(String serviceName)
This method returns the service definition for the specified name.Team[]
getTeams()
This method returns an array containing all the defined teams.Theme[]
getThemes()
This method returns an array of all the themes that are defined to the application.IValidatorDefinition
getValidatorByName(String name)
This method returns the validator definition for the specified type name.String[]
getValidatorNames()
This method returns an array containing the names of the (custom) validators that are available.IValueFormat
getValueFormat(String name)
This method may be used to retrieve the value format for a specified name.IValueFormatDefinition
getValueFormatDefinition(String name)
This method returns the value format definition for the specified name.IValueFormatDefinition[]
getValueFormatDefinitions()
This method returns an array containing the names of the value formats that are available.IValueFormat[]
getValueFormats()
This method returns an array containing the available value formats.Version
getVersion()
This method returns the version of the application for which the metamodel is defined.protected static boolean
isValidName(String name)
-
-
-
Constructor Detail
-
Project
public Project(IProjectDS datasource)
Constructs, initializes and validates the project using the provided data-source.- Parameters:
datasource
- The object that should be used to initialize the project with.- Throws:
InitializationException
- This exception is thrown when the project could not be initialized.
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:IProject
This method returns the (technical) name of the application for which the metamodel is defined. The combination of application name and version uniquely identify a metamodel.
-
getDescription
public String getDescription()
Description copied from interface:IProject
This method returns the description of the application. The description of an application is optional, and as such, this method may return a null value.- Specified by:
getDescription
in interfaceIProject
- Returns:
- The description of the application.
-
getVersion
public Version getVersion()
Description copied from interface:IProject
This method returns the version of the application for which the metamodel is defined. The combination of application name and version uniquely identify a metamodel.- Specified by:
getVersion
in interfaceIProject
- Returns:
- The version of the application.
-
getLanguages
public ILanguage[] getLanguages()
Description copied from interface:IProject
This method returns an array of all the languages that are defined to the application.- Specified by:
getLanguages
in interfaceIProject
- Returns:
- Array containing all the language definitions.
-
getLanguageByCode
public ILanguage getLanguageByCode(String code)
Description copied from interface:IProject
This method returns the language specified for the given language code. When no language can be found for the code an UnknownLanguageException will be thrown.- Specified by:
getLanguageByCode
in interfaceIProject
- Parameters:
code
- of the language that is requested.- Returns:
- The language definition for the specified code.
-
getLanguageByName
public final ILanguage getLanguageByName(String languageName)
Description copied from interface:IProject
This method returns the language specified for the given name. When no language can be found for the name an UnknownLanguageException will be thrown.- Specified by:
getLanguageByName
in interfaceIProject
- Parameters:
languageName
- of the language that is requested.- Returns:
- The language definition for the specified name.
-
getTeams
public Team[] getTeams()
Description copied from interface:IProject
This method returns an array containing all the defined teams.
-
getRoles
public IRole[] getRoles()
Description copied from interface:IProject
This method returns an array containing all the defined roles.
-
getChannels
public Channel[] getChannels()
Description copied from interface:IProject
This method returns an array containing all the defined channels.- Specified by:
getChannels
in interfaceIProject
- Returns:
- array containing all the defined channels
-
getDefaultLanguage
public ILanguage getDefaultLanguage()
Description copied from interface:IProject
Returns the default language for an application.- Specified by:
getDefaultLanguage
in interfaceIProject
- Returns:
- The default language for the application.
-
addMessage
protected void addMessage(String key, IMultilingualText message)
-
containsMessage
public boolean containsMessage(String id)
Description copied from interface:IProject
This method will check if a message exists for the specified id. The id is not case sensitive.- Specified by:
containsMessage
in interfaceIProject
- Parameters:
id
- String containing the name (id)- Returns:
- Boolean indicating if a message is defined for the specified id.
-
getMessage
public IMultilingualText getMessage(String id)
Description copied from interface:IProject
This method returns the message object belonging to the specified id. When no message could be found for the given id an UnknownMessageException is thrown.- Specified by:
getMessage
in interfaceIProject
- Parameters:
id
- Identifier of the message that is requested.- Returns:
- Message object for the specified id.
-
getMessage
public IMultilingualText getMessage(String id, String[] parameters)
Description copied from interface:IProject
This method returns the message object belonging to the specified id. With parameters. these parameters are inserted in the message, when the message string contains {} expressions. For example: a message definition of test=Test message with 3 parameters namely: {0}, {1} and {2} will result in the expanded message. When no message could be found for the given id an UnknownMessageException is thrown.- Specified by:
getMessage
in interfaceIProject
- Parameters:
id
- Identifier of the message that is requested.parameters
- Array of parameter values that should be used in the message.- Returns:
- Message object for the specified id.
-
getDefaultTheme
public Theme getDefaultTheme()
Description copied from interface:IProject
Returns the default theme for an application.- Specified by:
getDefaultTheme
in interfaceIProject
- Returns:
- The default theme for the application.
-
getThemes
public Theme[] getThemes()
Description copied from interface:IProject
This method returns an array of all the themes that are defined to the application.
-
getValueFormat
public IValueFormat getValueFormat(String name)
Description copied from interface:IProject
This method may be used to retrieve the value format for a specified name.- Specified by:
getValueFormat
in interfaceIProject
- Parameters:
name
- The name of the requested value format.- Returns:
- The value format for the specified name.
-
getValueFormats
public IValueFormat[] getValueFormats()
Description copied from interface:IProject
This method returns an array containing the available value formats.- Specified by:
getValueFormats
in interfaceIProject
- Returns:
- an array containing the available value formats.
-
addExpander
protected void addExpander(ExpanderDefinition definition)
-
getExpanderByName
public IExpanderDefinition getExpanderByName(String expanderName)
Description copied from interface:IProject
This method returns the expander definition for the specified name. If no expander definition can be found for the name, an exception is thrown. The name is not case sensitive.- Specified by:
getExpanderByName
in interfaceIProject
- Parameters:
expanderName
- The name of the expander whose definition is requested.- Returns:
- The definition of the expander with the specified name.
-
addService
protected void addService(ServiceDefinition definition)
-
isValidName
protected static boolean isValidName(String name)
-
getServiceByName
public IServiceDefinition getServiceByName(String serviceName)
Description copied from interface:IProject
This method returns the service definition for the specified name. If no service definition can be found for the name, an exception is thrown. The name is not case sensitive.- Specified by:
getServiceByName
in interfaceIProject
- Parameters:
serviceName
- The name of the service whose definition is requested.- Returns:
- The definition of the service with the specified name.
-
getValidatorByName
public IValidatorDefinition getValidatorByName(String name)
Description copied from interface:IProject
This method returns the validator definition for the specified type name.- Specified by:
getValidatorByName
in interfaceIProject
- Parameters:
name
- The type name of the requested validator.- Returns:
- The validator definition for the specified type name.
-
addValidator
protected void addValidator(ValidatorDefinition definition)
-
getValidatorNames
public String[] getValidatorNames()
Description copied from interface:IProject
This method returns an array containing the names of the (custom) validators that are available.- Specified by:
getValidatorNames
in interfaceIProject
- Returns:
- array containing the names of the (custom) validators that are available.
-
getValueFormatDefinition
public IValueFormatDefinition getValueFormatDefinition(String name)
Description copied from interface:IProject
This method returns the value format definition for the specified name.- Specified by:
getValueFormatDefinition
in interfaceIProject
- Parameters:
name
- The name of the requested value format.- Returns:
- The value format definition for the specified name.
-
getValueFormatDefinitions
public IValueFormatDefinition[] getValueFormatDefinitions()
Description copied from interface:IProject
This method returns an array containing the names of the value formats that are available.- Specified by:
getValueFormatDefinitions
in interfaceIProject
- Returns:
- array containing the names of the value formats that are available.
-
getConnectionManager
public IConnectionManager getConnectionManager()
Description copied from interface:IProject
This method returns the connection manager for this project. It may contain connections that are defined in this project.- Specified by:
getConnectionManager
in interfaceIProject
- Returns:
- The connection manager for this project.
-
getConnectionDefinition
public IConnectionDefinition getConnectionDefinition(String name, ConnectionType type)
Description copied from interface:IProject
This method returns the value connection definition for the specified name.- Specified by:
getConnectionDefinition
in interfaceIProject
- Parameters:
name
- The name of the requested connection definition.type
- The type of the requested connection definition.- Returns:
- The connection definition definition for the specified name.
-
getConnectionDefinitions
public IConnectionDefinition[] getConnectionDefinitions(ConnectionType type)
Description copied from interface:IProject
This method returns an array containing the names of the connection definitions that are available.- Specified by:
getConnectionDefinitions
in interfaceIProject
- Parameters:
type
- The type of the requested connection definitions.- Returns:
- array containing the names of the connection definitions that are available.
-
addConnection
protected void addConnection(ConnectionDefinition definition)
-
getRoleByName
public IRole getRoleByName(String name)
Description copied from interface:IProject
This method returns the role specified for the given name. When no role can be found for the name an UnknownRoleException will be thrown.- Specified by:
getRoleByName
in interfaceIProject
- Parameters:
name
- of the role that is requested.- Returns:
- The role definition for the specified name.
-
addRole
protected void addRole(IRole role)
-
getApplicationId
public ApplicationID getApplicationId()
Description copied from interface:IProject
This method returns the id of the application.- Specified by:
getApplicationId
in interfaceIProject
- Returns:
- The id of the application.
-
getPortalMessageDefinitionByName
public IPortalMessageDefinition getPortalMessageDefinitionByName(String name)
Description copied from interface:IProject
Returns the portal message with the given name, if no portal message exists an UnknowPortalMessageException will be thrown- Specified by:
getPortalMessageDefinitionByName
in interfaceIProject
- Parameters:
name
- the name of the portal message- Returns:
- the portal message definition
-
addPortalMessage
protected void addPortalMessage(PortalMessageDefinition definition)
-
getGlobalParameters
public IGlobalParameterDefinition[] getGlobalParameters()
Description copied from interface:IProject
Returns an array with all the global parameters definition. If none exists, an empty array will be returned.- Specified by:
getGlobalParameters
in interfaceIProject
- Returns:
- the available global parameters or an empty array
-
addGlobalParameter
protected void addGlobalParameter(IGlobalParameterDefinition globalParameter)
-
getGlobalParameterByName
public IGlobalParameterDefinition getGlobalParameterByName(String name)
Description copied from interface:IProject
Returns the global parameter with the given name, if no global parameter exists anUnknownGlobalParameterException
will be thrown- Specified by:
getGlobalParameterByName
in interfaceIProject
- Parameters:
name
- - name of the global parameter's definition to be returned- Returns:
- - the global paramter's definition
-
addFieldType
protected void addFieldType(IFieldTypeDefinition fieldType)
-
getFieldTypes
public IFieldTypeDefinition[] getFieldTypes()
Description copied from interface:IProject
Returns an array with all the field types definition. If none exists, an empty array will be returned.- Specified by:
getFieldTypes
in interfaceIProject
- Returns:
- the available field types or an empty array
-
getFieldTypeByName
public IFieldTypeDefinition getFieldTypeByName(String name)
Description copied from interface:IProject
Returns the field type with the given name, if no field type exists anUnknownFieldTypeException
will be thrown- Specified by:
getFieldTypeByName
in interfaceIProject
- Parameters:
name
- - name of the field type's definition to be returned- Returns:
- - the field type's definition
-
-