/** * Returns the container-page type id, but returns -1 instead of throwing an exception when an error happens.<p> * * @return the container-page type id */ public static int getContainerPageTypeIdSafely() { try { return getContainerPageTypeId(); } catch (CmsLoaderException e) { if (LOG.isDebugEnabled()) { LOG.debug(e.getLocalizedMessage(), e); } return -1; } }
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsLoaderException(container, cause); } }
comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_HISTORY_COLS_FILE_TYPE_0, type1, type2)); } catch (CmsLoaderException e) { LOG.debug(e.getMessage(), e);
comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_HISTORY_COLS_FILE_TYPE_0, type1, type2)); } catch (CmsLoaderException e) { LOG.debug(e.getMessage(), e);
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return m_galleryTypeId; }
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsLoaderException(container, cause); } }
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { this.m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return this.m_galleryTypeId; }
/** * Returns the initialized resource type instance for the given id.<p> * * @param typeId the id of the resource type to get * * @return the initialized resource type instance for the given id * * @throws CmsLoaderException if no resource type is available for the given id */ public I_CmsResourceType getResourceType(int typeId) throws CmsLoaderException { I_CmsResourceType result = m_configuration.getResourceTypeById(typeId); if (result == null) { throw new CmsLoaderException( Messages.get().container(Messages.ERR_UNKNOWN_RESTYPE_ID_REQ_1, new Integer(typeId))); } return result; }
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { this.m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return this.m_galleryTypeId; }
/** * Returns the initialized resource type instance for the given id.<p> * * @param typeId the id of the resource type to get * * @return the initialized resource type instance for the given id * * @throws CmsLoaderException if no resource type is available for the given id */ public I_CmsResourceType getResourceType(int typeId) throws CmsLoaderException { I_CmsResourceType result = m_configuration.getResourceTypeById(typeId); if (result == null) { throw new CmsLoaderException(Messages.get().container( Messages.ERR_UNKNOWN_RESTYPE_ID_REQ_1, new Integer(typeId))); } return result; }
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { this.m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return this.m_galleryTypeId; }
/** * Returns the initialized resource type instance for the given resource type name.<p> * * @param typeName the name of the resource type to get * * @return the initialized resource type instance for the given name * * @throws CmsLoaderException if no resource type is available for the given name */ public I_CmsResourceType getResourceType(String typeName) throws CmsLoaderException { I_CmsResourceType result = m_configuration.getResourceTypeByName(typeName); if (result != null) { return result; } throw new CmsLoaderException(Messages.get().container(Messages.ERR_UNKNOWN_RESTYPE_NAME_REQ_1, typeName)); }
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return m_galleryTypeId; }
/** * Returns the initialized resource type instance for the given resource type name.<p> * * @param typeName the name of the resource type to get * * @return the initialized resource type instance for the given name * * @throws CmsLoaderException if no resource type is available for the given name */ public I_CmsResourceType getResourceType(String typeName) throws CmsLoaderException { I_CmsResourceType result = m_configuration.getResourceTypeByName(typeName); if (result != null) { return result; } throw new CmsLoaderException(Messages.get().container(Messages.ERR_UNKNOWN_RESTYPE_NAME_REQ_1, typeName)); }
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return m_galleryTypeId; }
/** * Creates a new template loader facade.<p> * * Some resource types are actually not loadable themself but require a template * to be processed. This template is attached using the <code>template</code> property. * Depending on the resource type of the template itself, a loader is then selected that * processed the requested resource. The processing itself might start on the template, * or on the requested resource (this will depend on the loader and the resource type implementation).<p> * * @param loader the loader to use * @param resource the file to use * @param template the template to use (ignored if null) * @throws CmsLoaderException in case the template file does not use a loader that actually supports templates */ public CmsTemplateLoaderFacade(I_CmsResourceLoader loader, CmsResource resource, CmsResource template) throws CmsLoaderException { if (!loader.isUsableForTemplates()) { throw new CmsLoaderException(Messages.get().container(Messages.ERR_LOADER_NOT_TEMPLATE_ENABLED_0)); } m_loader = loader; m_resource = resource; m_template = template; }
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return m_galleryTypeId; }
/** * Creates a new template loader facade.<p> * * Some resource types are actually not loadable themself but require a template * to be processed. This template is attached using the <code>template</code> property. * Depending on the resource type of the template itself, a loader is then selected that * processed the requested resource. The processing itself might start on the template, * or on the requested resource (this will depend on the loader and the resource type implementation).<p> * * @param loader the loader to use * @param resource the file to use * @param template the template to use (ignored if null) * @throws CmsLoaderException in case the template file does not use a loader that actually supports templates */ public CmsTemplateLoaderFacade(I_CmsResourceLoader loader, CmsResource resource, CmsResource template) throws CmsLoaderException { if (!loader.isUsableForTemplates()) { throw new CmsLoaderException(Messages.get().container(Messages.ERR_LOADER_NOT_TEMPLATE_ENABLED_0)); } m_loader = loader; m_resource = resource; m_template = template; }
/** * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#getGalleryTypeId() */ @Override public int getGalleryTypeId() { try { m_galleryTypeId = OpenCms.getResourceManager().getResourceType(GALLERYTYPE_NAME).getTypeId(); } catch (CmsLoaderException e) { // resource type not found, log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } return m_galleryTypeId; }
/** * @see org.opencms.loader.I_CmsResourceLoader#load(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ public void load(CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res) throws IOException, CmsException { if ((res == null) || res.isCommitted()) { // nothing we can do return; } String pointer = new String(cms.readFile(resource).getContents()); if (CmsStringUtil.isEmptyOrWhitespaceOnly(pointer)) { throw new CmsLoaderException(Messages.get().container( Messages.ERR_INVALID_POINTER_FILE_1, resource.getName())); } if (pointer.indexOf(':') < 0) { pointer = OpenCms.getLinkManager().substituteLink(cms, pointer); } res.sendRedirect(pointer); }