Difference between revisions of "Migration from 4.0 to 4.1"

From OpenKM Documentation
Jump to: navigation, search
Line 7: Line 7:
 
* Rename your my_groups.cnd (perhaps you file has other name, but the extension should be .cnd) to PropertyGroups.cnd
 
* Rename your my_groups.cnd (perhaps you file has other name, but the extension should be .cnd) to PropertyGroups.cnd
  
* Remember that in OpenKM 4.0 the Property Groups definitions was splitted in two files: the metadata description and the translations. Create a file PropertyGroups.xml which contents should be the combination of old PropertyGroupValues.properties  
+
* Remember that in OpenKM 4.0 the Property Groups definitions was splitted in two files: the metadata description and the translations. Create a file PropertyGroups.xml which contents should be the combination of old PropertyGroupValues.properties (metadata description) and PropertyGroupsBundle.properties (translations) in the new XML-based format. Refer to [[Property Groups definition]] for more info on this format.
(metadata description) and PropertyGroupsBundle.properties (translations) in the new XML-based format. Refer to [[Property Groups definition]] for more info on this format.
 
  
 
* These are the equivalences:
 
* These are the equivalences:
Line 27: Line 26:
  
 
{{Note|You don't have to register your Property Groups again.}}
 
{{Note|You don't have to register your Property Groups again.}}
 +
 +
== Example of conversion ==
 +
 +
* '''my_groups.cnd'''
 +
<source lang="text">
 +
<okm = 'http://www.openkm.org/1.0'>
 +
<okg = 'http://www.openkm.org/group/1.0'>
 +
<okp = 'http://www.openkm.org/group/property/1.0'>
 +
 +
[okg:tecnologia] mixin
 +
- okp:tecnologia.tipo (string) = '' multiple autocreated
 +
- okp:tecnologia.lenguaje (string) = '' autocreated
 +
- okp:tecnologia.descripcion (string) = '' autocreated
 +
- okp:tecnologia.comentario (string) = '' autocreated
 +
</source>
 +
 +
* '''PropertyGroupValues.properties'''
 +
<source lang="java">
 +
# Tecnología
 +
okp\:tecnologia.tipo=0,4,uno,dos,tres
 +
okp\:tecnologia.lenguaje=1,3,java,c,c#,c++,python
 +
okp\:tecnologia.descripcion=2,1
 +
okp\:tecnologia.comentario=3,2
 +
</source>
 +
 +
* '''PropertyGroupBundle.properties'''
 +
<source lang="java">
 +
# Tecnología
 +
okg\:tecnologia=Tecnología
 +
okp\:tecnologia.tipo=Tipo
 +
okp\:tecnologia.tipo.uno=Tipo Uno
 +
okp\:tecnologia.tipo.dos=Tipo Dos
 +
okp\:tecnologia.tipo.tres=Tipo Tres
 +
okp\:tecnologia.lenguaje=Lenguaje
 +
okp\:tecnologia.lenguaje.java=Java
 +
okp\:tecnologia.lenguaje.c=C
 +
okp\:tecnologia.lenguaje.c++=C++
 +
okp\:tecnologia.lenguaje.python=Python
 +
okp\:tecnologia.descripcion=Descripción
 +
okp\:tecnologia.comentario=Comentario
 +
</source>
 +
 +
Should be migrated to:
 +
 +
* '''PropertyGroups.cnd''' (content unchanged, because is the same)
 +
<source lang="text">
 +
<okm = 'http://www.openkm.org/1.0'>
 +
<okg = 'http://www.openkm.org/group/1.0'>
 +
<okp = 'http://www.openkm.org/group/property/1.0'>
 +
 +
[okg:tecnologia] mixin
 +
- okp:tecnologia.tipo (string) = '' multiple autocreated
 +
- okp:tecnologia.lenguaje (string) = '' autocreated
 +
- okp:tecnologia.descripcion (string) = '' autocreated
 +
- okp:tecnologia.comentario (string) = '' autocreated
 +
</source>
 +
 +
* '''PropertyGroups.xml'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 1.0//EN"
 +
                                "http://www.openkm.com/dtd/property-groups-1.0.dtd">
 +
<property-groups>
 +
 +
  <!-- Tecnología -->
 +
  <property-group label="Tecnología" name="okg:tecnologia">
 +
    <select label="Tipo" name="okp:tecnologia.tipo" type="multiple">
 +
      <option label="Tipo Uno" value="okp:tecnologia.tipo.uno" />
 +
      <option label="Tipo Dos" value="okp:tecnologia.tipo.dos" />
 +
      <option label="Tipo Tres" value="okp:tecnologia.tipo.tres" />
 +
    </select>
 +
    <select label="Lenguaje" name="okp:tecnologia.lenguaje" type="simple">
 +
      <option label="Java" value="okp:tecnologia.lenguaje.java" />
 +
      <option label="C" value="okp:tecnologia.lenguaje.c" />
 +
      <option label="C++" value="okp:tecnologia.lenguaje.c++" />
 +
      <option label="Python" value="okp:tecnologia.lenguaje.python" />
 +
    </select>
 +
    <input label="Descripcion" name="okp:tecnologia.descripcion" />
 +
    <textarea label="Description" name="okp:tecnologia.comentario" />
 +
  </property-group>
 +
 +
</property-groups>
 +
</source>
  
 
[[Category: Migration Guide]]
 
[[Category: Migration Guide]]

Revision as of 09:45, 28 April 2010


Nota advertencia.png This migration process is under revision, don't try until OpenKM 4.1 is released.

  • Stop the JBoss server.
  • Make a backup of your current repository and configuration files... because Murphy's laws :)
  • Rename your my_groups.cnd (perhaps you file has other name, but the extension should be .cnd) to PropertyGroups.cnd
  • Remember that in OpenKM 4.0 the Property Groups definitions was splitted in two files: the metadata description and the translations. Create a file PropertyGroups.xml which contents should be the combination of old PropertyGroupValues.properties (metadata description) and PropertyGroupsBundle.properties (translations) in the new XML-based format. Refer to Property Groups definition for more info on this format.
  • These are the equivalences:
Type XML
1 <input label="xxx" name="okp:yyy" />
2 <textarea label="xxx" name="okp:yyy" />
3 <select label="xxx" name="okp:yyy" type="simple">
    <option label="xxx" value="yyy" />
    ...
</select>
4 <select label="xxx" name="okp:yyy" type="multiple">
    <option label="xxx" value="yyy" />
    ...
</select>
  • Starts the JBoss server again.

Nota clasica.png You don't have to register your Property Groups again.

Example of conversion

  • my_groups.cnd
<okm = 'http://www.openkm.org/1.0'>
<okg = 'http://www.openkm.org/group/1.0'>
<okp = 'http://www.openkm.org/group/property/1.0'>

[okg:tecnologia] mixin
- okp:tecnologia.tipo (string) = '' multiple autocreated
- okp:tecnologia.lenguaje (string) = '' autocreated
- okp:tecnologia.descripcion (string) = '' autocreated
- okp:tecnologia.comentario (string) = '' autocreated
  • PropertyGroupValues.properties
# Tecnología
okp\:tecnologia.tipo=0,4,uno,dos,tres
okp\:tecnologia.lenguaje=1,3,java,c,c#,c++,python
okp\:tecnologia.descripcion=2,1
okp\:tecnologia.comentario=3,2
  • PropertyGroupBundle.properties
# Tecnología
okg\:tecnologia=Tecnología
okp\:tecnologia.tipo=Tipo
okp\:tecnologia.tipo.uno=Tipo Uno
okp\:tecnologia.tipo.dos=Tipo Dos
okp\:tecnologia.tipo.tres=Tipo Tres
okp\:tecnologia.lenguaje=Lenguaje
okp\:tecnologia.lenguaje.java=Java
okp\:tecnologia.lenguaje.c=C
okp\:tecnologia.lenguaje.c++=C++
okp\:tecnologia.lenguaje.python=Python
okp\:tecnologia.descripcion=Descripción
okp\:tecnologia.comentario=Comentario

Should be migrated to:

  • PropertyGroups.cnd (content unchanged, because is the same)
<okm = 'http://www.openkm.org/1.0'>
<okg = 'http://www.openkm.org/group/1.0'>
<okp = 'http://www.openkm.org/group/property/1.0'>

[okg:tecnologia] mixin
- okp:tecnologia.tipo (string) = '' multiple autocreated
- okp:tecnologia.lenguaje (string) = '' autocreated
- okp:tecnologia.descripcion (string) = '' autocreated
- okp:tecnologia.comentario (string) = '' autocreated
  • PropertyGroups.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 1.0//EN"
                                 "http://www.openkm.com/dtd/property-groups-1.0.dtd">
<property-groups>

  <!-- Tecnología -->
  <property-group label="Tecnología" name="okg:tecnologia">
    <select label="Tipo" name="okp:tecnologia.tipo" type="multiple">
      <option label="Tipo Uno" value="okp:tecnologia.tipo.uno" />
      <option label="Tipo Dos" value="okp:tecnologia.tipo.dos" />
      <option label="Tipo Tres" value="okp:tecnologia.tipo.tres" />
    </select>
    <select label="Lenguaje" name="okp:tecnologia.lenguaje" type="simple">
      <option label="Java" value="okp:tecnologia.lenguaje.java" />
      <option label="C" value="okp:tecnologia.lenguaje.c" />
      <option label="C++" value="okp:tecnologia.lenguaje.c++" />
      <option label="Python" value="okp:tecnologia.lenguaje.python" />
    </select>
    <input label="Descripcion" name="okp:tecnologia.descripcion" />
    <textarea label="Description" name="okp:tecnologia.comentario" />
  </property-group>

</property-groups>