本文整理汇总了Java中com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil类的典型用法代码示例。如果您正苦于以下问题:Java StagedModelDataHandlerUtil类的具体用法?Java StagedModelDataHandlerUtil怎么用?Java StagedModelDataHandlerUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StagedModelDataHandlerUtil类属于com.liferay.exportimport.kernel.lar包,在下文中一共展示了StagedModelDataHandlerUtil类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doImportData
import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil; //导入依赖的package包/类
@Override
protected PortletPreferences doImportData(PortletDataContext portletDataContext, String portletId,
PortletPreferences portletPreferences, String data) throws Exception {
if (!portletDataContext.getBooleanParameter(NAMESPACE, "task-records")) {
return null;
}
portletDataContext.importPortletPermissions(TimetrackerPortletPermission.RESOURCE_NAME);
Element entriesElement = portletDataContext.getImportDataGroupElement(TaskRecord.class);
List<Element> entryElements = entriesElement.elements();
for (Element entryElement : entryElements) {
StagedModelDataHandlerUtil.importStagedModel(portletDataContext, entryElement);
}
return null;
}
示例2: doImportData
import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil; //导入依赖的package包/类
@Override
protected PortletPreferences doImportData(PortletDataContext portletDataContext, String portletId,
PortletPreferences portletPreferences, String data) throws Exception {
if (!portletDataContext.getBooleanParameter(NAMESPACE, "contacts")) {
return null;
}
portletDataContext.importPortletPermissions(ContactManagerPortletPermission.RESOURCE_NAME);
Element entriesElement = portletDataContext.getImportDataGroupElement(Contact.class);
List<Element> entryElements = entriesElement.elements();
for (Element entryElement : entryElements) {
StagedModelDataHandlerUtil.importStagedModel(portletDataContext, entryElement);
}
return null;
}
示例3: getExportActionableDynamicQuery
import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil; //导入依赖的package包/类
@Override
public ExportActionableDynamicQuery getExportActionableDynamicQuery(
final PortletDataContext portletDataContext) {
final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
@Override
public long performCount() throws PortalException {
ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
StagedModelType stagedModelType = getStagedModelType();
long modelAdditionCount = super.performCount();
manifestSummary.addModelAdditionCount(stagedModelType,
modelAdditionCount);
long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
stagedModelType);
manifestSummary.addModelDeletionCount(stagedModelType,
modelDeletionCount);
return modelAdditionCount;
}
};
initActionableDynamicQuery(exportActionableDynamicQuery);
exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
@Override
public void addCriteria(DynamicQuery dynamicQuery) {
portletDataContext.addDateRangeCriteria(dynamicQuery,
"modifiedDate");
}
});
exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Foo>() {
@Override
public void performAction(Foo foo) throws PortalException {
StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
foo);
}
});
exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
PortalUtil.getClassNameId(Foo.class.getName())));
return exportActionableDynamicQuery;
}