@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; } }
private PortletDataException _handleException( Exception e, int type, String portletId) { PortletDataException pde = null; if (e instanceof PortletDataException) { pde = (PortletDataException)e; } else { pde = new PortletDataException(e.getMessage(), e); } if (Validator.isNull(pde.getPortletId())) { pde.setPortletId(portletId); } if (pde.getType() == PortletDataException.DEFAULT) { pde.setType(type); } return pde; }
@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); } }
PortletDataException pde = new PortletDataException(pe); pde.setPortletId(MBPortletKeys.MESSAGE_BOARDS); pde.setType(PortletDataException.EXPORT_PORTLET_PERMISSIONS); PortletDataException pde = new PortletDataException(pe); pde.setPortletId(MBPortletKeys.MESSAGE_BOARDS); pde.setType(PortletDataException.EXPORT_PORTLET_DATA);
String referrerClassName = pde.getStagedModelClassName(); String referrerDisplayName = pde.getStagedModelDisplayName(); if (pde.getType() == PortletDataException.COMPANY_BEING_DELETED) { errorMessage = LanguageUtil.format( resourceBundle, "unable-to-create-a-portlet-data-context-for-company-x-" + "because-it-is-being-deleted", String.valueOf(pde.getCompanyId())); else if (pde.getType() == PortletDataException.DELETE_PORTLET_DATA) { if (Validator.isNotNull(pde.getLocalizedMessage())) { errorMessage = LanguageUtil.format( locale, "has-stopped-the-process-x", new String[] { _portal.getPortletTitle(pde.getPortletId(), locale), pde.getLocalizedMessage() }, false); "has-stopped-the-process", new String[] { _portal.getPortletTitle(pde.getPortletId(), locale) }, false);
protected Element getExportDataGroupElement(String name) { if (_exportDataRootElement == null) { PortletDataException pde = new PortletDataException( PortletDataException.EXPORT_DATA_GROUP_ELEMENT); pde.setStagedModelClassName(name); throw new SystemException(pde); } Element groupElement = _exportDataRootElement.element(name); if (groupElement == null) { groupElement = _exportDataRootElement.addElement(name); } return groupElement; }
if (pde.getCause() instanceof NullPointerException) { findReference = true; PortletDataException pde = new PortletDataException(); pde.setStagedModel(stagedModel); pde.setType(PortletDataException.MISSING_REFERENCE);
PortletDataException pde = new PortletDataException( PortletDataException.COMPANY_BEING_DELETED, e); pde.setCompanyId(companyId); PortletDataException pde = new PortletDataException( PortletDataException.COMPANY_BEING_DELETED, e); pde.setCompanyId(companyId);
/** * @deprecated As of Judson (7.1.x) */ @Deprecated @Override public PortletPreferences processImportPortletPreferences( PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) throws PortletDataException { try { return doProcessImportPortletPreferences( portletDataContext, portletId, portletPreferences); } catch (PortletDataException pde) { throw pde; } catch (Exception e) { throw new PortletDataException(e); } }
PortletDataException pde = new PortletDataException(pe); pde.setPortletId(MBPortletKeys.MESSAGE_BOARDS); pde.setType(PortletDataException.IMPORT_PORTLET_PERMISSIONS);
protected Element getImportDataGroupElement(String name) { if (_importDataRootElement == null) { PortletDataException pde = new PortletDataException( PortletDataException.IMPORT_DATA_GROUP_ELEMENT); pde.setStagedModelClassName(name); throw new SystemException(pde); } if (Validator.isNull(name)) { return SAXReaderUtil.createElement("EMPTY-ELEMENT"); } Element groupElement = (Element)_importDataRootElement.selectSingleNode( ".//" + name); if (groupElement == null) { return SAXReaderUtil.createElement("EMPTY-ELEMENT"); } return groupElement; }
protected void validateExport( PortletDataContext portletDataContext, T stagedModel) throws PortletDataException { if (stagedModel instanceof TrashedModel) { TrashedModel trashedModel = (TrashedModel)stagedModel; if (trashedModel.isInTrash()) { PortletDataException pde = new PortletDataException( PortletDataException.STATUS_IN_TRASH); pde.setStagedModelDisplayName(getDisplayName(stagedModel)); pde.setStagedModelClassName(stagedModel.getModelClassName()); pde.setStagedModelClassPK( GetterUtil.getString(stagedModel.getPrimaryKeyObj())); throw pde; } } if (!portletDataContext.isInitialPublication() && (stagedModel instanceof WorkflowedModel)) { WorkflowedModel workflowedModel = (WorkflowedModel)stagedModel; if (!ArrayUtil.contains( getExportableStatuses(), workflowedModel.getStatus())) { PortletDataException pde = new PortletDataException( PortletDataException.STATUS_UNAVAILABLE); pde.setStagedModelDisplayName(getDisplayName(stagedModel)); pde.setStagedModelClassName(stagedModel.getModelClassName()); pde.setStagedModelClassPK( GetterUtil.getString(stagedModel.getPrimaryKeyObj())); throw pde; } } }
/** * @deprecated As of Judson (7.1.x) */ @Deprecated @Override public PortletPreferences processExportPortletPreferences( PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) throws PortletDataException { try { return doProcessExportPortletPreferences( portletDataContext, portletId, portletPreferences); } catch (PortletDataException pde) { throw pde; } catch (Exception e) { throw new PortletDataException(e); } }
PortletDataException pde = new PortletDataException( t.getMessage(), t); pde.setStagedModelDisplayName(getDisplayName(stagedModel)); pde.setStagedModelClassName(stagedModel.getModelClassName()); pde.setStagedModelClassPK( GetterUtil.getString(stagedModel.getPrimaryKeyObj())); pde.setType(PortletDataException.MISSING_DEPENDENCY); pde.setType(PortletDataException.EXPORT_STAGED_MODEL);
@Override public PortletPreferences addDefaultData( PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) throws PortletDataException { long startTime = 0; if (_log.isInfoEnabled()) { _log.info("Adding default data to portlet " + portletId); startTime = System.currentTimeMillis(); } try { return doAddDefaultData( portletDataContext, portletId, portletPreferences); } catch (PortletDataException pde) { throw pde; } catch (Exception e) { throw new PortletDataException(e); } finally { if (_log.isInfoEnabled()) { long duration = System.currentTimeMillis() - startTime; _log.info( "Added default data to portlet in " + Time.getDuration(duration)); } } }
PortletDataException pde = new PortletDataException( t.getMessage(), t); pde.setStagedModelDisplayName(getDisplayName(stagedModel)); pde.setStagedModelClassName(stagedModel.getModelClassName()); pde.setStagedModelClassPK( GetterUtil.getString(stagedModel.getPrimaryKeyObj())); pde.setType(PortletDataException.MISSING_DEPENDENCY); pde.setType(PortletDataException.IMPORT_STAGED_MODEL);
protected void validateDateRange(Date startDate, Date endDate) throws PortletDataException { if ((startDate == null) && (endDate != null)) { throw new PortletDataException( PortletDataException.END_DATE_IS_MISSING_START_DATE); } else if ((startDate != null) && (endDate == null)) { throw new PortletDataException( PortletDataException.START_DATE_IS_MISSING_END_DATE); } if (startDate != null) { if (startDate.after(endDate) || startDate.equals(endDate)) { throw new PortletDataException( PortletDataException.START_DATE_AFTER_END_DATE); } Date now = new Date(); if (startDate.after(now)) { throw new PortletDataException( PortletDataException.FUTURE_START_DATE); } if (endDate.after(now)) { throw new PortletDataException( PortletDataException.FUTURE_END_DATE); } } }
@Override protected void validateExport( PortletDataContext portletDataContext, DDMFormInstanceRecord record) throws PortletDataException { int status = WorkflowConstants.STATUS_ANY; try { status = record.getStatus(); } catch (Exception e) { throw new PortletDataException(e); } if (!portletDataContext.isInitialPublication() && !ArrayUtil.contains(getExportableStatuses(), status)) { PortletDataException pde = new PortletDataException( PortletDataException.STATUS_UNAVAILABLE); pde.setStagedModelDisplayName(record.getUuid()); pde.setStagedModelClassName(record.getModelClassName()); pde.setStagedModelClassPK( GetterUtil.getString(record.getFormInstanceRecordId())); throw pde; } }
throw new PortletDataException( "Unable to create portlet data context for the import " + "process because of an invalid LAR manifest",
throw new PortletDataException( "Unable to import service preferences for portlet " + portletDataContext.getPortletId(),