Update-Objects
Description
Updates the attributes of an object in a directory.
Syntax
<ie:webject name="Update-Objects" type="ACT">
<ie:param name="CONNECTION_ATTEMPT_INTERVAL" data="interval"/>
<ie:param name="CONNECTION_ATTEMPTS" data="attempts"/>
<ie:param name="DBUSER" data="dbuser_name"/>
<ie:param name="FIELD" data="attribute_name=value"/>
<ie:param name="GROUP_OUT" data="group_name"/>
<ie:param name="INSTANCE" data="instance_name"/>
<ie:param name="MODIFICATION" data="[ADD | REPLACE | DELETE]"/>
<ie:param name="OBJECT" data="context_name"/>
<ie:param name="PASSWD" data="dbpassword"/>
</ie:webject>
Parameters
Required
Optional
FIELD
CONNECTION_ATTEMPTS
INSTANCE
CONNECTION_ATTEMPT_INTERVAL
MODIFICATION
DBUSER
OBJECT
GROUP_OUT
PASSWD
CONNECTION_ATTEMPTS
Defines the maximum number of times to attempt establishing a connection to an adapter before returning an error. The default value is 1. This parameter is optional.
If multiple INSTANCE parameter values are specified, the value of CONNECTION_ATTEMPTS defines the maximum number of times to iterate through the list of adapter instances.
CONNECTION_ATTEMPT_INTERVAL
Defines the amount of time, in seconds, to delay between connection attempts. The default value is 60 seconds. This parameter is optional.
If multiple INSTANCE parameter values are specified, the value of CONNECTION_ATTEMPT_INTERVAL defines the number of seconds to wait between the attempts to iterate through the entire list of adapter instances.
DBUSER
Specifies the name to use when logging in to the data repository. If this parameter is specified in this webject, the webject value takes precedence over any value specified in the credentials mapping settings or in the adapter LDAP entry. If this parameter is not specified here, it must be specified in the credentials mapping settings or in the adapter LDAP entry. For more information about credentials mapping, see the section Credentials Mapping.
FIELD
Specifies the attributes and associated values to set for the target object. The values of this parameter are case-sensitive.
This parameter is used in conjunction with the MODIFICATION parameter to define updated attributes. Depending on how MODIFICATION is specified, this parameter is specified using one of the following formats:
If the MODIFICATION parameter is specified as ADD or REPLACE, then this parameter is specified in the following format:
attname=value
where attname is the attribute name and value is the name of the attribute value.
If the MODIFICATION parameter is specified as DELETE, and this parameter is specified in the above format, then the attribute value specified here is deleted from the attribute.
If the value of the MODIFICATION parameter is set to DELETE, then this parameter is specified in the following format:
attname
where attname is the attribute name, then the entire attribute is deleted.
This parameter is required.
GROUP_OUT
Specifies the name of the object-set returned by the update action. This parameter is optional.
INSTANCE
Specifies the name of the adapter that executes the webject. Adapter names are defined when the adapter is configured for use in your Info*Engine environment. This parameter is required.
To connect to other adapters if a specific adapter is not available, this parameter can be multi-valued. Info*Engine attempts to connect to the adapters in the order given. If the first adapter specified in not available, the next adapter listed is tried, and so on, until a connection is made. If a connection cannot be established with any listed adapter, an error is returned.
In conjunction with this parameter, you can include two other parameters, CONNECTION_ATTEMPTS and CONNECTION_ATTEMPT_INTERVAL.
MODIFICATION
Specifies the update action to take against the attributes and attribute values specified in the FIELD parameter. Valid values are ADD, REPLACE, and DELETE:
ADD appends the attribute values specified in the FIELD parameter, creating an attribute if necessary.
REPLACE substitutes the attribute values specified in the FIELD parameter for the existing attribute values, creating an attribute if necessary.
DELETE removes the attribute values specified in the FIELD parameter from an entry. Because attributes can have multiple values, either the entire attribute or one value can be deleted. If only the attribute is specified in the FIELD parameter, then the entire attribute is removed.
This is a required parameter.
OBJECT
Specifies the context name of the entry. One object may be specified. If more than one is specified, the first will be used and the remainder ignored. This is an optional parameter.
PASSWD
Specifies the password to use when logging in to the data repository. If this parameter is specified in this webject, the webject value takes precedence over any value specified in the credentials mapping settings or in the adapter LDAP entry. If this parameter is not specified here, it must be specified in the credentials mapping settings or in the adapter LDAP entry. For more information about credentials mapping, see the section Credentials Mapping.
Examples
The Update-Object webject shown in this example instructs Info*Engine to connect to the appropriate adapter instance. Once connected to the system, the attribute "location" is changed to "Pontiac" on the specified object.
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
prefix="ie"%>
<ie:webject name="Update-Objects" type="ACT">
<ie:param name="INSTANCE" data="jndiAdapter"/>
<ie:param name="OBJECT"
data="uid=pperson,ou=People,o=organization.com"/>
<ie:param name="MODIFICATION" data="REPLACE"/>
<ie:param name="FIELD" data="location=Pontiac"/>
<ie:param name="GROUP_OUT" data="update"/>
</ie:webject>
Example of an Update through Addition
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
prefix="ie"%>
<ie:webject name="Update-Objects" type="ACT">
<ie:param name="INSTANCE" data="jndiAdapter"/>
<ie:param name="OBJECT"
data="cn=Wes,ou=Sales,ou=dtr,o=aux,c=US"/>
<ie:param name="MODIFICATION" data="add"/>
<ie:param name="FIELD" data="sn=Shiminator"/>
<ie:param name="FIELD" data="sn=Shimano"/>
<ie:param name="FIELD" data="mail=junk"/>
<ie:param name="GROUP_OUT" data="leaf_data"/>/
</ie:webject>
Example of an Update Through Replacement
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
prefix="ie"%>
<ie:webject name="Update-Objects" type="ACT">
<ie:param name="INSTANCE" data="jndiAdapter"/>
<ie:param name="OBJECT"
data="cn=Wes,ou=Sales,ou=dtr,o=aux,c=US"/>
<ie:param name="MODIFICATION" data="replace"/>
<ie:param name="FIELD" data="sn=Shimrep1st"/>
<ie:param name="FIELD" data="sn=Shimrep2nd"/>
<ie:param name="GROUP_OUT" data="leaf_data"/>
</ie:webject>
Example of an Update Through Deletion
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
prefix="ie"%>
<ie:webject name="Update-Objects" type="ACT">
<ie:param name="INSTANCE" data="jndiAdapter"/>
<ie:param name="OBJECT"
data="cn=Wes,ou=Sales,ou=dtr,o=aux,c=US"/>
<ie:param name="MODIFICATION" data="delete"/>
<ie:param name="FIELD" data="sn=Shiminator"/>
<ie:param name="FIELD" data="sn=Shimano"/>
<ie:param name="FIELD" data="mail=junk"/>
<ie:param name="GROUP_OUT" data="leaf_data"/>
</ie:webject>
도움이 되셨나요?