/** * Fills the JSON object with the specific information used for file resource type of the table gallery.<p> * * <ul> * <li><code>htmltable</code>: the content of the given resource. (html table)</li> * </ul> * * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) * */ @Override protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) { try { jsonObj.append("htmltable", new String(getCms().readFile(res).getContents())); } catch (CmsException e) { // reading the resource or property value failed if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } catch (JSONException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } }
/** * Fills the JSON object with the specific information used for the resources of the html gallery.<p> * * <ul> * <li><code>html</code>: the content of the given file resource (html code).</li> * </ul> * * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) * */ @Override protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) { String html = ""; try { html = new String(getCms().readFile(res).getContents()); jsonObj.append("html", html); } catch (CmsException e) { // reading the resource or property value failed LOG.error(e.getLocalizedMessage(), e); } catch (JSONException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } }
/** * Fills the JSON object with the specific information used for file resource type of the table gallery.<p> * * <ul> * <li><code>htmltable</code>: the content of the given resource. (html table)</li> * </ul> * * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) * */ @Override protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) { try { jsonObj.append("htmltable", new String(getCms().readFile(res).getContents())); } catch (CmsException e) { // reading the resource or property value failed if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } catch (JSONException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } }
/** * Fills the JSON object with the specific information used for the resources of the html gallery.<p> * * <ul> * <li><code>html</code>: the content of the given file resource (html code).</li> * </ul> * * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) * */ @Override protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) { String html = ""; try { html = new String(getCms().readFile(res).getContents()); jsonObj.append("html", html); } catch (CmsException e) { // reading the resource or property value failed LOG.error(e.getLocalizedMessage(), e); } catch (JSONException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } }
/** * Fills the JSON object with the specific information used for pointer file resource type.<p> * * <ul> * <li><code>pointer</code>: the content of the pointer resource. This could be an external or internal link.</li> * </ul> * * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) * */ @Override protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) { // file target String pointer; try { pointer = new String(getCms().readFile(res).getContents()); if (CmsStringUtil.isEmptyOrWhitespaceOnly(pointer)) { pointer = getJsp().link(getCms().getSitePath(res)); } jsonObj.append("pointer", pointer); } catch (CmsException e) { // reading the resource or property value failed LOG.error(e.getLocalizedMessage(), e); } catch (JSONException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } }
/** * Fills the JSON object with the specific information used for pointer file resource type.<p> * * <ul> * <li><code>pointer</code>: the content of the pointer resource. This could be an external or internal link.</li> * </ul> * * @see org.opencms.workplace.galleries.A_CmsAjaxGallery#buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) * */ @Override protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) { // file target String pointer; try { pointer = new String(getCms().readFile(res).getContents()); if (CmsStringUtil.isEmptyOrWhitespaceOnly(pointer)) { pointer = getJsp().link(getCms().getSitePath(res)); } jsonObj.append("pointer", pointer); } catch (CmsException e) { // reading the resource or property value failed LOG.error(e.getLocalizedMessage(), e); } catch (JSONException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } }