<@doc hierarchy="GMLDOM" also="@Configurable, @Field, @RefInfoshape, @BOInfoshape"> The Infoshape is an element that contains a configurable collection of fields. This is an abstract class. (c) SAP AG 2003-2006. All rights reserved. /////////////////////////////////////////////////////////////////////// // CLASS HEADER Class Infoshape inherit Configuration; implement dev:IInfoshape; metadata title = '#TEXT[XTIT_INFOSHAPE]'; metadata descr = '#TEXT[XTOL_INFOSHAPE]'; metadata icon16 = '#URL[~res:skins.neutral.symbols.infoshape16.gif]'; /////////////////////////////////////////////////////////////////////// // PROPERTIES <@doc>The fields contained in this Infoshape. use @createField and @removeField to add or remove them. override strong property items = ^core.gml:Field[id]; /////////////////////////////////////////////////////////////////////// // ABSTRACT METHODS <@doc> Tests compatibility between two infoshapes. This method is overriden by derived classes. Another infoshape to be compared Returns ~true if infoshapes are compatible; otherwise, returns ~false abstract method isCompatible(other_infoshape); <@doc> Notify on changes that occurred in the infoshape the type of change of infoshape An object containing data related to the change in the infoshape ~changeData object contains members that represent the change in the infoshape. INFOSHAPE_CHANGE_NONE changeData is null. INFOSHAPE_CHANGE_FIELD_ADD, INFOSHAPE_CHANGE_FIELD_DELETE changeData contain these members Member | Type | Description fields | @Field![] | Array of added/deleted fields. Must contain at least one field. INFOSHAPE_CHANGE_FIELD_UPDATE changeData contain these members Member | Type | Description field | @Field! | Modified field evt | @GmlObject!onUpdateObject event | The event representing the field's modification. INFOSHAPE_CHANGE_BO_REPLACED changeData contain these members Member | Type | Description old_bo | id | bo id of the old @BOInfoshape! new_bo | id | bo id of the new @BOInfoshape! INFOSHAPE_CHANGE_REF_REPLACED changeData contain these members Member | Type | Description old_ref | id | id of the old @RefInfoshape! new_ref | id | id of the new @RefInfoshape! abstract method notifyOnChange(changeType, changeData); ///////////////////////////////////// // IINFOSHAPE METHODS - prototype implementation <@doc > Gets collection of the Fields that belong to this Infoshape. Collection of @gml:Field! elements. override method getFields(fieldSource) switch (fieldSource) { case #[DERIVED_FIELDS] : case #[BASE_FIELDS] : default: return this.getItems(); } end <@doc> Gets a Field in this Infoshape by its ID The id of the field to retrieve The retrieved @dev:IField! element method getFieldById(fieldId) var theFields = this.getFields(); for (var i in theFields) { if (theFields[i].getId() == fieldId) { return theFields[i]; } } return null; end /////////////////////////////////////////////////////////////////////// // METHODS override method onCreate() if (!this.name) this.name = this.Class.name + ' ' + this.id; this.supercall(); end <@doc>Wrapper method for creating fields in @gml:Infoshape. Use this method instead of @gml:TransObject!createElement The class name of the field object A collection of property values for initializing the new element the new field that was successfully created and inserted, or ~null method createField(field_class, values) return this.createElement(field_class, 'items', values); //already performs type check for ConfigurationItem end <@doc>Wrapper method for removing a field in @gml:Infoshape. Use this method instead of @gml:TransObject!removeElement The field child element to remove The Id of the field child element to remove Indicates whether the field child element was successfully removed method removeField(field) return this.removeElement(field, 'items'); end <@doc> Gets the infoshape's friendly name (alias) The infoshape's friendly name override method getAlias() return this.name; end <@doc> The infoshape's GML id override method getId() return this.id; end <@doc> Gets the infoshape's unique identifier. It should consist of letters, digits or '_', and not start with a digit. It is unique in the scope of all infoshapes and fields with the same parent infoshape The infoshape's unique identifier. override method getName() return this.name; end <@doc> Gets the infoshape's label, as retrieved from the backend The infoshape's label. override method getLabel() return ""; end <@doc> Gets the infoshape's description, as retrieved from the backend The infoshape's description. override method getDescription() return ""; end <@doc> Gets the infoshape's type The infoshape's type override method getType() return ""; end <@doc> Gets the string representation of the application-specific technical infoshape name The application-specific technical infoshape name override method getAppName() return ""; end <@doc> Gets the string representation of the application-specific technical infoshape type The application-specific technical infoshape type override method getAppType() return ""; end /////////////////////////////////////////////////////////////////////// // ENUMERATIONS <@enum name="INFOSHAPE_CHANGE"> An enumeration of the type of change in the infoshape The available field sources are listed below: Type | Description INFOSHAPE_CHANGE_NONE | No change INFOSHAPE_CHANGE_FIELD_ADD | Fields added to infoshape INFOSHAPE_CHANGE_FIELD_DELETE | Fields removed from infoshape INFOSHAPE_CHANGE_FIELD_UPDATE | Field updated in infoshape INFOSHAPE_CHANGE_BO_REPLACED | RefInfoshape now points to a new BO infoshape INFOSHAPE_CHANGE_REF_REPLACED | Configurable element has new RefInfoshape