/** * @see org.opencms.workplace.list.A_CmsListDefaultJsAction#jsCode() */ @Override public String jsCode() { StringBuffer jsCode = new StringBuffer(256); jsCode.append("javascript:top.openwinfull('"); jsCode.append(getResourceName()); jsCode.append("', true)"); return jsCode.toString(); }
/** * Default Constructor.<p> * * @param id the unique id * @param resColumnPathId the id of the column with the resource root path */ public CmsListOpenResourceAction(String id, String resColumnPathId) { super(id); m_resColumnPathId = resColumnPathId; setName(Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_NAME_0)); setHelpText(Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_HELP_0)); }
/** * Returns the most possible right resource name.<p> * * @return the most possible right resource name */ protected String getResourceName() { String resource = getItem().get(m_resColumnPathId).toString(); if (!getWp().getCms().existsResource(resource, CmsResourceFilter.DEFAULT)) { String siteRoot = OpenCms.getSiteManager().getSiteRoot(resource); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(siteRoot)) { resource = resource.substring(siteRoot.length()); } if (!getWp().getCms().existsResource(resource, CmsResourceFilter.DEFAULT)) { resource = null; } } return resource; } }
nameCol.setWidth("60%"); CmsListDefaultAction resourceOpenDefAction = new CmsListOpenResourceAction( LIST_DEFACTION_OPEN, LIST_COLUMN_RESOURCE);
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#getHelpText() */ @Override public CmsMessageContainer getHelpText() { if (isEnabled()) { return super.getHelpText(); } return Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_DISABLED_HELP_0); }
/** * Returns the most possible right resource name.<p> * * @return the most possible right resource name */ protected String getResourceName() { String resource = getItem().get(m_resColumnPathId).toString(); if (!getWp().getCms().existsResource(resource, CmsResourceFilter.DEFAULT)) { String siteRoot = OpenCms.getSiteManager().getSiteRoot(resource); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(siteRoot)) { resource = resource.substring(siteRoot.length()); } if (!getWp().getCms().existsResource(resource, CmsResourceFilter.DEFAULT)) { resource = null; } } return resource; } }
CmsListDefaultAction resourceOpenDefAction = new CmsListOpenResourceAction( LIST_DEFACTION_OPEN, LIST_COLUMN_ROOT_PATH);
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#getHelpText() */ @Override public CmsMessageContainer getHelpText() { if (isEnabled()) { return super.getHelpText(); } return Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_DISABLED_HELP_0); }
/** * Default Constructor.<p> * * @param id the unique id * @param resColumnPathId the id of the column with the resource root path */ public CmsListOpenResourceAction(String id, String resColumnPathId) { super(id); m_resColumnPathId = resColumnPathId; setName(Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_NAME_0)); setHelpText(Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_HELP_0)); }
CmsListDefaultAction resourceOpenDefAction = new CmsListOpenResourceAction( LIST_DEFACTION_OPEN, LIST_COLUMN_ROOT_PATH);
/** * @see org.opencms.workplace.list.A_CmsListDefaultJsAction#jsCode() */ @Override public String jsCode() { StringBuffer jsCode = new StringBuffer(256); jsCode.append("javascript:top.openwinfull('"); jsCode.append(getResourceName()); jsCode.append("', true)"); return jsCode.toString(); }
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#isEnabled() */ @Override public boolean isEnabled() { if (getResourceName() != null) { return super.isEnabled(); } return false; }
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#isEnabled() */ @Override public boolean isEnabled() { if (getResourceName() != null) { return super.isEnabled(); } return false; }