
h1. ECM Migration from ECM 2-2-x to DMS 2-3





Since ECM 2.3, we split ECM to 3 products as [DMS], [Workflow|Workflow:WebHome] and [WCM|http://wiki.exoplatform.org/xwiki/bin/view/WCM].
So, how can we upgrade from 2.2 to 2.3 ? You can follow these steps to get successful upgrade.
#info("For now, we have the ECM suite which contains 3 products as
{code:xml}
ECM(Enterprise Content Management)
 |
 |__DMS(Document Management System)
 |   |__core
 |   |__ext
 |       |__contentvalidation
 |
 |__Workflow
 |
 |__WCM(Web Content Management)
{code}
")

1 Migration for drives path

Since ECM 2.3, the DriveMigrationService was available at the location *ecm/dms/trunk/core/component/migration/2.3/drives*. This service is used to rename the old drive which contains invalid characters and prevent the WARNING messages at the console.\\

			How to do it?\\
* Compile the source code to create new jar *(exo.ecm.dms.core.component.migration.2.3.drives-2.3.jar)* by command:
{code:xml}
mvn clean install
{code}
   * Stop server and copy this jar to library.<br>
   * Run server DriveMigrationService to apply changes.<br>
   * After server has started, stop server again and remove this jar, restart server.


h1. How to use for Workflow Publication Plugin ?

Since ECM 2.3, the Workflow Publication Plugin was available at the location *ecm/dms/trunk/ext/contentvalidation/component/workflowPublication/*. This plugin is used to publish a content of documents. It breaks a work process down into tasks. See more details about [Workflow:Workflow Publication Plugin].

How to do it?
* Compile the source code to create new jar *(exo.ecm.dms.ext.contentvalidation.component.workflowPublication-2.3.jar)* by command:
{code:xml}
mvn clean install
{code}
   * Stop server and copy this jar to server library (for example: \tomcat\lib)<br>
   * Run server to apply the changes.<br>

Here are the structure of this jar
{code:xml}
exo.ecm.dms.ext.contentvalidation.component.workflowPublication-2.3.jar
 |
 |__conf
 |  |
 |  |__nodetypes-workflow-publication-config.xml
 |  |
 |  |__workflow-templates-configuration.xml
 |  |
 |  |__conf.portal
 |     |
 |     |__configuration.xml
 |
 |__...
 |
 |__...
{code}

* *configuration.xml*: This file is used to plug a new plugin (Workflow Publication Plugin). It will specify to two files: _nodetypes-workflow-publication-config.xml_, _workflow-templates-configuration.xml_ to configure for this plugin

{code:xml}
<?xml version="1.0" encoding="ISO-8859-1"?>

<configuration>		

  <component>
    <key>org.exoplatform.services.ecm.publication.PublicationService</key>
    <type>org.exoplatform.services.ecm.publication.impl.PublicationServiceImpl</type>
  </component>

  <component>
    <key>org.exoplatform.services.ecm.publication.PublicationPresentationService</key>
    <type>org.exoplatform.services.ecm.publication.impl.PublicationPresentationServiceImpl</type>
  </component>
  	
  <external-component-plugins>
    <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
    <component-plugin>
      <name>add.nodeType</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
      <priority>122</priority>
      <init-params>
        <values-param>
          <name>autoCreatedInNewRepository</name>
          <description>Node types configuration file</description>
          <value>jar:/conf/nodetypes-workflow-publication-config.xml</value>
        </values-param>
       </init-params>
     </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.services.ecm.publication.PublicationService</target-component>
    <component-plugin>
      <name>Workflow</name>
      <set-method>addPublicationPlugin</set-method>
      <type>org.exoplatform.services.ecm.publication.plugins.workflow.WorkflowPublicationPlugin</type>
      <description>Workflow Publication</description>	    	    	
      <init-params>
        <value-param>
	  <name>validator</name>
	  <value>*:/platform/administrators</value>
        </value-param>
        <value-param>
	  <name>to_workspace</name>
          <value>collaboration</value>
        </value-param>
        <value-param>
          <name>destPath</name>
          <value>/Documents/Live</value>
        </value-param>
        <value-param>
	  <name>destPath_currentFolder</name>
	  <value>true</value>
        </value-param>
        <value-param>
	  <name>isEditable</name>
	  <value>false</value>
        </value-param>
        <value-param>
	  <name>backupWorkspace</name>
	  <value>backup</value>
	</value-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>	
  <import>jar:/conf/workflow-templates-configuration.xml</import>
</configuration>

{code}

* *nodetypes-workflow-publication-config.xml*: This file is used to configure a new nodetype
{code:xml}
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
  xmlns:jcr="http://www.jcp.org/jcr/1.0">

  <nodeType name="publication:workflowPublication" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
    <supertypes>
      <supertype>publication:publication</supertype>
    </supertypes>
    <propertyDefinitions>
      <propertyDefinition name="publication:validator" requiredType="String" autoCreated="true" mandatory="true"
        onParentVersion="COPY" protected="false" multiple="false">
        <valueConstraints/>
        <defaultValues>
          <defaultValue>*</defaultValue>
        </defaultValues>
      </propertyDefinition>
      <propertyDefinition name="publication:businessProcess" requiredType="String" autoCreated="true" mandatory="true"
        onParentVersion="COPY" protected="true" multiple="false">
        <valueConstraints/>
        <defaultValues>
          <defaultValue>content-publishing</defaultValue>
        </defaultValues>
      </propertyDefinition>
      <propertyDefinition name="publication:backupPath" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
        <valueConstraints/>
      </propertyDefinition>
    </propertyDefinitions>
  </nodeType>

  <nodeType name="publication:workflowAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
    <supertypes>
      <supertype>exo:businessProcessAction</supertype>
    </supertypes>
    <propertyDefinitions>
      <propertyDefinition name="exo:validator" requiredType="String" autoCreated="false" mandatory="true"
        onParentVersion="COPY" protected="false" multiple="false"/>
      <propertyDefinition name="exo:businessProcess" requiredType="String" autoCreated="true" mandatory="true"
        onParentVersion="COPY" protected="true" multiple="false">
        <valueConstraints/>
        <defaultValues>
          <defaultValue>content-publishing</defaultValue>
        </defaultValues>
      </propertyDefinition>
    </propertyDefinitions>
  </nodeType>

</nodeTypes>
{code}

* *workflow-templates-configuration.xml*: This file is used to decide the template of publication : workflowAction. It will specify the dialog as well as view for that template.

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <component>
    <key>org.exoplatform.services.cms.templates.TemplateService</key>
    <type>org.exoplatform.services.cms.templates.impl.TemplateServiceImpl</type>
  </component>

  <external-component-plugins>
    <target-component>org.exoplatform.services.cms.templates.TemplateService</target-component>
    <component-plugin>
      <name>addTemplates</name>
      <set-method>addTemplates</set-method>
      <type>org.exoplatform.services.cms.templates.impl.TemplatePlugin</type>
      <init-params>
        <value-param>
          <name>autoCreateInNewRepository</name>
	  <value>true</value>
        </value-param>
        <value-param>
          <name>storedLocation</name>
	  <value>jar:/resources/templates/workflowAction</value>
	</value-param>
	<value-param>
	  <name>repository</name>
	  <value>repository</value>
	</value-param>	
	<object-param>
	  <name>template.configuration</name>
	  <description>configuration for the localtion of templates to inject in jcr</description>
	  <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig">            	
	    <field name="nodeTypes">
	      <collection type="java.util.ArrayList">
	        <value>
	          <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$NodeType">
	            <field name="nodetypeName"><string>publication:workflowAction</string></field>
	            <field name="documentTemplate"><boolean>false</boolean></field>
                    <field name="label"><string>Workflow Publication Action</string></field>
	            <field name="referencedView">
	              <collection type="java.util.ArrayList">
	                <value>
	                  <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$Template">
	                    <field name="templateFile"><string>/workflowActionView.gtmpl</string></field>
	                    <field name="roles"><string>*</string></field>
	                  </object>
	                </value>
	              </collection>
	            </field>
	            <field name="referencedDialog">
	              <collection type="java.util.ArrayList">
	                <value>
	                  <object type="org.exoplatform.services.cms.templates.impl.TemplateConfig$Template">
	                    <field name="templateFile"><string>/workflowActionDialog.gtmpl</string></field>
	                    <field name="roles"><string>*</string></field>
	                  </object>
	                </value>
	              </collection>
	            </field>
	          </object>
	        </value>
	      </collection>
	    </field>
	  </object>
	</object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

</configuration>
{code}


1 How to access a drive directly?
Since DMS 2.3, we support 4 ways to access File Explorer as "Selection", "Social", "Personal" and "Jailed".
This means, when you switch to use DSM 2.3 you should modify the portlet.xml file to make it work well.
{code:xml}
   <preference>
     <name>usecase</name>
     <value>selection</value>
     <read-only>false</read-only>
   </preference>
   <preference>
     <name>driveName</name>
     <value>Collaboration Center</value>
     <read-only>false</read-only>
   </preference>
{code}

By default the usecase is "selection" and you can select any drive to access File Explorer, in this case the driveName preference is not used. In the other cases, you should specify the driveName to access directly to the File Explorer.
See more details in [How to use access directly FE drive|How+to+use+access+directly+JCR+FE+drive]




h1. How to make BC publication aware?
When you create an instance of Content Browser, all documents are listed under the folder. But since DMS 2.3 we supported one more preference and you can decide which kind of documents should be displayed, publised documents only or every kind of documents.<br>

You can modify something in the portlet.xml file at location core/portlet/ecm/src/main/webapp/WEB-INF/ to use this new function.

{code:xml}
<preference>
   <name>isAllowPublish</name>
   <value>false</value>
   <read-only>false</read-only>
</preference>
{code}

See more detail in [Migration for CB_Migration+for+CB]

1 How to specify the root location of search in BC portlet?
When you make a search in BC portlet before, you can not specify the search location. So, we always execute this function at the current location. Since DMS 2.3, we improved this one and make it more powerful by support search with another one. Users can choose the place where they want to execute the search.

How can we do?
Make it easy by add preferences to portlet.xml file.
{code:xml}

<!--
  Enable search root location
-->
 <preference>
   <name>enableSearch</name>
   <value>false</value>
   <read-only>false</read-only>
 </preference>
<!--
 Specify the search root location. This preference affect only when enableSearch is true
 Notice: Have to specify the workspace name
-->
 <preference>
   <name>searchLocation</name>
   <value>collaboration:/Documents/Live</value>
   <read-only>false</read-only>
 </preference>
{code}

Anyway, you can refer to [this page|http://wiki.exoplatform.com/xwiki/bin/view/ECM/Specify+the+root+location+of+the+search+in+BC+portlet] to see more details.

h1. How to enable GadgetRegistryService?

In the file /exo.ecm.dms.core.web.portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
You have to add the configuration for GadgetRegistryService.
{code:xml}
  <component>
    <key>org.exoplatform.application.gadget.GadgetRegistryService</key>
    <type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type>
    <init-params>
     <properties-param>
       <name>developerInfo</name>
       <description>The group that is allowed to develop gadgets</description>
       <property name="developer.group" value="/platform/administrators"></property>
     </properties-param>
    </init-params>
  </component>
{code}

Of course, you can change the value of developer.group to make it correspond with your data.


