protected boolean validateMissingReference(String uuid, long groupId) { T existingStagedModel = fetchMissingReference(uuid, groupId); if (existingStagedModel == null) { return false; } return true; }
@Override public void importMissingReference( PortletDataContext portletDataContext, String uuid, long groupId, long classPK) throws PortletDataException { try { doImportMissingReference( portletDataContext, uuid, groupId, classPK); } catch (PortletDataException pde) { throw pde; } catch (Exception e) { throw new PortletDataException(e); } }
ExportImportLifecycleConstants. EVENT_STAGED_MODEL_IMPORT_STARTED, getProcessFlag(), portletDataContext.getExportImportProcessId(), PortletDataContextFactoryUtil.clonePortletDataContext( portletDataContext), restoreStagedModel(portletDataContext, stagedModel); importAssetCategories(portletDataContext, stagedModel); importAssetTags(portletDataContext, stagedModel); importReferenceStagedModels(portletDataContext, stagedModel); doImportStagedModel(portletDataContext, stagedModel); importComments(portletDataContext, stagedModel); importRatings(portletDataContext, stagedModel); ExportImportLifecycleConstants. EVENT_STAGED_MODEL_IMPORT_SUCCEEDED, getProcessFlag(), portletDataContext.getExportImportProcessId(), PortletDataContextFactoryUtil.clonePortletDataContext( portletDataContext), ExportImportLifecycleManagerUtil.fireExportImportLifecycleEvent( ExportImportLifecycleConstants.EVENT_STAGED_MODEL_IMPORT_FAILED, getProcessFlag(), portletDataContext.getExportImportProcessId(), PortletDataContextFactoryUtil.clonePortletDataContext( portletDataContext),
validateExport(portletDataContext, stagedModel); ExportImportLifecycleConstants. EVENT_STAGED_MODEL_EXPORT_STARTED, getProcessFlag(), portletDataContext.getExportImportProcessId(), PortletDataContextFactoryUtil.clonePortletDataContext( portletDataContext), doExportStagedModel(portletDataContext, (T)stagedModel.clone()); exportAssetCategories(portletDataContext, stagedModel); exportAssetTags(portletDataContext, stagedModel); exportComments(portletDataContext, stagedModel); exportRatings(portletDataContext, stagedModel); if (countStagedModel(portletDataContext, stagedModel)) { manifestSummary.incrementModelAdditionCount( stagedModel.getStagedModelType()); ExportImportLifecycleConstants. EVENT_STAGED_MODEL_EXPORT_SUCCEEDED, getProcessFlag(), portletDataContext.getExportImportProcessId(), PortletDataContextFactoryUtil.clonePortletDataContext( portletDataContext), ExportImportLifecycleManagerUtil.fireExportImportLifecycleEvent( ExportImportLifecycleConstants.EVENT_STAGED_MODEL_EXPORT_FAILED, getProcessFlag(), portletDataContext.getExportImportProcessId(), PortletDataContextFactoryUtil.clonePortletDataContext(
T existingStagedModel = fetchStagedModelByUuidAndGroupId(uuid, groupId); !isStagedModelInTrash(existingStagedModel)) { existingStagedModel = fetchStagedModelByUuidAndGroupId( uuid, group.getGroupId()); !isStagedModelInTrash(existingStagedModel)) { List<T> existingStagedModels = fetchStagedModelsByUuidAndCompanyId( uuid, originalGroup.getCompanyId()); !isStagedModelInTrash(stagedModel)) { else if (!isStagedModelInTrash(stagedModel)) { return stagedModel;
@Override public void restoreStagedModel( PortletDataContext portletDataContext, T stagedModel) throws PortletDataException { try { if (stagedModel instanceof TrashedModel) { doRestoreStagedModel(portletDataContext, stagedModel); } } catch (PortletDataException pde) { throw pde; } catch (Exception e) { PortletDataException pde = new PortletDataException(e); pde.setStagedModelDisplayName(getDisplayName(stagedModel)); pde.setStagedModelClassName(stagedModel.getModelClassName()); pde.setStagedModelClassPK( GetterUtil.getString(stagedModel.getPrimaryKeyObj())); throw pde; } }
@Override public T fetchStagedModelByUuidAndGroupId(String uuid, long groupId) { StagedModelRepository<T> stagedModelRepository = getStagedModelRepository(); if (stagedModelRepository == null) { return super.fetchStagedModelByUuidAndGroupId(uuid, groupId); } return stagedModelRepository.fetchStagedModelByUuidAndGroupId( uuid, groupId); }
@Override public void restoreStagedModel( PortletDataContext portletDataContext, T stagedModel) throws PortletDataException { StagedModelRepository<T> stagedModelRepository = getStagedModelRepository(); if (stagedModelRepository == null) { super.restoreStagedModel(portletDataContext, stagedModel); return; } stagedModelRepository.restoreStagedModel( portletDataContext, stagedModel); }
@Override public T fetchMissingReference(String uuid, long groupId) { StagedModelRepository<T> stagedModelRepository = getStagedModelRepository(); if (stagedModelRepository == null) { return super.fetchMissingReference(uuid, groupId); } return stagedModelRepository.fetchMissingReference(uuid, groupId); }
@Override public void importMissingReference( PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException { try { doImportMissingReference(portletDataContext, referenceElement); } catch (Exception e) { if (!StringUtil.equalsIgnoreCase( referenceElement.attributeValue("type"), PortletDataContext.REFERENCE_TYPE_DEPENDENCY_DISPOSABLE)) { throw e; } } }