Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to apply permission for a document based on Document category attribute using OScript?

Status
Not open for further replies.

Sunil Poojari

Programmer
Dec 22, 2016
7
KW
Hello,

I have requirement to put a security to a document. I need a module which does the security.

I have document which contains the attached category with attributes. Based on the attribute I need to apply the permission for a document.

For example I have category attribute "Department", If the Department is A I have to apply some rules, If B I have to apply rules.

thanks in advance.
 
Hi Sunil,
What kind of prior Oscript work have you done and in what version of livelink?
Oscript is a new language if you are a starter and is not practiced outside of livelink
My blog has some information
Most of us have logins to knowledge.opentext.com and we regularly exchange ideas,snippets etc but not fully finished modules
as you ask because oscripters command more money in the OT dev world.

OT wants you to use WebReports or other API's like WSAPI or REST API for such work and oscript would be the most difficult for a starter.


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Hi Appnair sir,

I have 2years of experience in OT domain.I have basic knowledge of OScript and worked on content server 10 and 10.5. My requirement is very difficult for me to do. So I need some suggestion how to do it?

Requirements are:

1.I have to create an custom agent.Which runs the logic for given scheduled time.
2.I have to apply a security rules for a document based on document category attribute in a particular folder,though agent.

kindly assist me.

thank you.
 
OK That is fair experience I will tell you how I would have proceeded lots of examples snippets in my website livelink.in and greggriffiths.org and KB knowledge.opentext.com.

OK the first thing for you to know is the LLIAPI::Node Objects this is an encapsulation/abstraction of a dtree.dataid.So in true OOP fashion if you have a dataid you can find its NODE.Then all Node manipulation operations are in the same ospace.

For e.g from memory and in kind of psuedocode

Object myNode
myNode=DAPI.GetNodeByID(correct params ,dataid)
lliapi.GetCategories(myNode)
lliapi.GetNodePermissions(myNode)

If you spent about 8 hrs familarizing the Node looking through Oscript code there you have it.
Refrain form programming using the DAPI direct calls reason is that DAPI is very low and you would produce code that is
very dangerous.For example a DAPI.RenameNode will have renamed the NODE but none of the callbacks to other modules would have run so in theory until OT deprecates the
DAPI use ? programmers can destroy the inner workings of livelink.So read through the builder forum perhaps look at code that was written recently not in the 1999 era I would say 2003 and up when we were all forced to use DAPI extensively.

I have written conventional agents and have written a lot about agent workings.However I never had a need to do DA so I dont know that much.

Do some good lliapi research and then we will rescue you to become a good programmer.No two ways about it either learn it from OT or burn the midnight oil.







Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Ok sir. I will try to do it. If I stuck in something. I will get back to you. Thank you for your time and suggestions.
 
Another simple way if you know WSAPI is it has better documentation so while you run a WSAPI command to apply permissions you put a debug and it will show you the exact lines of good way of OT code.For that you would need to understand debugging.The only reason I suggest that is WSAPI has good javadocs and better documentation than oscript documentation.All experienced oscripters know how to trace a call from browser to completion the Request/Response methodology so while on the GUI I trace calls and learn the OT way.When I am in doubt I quickly run LAPI or WSAPI from oscript itself(you don't need to write java/net code) and then you can see properly how o devise a solution.
BTW a professional forum no need for the Sir part...

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Hi,

I have developed custom agent module. It is running now.

Can you please share if any sample code. how to retrieve document category attribute and how to change the permission for that document based on cat attribute.

I tried but am not able to figure it out. I don't used LLIAPI module before.

Thank you.
 

that is a folder full of oscript utilities what i wrote to show people

This is official OT stuff
t has links to builder forum and shows code that started out somehere in 1993 and onwards

look for LLIAPI ,LL Node,Node as search terms and you will find what is needed for your work.



Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Hello,

I was trying to read category values using DAPI. Is it possible to get the category values using DAPI.

I tried RecArray rec = DAPI.ListCategories(DAPISESSION session), but it referring to DCategories table. In the DCategories table am not able to see the categorues which I have created.

Please any code snippet for read the category values using DAPI would help.

Thank you.
 
Sunil,You have KB access why don't you pose this quetsion there? I don't want a semi hacked solution that you will give to your client without undertanding the basic programming aspects.I would be doing a great dis service to the entire team of oscripters who take pride in doing it the correct way.In fact many have advised me of the fallacy I am doing so I have to respect my peer group.For casual programmers like you WebReports offers perhaps easier ways and that way you wont affect core code.

From memory when you get to documentation i remember seeing this back in 2003 or so

Note: The DAPI category functionality supports the legacy node category features. Most of the current set of DAPI category attributes functions
are not used for the current more sophisticated category features which are implemented in OScript. However, a few of the functions are used to
support the additional node attributes feature.
The followings are types of DAPI object handles used with the DAPI functions:


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
I used,

Frame f = $LLIApi.AttrData.New(prgCtx,<nodeid of folder>,<vernum of folder>)
f.DBGet()

from this method, I am able to read and loop the categories and its attribute.

Thanks appnair. I am able to complete the given task. Thanks for your suggestions and information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top