Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
How to control specific attributes from user view/edit?
Tom_Fontanella_(genzymeuser1_-_(deleted))
Hello All,Does anyone know what the best method for dynamically controlling whether specific category attributes are displayed to the user for editing (based on some custom OScript logic) would be?Would prefer to stay in OScript instead of modifying HTML pages but am open to either route.Thank you,Eliot Gorman
Find more posts tagged with
Comments
Claudia_Meyer
Message from chris meyer via eLinkHi Eliot,I worked on this exact problem a few months ago and tackled it by building a callback mechanism into a few of the main functions that handle category & attribute requests. These are rather high-level and only effect the web interface. This means that a user could by-pass any of the read-only changes by issuing a request-handler of the right form or by using LAPI.There are a few requests that you need to be aware of. Livelink uses a different request when a) adding a category at create time of a Livelink object, b) editing attribute values from the Function -> Info -> Categories, and c) editing the attribute values of a versioned object from the Function -> Info > Cateories function. These are handled respectively by EditAttrValuesEdit, AttrValuesEdit, and VersionAttrValuesEdit, which all found within the WebAttribute ospace. In each case a response assoc is returned that contains the category definition and attribute values. It was here that I built the callback system, which I used in my module to change the read-only behaviour of a select group of attributes. The code that changes the read-only state within these response assocs is roughly as follows...---8<--- Assoc AttrDefinitions = response.data.AttrDefinition List AttrDefs for AttrDefs in Assoc.Keys( AttrDefinitions ) if ( AttrDefs[1] == IndexCat ) for child in AttrDefinitions.(AttrDefs).Children if ( inclusive ) if ( child.ID in attrs ) child.ReadOnly = TRUE end else // exlusive list if !(child.ID in attrs) child.ReadOnly = TRUE end end end end end---8<---That should give you an idea for an approach. There might still be a better way. chriseLink Discussion: Development Discussion wrote:>How to control specific attributes from user view/edit?>Posted by Gorman, Eliot on 06/16/2003 06:43 AM>>Hello All,>>Does anyone know what the best method for dynamically controlling whether specific category attributes are displayed to the user for editing (based on some custom OScript logic) would be?>>Would prefer to stay in OScript instead of modifying HTML pages but am open to either route.>>Thank you,>>Eliot Gorman>>[To reply to this thread, use your normal e-mail reply function.]>>============================================================>>Discussion: Development Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=view>>Livelink
Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>>>
; >
Tom_Fontanella_(genzymeuser1_-_(deleted))
Chris,Thanks for the information - that is precisely what I needed. How did you do invoke callback, did you subclass the EditAttrValuesEdit object then just replace the frame object after you updated the .ReadOnly property of the attributes you wanted to affect?Thanks,Eliot
Claudia_Meyer
Message from chris meyer via eLinkHi Eliot,Two things. The callbacks is an independent module I wrote for general listening of category & attribute events. The callbacks were implemented by editing the _SubclassExecute() method of AttrValuesEdit, EditAttrValuesEdit, etc. and inserting something like this near the bottom of the function... /***** ATTRCALLBACKS *****/ if ok Object cb for cb in $AttrAPI.AttributesCBSubsystem.GetItems() response = cb.AttrValuesEdit(prgCtx, request, response) end end /** ** **/This requires you to implement a callback subsystem and callback object with a standard interface for accepting these calls. This module does nothing on its own; it just provides hooks (or 'listeners' in Java terminology) for other modules.Have a look at the attachment to give you an idea of how I did this. Please note that this module is incomplete (i.e., no support, guarantee, or documentation is provided).The second thing was to orphan the callback object into my ospace of interest, and then in there modify the response assoc to make the attribute read-only.I hope this answers your question. chriseLink Discussion: Development Discussion wrote:>Re How to control specific attributes from user view/edit?>Posted by Gorman, Eliot on 06/16/2003 10:54 AM>>Chris,>>Thanks for the information - that is precisely what I needed. How did you do invoke callback, did you subclass the EditAttrValuesEdit object then just replace the frame object after you updated the .ReadOnly property of the attributes you wanted to affect?>>Thanks,>>Eliot>>[To reply to this thread, use your normal e-mail reply function.]>>============================================================>>Topic: How to control specific attributes from user view/edit?>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=3081851&objAction=view>>Discussion
: Development Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=view>>Livelink
Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>>>
; >
Tom_Fontanella_(genzymeuser1_-_(deleted))
Hi Chris,Thanks for your help with this issue. The callback system works great, however the ReadOnly parameter only makes the attribute non-editable to the user. I actually want to dynamically hide specific attributes from the user at runtime so they don't see them at all, but I will update the attribute data programmatically based on external data.Is there a parameter that I can set to indicate to the row html generation routine that it should make it TYPE="HIDDEN" similar to the way date fields work? Or should I simply call a function from the html page that determines "HIDDEN" attributes, then customize the HTML to dynamically build a hidden field based on that and does not generate a dynamic row from the html row generator?I am assuming that I need a hidden row, I can't just omit it because then it won't exist in the frame for the submit...Thanks much,Eliot
Claudia_Meyer
Message from chris meyer via eLinkYou might be able to use a callback to remove those attributes definitions from the response.data.AttrDefinition list. I'm not sure what will happen after you submit the changes, other than that it will most certainly fail on any required attributes.chriseLink Discussion: Development Discussion wrote:>RE How to control specific attributes from user view/edit?>Posted by Gorman, Eliot on 06/17/2003 09:30 AM>>Hi Chris,>>Thanks for your help with this issue. The callback system works great, however the ReadOnly parameter only makes the attribute non-editable to the user. I actually want to dynamically hide specific attributes from the user at runtime so they don't see them at all, but I will update the attribute data programmatically based on external data.>>Is there a parameter that I can set to indicate to the row html generation routine that it should make it TYPE="HIDDEN" similar to the way date fields work? >>Or should I simply call a function from the html page that determines "HIDDEN" attributes, then customize the HTML to dynamically build a hidden field based on that and does not generate a dynamic row from the html row generator?>>I am assuming that I need a hidden row, I can't just omit it because then it won't exist in the frame for the submit...>>Thanks much,>>Eliot>>[To reply to this thread, use your normal e-mail reply function.]>>============================================================>>Topic: How to control specific attributes from user view/edit?>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=3081851&objAction=view>>Discussion
: Development Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=view>>Livelink
Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>>>
; >