Advanced Customization > Windchill Adapter > Windchill Adapter Webject Library > Action Webjects > Add-ContentItems
  
Add-ContentItems
The Add-ContentItems webject adds content to Windchill objects implementing wt.content.ContentHolder (also known as “content holders”). For example, this webject adds content to objects that have the wt.doc.WTDocument type or the wt.part.WTPart type.
Depending on the parameters you use, the webject can be used in three separate scenarios:
Add content directly from the Info*Engine BLOB stream to the content holder (OBJECT_REF or TYPE and WHERE).
Stage content from the Info*Engine BLOB stream to a staging location to be added later (STAGING_AREA).
Add content to a content holder from previously staged data (STAGING_AREA and STAGED_FILE_ID and OBJECT_REF; or TYPE and WHERE).
An exception is issued if you select multiple objects (using the OBJECT_REF or TYPE and WHERE parameters).
For additional information about using the BLOB_COUNT parameter in adapter webjects, see Uploading and Downloading BLOBs.
Syntax
<ie:webject name="Add-ContentItems" type="ACT">
  <ie:param name="ACCEPT_LANGUAGE"
            data="$(@SERVER[]accept_language[])"/>
  <ie:param name="ATTRIBUTE" data="attribute"/>
  <ie:param name="AUTHORIZATION"
            data="$(@SERVER[]authorization[0])"/>
  <ie:param name="CONNECTION_ATTEMPTS" data="attempts"/>
  <ie:param name="CONNECTION_ATTEMPT_INTERVAL" data="interval"/>
  <ie:param name="CONTAINER_REF" data="[ufid | MEMBERSHIP]"/>
  <ie:param name="DBUSER" data="username"/>
  <ie:param name="DESCRIPTION" data="description" />
  <ie:param name="DESCRIPTOR" data="attribute_name"/>
  <ie:param name="FORMAT" data="[TRUE | FALSE]"/>
  <ie:param name="GROUP_FILTER" data="group_name"/>
  <ie:param name="GROUP_OUT" data="group_out"/>
  <ie:param name="INSTANCE" data="appl_name"/>
  <ie:param name="NEXT_OP" data="operation_name"/>
  <ie:param name="OBJECT_REF" data="ufid"/>
  <ie:param name="PASSWD" data="password"/>
  <ie:param name="PRIMARY" data="[TRUE | FALSE]"/>
  <ie:param name="REFERENCE_DELIMITER" data="^" />
  <ie:param name="REFERENCE_EXCEPTIONS" data="[TRUE | FALSE]"/>
  <ie:param name="REFERENCE_OUTPUT_DELIMITER" data="^" />
  <ie:param name="ROLE" data="PRIMARY" />
  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>
  <ie:param name="STAGED_FILE_ID" data="file_id"/>
  <ie:param name="STAGING_AREA" data="pathname"/>
  <ie:param name="TYPE" data="type_name"/>
  <ie:param name="UNFORMATED" data="dataType"/>
  <ie:param name="UPLOADED_FROM_PATH" data="uploaded_from_path" />
  <ie:param name="URL" data="url"/>
  <ie:param name="USE_CONTENT_CACHE" data="[TRUE | FALSE]"/>
  <ie:param name="WHERE" data="where_clause"/>
  <ie:param name="WHERE_CASE_SENSITIVITY" data="[TRUE | FALSE]"/>
