Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-10 of 12 total  RSS 

Documentum JSP template

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
       pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/tlds/dmform_1_0
.tld" prefix="dmf"%>
<%@ taglib uri="/WEB-INF/tlds/dmformext_1_0.tld" prefix="dmfx"%>

<%-- Importa la clase controladora para poder acceder a los atributos --%>
<%@ page import="com.example.foo.Bar" %>

<%-- Para poder acceder a la clase Form desde código Java en la .jsp. --%>
<%@ page import="com.documentum.web.form.Form" %>

<html>
<head>

       <%-- Ejecuta la clase controladora --%>
       <dmf:webform validation="true" />

       <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
       <title></title>
</head>
<body>
       <%-- Some code --%>

       <%-- necesario para cualquier botón, incluido javascript --%>
       <dmf:form name="fooForm">

               <%-- Some code --%>

       </dmf:form>

       <%-- Some code --%>
</body>
</html>

[Documentum] Post-Synch Script Parameters

// Site Catching Services Post-Synch Script Parameters:

# arg 1 => path to agent.ini
# arg 2 => transfer directory for that publish
# arg 3 => target_root_dir for that publish
# arg 4 => string which tells whether sync agent on target
#          completed successfully ("SUCCESS") or failed ("FAILED").
# arg 5 => full_refresh ("true" or "false")
# arg 6 => export_properties ("true" or "false")
# arg 7 => recreate_property_schema ("true" or "false") 

[Documentum] DQL to obtain r_object_id from last version of a document by id

select 
  r_object_id 
from 
  dm_sysobject
where 
  i_chronicle_id in (
                      select 
                        i_chronicle_id 
                      from 
                        dm_sysobject(all) 
                      where 
                        r_object_id = 'YOUR_ID'
                    )

[Documentum] Error DM_FOLDER_E_MUST_HAVE_NAME while creating a new content with new Web Publisher user

I received this error while creating a new content with new Web Publisher user.
The new content cannot be created. 
[DM_FOLDER_E_MUST_HAVE_NAME]error: "A new folder/cabinet must have an object_name."

Solution:

Make sure that field user_os_name from dm_user object corresponding to your user contains your user's account. If not, update it via Documentum Administrator.

[Documentum] Error msg: [DM_FOLDER_E_MUST_HAVE_NAME]error: "A new folder/cabinet must have an object_name.

Can't create new content throught Documentum Webpublisher using account with inline password.

Run this DQL and make sure that 'user_os_name' is null

select * from dm_user where user_name = 'user_name' and user_os_name is not null


If not, set 'user_os_name' field as null from Documentum Administrator or running this DQL.

update dm_user object set user_os_name = '' where user_name = 'wp_admin'


Restart Web Publisher session.

[Documentum] Error DM_METHOD_E_HTTP_ POST_APP_SERVER_NAME_INVALID

Error code:
Error occured while publishing the Site Publishing Configuration
[DM_METHOD_E_HTTP_POST_APP_SERVER_NAME_INVALID]
error: "The app_server_name 'WebCache' was not specified in dm_server_config."

In Documentum Administrator. System -> Configurations -> Servers -> Info -> Tab AppServers

Look for this line:
WebCache http://localhost:6677/webcache/publish

If this line doesn't exists, run:
%DM_HOME%\product\5.3\webcache\install\config.exe

[Documentum] Move contents from web cabinet to another path using DFC

import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import org.apache.log4j.Logger;

import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.DfClient;
import com.documentum.fc.client.DfQuery;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfCollection;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.client.IDfWorkitem;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.DfId;
import com.documentum.fc.common.DfLoginInfo;
import com.documentum.fc.common.IDfId;
import com.documentum.fc.common.IDfLoginInfo;
import com.documentum.mthdservlet.IDmMethod;
import com.documentum.operations.*;

