/** * @see java.lang.Throwable#getMessage() */ @Override public String getMessage() { return getLocalizedMessage(); }
/** * @see org.opencms.gwt.shared.rpc.I_CmsVfsService#getSitePath(org.opencms.util.CmsUUID) */ public String getSitePath(CmsUUID structureId) { try { CmsResource resource = getCmsObject().readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION); return getCmsObject().getSitePath(resource); } catch (CmsException e) { if (LOG.isWarnEnabled()) { LOG.warn(e.getMessageContainer(), e); } } return null; }
/** * Creates a copied instance of this localized exception.<p> * * @param container the message container * @param cause the root cause * * @return a copied instance of this localized exception */ public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsException(container, cause); }
/** * Tries to convert a CmsException to the matching exception type from JLAN.<p> * * @param e the exception to convert * @return the converted exception */ public static IOException convertCmsException(CmsException e) { LOG.error(e.getLocalizedMessage(), e); if (e instanceof CmsSecurityException) { return new AccessDeniedException(e.getMessage(), e); } else if (e instanceof CmsVfsResourceAlreadyExistsException) { return new FileExistsException("File exists: " + e); } else if (e instanceof CmsVfsResourceNotFoundException) { return new FileNotFoundException("File does not exist: " + e); } else { return new IOException(e); } }
/** * Creates a new helper object.<p> * * @param cms the cms object * @param publishList a publish list to validate */ public CmsRelationPublishValidator(CmsObject cms, CmsPublishList publishList) { try { m_cms = OpenCms.initCmsObject(cms); } catch (CmsException e) { m_cms = cms; } try { m_brokenRelations = OpenCms.getPublishManager().validateRelations(m_cms, publishList, null); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); throw new CmsRuntimeException(e.getMessageContainer(), e); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); throw new RuntimeException(e.getLocalizedMessage()); } }
/** * @see org.opencms.search.CmsSearchIndex#addConfigurationParameter(java.lang.String, java.lang.String) */ @Override public void addConfigurationParameter(String key, String value) { if (POST_PROCESSOR.equals(key)) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { setPostProcessor((I_CmsSolrPostSearchProcessor)Class.forName(value).newInstance()); } catch (Exception e) { CmsException ex = new CmsException( Messages.get().container(Messages.LOG_SOLR_ERR_POST_PROCESSOR_NOT_EXIST_1, value), e); LOG.error(ex.getMessage(), ex); } } } super.addConfigurationParameter(key, value); }
StringBuffer msg = new StringBuffer("<!--\n").append(cmex.getLocalizedMessage()).append("\n"); cmex.printStackTrace(writer); msg.append(stackTrace.toString()).append("\n-->"); result = msg.toString();
/** * Creates the html code for the given error message and the * provided Exception.<p> * * @param errorMsg the error message to place in the html code * @param t the exception to add to the error message * * @return the html code for the error message */ private String createError(String errorMsg, Throwable t) { StringBuffer msg = new StringBuffer(); msg.append(errorMsg); msg.append("\n"); msg.append(t.getMessage()); msg.append("\n"); msg.append(CmsException.getStackTraceAsString(t)); return createError(msg.toString()); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() throws IOException, ServletException { if (getParamListAction().equals(LIST_ACTION_RESTORE)) { try { performRestoreOperation(); Map params = new HashMap(); params.put(PARAM_ACTION, DIALOG_INITIAL); getToolManager().jspForwardPage(this, "/system/workplace/views/explorer/explorer_files.jsp", params); } catch (CmsException e) { LOG.error(e.getMessage(), e); throw new CmsRuntimeException(e.getMessageContainer()); } } refreshList(); }
/** * Sets the start view for the given user.<p> * * @param userName the name of the user * @param view the start view path * * @throws CmsException if something goes wrong */ public void setStartView(String userName, String view) throws CmsException { try { CmsUser user = m_cms.readUser(userName); user.getAdditionalInfo().put( CmsUserSettings.PREFERENCES + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration.N_WORKPLACEVIEW, view); m_cms.writeUser(user); } catch (CmsException e) { e.printStackTrace(System.err); throw e; } }
LOG.warn(e.getMessage(), e);
StringBuffer msg = new StringBuffer("<!--\n").append(cmex.getLocalizedMessage()).append("\n"); cmex.printStackTrace(writer); msg.append(stackTrace.toString()).append("\n-->"); result = msg.toString();
m_errorMessages.add(e.getMessage()); if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e);
/** * Creates the html code for the given error message and the * provided Exception.<p> * * @param errorMsg the error message to place in the html code * @param t the exception to add to the error message * * @return the html code for the error message */ private String createError(String errorMsg, Throwable t) { StringBuffer msg = new StringBuffer(); msg.append(errorMsg); msg.append("\n"); msg.append(t.getMessage()); msg.append("\n"); msg.append(CmsException.getStackTraceAsString(t)); return createError(msg.toString()); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() throws IOException, ServletException { if (getParamListAction().equals(LIST_ACTION_RESTORE)) { try { performRestoreOperation(); Map<String, String[]> params = new HashMap<String, String[]>(); params.put(PARAM_ACTION, new String[] {DIALOG_INITIAL}); getToolManager().jspForwardPage(this, "/system/workplace/views/explorer/explorer_files.jsp", params); } catch (CmsException e) { LOG.error(e.getMessage(), e); throw new CmsRuntimeException(e.getMessageContainer()); } } refreshList(); }
shownValue = getCms().readPropertyObject(getParamResource(), curProperty, false).getValue(); } catch (CmsException e) { e.printStackTrace();
/** * Returns the search field mappings declared within the XSD.<p> * * @param cms the CmsObject * @param resource the resource * * @return the fields to map */ protected Set<CmsSearchField> getXSDMappings(CmsObject cms, CmsResource resource) { try { if (CmsResourceTypeXmlContent.isXmlContent(resource)) { I_CmsXmlContentHandler handler = CmsXmlContentDefinition.getContentHandlerForResource(cms, resource); if ((handler != null) && !handler.getSearchFields().isEmpty()) { return handler.getSearchFields(); } } } catch (CmsException e) { LOG.error(e.getMessage(), e); } return null; }
/** * @see java.lang.Throwable#getMessage() */ @Override public String getMessage() { return getLocalizedMessage(); }
LOG.error(e.getLocalizedMessage(), e); e.printStackTrace(response.getWriter());
/** * @see org.opencms.db.I_CmsUserDriver#getOrganizationalUnits(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean) */ public List getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren) throws CmsDataAccessException { List orgUnits = new ArrayList(); try { CmsResource parentFolder = internalOrgUnitFolder(dbc, parent); Iterator itResources = m_driverManager.readResources( dbc, parentFolder, CmsResourceFilter.DEFAULT, includeChildren).iterator(); while (itResources.hasNext()) { CmsResource resource = (CmsResource)itResources.next(); orgUnits.add(internalCreateOrgUnitFromResource(dbc, resource)); } } catch (CmsException e) { throw new CmsDataAccessException(e.getMessageContainer(), e); } return orgUnits; }