/** * @see java.lang.Throwable#getMessage() */ @Override public String getMessage() { return getLocalizedMessage(); }
/** * @see java.lang.Throwable#getMessage() */ @Override public String getMessage() { return getLocalizedMessage(); }
/** * Handles finished publish jobs by removing projects of resources in the publish job if they are empty workflow projects.<p> * * @param publishJob the finished published job */ protected void onFinishPublishJob(CmsPublishJobRunning publishJob) { try { cleanupEmptyWorkflowProjects(null); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } }
/** * Refreshes the internal data if the last update was longer ago than the udpate interval.<p> */ private synchronized void refresh() { try { long now = System.currentTimeMillis(); if ((now - m_lastUpdate) > UPDATE_INTERVAL) { setup(); } } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } }
/** * Updates the internally stored OpenCms user context.<p> * * @param cms the new OpenCms user context */ public void updateCmsObject(CmsObject cms) { try { m_cms = OpenCms.initCmsObject(cms); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); m_cms = cms; } }
/** * Wrap OpenCms into OpenCMIS exceptions and rethrow them.<p> * * @param e the exception to handle */ public static void handleCmsException(CmsException e) { if (e instanceof CmsVfsResourceNotFoundException) { throw new CmisObjectNotFoundException(e.getLocalizedMessage(), e); } else if (e instanceof CmsSecurityException) { throw new CmisUnauthorizedException(e.getLocalizedMessage(), e); } else { throw new CmisRuntimeException(e.getLocalizedMessage(), e); } }
public CmsGallerySearchResult getSearchResult(Locale locale) { if (!m_searchResultMap.containsKey(locale)) { CmsGallerySearchResult sResult; try { sResult = CmsGallerySearch.searchById(m_cms, m_resource.getStructureId(), locale); m_searchResultMap.put(locale, sResult); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } } return m_searchResultMap.get(locale); }
/** * @see org.opencms.ade.publish.I_CmsVirtualProject#getResources(org.opencms.file.CmsObject, java.util.Map, java.lang.String) */ public List<CmsResource> getResources(CmsObject cms, Map<String, String> params, String workflowId) { try { return Lists.newArrayList(OpenCms.getPublishManager().getUsersPubList(cms)); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); return Lists.newArrayList(); } }
public Boolean apply(CmsUUID projectId) { try { CmsProject project = m_cms.readProject(projectId); return new Boolean(project.isWorkflowProject()); } catch (CmsException e) { getLog().warn(e.getLocalizedMessage(), e); return Boolean.FALSE; } }
/** * @see org.opencms.ui.sitemap.I_CmsLocaleCompareContext#refreshAll() */ public void refreshAll() { try { initialize(m_currentRoot.getStructureId(), m_comparisonLocale); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); CmsErrorDialog.showErrorDialog(e); } }
@Override public Object transform(Object input) { try { CmsDynamicFunctionBean dynamicFunction = readDynamicFunctionBean((String)input); CmsDynamicFunctionBeanWrapper wrapper = new CmsDynamicFunctionBeanWrapper( m_cms, dynamicFunction); return wrapper; } catch (CmsException e) { LOG.debug(e.getLocalizedMessage(), e); return new CmsDynamicFunctionBeanWrapper(m_cms, null); } } };
public Object transform(Object categoryPath) { try { return CmsCategoryService.getInstance().readCategory( m_cms, (String)categoryPath, getRequestContext().getUri()); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); return null; } }
public Object transform(Object resourceName) { try { CmsResource resource = m_cms.readResource( getRequestContext().removeSiteRoot((String)resourceName)); return new CmsJspCategoryAccessBean(m_cms, resource); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); return null; } } });
/** * @see org.opencms.main.I_CmsRequestHandler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String) */ public void handle(HttpServletRequest req, HttpServletResponse res, String name) throws IOException { CmsObject cms; try { cms = getCmsObject(req); CmsSolrSpellchecker dict = OpenCms.getSearchManager().getSolrDictionary(cms); if (dict != null) { dict.getSpellcheckingResult(res, req, cms); } } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } }
/** * Checks if this resource has siblings.<p> * * @return true if this resource has siblings */ public boolean hasSiblings() { try { return getCms().readResource(getParamResource(), CmsResourceFilter.ALL).getSiblingCount() > 1; } catch (CmsException e) { LOG.error(e.getLocalizedMessage(getLocale()), e); return false; } }
/** * Checks if this resource has siblings.<p> * * @return true if this resource has siblings */ public boolean hasSiblings() { try { return getCms().readResource(getParamResource(), CmsResourceFilter.ALL).getSiblingCount() > 1; } catch (CmsException e) { LOG.error(e.getLocalizedMessage(getLocale()), e); return false; } }
/** * @see org.opencms.ade.galleries.shared.rpc.I_CmsGalleryService#saveResultViewType(java.lang.String) */ public void saveResultViewType(String resultViewType) { CmsUser user = getCmsObject().getRequestContext().getCurrentUser(); user.setAdditionalInfo(RESULT_VIEW_TYPE_ADD_INFO_KEY, resultViewType); try { getCmsObject().writeUser(user); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } }
/** * @see org.opencms.ui.components.I_CmsFilePropertyEditHandler#start() */ public void start() { CmsObject cms = A_CmsUI.getCmsObject(); try { CmsResource res = cms.readResource(m_editId); m_lockActionRecord = CmsLockUtil.ensureLock(cms, res); CmsAppWorkplaceUi.get().disableGlobalShortcuts(); m_fileTable.startEdit(m_editId, m_editProperty, this); } catch (CmsException e) { CmsErrorDialog.showErrorDialog(e); LOG.debug(e.getLocalizedMessage(), e); } }
/** * @see org.opencms.gwt.shared.rpc.I_CmsCoreService#unlock(org.opencms.util.CmsUUID) */ public String unlock(CmsUUID structureId) throws CmsRpcException { CmsObject cms = getCmsObject(); try { CmsResource resource = cms.readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION); tryUnlock(resource); } catch (CmsException e) { return e.getLocalizedMessage(OpenCms.getWorkplaceManager().getWorkplaceLocale(cms)); } catch (Throwable e) { error(e); } return null; }
/** * @see com.vaadin.data.Validator#validate(java.lang.Object) */ public void validate(Object value) throws InvalidValueException { if (m_fieldOU.isEnabled() && CmsStringUtil.isNotEmptyOrWhitespaceOnly((String)value)) { try { OpenCms.getOrgUnitManager().readOrganizationalUnit(A_CmsUI.getCmsObject(), (String)value); } catch (CmsException e) { throw new InvalidValueException(e.getLocalizedMessage(UI.getCurrent().getLocale())); } } } }