Snippets

Share your snippets!

Do you want to contribute and add your own snippets?
Start sharing your information here!
You don't have an account?
Create it here.

 
 
 

Has rendition attached to current version

Check if a rendtion (specified by fullFormat) is available in the CURRENT_VERSION of the document.

public boolean hasRendition(IDfSession session,
		IDfDocument document, String fullFormat) throws DfException {
 
	// Get the renditions of the current (incomming)document.
	IDfCollection rendition 

Copy document content

Copies the original Document to the Destination document. This method only works with the default document-content found by page-number.

private void copyContent(IDfDocument orgDocument, IDfDocument destDocument,
 
boolean asNewVersion) throws DfException {
 
	String strFile = null;
	try {
		// getFile(null) will place the content 

Show folder locations of an object

Shows the r_folder_path values from the dm_folder table for a specific object. The Fld.r_folder_path<>' ' where clause is added to filter the empty return values

SELECT Obj.r_object_id, Obj.object_name, Fld.r_folder_path
FROM dm_sysobject Obj, dm_folder_r Fld
WHERE any Obj.i_folder_id = Fld.r_object_id AND Obj.r_object_id='[OBJECT ID]'  
AND Fld.r_folder_path<>' '
 
 

Get all documents attached to specific workflow

SELECT r_object_id,object_name FROM dm_document WHERE r_object_id IN (SELECT  
r_component_id FROM dmi_package WHERE r_workflow_id='%PARAM%')
 
 

DQL to get total number of documents and folders under a cabinet

It counts all documents stored in a given [CABINET/FOLDER] path.

SELECT count(*) AS cnt,'Docs' AS category
FROM dm_document(ALL)
WHERE FOLDER
('[CABINET/FOLDER]',DESCEND)