ziulmem1 Absent Member.
Absent Member.
283 views

Change current modify Operation to an add Operation


Hi,
who can i change the current modify Operation to an add Operation. (
e.g. in the Command Transform )
Do i need a stylesheet, or create a policy-Rule?

Thanks

Michael


--
ziulmem1
------------------------------------------------------------------------
ziulmem1's Profile: http://forums.novell.com/member.php?userid=58909
View this thread: http://forums.novell.com/showthread.php?t=450627

Labels (1)
0 Likes
5 Replies
Knowledge Partner
Knowledge Partner

Re: Change current modify Operation to an add Operation

On 1/12/2012 10:06 AM, ziulmem1 wrote:
>
> Hi,
> who can i change the current modify Operation to an add Operation. (
> e.g. in the Command Transform )
> Do i need a stylesheet, or create a policy-Rule?


Both ways. I prefer policy, since I like it policy.

I would add destination object Action.

Then for each op-attr in the modify doc, add destination attr to that
object.

Three tokens?

Four! Veto the modify or strip by XPATH the modify as you feel like.


0 Likes
Knowledge Partner
Knowledge Partner

Re: Change current modify Operation to an add Operation

On Thu, 12 Jan 2012 15:06:02 +0000, ziulmem1 wrote:

> who can i change the current modify Operation to an add Operation. (
> e.g. in the Command Transform )


I don't see why you'd want to do this. If the engine gets a <modify> on
an object that is not already associated, it will be converted to an
<add> for you. By the time you get as far as the Command Transform, if
you still have a <modify>, then the engine is pretty sure that it knows
what object to process, and what to do. So while it's possible to do,
converting the operation to an <add> at this point doesn't make sense.

Can you elaborate on what you're trying to do, and why?


--
--------------------------------------------------------------------------
David Gersic dgersic_@_niu.edu
Knowledge Partner http://forums.novell.com

Please post questions in the forums. No support provided via email.

0 Likes
ziulmem1 Absent Member.
Absent Member.

Re: Change current modify Operation to an add Operation


Hi, thanks for your answer.

@geoffc
how can i do that, have you a example?
#################
I would add destination object Action.

Then for each op-attr in the modify doc, add destination attr to that
object.
#################


I have a Stylesheet, that formats the xml-output, and this is created
for add-events.
I dont want to create the same for the modify-events, because of
changes, i will not do it on nearly same code.

Thanks
Michael


--
ziulmem1
------------------------------------------------------------------------
ziulmem1's Profile: http://forums.novell.com/member.php?userid=58909
View this thread: http://forums.novell.com/showthread.php?t=450627

0 Likes
Knowledge Partner
Knowledge Partner

Re: Change current modify Operation to an add Operation

On 1/16/2012 10:16 AM, ziulmem1 wrote:
>
> Hi, thanks for your answer.
>
> @geoffc
> how can i do that, have you a example?
> #################
> I would add destination object Action.
>
> Then for each op-attr in the modify doc, add destination attr to that
> object.
> #################
>
>
> I have a Stylesheet, that formats the xml-output, and this is created
> for add-events.
> I dont want to create the same for the modify-events, because of
> changes, i will not do it on nearly same code.


This assumes single valued attributes being sent. Slightly different to
support Multi valued, but this is a quick example. (Under 2 minutes to
write). This will ignore Remove-values, since they make no sense in a
<add> event, right? If the object does not exist, how do you remove a
value from it? If it does exist, you have a fatal flaw as this add will
then fail.



<rule>
<description>Sample Rule</description>
<conditions>
<and/>
</conditions>
<actions>
<do-set-local-variable name="DEST-DN" scope="policy">
<arg-string>
<token-text xml:space="preserve">Figure out what the Dest-DN needs
to be. Maybe Resolve the current association to a DN? I do not know
whatyour data looks like.</token-text>
</arg-string>
</do-set-local-variable>
<do-add-dest-object class-name="User" when="after">
<arg-dn>
<token-local-variable name="DEST-DN"/>
</arg-dn>
</do-add-dest-object>
<do-for-each>
<arg-node-set>
<token-xpath expression="modify-attr"/>
</arg-node-set>
<arg-actions>
<do-add-dest-attr-value class-name="User" name="$CURR-ATTR$"
when="after">
<arg-dn>
<token-local-variable name="DEST-DN"/>
</arg-dn>
<arg-value type="string">
<token-xpath expression="$current-node/add-value/value"/>
</arg-value>
</do-add-dest-attr-value>
<do-set-local-variable name="CURR-ATTR" scope="policy">
<arg-string>
<token-xpath expression="$current-node/@attr-name"/>
</arg-string>
</do-set-local-variable>
</arg-actions>
</do-for-each>
</actions>
</rule>

0 Likes
Knowledge Partner
Knowledge Partner

Re: Change current modify Operation to an add Operation

On Mon, 16 Jan 2012 15:16:02 +0000, ziulmem1 wrote:

> I have a Stylesheet, that formats the xml-output, and this is created
> for add-events.


Formats it how? To what purpose?


--
--------------------------------------------------------------------------
David Gersic dgersic_@_niu.edu
Knowledge Partner http://forums.novell.com

Please post questions in the forums. No support provided via email.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.