Liferay 7.0-ce-b4

com.liferay.portlet.exportimport.lar
Class ExportImportPathUtil

java.lang.Object
  extended by com.liferay.portlet.exportimport.lar.ExportImportPathUtil

@ProviderType
public class ExportImportPathUtil
extends Object

Provides utility methods for generating paths for entities being serialized with the portal's export/import framework.

Since:
6.2

Field Summary
static String PATH_PREFIX_COMPANY
          The company prefix used in generating paths.
static String PATH_PREFIX_GROUP
          The group prefix used in generating paths.
static String PATH_PREFIX_LAYOUT
          Deprecated. As of 7.0.0
static String PATH_PREFIX_PORTLET
          The portlet prefix used in generating paths.
static String PATH_PREFIX_SERVICE
          The service prefix used in generating paths.
 
Constructor Summary
ExportImportPathUtil()
           
 
Method Summary
static String getCompanyModelPath(long companyId, String className, long classPK)
           
static String getExpandoPath(String path)
          Returns the expando-specific path for the entity path.
static String getLayoutPath(PortletDataContext portletDataContext, long plid)
          Deprecated. As of 7.0.0, replaced by getModelPath(StagedModel)
static String getModelPath(long groupId, String className, long classPK)
          Returns a model path based on the group ID, class name, and class PK.
static String getModelPath(PortletDataContext portletDataContext, String className, long classPK)
          Returns a model path based on the group ID, class name, and class PK, where the group ID is queried from the portlet data context.
static String getModelPath(PortletDataContext portletDataContext, String className, long classPK, String dependentFileName)
          Returns a model path for the named file related to the entity, having the class name and class PK.
static String getModelPath(StagedModel stagedModel)
          Returns a model path for the staged model.
static String getModelPath(StagedModel stagedModel, String dependentFileName)
          Returns a model path for the named file related to the staged model.
protected static String getModelPath(String pathPrefix, long pathPrimaryKey, String className, Serializable primaryKeyObj, String dependentFileName)
           
protected static String getOwnerTypePath(int ownerType)
           
static String getPortletPath(PortletDataContext portletDataContext)
          Returns a portlet path for the portlet ID.
static String getPortletPath(PortletDataContext portletDataContext, String portletId)
          Returns a portlet path for the portlet ID.
static String getPortletPreferencesPath(PortletDataContext portletDataContext, String portletId, long ownerId, int ownerType, long plid)
           
static String getRootPath(PortletDataContext portletDataContext)
          Returns a root path, or fragment, of the model path based on the scope group ID from the portlet data context.
protected static String getRootPath(String pathPrefix, long pathPrimaryKey)
           
static String getServicePortletPreferencesPath(PortletDataContext portletDataContext, String serviceName, long ownerId, int ownerType)
           
static String getSourceLayoutPath(PortletDataContext portletDataContext, long layoutId)
          Deprecated. As of 7.0.0, replaced by getModelPath(PortletDataContext, String, long)
static String getSourcePortletPath(PortletDataContext portletDataContext, String portletId)
          Deprecated. As of 7.0.0, with no direct replacement
static String getSourceRootPath(PortletDataContext portletDataContext)
          Returns a source root path, or fragment, of the model path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_PREFIX_COMPANY

public static final String PATH_PREFIX_COMPANY
The company prefix used in generating paths.

See Also:
Constant Field Values

PATH_PREFIX_GROUP

public static final String PATH_PREFIX_GROUP
The group prefix used in generating paths.

See Also:
Constant Field Values

PATH_PREFIX_LAYOUT

@Deprecated
public static final String PATH_PREFIX_LAYOUT
Deprecated. As of 7.0.0
See Also:
Constant Field Values

PATH_PREFIX_PORTLET

public static final String PATH_PREFIX_PORTLET
The portlet prefix used in generating paths.

See Also:
Constant Field Values

PATH_PREFIX_SERVICE

public static final String PATH_PREFIX_SERVICE
The service prefix used in generating paths.

See Also:
Constant Field Values
Constructor Detail

ExportImportPathUtil

public ExportImportPathUtil()
Method Detail

getCompanyModelPath

public static String getCompanyModelPath(long companyId,
                                         String className,
                                         long classPK)

getExpandoPath

public static String getExpandoPath(String path)
Returns the expando-specific path for the entity path. The entity path must include an XML file.

For example, if you had the entity path of /group/10184/com.liferay.portlet.dynamicdatamapping.DDMStructure/10951.xml, the returned expando-specific path would be the following:

 
 /group/10184/com.liferay.portlet.dynamicdatamapping.DDMStructure/10951-expando.xml
 
 

Parameters:
path - the previously generated entity path
Returns:
the expando-specific path for the entity path

getLayoutPath

@Deprecated
public static String getLayoutPath(PortletDataContext portletDataContext,
                                              long plid)
Deprecated. As of 7.0.0, replaced by getModelPath(StagedModel)


getModelPath

public static String getModelPath(long groupId,
                                  String className,
                                  long classPK)
Returns a model path based on the group ID, class name, and class PK.

For example, a model path would resemble the following:

 
 /group/"groupId"/"className"/"classPK".xml
 
 

