ConfSchema
public class ConfStructure extends ConfObjectBase
ConfStructure
instance separately,
and set it as objects' property value like this (its not right, don't use it):
ConfStructure ownerId = new ConfStructure(metadata, CfgStructureType.CFGID);
ownerId.setPropertyValue("type", 7);
ownerId.setPropertyValue("DBID", 1);
folder.setPropertyValue("ownerID", ownerId);
It may work in some cases, but it can fail in scenarios like XML serialization.CfgOwnerID
. It may be created with:
ConfStructure ownerId = new ConfStructure((CfgDescriptionStructure) metadata.getCfgClass("CfgOwnerID"));
...
Recommended way for child structure creation is to use special helper method
getOrCreatePropertyValue()
, which takes actual metadata description
and creates proper structure if it has not been created already:
ConfStructure ownerId = (ConfStructure) folder.getOrCreatePropertyValue("ownerID");
ownerId.setPropertyValue("type", 7);
ownerId.setPropertyValue("DBID", 1);
This method works for child structure or structure collection properties also. For example,
adding of members to access group may look like:
ConfStructureCollection members = (ConfStructureCollection) accGroup.getOrCreatePropertyValue("memberIDs");
ConfStructure id = members.createStructure();
id.setPropertyValue("type", CfgObjectType.CFGPerson.ordinal());
id.setPropertyValue("DBID", person1.getObjectDbid());
members.add(id);
id = members.createStructure();
id.setPropertyValue("type", CfgObjectType.CFGPerson.ordinal());
id.setPropertyValue("DBID", person2.getObjectDbid());
members.add(id);
Note*: Structure collections does not control uniqueness of child elements.
So, in mentioned sample it is supposed that the persons are not present in the members list already.Constructor | Description |
---|---|
ConfStructure(CfgDescriptionStructure metadata) |
Creates and initializes configuration structure data container by structure class description.
|
ConfStructure(CfgMetadata metadata,
CfgStructureType structType) |
Creates and initializes configuration structure data container by structure structure type.
|
Modifier and Type | Method | Description |
---|---|---|
CfgDescriptionStructure |
getClassInfo() |
Returns reference to the structure class MetaData description.
|
checkTypeCompatibility, clone, createChildElement, equals, getAttributeInfo, getOrCreatePropertyValue, getPropertyInfo, getPropertyValue, getPropertyValue, hashCode, setPropertyValue, setPropertyValue, toString, toString, toStringContentHelper, toStringHelper
public ConfStructure(CfgDescriptionStructure metadata)
metadata
- structure class MetaData description.ConfObjectAttributeException
- if given MetaData is null or there is some problem
with its usage here.public ConfStructure(CfgMetadata metadata, CfgStructureType structType)
metadata
- structure class MetaData description.structType
- type of configuration structurejava.lang.NullPointerException
- if given MetaData is null.ConfObjectAttributeException
- if given MetaData does not contain description
for given structure type or there is some problem with its usage here.public CfgDescriptionStructure getClassInfo()
getClassInfo
in class ConfObjectBase
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.