public class MoverContenidosViejos
    implements IDmMethod
{

    public MoverContenidosViejos()
    {
        m_domain = null;
        m_jobid = null;
        m_mtl = "0";
        m_ticket = null;
        m_File = null;
        _session = null;
    }

    private void MoverContenidos()
        throws Exception
    {
        System.out.println("MoverContenidosViejos, inicio");
        
        try
        {
        	String seccion=null;
        	String apartado=null;
        	String subapartado=null;
        	String Idcontenido =null;
        	String carpetaDestino=null;
        	IDfClientX clientx =null;
        	IDfId myId = null;
        	IDfSysObject contenido =null;
        	
        	//Carpeta Origen
        	
        	String carpetaOrigen=null;
        	
        	//Ejecutamos la query para sacar los contenidos de la carpeta origen
        	
            DfQuery queryCont = new DfQuery();
            queryCont.setDQL(DQLContenidosprueba);
            System.out.println("MoverContenidosViejos, query: " + queryCont.getDQL());
            IDfCollection idfc = queryCont.execute(_session, 0);
            
            while (idfc.next())
            
             {
                m_log.debug("MoverContenidosViejos. Obtengo los contenidos: ");
                
                //Obtenemos los datos del contenido 
                
                Idcontenido = idfc.getString("r_object_id");
                
                //Creamos el contenido como un objeto
                
                               	
                	System.out.println("MoverContenidosViejos, Creamos el objeto contenido y la carpeta destino.");
                	clientx = new DfClientX();
                	myId = clientx.getId(Idcontenido);
                	System.out.println("MoverContenidosViejos, myId: "+ myId);
                	contenido = (IDfSysObject)_session.getObject(myId);
                
                	//Creamos la carpeta destino
                
                	                
                	//Movemos el contenido de una carpeta a otra
                
                	
                	carpetaOrigen="/MoverContenido/Origen";
                	carpetaDestino="/MoverContenido/Destino";
                	System.out.println("MoverContenidosViejos, Carpeta destino: "+ carpetaDestino);
                	System.out.println("MoverContenidosViejos, Carpeta origen: "+ carpetaOrigen);
                	contenido.unlink(carpetaOrigen);
                	contenido.link(carpetaDestino);
                	contenido.save();
                
                
            }

            System.out.println("MoverContenidosViejos, cerrar collection");
            idfc.close();
                                            
                
        }
        catch(Exception e)
        {
            System.out.println("MoverContenidosViejos, error" + e.getMessage());
            m_log.error("MoverContenidosViejos: " + e.getMessage());
        }
    }


    protected IDfSessionManager login()
        throws DfException
    {
        System.out.println("MoverContenidosViejos- login: inicio");
        PassDocbase = "demo.demo";
        if(docbaseName == null || UserDocbase == null || PassDocbase == null)
        {
            System.out.println("MoverContenidosViejos- login: falten dades per iniciar la sesio");
            m_log.error("MoverContenidosViejos - login: falten dades per iniciar la sesio.");
            return null;
        }
        IDfClient dfClient = DfClient.getLocalClient();
        if(dfClient != null)
        {
            IDfLoginInfo li = new DfLoginInfo();
            li.setUser(UserDocbase);
            li.setPassword(PassDocbase);
            li.setDomain(m_domain);
            IDfSessionManager sessionMgr = dfClient.newSessionManager();
            sessionMgr.setIdentity(docbaseName, li);
            System.out.println("MoverContenidosViejos - login: fin");
            return sessionMgr;
        } else
        {
            System.out.println("MoverContenidosViejos- login: error2");
            System.out.println("MoverContenidosViejos - login: No se ha podido iniciar el cliente local de documentum");
            return null;
        }
    }

    protected void initWorkflowParams(Map params)
    {
        m_log.info("MoverContenidosViejos - initWorkflowParams: inicio");
        Set keys = params.keySet();
        for(Iterator iter = keys.iterator(); iter.hasNext();)
        {
            String key = (String)iter.next();
            m_log.debug("MoverContenidosViejos - initWorkflowParams: " + key);
            if(key != null && key.length() != 0)
            {
                String value[] = (String[])params.get(key);
                m_log.debug("MoverContenidosViejos - initWorkflowParams: valor[]: " + value);
                if(key.equalsIgnoreCase("user_name"))
                    UserDocbase = value.length <= 0 ? "" : value[0];
                else
                if(key.equalsIgnoreCase("docbase_name"))
                    docbaseName = value.length <= 0 ? "" : value[0];
                else
                if(key.equalsIgnoreCase("password"))
                    PassDocbase = value.length <= 0 ? "" : value[0];
                else
                if(key.equalsIgnoreCase("domain"))
                    m_domain = value.length <= 0 ? "" : value[0];
                else
                if(key.equalsIgnoreCase("job_id"))
                    m_jobid = value.length <= 0 ? "" : value[0];
                else
                if(key.equalsIgnoreCase("method_trace_level"))
                    m_mtl = value.length <= 0 ? "" : value[0];
            }
        }

        m_log.info("MoverContenidosViejos - initWorkflowParams: fin");
    }

    
    public void execute(Map params, OutputStream ostream)
        throws Exception
    {
    	System.out.println("MoverContenidosViejos, execute: inicio");
        initWorkflowParams(params);
        IDfSessionManager sessionManager = login();
        IDfSession session = null;
        try
        {
            _session = sessionManager.getSession(docbaseName);
            MoverContenidos();
            
        }
        catch(DfException e)
        {
            ostream.write(e.getMessage().getBytes());
            e.printStackTrace();
            throw e;
        }
        finally
        {
            if(session != null)
                sessionManager.release(session);
        }
        return;
    }

    private IDfSession _session;
    private static Logger m_log = Logger.getLogger("MoverContenidosViejos");
    private static String PassDocbase = null;
    private static String UserDocbase = null;
    private static String docbaseName = null;
    protected String m_domain;
    protected String m_jobid;
    protected String m_mtl;
    protected String m_ticket;
    protected RandomAccessFile m_File;
											/*dpg_alerta,dpg_articulo,dpg_bienvenida,dpg_contacto,dpg_documento,dpg_editorial,dpg_encuesta,dpg_enlace,dpg_evento,dpg_fasciculo,dpg_ficha,dpg_glosario,dpg_grafico,dpg_legislacion,dpg_noticia,dpg_portada,dpg_prima,dpg_reportaje,dpg_ticker,dpg_FAQ
     * */
    

    private static String DQLContenidosprueba = "select r_object_id, object_name from dm_document where folder('/MoverContenido/Origen')";
    
    private static final String USER_KEY = "user_name";
    private static final String DOCBASE_KEY = "docbase_name";
    private static final String PASSWORD_KEY = "password";
    private static final String DOMAIN_KEY = "domain";
    private static final String JOBID = "job_id";
    private static final String MTL = "method_trace_level";
    private String lifeCycleState;
    private boolean lifeCycleOverride;
    private boolean lifeCycleTestOnly;
    protected String m_workitemId = null;
    private IDfId docIdObj;

}