Parameters:
groupId - the group ID of the entity's group
className - the entity's class name
classPK - the primary key of the entity
Returns:
a model path based on the parameters

getModelPath

public static String getModelPath(PortletDataContext portletDataContext,
                                  String className,
                                  long classPK)
Returns a model path based on the group ID, class name, and class PK, where the group ID is queried from the portlet data context. This method uses the source group ID from the context.

For example, a model path would resemble the following:

 
 /group/"queried groupId"/"className"/"classPK".xml
 
 

Parameters:
portletDataContext - the context of the current export/import process
className - the entity's class name
classPK - the primary key of the entity
Returns:
a model path based on the parameters
See Also:
PortletDataContext.getSourceGroupId()

getModelPath

public static String getModelPath(PortletDataContext portletDataContext,
                                  String className,
                                  long classPK,
                                  String dependentFileName)
Returns a model path for the named file related to the entity, having the class name and class PK. The dependent object's file name is appended to the generated prefix.

For example, a model path would resemble the following:

 
 /group/"queried groupId"/"className"/"classPK"/"dependentFileName"
 
 

Parameters:
portletDataContext - the context of the current export/import process
className - the related entity's class name
classPK - the primary key of the related entity
dependentFileName - the dependent object's file name
Returns:
a model path for the entity's dependent object

getModelPath

public static String getModelPath(StagedModel stagedModel)
Returns a model path for the staged model. The group ID, class name, and class PK are queried from the staged model to generate the path.

For example, a model path would resemble the following:

 
 /group/"queried groupId"/"queried className"/"queried classPK".xml
 
 

Parameters:
stagedModel - the staged model the path is needed for
Returns:
a model path for the staged model
See Also:
StagedModel

getModelPath

public static String getModelPath(StagedModel stagedModel,
                                  String dependentFileName)
Returns a model path for the named file related to the staged model.

This method is useful, for example, for generating the path for an image related to a web content article. The staged model's attributes are used to generate the first part of the path; then the dependent object's file name is attached to the end of the path.

For example, a model path would resemble the following:

 
 /group/"queried groupId"/"queried className"/"queried classPK"/"dependentFileName"
 
 

Parameters:
stagedModel - the staged model the path is needed for
dependentFileName - the dependent object's file name
Returns:
a model path for the staged model's dependent object

getPortletPath

public static String getPortletPath(PortletDataContext portletDataContext)
Returns a portlet path for the portlet ID.

For example, a portlet path would resemble the following:

 
 /group/"queried groupId"/portlet/"portletId"
 
 

Parameters:
portletDataContext - the context of the current export/import process
Returns:
a portlet path for the portlet ID

getPortletPath

public static String getPortletPath(PortletDataContext portletDataContext,
                                    String portletId)
Returns a portlet path for the portlet ID.

For example, a portlet path would resemble the following:

 
 /group/"queried groupId"/portlet/"portletId"
 
 

Parameters:
portletDataContext - the context of the current export/import process
portletId - the portlet ID the path is being generated for
Returns:
a portlet path for the portlet ID

getPortletPreferencesPath

public static String getPortletPreferencesPath(PortletDataContext portletDataContext,
                                               String portletId,
                                               long ownerId,
                                               int ownerType,
                                               long plid)

getRootPath

public static String getRootPath(PortletDataContext portletDataContext)
Returns a root path, or fragment, of the model path based on the scope group ID from the portlet data context.

For example, a root path would resemble the following:

 
 /group/"queried groupId"
 
 

Parameters:
portletDataContext - the context of the current export/import process
Returns:
a root path, or fragment, of the model path
See Also:
PortletDataContext.getScopeGroupId(), getSourceRootPath(PortletDataContext)

getServicePortletPreferencesPath

public static String getServicePortletPreferencesPath(PortletDataContext portletDataContext,
                                                      String serviceName,
                                                      long ownerId,
                                                      int ownerType)

getSourceLayoutPath

@Deprecated
public static String getSourceLayoutPath(PortletDataContext portletDataContext,
                                                    long layoutId)
Deprecated. As of 7.0.0, replaced by getModelPath(PortletDataContext, String, long)


getSourcePortletPath

@Deprecated
public static String getSourcePortletPath(PortletDataContext portletDataContext,
                                                     String portletId)
Deprecated. As of 7.0.0, with no direct replacement


getSourceRootPath

public static String getSourceRootPath(PortletDataContext portletDataContext)
Returns a source root path, or fragment, of the model path. This method is called by the getRootPath(PortletDataContext) method. The fragment is generated with the source group ID from the portlet data context. This helper method is useful during the import process.

For example, a source root path would resemble the following:

 
 /group/"queried groupId"
 
 

Parameters:
portletDataContext - the context of the current export/import process
Returns:
a path fragment
See Also:
PortletDataContext.getSourceGroupId()

getModelPath

protected static String getModelPath(String pathPrefix,
                                     long pathPrimaryKey,
                                     String className,
                                     Serializable primaryKeyObj,
                                     String dependentFileName)

getOwnerTypePath

protected static String getOwnerTypePath(int ownerType)

getRootPath

protected static String getRootPath(String pathPrefix,
                                    long pathPrimaryKey)

Liferay 7.0-ce-b4