EXPORT CONTENT from DocBase using API
Hi, I have went through Documentum API Reference Guide. I'm able to execute single line commands in DA and DqMan as well.
I need to export bulk contents from DocBase using API Scripts. I tried below script. Its throwing some error message. Can you please help me?
query_str = "select r_object_id, ots_doc_number, object_name, a_content_type from literature_document where title is not NULLSTRING and r_is_virtual_doc = 0 and i_latest_flag = 1"
query_id = dmAPIGet("query,"session",query_str")
while( dmAPIExec("next,"session", query_id") > 0 )
{
doc_id = dmAPIGet("get,"session","query_id",r_object_id")
doc_num = dmAPIGet("get,"session","query_id",ots_doc_number")
obj_name = dmAPIGet("get,"session","query_id",object_name")
cnt_typ = dmAPIGet("get,"session","query_id",a_content_type")
name = S:\Export_Lit\ "obj_name" _ "doc_num" ."pdf"
getfile,c,doc_id,name,cnt_typ
}
Thank you so much !!
Comments
-
Brian Dinneen Can you please help me on this?
0 -
Please consider moving this question as-is (no need to recreate) to the proper forum for maximum visibility. Questions written to the users' own "Discussions" space don't get the same amount of attention and can go unanswered for a long time.
You can do so by selecting "Move" under ACTIONS along the upper-right. Then search for: "Documentum" and select the first result that appears. This will relocate it to the Developer Network space of the Documentum community.
For further guidance on engaging with the communities for Documentum and related products, please refer to the
IIG Communities Getting Started Guide.
Seeing though that over 6 months have elapsed since you posted, maybe you have already found the answer (possibly opened up a ticket with support)? If so, once relocated, consider sharing the resolution and also marking the question as "Answered" so that it can help others that have the same question. If not, once relocated, it will then have more visibility by the community of dedicated customers, partners, and EMC employees that are eager to assist.
0 -
Hi Chris,
I have moved to Documentum.
Thanks you so much!
Sri
0 -
Any reason you are using the API and not the DFC?
Anyway, the last API call in the loop should look more like this: dmAPIGet("getfile","session","doc_id","name","cnt_type")
I have to caveat this advice by saying: I don't have an API guide with me, so I don't know if dmAPIGet() is the correct API to use with the "getfile" command (it might be dmAPIExec()). Also, I am trusting your formatting of the arguments for the "getfile" command are correct since I can't verify them.
I built a pretty versatile and easy to use exporter here if you want to use it or take it apart to learn from it: http://msroth.wordpress.com/2013/05/28/documentum-bulk-export-tool/
0 -
You are overstating the task, all that @Sri_Kumaran is need - write SQL to generate API, oracle example:
SELECT 'getfile,c,'
|| doc.r_object_id
|| ',S:\Export_Lit\'
|| REPLACE (object_name, ',', '')
|| CASE
WHEN ROW_NUMBER ()
OVER (PARTITION BY REPLACE (object_name, ',', '')
ORDER BY NULL) > 1
THEN
'_'
|| ROW_NUMBER ()
OVER (PARTITION BY REPLACE (object_name, ',', '')
ORDER BY NULL)
END
|| CASE
WHEN fmt.dos_extension IS NOT NULL AND fmt.dos_extension <> ' '
THEN
'.' || fmt.dos_extension
END
ots_doc_number,
object_name,
a_content_type
FROM literature_document_sp doc, dm_format_sp fmt
WHERE doc.title IS NOT NULL
AND doc.title <> ' '
AND doc.r_is_virtual_doc = 0
AND doc.i_latest_flag = 1
AND doc.a_content_type = fmt.name(+);0 -
Using the DFC option would be more reasonable, Though the PSQL/SQL is also viable and better then API.
I recommend using the DFC if there are a lot of objects in the database as SQL or PSQL could slow down the system or even bring it to a grinding halt. If this is non production the by all means use whatever method you want
0 -
And how is SQL able to slowdown the system? I do think you do not understand the main idea of script.
0 -
Not in regards to your SQL, which is just making all the API scripts. I mean SQL as a solution to pulling the data and objects out.
I still stand by DFC being the faster cleaner method to get the results he wants
0 -
What is the best option completely depends on performer. You have some IDE, but there is no IDE for dmbasic, so you think that dmbasic is not suitable for you. I think that the best option to automate some administrative routines is VB with PIA, but EMC does not develop PIA anymore If you're taking that SQL is not good option to update docbase data, I completely agree, but when I should perform a lot of simple updates I would prefer to generate corresponding API using SQL rather then coding something in Java.
0 -
If you are updating objects I agree SQL/DQL. But he is wanting to export, DFC is the fastest option, preferably in a threaded application.
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 102 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 124 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax