Advanced Customization > Info*Engine User’s Guide > Task Webject Reference > Group Webjects > Extract-Group
  
Extract-Group
DESCRIPTION
Searches for one or more attribute names and values and puts them into a new group. This forms a type of subset of a group of attributes. For information on searching for a subset of objects (not attributes on objects), see Subset-Group.
When used in combination with the EXTRACT parameter, a specific set of attributes are extracted from the specified subset of elements. If the ELEMENT_OFFSET parameter is omitted, its value defaults to 0 (thus, the subset of elements returned begin with the first element of the input group). If the ELEMENT_COUNT parameter is omitted, its value defaults to the size of the input group (thus, the subset of elements returned include all elements of the input group, starting from the one specified by ELEMENT_OFFSET). If ELEMENT_OFFSET + ELEMENT_COUNT exceeds the number of elements in the input group, the output group contains fewer ELEMENT_COUNT elements (it contains as many elements as remain in the input group, beginning with ELEMENT_OFFSET). If the EXTRACT parameter is omitted, all attributes of each selected element are returned. At least one of the EXTRACT, ELEMENT_OFFSET, or ELEMENT_COUNT parameters must be specified. If all three are omitted, an exception is thrown.
SYNTAX
<ie:webject name="Extract-Group" type="GRP">
  <ie:param name="CLASS" data="class"/>
  <ie:param name="EXTRACT" data="attribute_name"/>
  <ie:param name="EXTRACT_MODE" data="[MATCH | NOMATCH]"/>
  <ie:param name="GROUP_IN" data="group_name"/>
  <ie:param name="GROUP_OUT" data="output_group"/>
<ie:param name="ELEMENT_COUNT" data="number of elements to extract" />
<ie:param name="ELEMENT_OFFSET" data="index of the starting element to extract" />
</ie:webject>
PARAMETERS
Required
Select
Optional
GROUP_IN
ELEMENT_COUNT
CLASS
GROUP_OUT
ELEMENT_OFFSET
EXTRACT_MODE
EXTRACT
CLASS
Specifies the type of the objects contained in the output group named by the GROUP_OUT parameter. For example if a webject specifies CLASS=MyClassName and GROUP_OUT=data_1, then the XML representation of the output group contains the following tags:
<MyClassName NAME="data_1" TYPE="Object" STATUS="0">
</MyClassName>
The default for this parameter is “Unknown-Class-Name.” This parameter is optional.
ELEMENT_COUNT
Allows the webject to return a subset of elements from the input group, thus allowing this webject to be used in simulating page-mode queries in cases where true page-mode is not supported by a back-end information system. This parameter specifies the number of elements to extract. The default value is the size of the input group.
ELEMENT_OFFSET
Allows the webject to return a subset of elements from the input group, thus allowing this webject to be used in simulating page-mode queries in cases where true page-mode is not supported by a back-end information system. This parameter specifies the index of the element at which to begin extraction. The default value is 0.
EXTRACT
Specifies the name of the attribute to be extracted. Multiple values can be specified for this parameter. This parameter is required.
EXTRACT_MODE
Specifies the extract mode. The value can be either MATCH or NOMATCH. When EXTRACT_MODE is MATCH, the specified attributes on the EXTRACT parameter are included in the output group. When EXTRACT_MODE is NOMATCH, all but the specified attributes on the EXTRACT parameter are included in the output group. This parameter is optional. If not specified, the default mode of MATCH is assumed.
GROUP_IN
Specifies the name of the input group. This parameter is required.
GROUP_OUT
Specifies the name of the extraction of attributes from the input group. This parameter is required.
EXAMPLE
The following example searches for the specified attribute names and values and puts them into a new group named “extractresults”:
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
                                               prefix="ie"%>

<!-- Extract attributes from a group. -->

<ie:task uri="com/company/CreateGroup.xml"/>

<ie:webject name="Extract-Group" type="GRP">
  <ie:param name="GROUP_IN" data="createdgroup"/>
  <ie:param name="EXTRACT" data="NAME"/>
  <ie:param name="EXTRACT" data="ADDRESS"/>
  <ie:param name="CLASS" data="resultGroup"/>
  <ie:param name="GROUP_OUT" data="extractresults"/>
</ie:webject>