info.magnolia.dam.setup.migration
Class DamMigrationUtil

java.lang.Object
  extended by info.magnolia.dam.setup.migration.DamMigrationUtil

public class DamMigrationUtil
extends Object

Utility methods used in migration tasks.


Constructor Summary
DamMigrationUtil()
           
 
Method Summary
static String buildI18nSuffixPropertyName(String propertyName, String propertyNameSuffix)
          Based on propertyName build a i18n suffixed property name.
- if the propertyName has no local suffix (myPropertyName)
return propertyName+propertyNameSufix (propertyNamepropertyNameSufix)
- if the propertyName has a valid i18n suffix (myPropertyName_en)
return propertyName+propertyNameSufix + i18n suffix (propertyNamepropertyNameSufix_en).
static String getI18nLocalBasedOnPropertyName(String propertyName)
           
static String getPropertyNameWithoutLocalSuffix(String propertyName)
           
static boolean isPropertyNameI18nBased(String propertyName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DamMigrationUtil

public DamMigrationUtil()
Method Detail

buildI18nSuffixPropertyName

public static String buildI18nSuffixPropertyName(String propertyName,
                                                 String propertyNameSuffix)
Based on propertyName build a i18n suffixed property name.
- if the propertyName has no local suffix (myPropertyName)
return propertyName+propertyNameSufix (propertyNamepropertyNameSufix)
- if the propertyName has a valid i18n suffix (myPropertyName_en)
return propertyName+propertyNameSufix + i18n suffix (propertyNamepropertyNameSufix_en).

Parameters:
propertyName - root property name.
propertyNameSufix - suffix to add to the property name
Returns:

isPropertyNameI18nBased

public static boolean isPropertyNameI18nBased(String propertyName)
Returns:
true if the property define a valid i18n suffix (image_en -->true, image_cxssw -->false).

getI18nLocalBasedOnPropertyName

public static String getI18nLocalBasedOnPropertyName(String propertyName)
Parameters:
propertyName - (propertyName_en return en, propertyName return null)
Returns:
the local of the property id it's a i18n propertyName. Null otherwise

getPropertyNameWithoutLocalSuffix

public static String getPropertyNameWithoutLocalSuffix(String propertyName)


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.