Class ConfigurationModel
java.lang.Object
de.mid.innovator.m2msdk.model.configuration.ConfigurationModel
- All Implemented Interfaces:
ConfigurationInterface,Serializable,Remote
This class implements the ModelTransformationConfiguratonInterface. Thus it
is responsible for initializing a tree of ConfigurationItems based on a XML
configuration.
- Version:
- 10.1.1
- Author:
- Fabian Knoll fabian.knoll@koelsch-altmann.de
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItem(ConfigurationItemIF item) Add the configuration item to the model.voidaddOrRemoveCustomer(boolean bCustomerMode) Remove or add the customer items depending on the value of the customer mode parameter.createConfigurationItem(ConfigurationItemIF iParent, org.jdom2.Element xmlElement, boolean bCustomer, boolean bCheckOnly) Create a configuration item from an XML element in this model.org.jdom2.DocumentGet content of configuration as a document.getInsert(ConfigurationItemIF inserted, boolean bCreate, boolean bCheckOnly) Get insert for an inserted item.Get the configuration item defined with the given id.Get the configuration items using the given id.getModification(ConfigurationItemIF original, boolean bCreate, boolean bCheckOnly) Get modified item of an original item.getRoot(ConfigurationTag tag) Get the root of the configuration.booleanHas model transformation configuration content changed since last save or load?voidinitialize(org.jdom2.Document configuration, org.jdom2.Document workflow, org.jdom2.Document templates, org.jdom2.Document customer, boolean bExpand) Initialize the model configuration based on given documents.voidremoveItem(ConfigurationItemIF iItem) Remove the configuration item from the model.voidThe content of the model has changed.
-
Constructor Details
-
ConfigurationModel
Constructor
-
-
Method Details
-
initialize
public void initialize(org.jdom2.Document configuration, org.jdom2.Document workflow, org.jdom2.Document templates, org.jdom2.Document customer, boolean bExpand) throws M2MException, RemoteException Description copied from interface:ConfigurationInterfaceInitialize the model configuration based on given documents.- Specified by:
initializein interfaceConfigurationInterface- Parameters:
configuration- document containing the model transformation configurationworkflow- document containing the workflow configurationtemplates- document containing the templatescustomer- document containing the customer modifications and insertsbExpand- expand the model so that all references are instantiated- Throws:
M2MExceptionRemoteException
-
getRoot
Description copied from interface:ConfigurationInterfaceGet the root of the configuration.- Specified by:
getRootin interfaceConfigurationInterface- Parameters:
tag- tag may either be model transformation or customer or workflow or templates.- Returns:
- The root ConfigurationItem of a tree of ConfigurationItems.
- Throws:
M2MExceptionRemoteException
-
createConfigurationItem
public ConfigurationItemIF createConfigurationItem(ConfigurationItemIF iParent, org.jdom2.Element xmlElement, boolean bCustomer, boolean bCheckOnly) throws RemoteException, M2MException Description copied from interface:ConfigurationInterfaceCreate a configuration item from an XML element in this model. And put it beneath the parent.- Specified by:
createConfigurationItemin interfaceConfigurationInterface- Parameters:
iParent- parent of new item,maybe null for a rootxmlElement- XML element describing a configuration itembCustomer- import it from customerbCheckOnly- only check it and do not add to model- Returns:
- configuration item
- Throws:
RemoteExceptionM2MException
-
getDocument
Description copied from interface:ConfigurationInterfaceGet content of configuration as a document. Important side effect: The configuration model is marked as unchanged because it is assumed that the reading into a document is used to save the model.- Specified by:
getDocumentin interfaceConfigurationInterface- Parameters:
tag- tag of root specifies the configuration which is exported ModelTransformation exports model transformation configuration Customer exports customer modifications Workflow exports workflow configuration Templates exports templates- Returns:
- XML document containing the content of the model transformation configuration
- Throws:
RemoteExceptionM2MException
-
hasChanged
Description copied from interface:ConfigurationInterfaceHas model transformation configuration content changed since last save or load?- Specified by:
hasChangedin interfaceConfigurationInterface- Parameters:
tag- tag of root specifies the configuration which is exported ModelTransformation exports model transformation configuration Customer exports customer modifications Workflow exports workflow configuration Templates exports templates- Returns:
- true, if the content of the model has changed.
- Throws:
M2MExceptionRemoteException
-
setContentChanged
Description copied from interface:ConfigurationInterfaceThe content of the model has changed.- Specified by:
setContentChangedin interfaceConfigurationInterface- Parameters:
tag- tag of root specifies the configuration which is exported ModelTransformation exports model transformation configuration Customer exports customer modifications Workflow exports workflow configuration
-
getItem
Description copied from interface:ConfigurationInterfaceGet the configuration item defined with the given id.- Specified by:
getItemin interfaceConfigurationInterface- Parameters:
id- qualified id or string containing a qualified id in double quotes- Returns:
- null if no item has this id
-
getItems
Description copied from interface:ConfigurationInterfaceGet the configuration items using the given id. Use means it is within the value of a parameter.- Specified by:
getItemsin interfaceConfigurationInterface- Parameters:
id- qualified id- Returns:
- null if no item uses this id, else the parameter using it directly or within a string and double quotes
- Throws:
RemoteExceptionM2MException
-
addItem
Description copied from interface:ConfigurationInterfaceAdd the configuration item to the model.- Specified by:
addItemin interfaceConfigurationInterface- Parameters:
item- configuration item to add- Throws:
RemoteExceptionM2MException
-
getModification
public ConfigurationItemIF getModification(ConfigurationItemIF original, boolean bCreate, boolean bCheckOnly) throws RemoteException, M2MException Description copied from interface:ConfigurationInterfaceGet modified item of an original item. Only available if running in customer mode.- Specified by:
getModificationin interfaceConfigurationInterface- Parameters:
original- original configuration itembCreate- true to create a new modification if there is not yet a modification defined. This only works in customer mode.bCheckOnly- Only check if this is possible- Returns:
- null, if there is no modification or no customer mode
- Throws:
RemoteExceptionM2MException
-
getInsert
public ConfigurationItemIF getInsert(ConfigurationItemIF inserted, boolean bCreate, boolean bCheckOnly) throws RemoteException, M2MException Description copied from interface:ConfigurationInterfaceGet insert for an inserted item.- Specified by:
getInsertin interfaceConfigurationInterface- Parameters:
inserted- inserted itembCreate- true to create a new insertbCheckOnly- Only check if this is possible- Returns:
- insertion which defines the insertion of the inserted item
- Throws:
RemoteExceptionM2MException
-
removeItem
Description copied from interface:ConfigurationInterfaceRemove the configuration item from the model.- Specified by:
removeItemin interfaceConfigurationInterface- Parameters:
iItem- configuration item to remove- Throws:
RemoteExceptionM2MException
-
addOrRemoveCustomer
Description copied from interface:ConfigurationInterfaceRemove or add the customer items depending on the value of the customer mode parameter.- Specified by:
addOrRemoveCustomerin interfaceConfigurationInterface- Parameters:
bCustomerMode- true means add false means remove- Throws:
RemoteExceptionM2MException
-