Class ADModelHelper
- java.lang.Object
-
- de.mid.innovator.srv2api.icw2meta.ADModelHelper
-
public abstract class ADModelHelper extends java.lang.Object
Represents a common model.- See Also:
ADModel
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ARG_CreateRepository
createBranch(SrvContext srvCtx, ADModel adModel, java.lang.String branchName, java.lang.String note, boolean asSubBranch, boolean withCS)
Creates a branch.static ARG_CreateRepository
createBranchBackup(SrvContext srvCtx, ADModel adModel, java.lang.String backupName, java.lang.String note)
Creates a backup of the current branch.static ARG_ADModelInfo
createByFile(SrvContext srvCtx, ADLogin login, byte[] file, java.lang.String nameModel, java.lang.String password, java.lang.String passCopy)
Creates a new model using the given version file.static ARG_CreateRepository
createModelVersion(SrvContext srvCtx, ADModel adModel, java.lang.String branchName, java.lang.String note, java.lang.String adModelUUID, java.lang.String parentBranchUUID, java.lang.String adModelName)
Creates a new model version.static ELElement
getFindElementById(SrvContext srvCtx, java.lang.Class<? extends ELObject> kVOcl, int id)
If it exists, returns the model element described by the ARG_FindElementByIdOclReq structure.static ARG_CreationDate
getFirstCreationDate(SrvContext srvCtx, java.util.List<? extends ELContainerAble> seqRoot, java.util.List<? extends ELElement> seqFlat)
examines the transitive content of the elements in seqRoot and returns the oldest creation date of these elements.static ARG_ADListLoginOut
getListLogin(SrvContext srvCtx, java.lang.String nameModel, K_ADMODEL methModel, java.lang.String patternUser)
Returns information about the login user list.static ARG_ADModelConfig
getListModelConfig(SrvContext srvCtx, K_ADMODEL item)
Returns the names of available model configurations.static ARG_ADUserConfig
getListUserConfig(SrvContext srvCtx)
Returns the names of available user configurations.static byte[]
getVersionFile(SrvContext srvCtx, ADLogin login, K_ADMODEL method, java.lang.String name)
Returns the complete version ASCII representation of the model.static void
guestAllow(SrvContext srvCtx, ADModel model, boolean allowLogin, java.lang.String text)
Allow and forbid for the guest logins.static void
modifyBranchProperties(SrvContext srvCtx, ADModel adModel, java.lang.String name, java.lang.String note)
Updates the properties of this branch.static void
modifyVersionAlias(SrvContext srvCtx, ADModel adModel, java.util.List<ARG_Alias> seqAlias)
Replaces the model versions alias list.static void
nameConstraintsUpdate(SrvContext srvCtx, ADModel adModel, java.lang.String expressionForVersionName, java.lang.String expressionForBackupName)
Updates the regular expressions constraining the name of a model version and a model backup.static void
reassignBranch(SrvContext srvCtx, ADModel adModel, java.lang.String parentBranchUUID)
assigns this branch to a new parent branch.
-
-
-
Method Detail
-
getFindElementById
public static ELElement getFindElementById(SrvContext srvCtx, java.lang.Class<? extends ELObject> kVOcl, int id) throws InoNetException, SrvErrorException
If it exists, returns the model element described by the ARG_FindElementByIdOclReq structure.- Parameters:
srvCtx
- The context of the related innovator server.kVOcl
- VOCL of elementid
- Id of element- Throws:
InoNetException
SrvErrorException
-
getFirstCreationDate
public static ARG_CreationDate getFirstCreationDate(SrvContext srvCtx, java.util.List<? extends ELContainerAble> seqRoot, java.util.List<? extends ELElement> seqFlat) throws InoNetException, SrvErrorException
examines the transitive content of the elements in seqRoot and returns the oldest creation date of these elements.- Parameters:
srvCtx
- The context of the related innovator server.seqRoot
- consider this element and all transitivly owned elementsseqFlat
- consider only this elements but omit transitifly owned elements- Throws:
InoNetException
SrvErrorException
-
getListLogin
public static ARG_ADListLoginOut getListLogin(SrvContext srvCtx, java.lang.String nameModel, K_ADMODEL methModel, java.lang.String patternUser) throws InoNetException, SrvErrorException
Returns information about the login user list.- Parameters:
srvCtx
- The context of the related innovator server.nameModel
- name of the modelmethModel
- method of the modelpatternUser
- pattern for the user name- Throws:
InoNetException
SrvErrorException
-
getListModelConfig
public static ARG_ADModelConfig getListModelConfig(SrvContext srvCtx, K_ADMODEL item) throws InoNetException, SrvErrorException
Returns the names of available model configurations.- Parameters:
srvCtx
- The context of the related innovator server.item
-- Throws:
InoNetException
SrvErrorException
-
getListUserConfig
public static ARG_ADUserConfig getListUserConfig(SrvContext srvCtx) throws InoNetException, SrvErrorException
Returns the names of available user configurations.- Parameters:
srvCtx
- The context of the related innovator server.- Throws:
InoNetException
SrvErrorException
-
getVersionFile
public static byte[] getVersionFile(SrvContext srvCtx, ADLogin login, K_ADMODEL method, java.lang.String name) throws InoNetException, SrvErrorException
Returns the complete version ASCII representation of the model.- Parameters:
srvCtx
- The context of the related innovator server.login
- administrator loginmethod
- model typename
- model name- Throws:
InoNetException
SrvErrorException
-
createBranchBackup
public static ARG_CreateRepository createBranchBackup(SrvContext srvCtx, ADModel adModel, java.lang.String backupName, java.lang.String note) throws InoNetException, SrvErrorException
Creates a backup of the current branch.- Parameters:
srvCtx
- The context of the related innovator server.adModel
- take the current branch of this modelbackupName
- name of the backup branchnote
- note of the new branch- Throws:
InoNetException
SrvErrorException
-
createBranch
public static ARG_CreateRepository createBranch(SrvContext srvCtx, ADModel adModel, java.lang.String branchName, java.lang.String note, boolean asSubBranch, boolean withCS) throws InoNetException, SrvErrorException
Creates a branch. The branch holds a copy of the current model. The branch is a either a sub branch of the current branch or a sibling branch of the current branch.- Parameters:
srvCtx
- The context of the related innovator server.adModel
- create branch for this modelbranchName
- name of the new branchnote
- note of the new branchasSubBranch
- if true create as a sub brunch of the current branchwithCS
- extract with change set- Throws:
InoNetException
SrvErrorException
-
createByFile
public static ARG_ADModelInfo createByFile(SrvContext srvCtx, ADLogin login, byte[] file, java.lang.String nameModel, java.lang.String password, java.lang.String passCopy) throws InoNetException, SrvErrorException
Creates a new model using the given version file. The name of the model from inside the file is used made unique if necessary.- Parameters:
srvCtx
- The context of the related innovator server.login
- repository administrator loginfile
- file to importnameModel
- name of the new model. If not set the name of the copied one will be usedpassword
- password of the new model. If not set the password of the copied one will be usedpassCopy
- password of the copied model. Must be set if a new password should be set- Throws:
InoNetException
SrvErrorException
-
createModelVersion
public static ARG_CreateRepository createModelVersion(SrvContext srvCtx, ADModel adModel, java.lang.String branchName, java.lang.String note, java.lang.String adModelUUID, java.lang.String parentBranchUUID, java.lang.String adModelName) throws InoNetException, SrvErrorException
Creates a new model version. The repository contains a copy of the current model.- Parameters:
srvCtx
- The context of the related innovator server.adModel
- create a version for this modelbranchName
- name of the new branchnote
- note of the new branchadModelUUID
- uuid of the model. If null a new UUID is assigned to the model.parentBranchUUID
- uuid of the new parent branch. If not null an adModelUUID is required. If null this version is root versionadModelName
- name of the model of the newly created branch- Throws:
InoNetException
SrvErrorException
-
guestAllow
public static void guestAllow(SrvContext srvCtx, ADModel model, boolean allowLogin, java.lang.String text) throws InoNetException, SrvErrorException
Allow and forbid for the guest logins.- Parameters:
srvCtx
- The context of the related innovator server.model
- model idallowLogin
- flag if login is allowedtext
- lock text- Throws:
InoNetException
SrvErrorException
-
modifyBranchProperties
public static void modifyBranchProperties(SrvContext srvCtx, ADModel adModel, java.lang.String name, java.lang.String note) throws InoNetException, SrvErrorException
Updates the properties of this branch.- Parameters:
srvCtx
- The context of the related innovator server.adModel
- modify the properties of the current branch of this modelname
- name of the versionnote
- updates description of this branch- Throws:
InoNetException
SrvErrorException
-
modifyVersionAlias
public static void modifyVersionAlias(SrvContext srvCtx, ADModel adModel, java.util.List<ARG_Alias> seqAlias) throws InoNetException, SrvErrorException
Replaces the model versions alias list.- Parameters:
srvCtx
- The context of the related innovator server.adModel
- modify the version aliases of this modelseqAlias
- list of aliases- Throws:
InoNetException
SrvErrorException
-
nameConstraintsUpdate
public static void nameConstraintsUpdate(SrvContext srvCtx, ADModel adModel, java.lang.String expressionForVersionName, java.lang.String expressionForBackupName) throws InoNetException, SrvErrorException
Updates the regular expressions constraining the name of a model version and a model backup.- Parameters:
srvCtx
- The context of the related innovator server.adModel
- update the name constraints of this modelexpressionForVersionName
- constraint for version namesexpressionForBackupName
- constraint for backup names- Throws:
InoNetException
SrvErrorException
-
reassignBranch
public static void reassignBranch(SrvContext srvCtx, ADModel adModel, java.lang.String parentBranchUUID) throws InoNetException, SrvErrorException
assigns this branch to a new parent branch.- Parameters:
srvCtx
- The context of the related innovator server.adModel
- reassign the current branch of this modelparentBranchUUID
- uuid of the new parrnet branch- Throws:
InoNetException
SrvErrorException
-
-