</ie:webject>
Required
Required
Interdependent
Optional
INSTANCE
AUTHORIZATION
ACCEPT_LANGUAGE
CONTAINER_REF
ATTRIBUTE
DBUSER
CONNECTION_ATTEMPTS
DESCRIPTOR
CONNECTION_ATTEMPT_INTERVAL
GROUP_FILTER
DESCRIPTION
INCLUDE_ARGS
FORMAT
INCLUDE_CONSTRAINTS
GROUP_OUT
INCLUDE_DESCRIPTORS
REFERENCE_DELIMITER
NEXT_OP
REFERENCE_OUTPUT_DELIMITER
OBJECT_REF
ROLE
PASSWD
SESSION_ID
PRIMARY
UNFORMATTED
REFERENCE_EXCEPTIONS
USE_CONTENT_CACHE
STAGED_FILE_ID
STAGING_AREA
TYPE
UPLOADED_FROM_PATH
URL
WHERE
WHERE_CASE_SENSITIVITY
* 
If a parameter is listed in the table but is not defined below, then it has a common parameter definition. For descriptions of those parameters, see the section Common Webject Parameters in Adapter Webjects Overview.
CONTAINER_REF
A Windchill context to apply the webject against. This parameter accepts the following types of input:
The UFID of a Windchill context. Multiple UFIDs can be specified for this parameter.
MEMBERSHIP—The query finds only those contexts of which the user is a member.
When this parameter is specified, the scope of queries executed against the TYPE and WHERE parameters are restricted to the associated context.
DESCRIPTION
Specifies the description of a corresponding content item. Each instance of the DESCRIPTION parameter corresponds to a content item and specifies the description of that content item.
If no DESCRIPTION parameters are specified, then the description of the content items defaults to an empty string. Similarly, if there are fewer DESCRIPTION parameters than content items, empty strings are implicitly added to the list of DESCRIPTION parameters. This parameter is optional.
GROUP_OUT
The name of the output group containing the results.
When the webject is used to stage content items to the server file system (for example, when STAGING_AREA is specified and neither OBJECT_REF nor WHERE are specified), then output group contains the identifiers of the staged content items.
If this parameter is omitted, then the name of the output group is constructed by appending the string “-Output” to the webject name. This parameter is optional.
OBJECT_REF
The Unique Federation Identifier (UFID) of a Windchill object. This is the content holder to which you are adding content. You must specify a single value for this parameter, otherwise an exception is issued. This parameter is mutually exclusive with TYPE and WHERE. For more information, see Specifying the TYPE and WHERE Parameters.
PRIMARY
This parameter has been replaced by the ROLE parameter. If the ROLE parameter is specified, then this parameter is ignored.
This parameter remains for backward compatibility. If this parameter is used to designate the content role, a value of TRUE specifies that the first content item is designated as primary content. FALSE indicates that the first content item is designated as secondary content. If there are multiple content items, other content items are designated as secondary content regardless. The default is FALSE.
ROLE
Specifies the category of a corresponding content item. Each instance of the ROLE parameter corresponds to a content item and specifies the category that differentiates contents within a single content holder.
A list of available categories is defined in the Windchill resource bundle wt.content.ContentRoleTypeRB.rbInfo.
If no ROLE parameters are specified, then category defaults to SECONDARY. Similarly, if there are fewer ROLE parameters than content items, SECONDARY is implicitly added to the list of ROLE parameters. This parameter is optional.
STAGED_FILE_ID
The identifier of a previously staged content item. Multiple values can be specified for this parameter to identify more than one previously staged content item. When this parameter is specified, the STAGING_AREA parameter must also be specified. These parameters combine to identify a previously staged content item that is transferred into the database.
STAGING_AREA
Specifies a relative path for an existing file directory located on a server. You can use this parameter in two ways:
Temporarily stage content items.
If you do not specify TYPE and WHERE, you can use STAGING_AREA to identify a directory outside the Windchill database in which to upload content items. This allows you to temporarily stage large content items to a server file system before committing them to Windchill. In this case, the webject returns an output group containing elements that provide identifiers for the staged content items.
Each element includes a source attribute specifying the name of the source file, and a staged_file_id attribute providing an identifier for the staged content item. You can later use this identifier in the STAGED_FILE_ID parameter to select staged items to transfer into the database.
Transfer a previously staged content item.
If you specify TYPE or WHERE, you can use STAGING_AREA alongside the STAGED_FILE_ID parameter to identify and transfer a previously staged content item. In this case, the webject transfers the content items into the database and associates them with the content holder object identified by TYPE and WHERE (or, alternatively, the OBJECT_REF parameter). When all of the specified staged content items have been transferred successfully, they are deleted from the staging area.
The STAGING_AREA parameter is enabled only when an administrator has defined the wt.adapter.stagingAreaRoot property, which identifies the root file directory path of the staging area. The value specified for the STAGING_AREA parameter is appended to this property to create an absolute file path to the directory in which staged content items are stored. The wt.adapter.stagingAreaRoot property can be set in the wt.properties file
The absolute path for the staged files is:
stagingAreaRoot/STAGING_AREA/username
stagingAreaRoot is the value defined for the wt.adapter.stagingAreaRoot property.
STAGING_AREA is the value specified for this parameter.
username is the user name of the current user.
If the current user has one or more alternate user names, you cannot predict or control which alternate name is used to build the staging area directory path.
TYPE
The object type name. If WHERE is specified, TYPE must also be specified. For more information, see Specifying the TYPE and WHERE Parameters.
UPLOADED_FROM_PATH
The path from which a corresponding content item is uploaded. Each instance of the UPLOADED_FROM_PATH parameter corresponds to a content item and specifies where the content item is uploaded. This parameter is not applicable to URL content items.
If no UPLOADED_FROM_PATH parameters are specified or there are fewer UPLOADED_FROM_PATH parameters than content items, then the path of the content items defaults to null or the absolute file system path of the staging area directory. This parameter is optional.
URL
A URL to be added as a content item. For a URL to be specified, either OBJECT_REF or TYPE and WHERE must also specified.
USE_CONTENT_CACHE
Specifies whether the upload service content cache is used. If the parameter is set to TRUE, then the content cache is used.
Using the content cache causes the upload service to open HTTP connections to upload the content to the cache vault, which can cause a performance slowdown when uploading multiple items at once. The default for this parameter is FALSE. This parameter is optional.
WHERE
A query expression that selects the content holder where the new content is added. This parameter is used mutually exclusive with OBJECT_REF. If WHERE is specified, then TYPE must also be specified. For more information, see Specifying the TYPE and WHERE Parameters.