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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verify document filling using JAVA and CWS

Status
Not open for further replies.

rahulsingh81

Technical User
Jun 21, 2013
5
Using Content Web Services and JAVA API, I want to verify whether a specific Document exists in specific folder e.g. Document with Title "Doc XYZ" is in Folder "Folder ABC".

I want to know cleanest and best (performance) way of doing same as it would be a bulk verification process?

One I Know is fetching Node using getNodeByName(getID(), Name).

But I feel this might be slow considering Folder ABC can be at any level in hierarchy and it might contain many documents.

Please do suggest?

thanks
rahul
 
Thanks Greg.
At a given level, folder structure would be unique i.e. at FolderLevel1/FolderLevel2 i would only have one FolderLevel3.
So i was hoping i can use ews = fDocMan.getRootNode("EnterpriseWS");Node ew1 = fDocMan.getNodeByPath(ews.getID(), pathelements)where path element is FolderLevel1:FolderLevel:FolderLevel3.
Queries are :
1. is querying this way efficient way..when we might have in Prod many folders to be verified in Bulk ?Please do let me know different ways to do same ?
2. What would really change if i have FolderLevel3 in two different folder hierarchies ?
3. If pathElements is wrong fDocMan.getNodeByPath is not returning any exception, how to verify (raise exception) if there is no node at the pathElements ?
4. Would any thing change if the folders are Business Workspaces (Extended ECM)

Too many questions but am very new to OT so need help.

thanks
rahul
 
Hi Greg ,
Can you please help me with the query.

At a given level, folder structure would be unique i.e. at FolderLevel1/FolderLevel2 i would only have one FolderLevel3.
So i was hoping i can use ews = fDocMan.getRootNode("EnterpriseWS");Node ew1 = fDocMan.getNodeByPath(ews.getID(), pathelements)where path element is FolderLevel1:FolderLevel:FolderLevel3.
Queries are :
1. is querying this way efficient way..when we might have in Prod many folders to be verified in Bulk ?Please do let me know different ways to do same ?
2. What would really change if i have FolderLevel3 in two different folder hierarchies ?
3. If pathElements is wrong fDocMan.getNodeByPath is not returning any exception, how to verify (raise exception) if there is no node at the pathElements ?
4. Would any thing change if the folders are Business Workspaces (Extended ECM)

Have not received answers i am looking for till now .Please if you can help me out , it would be great.

thanks
rahul
 
A large livelink system does not insists on any kind of structuring.If your question is I have a folder that is called FolderLevel3
in a hierarchy and can you have Folderlevel2 and FolderLevel1 as its parents ,if so yes.In your call
fDocMan.getNodeByPath(ews.getID(), FolderLevel1:FolderLevel:FolderLevel3) all you are asking the sytem is starting at the
ews.getID() is there something like that in that path specified.

If a company says I will have 100 folders in my EWS and in each of the folders I create a path FolderLevel1:FolderLevel:FolderLevel3 then you have
ENTERPRISE WS(2000)
LEVEL1(12345):FolderLevel1:FolderLevel:FolderLevel3
LEVELN(43216789):FolderLevel1:FolderLevel:FolderLevel3

If you have not understood livelink to this point then please understand that it is the immediate parent or volume with which you can traverse and livelink is a RDBMS
based solution which kind of is trying to give you a TREE walk.

One can using a RDBMS function,query or stored proc write something that would say give me all the trees that look like FolderLevel1:FolderLevel:FolderLevel3 regardless of its position but I would question you why do this.Why is it important to know this pathing in livelink?.It does not make any SENSE to me.

BWS or xECM are a custom subtype in livelink like folders.Newer CWS code probably knows how to interact with it.If not there is another kind of webservices trageting SAP to livelink programmers called Enterprise Library services.in a xECM scenario you will have some function to figure out the root location of a BWS or Application and I would start looking there not in the entire livelink system as it can become expensive very much.
Are you sure about this
If pathElements is wrong fDocMan.getNodeByPath is not returning any exception, how to verify (raise exception) if there is no node at the pathElements ?
if so have you asked OT about it?How can you say it is an EXCEPTION. An exception means some kind of problem happened.My thought is you are asking the system do you have this fDocMan.getNodeByPath(ews.getID(), FolderLevel1:FolderLevel:FolderLevel3) if livelink does not have it it will probably return something,if it suceeds it will return the nodeid of FolderLevel3.Again I have not tested this but just to help you out.If you feel it should be an exception please ask OT.




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
 
Thanks alot.........
Sorry if my query were not to the point.......

I just wanted to know the Best way to figure out "Whether a specific document exists in a specific folder" (e.g. Document with Title "Doc XYZ" is in Folder "Folder ABC" where "Folder ABC" is under Folder 1 :Folder 2 or it may be at a different known hierarchy ).

Can you suggest Best Performance oriented way to do same using Content Web Services CWS ? Heard CWS is the way Forward for development.

Why i want to know ---Its a business requirement to verify whether specific document exists in specific folder (and those folders would be Business Workspace) ?

And yes i am new in OpenText area and working towards learning the same.So many a times my question would feel like I have not understood livelink.

Hoping for help and guidance.

rahul
 
First of I would find the id of a XECM object in livelink and see if I say ListNodes or its equivalent I mean there is a call to find listChildren and see if xECM and CWS jive.In a CS10 livelink with only metadata of English if you are in Folder3(123456789) and you say I want to create 'Doc XYZ' then if any object be it document folder or any subtype by the same name exist you will get an error message saying "item with same name Doc XYZ' exists .So I would use that to figure out .I could use use ListObjects then iterate over the obejcts and its name and see if it exists .

If you are new to livelink get a URL to the real livelink and use the GUI to understand what all you acn use.If search is properly configured you can use (XML) search API(RESTful) as well.Can you use a db query within a programming language sure you can leave out performance for a while and concentrate on what gets you going.

Just because CWS is there that does not mean you should treat livelink as a blackbox that is where all frustration happen.If you understand the gui and the business rules you will become a better programmer in no time.

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top