[Documentum] URL to refresh Webpublisher config

http://host:port/wp/wdk/refresh.jsp

[Documentum] Error msg: DM_LOCALE_E_UNKNOWN_LOCALE_NAME

Put this on your dmcl.ini at DMAPI_CONFIGURATION section.

client_locale=es

[Documentum] Publishing locale-specific information to the data dictionary

// description of your code here

1. From the command prompt on the computer on which eContent Server is installed, run this dmbasic command:

where:

docbase_name: The name of the Docbase.
user_name: Your user name.
password: Your password.
data_file: The data file that contains data dictionary information that is specific to the locale you want to publish.

Path: ‘documentum\product\4.2\bin’ (normally).

dmbasic -f dd_populate.ebs -e LoadDataDictionary -- docbase_name user_name password data_file


Open the IAPI utility and execute this API command:

where:

session: The session for IAPI (usually s0).
Locale: The locale for which you want to publish data dictionary information. For example, ja for Japanese. The default is the locale that is specified for the current client session.
Type: The specific object type for which you want to publish data dictionary information.
attribute: The specific attribute for which you want to publish data dictionary information. You must enter the type argument for which the attribute is defined.

publish_dd,session[,locale][,type][,attribute]


« Newer Snippets
Older Snippets »
Showing 1-10 of 12 total  RSS