Skip to main content
1-Visitor
August 1, 2014
Question

checking preferences via ACL

  • August 1, 2014
  • 18 replies
  • 3343 views

How would one checkthe value of apreference setting with ACL? I assume there is some kind of prefix required.
For example, I want to know whether peservices is on or off and


message peservices


doesn't work.

    18 replies

    1-Visitor
    August 1, 2014
    Hare you tried:
    response(preference('peservices'))
    1-Visitor
    August 1, 2014
    I use:
    response(option('peservices'))

    Or I will do something like:
    chgtrk = option('changetracking')
    set changetracking = off
    Do my wonderful, magical, and sometimes tricky stuff here.
    set changetracking =$chgtr

    Help says not all set options are preferences, preference() will return no
    value for one that is not. fwiw.



    On Fri, Aug 1, 2014 at 10:06 AM, Leoboldt, Thomas <-<br/>> wrote:

    > Hare you tried:
    >
    > response(preference('peservices'))
    >
    >
    >
    > *From:* Caroline Leccese [
    18-Opal
    August 1, 2014
    Forwarding my response to the list, got bit by the reply address thing...
    cleccese1-VisitorAuthor
    1-Visitor
    August 1, 2014

    Thanks, guys. Just what I wanted.

    cleccese1-VisitorAuthor
    1-Visitor
    August 4, 2014

    I have the following in my custom/init folder: (5.4)


    response(option('peservices'))
    if ( option('peservices') == "off" ) {
    set peservices=on
    }
    response(option('peservices'))
    set peserverurl=http://.../e3/servlet/e3


    Regardless of whether peservices is on or off, I get first response "off" and second "on". However, if I manually turn off peservices via either the command line or the preferences dialog, peservices is still off when I restart AE, even though I get the second "on" message. The url is always correct (I have a similar file in the custom/init folder for 6.0)


    If I source the acl file from the command line, it works as expected. I assume because all the PE stuff is already loaded. It didn't fire when placed in theeditinit folder or the doctype folder.


    Does anyone know if I can turn on peservices automatically at startup?

    1-Visitor
    August 4, 2014
    I do not know of a way to force peservices = on "at startup." We set
    peservices = on "at startup" using an ACL in ../init (although we don't
    even bother to test its state, we just set peservices = on).

    Is there a reason you need it on earlier than that?

    I work around some startup timing menu issues by the APTRC (user startup
    file environment variable) in the batch file we use to start Editor. Maybe
    this would be useful with your need, if there is one, to establish
    peservices = on earlier in the process.



    On Mon, Aug 4, 2014 at 10:06 AM, Caroline Leccese <-<br/>> wrote:

    > I have the following in my custom/init folder: (5.4)
    >
    > response(option('peservices'))
    > if ( option('peservices') == "off" ) {
    > set peservices=on
    > }
    > response(option('peservices'))
    > set peserverurl=
    > and second "on". However, if I manually turn off peservices via either the
    > command line or the preferences dialog, peservices is still off when I
    > restart AE, even though I get the second "on" message. The url is always
    > correct (I have a similar file in the custom/init folder for 6.0)
    >
    > If I source the acl file from the command line, it works as expected. I
    > assume because all the PE stuff is already loaded. It didn't fire when
    > placed in the editinit folder or the doctype folder.
    >
    > Does anyone know if I can turn on peservices automatically at startup?
    >
    cleccese1-VisitorAuthor
    1-Visitor
    August 4, 2014

    Hi Paul,


    No, it doesn't matter when peservices is turned on, as long as it's on when AE is finished loading. My problem is if someone turns it off manually and forgets to turn it back on, the script in the init folder doesn't turn it back on when AE restarts.


    If you have the time, could you turn off peservices and restart AE to see if your script turns it back on? I would be grateful.

    1-Visitor
    August 4, 2014
    Ah, that. Overriding the user preferences file (arbortext.wcf in 6.0).
    Yeah, this makes it trickier.

    You're right. Called from ../init, set peservices=on will not override the
    peservices setting saved in arbortext.wcf when a user changes peservices it
    through the Preferences interface.

    I tested setting it from a user start up file (specified by the APTRC
    environment variable). That will work. It appears to add a little time to
    Editor opening but I haven't tested enough (by including other users) to be
    sure it's not just something with my machine today.

    I found an old note in the adepters archives that suggests calling it from
    instance.acl might work ... that the processing order of startup files puts
    that later than .wcf processing. I didn't test this. Diving into the
    documentation about startup files, order, etc. might suggest other ways to
    handle it at startup.

    You might also consider providing users a way to set peservices off for a
    session so "peservices=off" doesn't get ever get written to the wcf. And/or
    a way for users to turn it on that would overwrite the setting in the wcf
    so it would be available going forward. Menu items? Hide it in existing
    code say for Editor Close so it is always saved as ON at the end of a
    session.




    On Mon, Aug 4, 2014 at 11:45 AM, Caroline Leccese <-<br/>> wrote:

    > Hi Paul,
    >
    > No, it doesn't matter when peservices is turned on, as long as it's on
    > when AE is finished loading. My problem is if someone turns it off manually
    > and forgets to turn it back on, the script in the init folder doesn't turn
    > it back on when AE restarts.
    >
    > If you have the time, could you turn off peservices and restart AE to see
    > if your script turns it back on? I would be grateful.
    >
    1-Visitor
    August 4, 2014
    I got bit by that 'reply' issue with this message. It only went to clay, so
    here is a response (sic) that is a bit dated right now.

    Lynn


    cleccese1-VisitorAuthor
    1-Visitor
    August 5, 2014

    Thanks, Paul and Lynn!


    Instance.acl seems to work, when put in the doctype folder.