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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

oid_modify_attr() issue

pzorrilla
1-Newbie

oid_modify_attr() issue

<h3>I've been having some problems with the oid_modify_attr() acl command, I readed th acl reference and I was using the commando without any problem, however I suddenly note something strange; I saw that arbortext changes the attribute of my sections in my opened Document only when I modify the content of the section, more specifically when I remove the section, make some changes in its content and then I re-insert the modified section into my document again, only in those cases the editor makes the change of the seciton's attribute; I'm needing to change the attribute in other escenarios because I want to navigate through the sections of my docbooks and I would like to assign an attribute to every section which works as a flag to understand if my section was visited, modified or if the section is the last section where the user is situated at the time he decides to close the document maybe for restart the navigation later.


Again I appreciate your time and the information you kindly provide me.


Paulette

6 REPLIES 6

How are you getting/specifying the oid passed to oid_modify_attr()? Are you creating an array of section oids and looping over it using specific cell of the array or are you navigating to the oid and then using oid_caret()?

Steve,


the oids I get them using Java, what I do first is get the Document through the "Acl.getDOMDocument(String.valueOf(docID))" using the value corresponding to the DocID of my document, then I get the first child of the book as a Node and I start to navigate though its children nodes, while I'm navigating I try to find the section elements using theoid_find_children() acl command through a call from java using the line "Acl.func(oid_find_children(), oid_dad)", from that call I'll receive in java from acl an array of OIDs related with sections, I'll navigate through those OIDs and save those OIDs in a structure I created for later use, those OIDs are the which one I'm using to change the attribute of the sections.


In order to change the attributes, I will navigate in Java through my structure and once I found the desired section I'll call a function in my ACL script since Java passing the corresponding oid I saved before, to change the "revision" attribute of the desired section inside my document.


Does it help you this information to understand better how I'm getting the oids? 🙂


Again, thank you so much!



Paulette

Steve,


Thank you,


Hi Paulette—

I suspect that something is getting lost in all that back-and-forth between Java and ACL. The two systems can certainly interact with each other, but my experience is that things work more smoothly if you can keep the transfer points to a minimum. Going from Java to ACL to Java to ACL just provides more opportunities for type mismatches and other such issues that can make debugging tricky.

If you are not able to use the OIDs from your Java output on the command line, they might not be valid. You could try using something like

response(oid_valid(‘(101,1,34)’))

to verify that your OID e.g. ‘(101,1,34)’ actually exists. You could also pass it to goto_oid() to see whether the element it refers to is the one you think it should. Note that you should be passing it as a string (inside quotes) if you are copying and pasting the actual OID value.

Finally, you can check the value of $main::ERROR or $main::ERRORS after running your script to see if ACL is providing any messages about why it wasn’t able to do the oid_modify_attr() operation, for example if the OID is not valid or if the document is read-only.

--Clay

Oids can change, too. Depending on the actions you are taking, you may need
to be careful about when you get your oid relative to when you act on your
oid.

On Fri, Nov 21, 2014 at 11:14 AM, Clay Helberg <->
wrote:

> Hi Paulette--
>
>
>
> I suspect that something is getting lost in all that back-and-forth
> between Java and ACL. The two systems can certainly interact with each
> other, but my experience is that things work more smoothly if you can keep
> the transfer points to a minimum. Going from Java to ACL to Java to ACL
> just provides more opportunities for type mismatches and other such issues
> that can make debugging tricky.
>
>
>
> If you are not able to use the OIDs from your Java output on the command
> line, they might not be valid. You could try using something like
>
>
>
> response(oid_valid('(101,1,34)'))
>
>
>
> to verify that your OID e.g. '(101,1,34)' actually exists. You could also
> pass it to goto_oid() to see whether the element it refers to is the one
> you think it should. Note that you should be passing it as a string (inside
> quotes) if you are copying and pasting the actual OID value.
>
>
>
> Finally, you can check the value of $main::ERROR or $main::ERRORS after
> running your script to see if ACL is providing any messages about why it
> wasn't able to do the oid_modify_attr() operation, for example if the OID
> is not valid or if the document is read-only.
>
>
>
> --Clay
>
>
>
> *From:* Paulette Zorrilla [

Paul, Clay,


I'm making a kind of remap everytime I modify one section and I insert or remove any section inside the document, this way my tool will navigate through the document identifying the oids that change after the modification. Something that is causing me doubt is why if I try to change the attribute manually using the command line of the editor, the attribute can not be modified, I tested some other commands having the oid, for example oid_select() to test if the oid is valid and it refers to the section I want and those commands worked, I'm not sure if there's any restriction to modify attributes.


Again, thank you so much for your help.


Paulette :D.

Top Tags