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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Support with an ACL buffer

pzorrilla
1-Newbie

Support with an ACL buffer

Hello experts!!

I'm trying to create and use a buffer in order to save data that later
will be presented to the user in a textbox inside a customized window
which was created by me, however i don't know a lot about buffers, I
found the paste command but I understand is only to paste the content
from my buffer to the place where the cursor is inside my document. I
thought that a buffer would be a good idea since my content will be
generated dynamically in a Java class which acts as an analyzer and
using content extracted from Arbortext. So, I create the buffer in my
init script and then I insert the info in my buffer, but when I need the
buffer's content I don't know what to do? :'(

Please, I really appreciate your time and support, and also all the
information related with buffers that you can provide me, also if any of
you knows another way to manage my issue, I really appreciate your opinion.

Best Regards!
Paulette Zorrilla
5 REPLIES 5

Hi Paulette,
Not sure how the Java you're working with would/could access buffer (named
or default). Might need some ACL to intermediate. Not sure what your
ultimate goal is, not sure how Java might integrate with what I'm about to
share, again, might need some ACL to intermediate, but you could create one
or more tempfiles.

I stripped the following out of some of my code (and hid some
corporate-speak so there is a possibility I've introduced error) but it
should give you a strategy for creating, opening, displaying, and
destroying a temporary file. Whether it would work (or whether you'd ever
want to display it .... it sounds like not) for your purposes ... can't
say. Displaying help for the various commands would reveal variations you
might need that I don't use.

## building temp file

local fn=temp_name("myname");

local tempfile = open( fn, "w+" );

if(tempfile < 0)

{

response("Couldn't open file $tempfile for write");

return 0;

}

put($tempfile, $some_content);

put($tempfile, $more_content);

close($tempfile);

local mydoc = doc_open($fn)

local flags=1+8

local geom="500x500-10+10"

mywin = window_create( 'help', flags, mydoc, geom );

window_set(mywin, 'title', 'mytitle’);

current_window(mywin)

window_show(mywin,1);

window_raise(mywin)

window_destroy(mywin);



On Thu, Apr 4, 2013 at 1:42 PM, Paulette Zorrilla <
paulette.zorrilla@oracle.com> wrote:

> Hello experts!!
>
> I'm trying to create and use a buffer in order to save data that later
> will be presented to the user in a textbox inside a customized window
> which was created by me, however i don't know a lot about buffers, I
> found the paste command but I understand is only to paste the content
> from my buffer to the place where the cursor is inside my document. I
> thought that a buffer would be a good idea since my content will be
> generated dynamically in a Java class which acts as an analyzer and
> using content extracted from Arbortext. So, I create the buffer in my
> init script and then I insert the info in my buffer, but when I need the
> buffer's content I don't know what to do? :'(
>
> Please, I really appreciate your time and support, and also all the
> information related with buffers that you can provide me, also if any of
> you knows another way to manage my issue, I really appreciate your opinion.
>
> Best Regards!
> Paulette Zorrilla
>

Hi Paulette--

You can make this work via the Acl object, using that to call ACL functions for working with buffers. Start by looking at the buffer_clipboard_contents() function. However, buffers are a distinctly ACL-ish data type, so I'm not sure it really buys you anything to do this if you're primarily working in Java.

Since you are dynamically generating the content in Java, why not just use the AOM methods to populate your text box with the content? Assuming your Java-generated content is a Node or a DocumentFragment, you should be able to just insert it directly into your textbox node using Node.appendChild().

If you are trying to insert markup without interpreting the markup, you can use ARange.toMarkupString() to get the markup, and then append it as a text node to textbox.

Let me know if I've misunderstood your use case, or if it's not clear what I'm recommending.

--Clay

Clay Helberg
Senior Consultant

TerraXML
1380 Forest Park Circle, Suite 100
Lafayette, CO 80027

I liked the idea of a log file. I will explain you a little more about how I do connect Java and Arbortext, I have a Java class which acts as a text analyzer, then, inside of any methods I use sentences like this:Acl.func("walkThrough::setUserInfo", txt); in order to call an ACL function and execute something inside Arbortext using ACL commands with the information provided by Java.


I don't know if this small explanation gives you a better idea of what I'm trying to do. I will try to implement the idea you share with me, I really appreciate your help and the information you shared with me.


Best Regards.


Paulette Zorrilla

How do I create an ACL object? Sorry about this question, but I'm pretty new with some concepts related with ACL inside Java.


Thank you for your time and response.


Regards. Paulette Zorrilla

HI Paulette--



If you have already loaded the AOM library, make sure you import
com.arbortext.epic.*, and the Acl class should be available. It is
basically a container for static methods that lets you access ACL
functions and variable values. With that import, you should be able to
just use something like this:



Acl.func("mypkg::some_acl_function", param_value1, param_value2, ...);



For details, search the Arbortext Help Center for "acl interface" and
you should be able to find detailed information. There is Javadoc in
there for all the objects/interfaces in the AOM.



--Clay



Clay Helberg

Senior Consultant



TerraXML

1380 Forest Park Circle, Suite 100

Lafayette, CO 80027
Top Tags