cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Need ACL help

ptc-953926
1-Visitor

Need ACL help

Adepters:

We use XIncludes extensively. Normally, even if you have write access to an XIncluded object, you can't make changes until you lock the entity. That happens automatically if you click inside the object. However, we have a couple of macros that we use to globally find and then replace a certain attribute (which get invoked by function keys):

<macro name="findChangeStatus">
<desc>Finds next changeStatus attribute</desc>
<script type="application/x-acl"></script>
</macro>
<macro name="deleteChangeStatus">
<desc>Finds next changeStatus attribute and deletes</desc>
<script type="application/x-acl"> oid_delete_attr(oid_current_tag(), "changeStatus");]]></script>
</macro>

Unfortunately, these don't cause the entity to be locked, so the deleteChangeStatus doesn't work. I found an ACL function, "oid_entity_lock", which would seem to be what I need. But, not being an accomplished ACL programmer, I can't figure out how to incorporate that into my "deleteChangeStatus" macro.

Can anyone help?

Dave Hintz
Siemens
3 REPLIES 3

I don't play with macros or entities, but I would try modifying the second
macro to be:

<macro name="deleteChangeStatus">
<desc>Finds next changeStatus attribute and deletes</desc>
<script type="application/x-acl"> #ModifyAttributes;
oid_entity_lock(oid_current_tag());
oid_delete_attr(oid_current_tag(), "changeStatus");
]]>
</script>
</macro>

The desc should probably be updated to:
Locks entity and deletes changeStatus attribute.

If oid_current_tag() returns a non-entity oid then oid_entity_lock() will
fail ... how gracefully, I don't know, but from reading the help on it,
there's hope it won't throw a user-distracting error.


I had actually tried that, but apparently had something wrong with the syntax. Your example worked perfectly!

Thanks!
Dave

super! glad to help.

Announcements

Top Tags