<@doc alias="config" hierarchy="GMLDOM" also="@Configurable, @ConfigurationItem"> The Configuration is an element that contains a collection of @ConfigurationItem objects, and represents the external configuration of an element. Child Elements @gml:ConfigurationItem (c) SAP AG 2003-2006. All rights reserved. /////////////////////////////////////////////////////////////////////// // CLASS HEADER Class Configuration inherit Element; metadata title = '#TEXT[XTIT_CONFIGURATION]'; metadata descr = '#TEXT[XTOL_CONFIGURATION]'; metadata icon16 = '#URL[~res:skins.neutral.symbols.infoshape16.gif]'; /////////////////////////////////////////////////////////////////////// // PROPERTIES <@doc>The configuration items for this Configuration. use @createItem and @removeItem to add or remove items. strong property items = ^core.gml:ConfigurationItem[id]; /////////////////////////////////////////////////////////////////////// // METHODS <@doc> Gets collection of the ConfigurationItems which compose the Configuration object. The method returns a collection of the ConfigurationItem child elements. The requested @gml:ConfigurationItem collection method getItems() return this.items; end override method onCreate() if (!this.name) this.name = this.Class.name + ' ' + this.id; this.supercall(); end <@doc>Wrapper method for creating configuration items in @gml:Configuration. Use this method instead of @gml:TransObject!createElement The class name of the configuration item object A collection of property values for initializing the new element the new configuration item that was successfully created and inserted, or ~null method createItem(configItemClass, values) /* if (!values) values = {}; values.id = $ENV.model.newId(); var conf_item = $ENV.createObject(config_item_class, values); if (!conf_item) return null; if (!ISA(field, 'core.gml:ConfigurationItem')) { #DEVTIME[throw new Error(-1, "tried to create a configuration item with bad class type"); ] return null; } return (this.insertElement(conf_item, 'items') ? conf_item : null); */ return this.createElement(configItemClass, 'items', values); //already performs type check for ConfigurationItem end <@doc>Wrapper method for inserting configuration items in @gml:Configuration. Use this method instead of @gml:TransObject!createElement The configuration item child element to insert method insertItem(item) return this.insertElement(item, 'items'); end <@doc>Wrapper method for removing a configuration item in @gml:Configuration. Use this method instead of @gml:TransObject!removeElement The configuration item child element to remove The Id of the configuration item child element to remove Indicates whether the configuration item child element was successfully removed method removeItem(cfg_item) return this.removeElement(cfg_item, 'items'); end