Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
I would like to create a folder and set group permissions to it (OScript)
Martin_Hipfinger_(martinhipfinger_-_(deleted))
Hello,I'am pretty new in LiveLink development. So I need really help. I have to create some folders and subfolders.Than I need to set the permission to the folder for a specified group. For example Read / Write permissons.Can anyone help me with a sample? How can I do that?I created a module in the admin.index to set some properties. The folders are read from a SQL Server.RegardsTimo
Find more posts tagged with
Comments
Donna Nalls
Hello Timo,If you have taken the LL SDK class, you may recall learning about WebNode and LLNode objects.....the methods that you use to create a folder node are in the Folder LLNode object (located in the LLIAPI Ospace). You will use NodeAlloc() and NodeCreate() methods.Attached, please find a very simple example where i have used a Request Handler Execute method to call a subroutine that will create a folder in the specified folder.After the folder creation, have a look at the LLNode methods that start with "NodeRight" - there are several ways to update the Permissions and the ACLs - choose the one that best suits your needs.I hope this will help to get you started!!!Best of Luck,Donna
Martin_Hipfinger_(martinhipfinger_-_(deleted))
Hi Donna,Thx a lot. This help me really much. I see that I can find scripts within LL Builder via search.I have 2 question more. Hopefully you can help me.1) We create within Enterprise some folders. How can I get this ID's dynamically. List all folders (incl. id) from enterprise root to create folders within.Enterprise is 141? I'am right? How can I bind this object to list now all nodeID's?2) I would like to have a button in my module (ok thats not that difficult) and run my self created script. If I see right I put my script under the root in my module (must I globalize it?). How can I call now this script from my webpage when I click on the button? Just call the name?RegardsTimo
Donna Nalls
Hi Timo,The enterprise node can be retrieved from your dapisession:dynamic getLN = prgCtx.fDSession.GetNodeLibrary()dapiNode libraryNodeinteger libraryIdif (getLN.ok) libraryNode = getLN.Library libraryId = libraryNode.pIdend // check your online help for DAPI.ListContents() or DAPI.ListSubNodes() to get the list of folders below your enterprise.There are different ways that you can access your script. I'm not completely sure i understand how you want to process this. You can call a utility (yes, you should add that to your Globals) from your form page but you might also want to consider a second request handler...that returns to a status page when it is completed...Hope this helps a little bit.Best,Donna
Martin_Hipfinger_(martinhipfinger_-_(deleted))
Hi Donna,Thanks a lot. I will try all that now. I implemented for the post back an second requesthandler. This works fine. Now I will see how to connect to external database and create some folders within my enterprise node.I'am just suprised that I do not need to give to my dapi any 'root id' (means the id of the enterprise node).I will post here when all is fine.GreetingsTimo
Martin_Hipfinger_(martinhipfinger_-_(deleted))
Hi Donna,Sorry for asking you again. You posted me the little oScript snipped. So I wanted to run that. But I get an error.When I put a script in my module and start the debugger I get an error on fDSession"An unknown feature was specified"When I search the oSpace and copied the GetNodeLibrary code and run it I get the same error.You have to know that I run my code only on the admin interface. The user will never use that module. We use it for autocreation folders and set the rights on it.RegardsTimoSee here for the source.function listEnterpriseSubNodes() Object prgCtx = .PrgSession() Assoc retVal Boolean ok = false Dynamic apiError String errMsg Dynamic getLn = prgCtx.fDSession.GetNodeLibrary() dapiNode libraryNode integer libraryID if (getLN.ok) ok = true libraryNode = getLN.Library libraryID = libraryNode.pId end if (isUndefined(retVal.ok)) retVal.ok = ok retVal.apiError = error retVal.errMsg = errMsg endend
Donna Nalls
Hi Timo,So, you do have a prgCtx defined, but it does not have an fDSession feature?Does prgCtx have a method called AllocDSession?? If so, you may need to make a call to that to get your dSession - then you should see the fDSession.GetNodeLibrary() method.Is the Admin user logged in when the request handler is processed???I am also attaching a little script that you might use to create an Admin session if your user is not currently logged in.Donna
Martin_Hipfinger_(martinhipfinger_-_(deleted))
Hi Donny,Hopefully what I post is right.When I searched within the globals I found following$prgSessions[1].fDSession.GetNodeLibraryso I set that to my getLN.I get back for getLN.Library -> U=051E64C0getLN.ID -> 2000is that the Enterprise workspace?Second thing. I use her LL 9.6. Is that the same version as you use? Because I think that's why it was not possible to bind my prgSession right.May I make somethink really wrong now because I use the global $Sessions?.For any help here thanks a lot. This helps me really a lot. I see that I can find a lot of stuff within the global.RegardsTimo
Donna Nalls
Hello Timo,I do not have a LL 9.6 instance. I wrote the script in LL9.5 but also tested it in LL9.7.I have always heard that using the $PrgSession global can be a little inconsistent - so, i don't want to recommend it. but, yes, you did find the library volume (Enterprise Workspace) that way. So, if you are comfortable with using it, you should move forward that way; otherwise, try to allocate a DSession from prgCtx - then look for the method to retrieve the library node.Best,Donna
eLink User
Message from Carsten Kulms via eLinkAs Donna said, this "can be a little inconsistent" -- indeed not a"little": Afaik $PrgSession[1] can be any user's context (if there isone at all).(Watch in LLBuilder what happens to the $PrgSession object when userslogin.)Donna already mentioned what should be looked at:- is the prgCtx object defined and a PrgSession?- Is the request authenticated, i.e. a context (login) occurred?- check what happens if you call DSession() instead of accessingfDSession directly
Louis_Routhier
Since your text file seems to be a lot like this here:
http://communities.opentext.com/communities/livelink.exe/wiki/162164/How to allocate an Admin program context (prgCtx)do
you think you could add to the wiki page to explain the differences with your script and make the wiki article better?Thanks!
Louis_Routhier
From what I understand, you run this code from a requestHandler or a webNodeAction. Look carefully at th this object's properties. You should have something like fPrgCtx that would contain the prgCtx itself and every other properties inside it.Also, since you say this is only accessible by users with admin privileges, you could use the technique mentionned before to create an admin context(a shorter but probably less safe piece of code is available here:
http://communities.opentext.com/communities/livelink.exe/wiki/162164/How to allocate an Admin program context (prgCtx))
Donna Nalls
Hi Louis,I no longer have membership in the any of the communities.I apologize if i "duplicated the wheel" for a script that already exists...i was simply putting together a very simple example for Timo, to help get him started down the correct path....i did not mean to imply that it was production ready.feel free to critique the code any way you see fit.Donna
Louis_Routhier
Communities is openly accessible.You can create an account by clicking on the link below the login textboxesNo offense
I simply try to get the best information possible in the Wiki for future reference :P
http://communities.opentext.com/communities/llisapi.dll?func=llr.loginrequest
Donna Nalls
yes, i am well aware of the communities, but have little enough time to remain an active participant on the KC....i used to participate on the govt community, but that was several years ago, and at the request of the OT govt sales team (all, now departed from OT).i wonder why you use the community to keep code examples instead of the KC? it seems that the KC is promoted by OT as the primary knowledge sharing environment.no offense taken; however, all developers have different styles of writing and i find that some on the KC seem to have some sort of competition (my code is better than yours) thing going on. i was simply trying to give another user a snippet of code that i thought would be useful....it shouldn't have become a freaking federal case.have a lovely weekend.
Louis_Routhier
It wasn't a "freaking federal case" :PTo answer your question about why I use the community to keep code, there are many reason:1- It is easier to structure the information and centralize it. Actually in KC, code snippets are all over the place2- Code in KC is there forever and immutable. On the opposite, in the communities wiki, if someone finds an error or a better way of doing something, the code can simply be improved3- Communities is accessible to all while KC is strongly secured4- The KC part that is publicly contributable is almost only forums and forums are not easy to go through when you're looking for something which makes people ask the same question again and again because they can't find what they're looking forThese are the main reason. Now I understand that you may have not enough time and so I'll look at your code and try to understand in my best knowledge the differences. The reason I would have appreciate you to do it is simply that you probably to the nuances better than me and it wasn't a hard request or anything but simply a request.Sorry if I offended you.
Louis_Routhier
I updated the code on the wiki with what I understood from the text file submited by Donna. Since I don'T have a LL9.2 installed, I can'T validate the code for this version so it would be appreciated that anyone who could do it modify the page if necessary and explains what has really changed.Thank you.
http://communities.opentext.com/communities/livelink.exe?func=ll&objId=1736073&objAction=WikiView&viewType=1
Martin_Hipfinger_(martinhipfinger_-_(deleted))
Ok,I will try to find the object.Thanks for the hint. I was suprised now how this discussion was going on.Donna it was a great help from you. Now I found my entrie in the OScript world.RegardsTimo
Donna Nalls
Hi Timo,I hope you enjoy working with OScript for your Livelink development.Pardon my fussing at Louis - i was simply misunderstanding his request and he and i got it all squared away.Good luck!Donna
Louis_Routhier
Yeah, right, everything'S fine ;)This is the problem with languages that are not or primary one :P (I speak for myself here
)
Martin_Hipfinger_(martinhipfinger_-_(deleted))
Ok,So I use now your script to bind my prgCtx. This is really cool but I'am not sure if that the really right way.I put your script to the globals and make a reference. Now I can connect to DB, Userinfos etc..Is this way ok?Many thanksTimo