Class ExportImportPathUtil
- Since:
- 6.2
- Author:
- Máté Thurzó, Daniel Kocsis
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetCompanyModelPath(long companyId, String className, long classPK) static StringgetCompanyModelPath(long companyId, String className, Serializable classPK) static StringgetExpandoPath(String path) Returns the expando-specific path for the entity path.static StringgetModelPath(long groupId, String className, long classPK) static StringgetModelPath(long groupId, String className, Serializable classPK) Returns a model path based on the group ID, class name, and class PK.static StringgetModelPath(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 StringgetModelPath(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 StringgetModelPath(StagedModel stagedModel) Returns a model path for the staged model.static StringgetModelPath(StagedModel stagedModel, String dependentFileName) Returns a model path for the named file related to the staged model.protected static StringgetModelPath(String pathPrefix, long pathPrimaryKey, String className, Serializable primaryKeyObj, String dependentFileName) protected static StringgetOwnerTypePath(int ownerType) static StringgetPortletDataPath(PortletDataContext portletDataContext) static StringgetPortletDataPath(PortletDataContext portletDataContext, String portletId, long plid) static StringgetPortletPath(PortletDataContext portletDataContext) Returns a portlet path for the portlet ID.static StringgetPortletPath(PortletDataContext portletDataContext, String portletId) Returns a portlet path for the portlet ID.static StringgetPortletPreferencesPath(PortletDataContext portletDataContext, String portletId, long ownerId, int ownerType, long plid) static StringgetRootPath(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 StringgetRootPath(String pathPrefix, long pathPrimaryKey) static StringgetServicePortletPreferencesPath(PortletDataContext portletDataContext, String serviceName, long ownerId, int ownerType) static StringgetSourceRootPath(PortletDataContext portletDataContext) Returns a source root path, or fragment, of the model path.
-
Field Details
-
PATH_PREFIX_COMPANY
The company prefix used in generating paths.- See Also:
-
PATH_PREFIX_GROUP
The group prefix used in generating paths.- See Also:
-
PATH_PREFIX_PORTLET
The portlet prefix used in generating paths.- See Also:
-
PATH_PREFIX_SERVICE
The service prefix used in generating paths.- See Also:
-
-
Constructor Details
-
ExportImportPathUtil
public ExportImportPathUtil()
-
-
Method Details
-
getCompanyModelPath
-
getCompanyModelPath
-
getExpandoPath
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.dynamic.data.mapping.kernel.DDMStructure/10951.xml, the returned expando-specific path would be the following:/group/10184/com.liferay.dynamic.data.mapping.kernel.DDMStructure/10951-expando.xml- Parameters:
path- the previously generated entity path- Returns:
- the expando-specific path for the entity path
-
getModelPath
-
getModelPath
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 groupclassName- the entity's class nameclassPK- 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 processclassName- the entity's class nameclassPK- the primary key of the entity- Returns:
- a model path based on the parameters
- See Also:
-
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 processclassName- the related entity's class nameclassPK- the primary key of the related entitydependentFileName- the dependent object's file name- Returns:
- a model path for the entity's dependent object
-
getModelPath
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:
-
getModelPath
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 fordependentFileName- the dependent object's file name- Returns:
- a model path for the staged model's dependent object
-
getPortletDataPath
-
getPortletDataPath
public static String getPortletDataPath(PortletDataContext portletDataContext, String portletId, long plid) -
getPortletPath
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
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 processportletId- 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
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:
-
getServicePortletPreferencesPath
public static String getServicePortletPreferencesPath(PortletDataContext portletDataContext, String serviceName, long ownerId, int ownerType) -
getSourceRootPath
Returns a source root path, or fragment, of the model path. This method is called by thegetRootPath(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:
-
getModelPath
protected static String getModelPath(String pathPrefix, long pathPrimaryKey, String className, Serializable primaryKeyObj, String dependentFileName) -
getOwnerTypePath
-
getRootPath
-