/** * Builds the html code for the report with the list of deleted resources.<p> * * @return html code for the report with the list of deleted resources * * @throws JspException if dialog actions fail * @throws IOException in case of errros forwarding to the required result page * @throws ServletException in case of errros forwarding to the required result page */ public String buildReport() throws JspException, ServletException, IOException { CmsDeletedResourcesList list = new CmsDeletedResourcesList(getJsp(), getParamResource(), Boolean.valueOf( getParamReadtree()).booleanValue()); list.actionDialog(); list.getList().setBoxed(false); StringBuffer result = new StringBuffer(512); result.append("<div style='height:200px; overflow: auto;'>\n"); result.append(list.getList().listHtml()); result.append("</div>\n"); return result.toString(); }
/** * Builds the html code for the report with the list of deleted resources.<p> * * @return html code for the report with the list of deleted resources * * @throws JspException if dialog actions fail * @throws IOException in case of errros forwarding to the required result page * @throws ServletException in case of errros forwarding to the required result page */ public String buildReport() throws JspException, ServletException, IOException { CmsDeletedResourcesList list = new CmsDeletedResourcesList( getJsp(), getParamResource(), Boolean.valueOf(getParamReadtree()).booleanValue()); list.actionDialog(); list.getList().setBoxed(false); StringBuffer result = new StringBuffer(512); result.append("<div style='height:200px; overflow: auto;'>\n"); result.append(list.getList().listHtml()); result.append("</div>\n"); return result.toString(); }
/** * Public constructor with JSP action element.<p> * * @param jsp an initialized JSP action element * @param resourcename the name of the resource to display deleted entries for * @param readTree display deleted resources for the subtree */ public CmsDeletedResourcesList(CmsJspActionElement jsp, String resourcename, boolean readTree) { super( jsp, LIST_ID, Messages.get().container(Messages.GUI_DELETED_RESOURCES_LIST_NAME_0), null, CmsListOrderEnum.ORDER_ASCENDING, null); // set the style to show common workplace dialog layout setParamStyle(""); // prevent paging, usually there are only few model files getList().setMaxItemsPerPage(Integer.MAX_VALUE); // hide print button getList().getMetadata().getIndependentAction(CmsListPrintIAction.LIST_ACTION_ID).setVisible(false); // suppress the box around the list getList().setBoxed(false); // hide title of the list //getList().setShowTitle(false); m_readTree = readTree; m_resourcename = resourcename; }
/** * Public constructor with JSP action element.<p> * * @param jsp an initialized JSP action element * @param resourcename the name of the resource to display deleted entries for * @param readTree display deleted resources for the subtree */ public CmsDeletedResourcesList(CmsJspActionElement jsp, String resourcename, boolean readTree) { super( jsp, LIST_ID, Messages.get().container(Messages.GUI_DELETED_RESOURCES_LIST_NAME_0), null, CmsListOrderEnum.ORDER_ASCENDING, null); // set the style to show common workplace dialog layout setParamStyle(""); // prevent paging, usually there are only few model files getList().setMaxItemsPerPage(Integer.MAX_VALUE); // hide print button getList().getMetadata().getIndependentAction(CmsListPrintIAction.LIST_ACTION_ID).setVisible(false); // suppress the box around the list getList().setBoxed(false); // hide title of the list //getList().setShowTitle(false); m_readTree = readTree; m_resourcename = resourcename; }
/** * @see org.opencms.workplace.list.A_CmsListDialog#getListItems() */ @Override protected List getListItems() throws CmsException { List ret = new ArrayList(); List list = getCms().readDeletedResources(m_resourcename, m_readTree); Iterator iter = list.iterator(); while (iter.hasNext()) { I_CmsHistoryResource res = (I_CmsHistoryResource)iter.next(); CmsListItem item = getList().newItem(res.getStructureId().toString()); String resourcePath = getCms().getSitePath((CmsResource)res); item.set(LIST_COLUMN_NAME, m_resourcename + "|" + resourcePath); item.set(LIST_COLUMN_DELETION_DATE, new Date(res.getDateLastModified())); item.set(LIST_COLUMN_VERSION, String.valueOf(res.getVersion())); item.set(LIST_COLUMN_TYPEID, String.valueOf(res.getTypeId())); ret.add(item); } return ret; }
/** * @see org.opencms.workplace.list.A_CmsListDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { List<CmsListItem> ret = new ArrayList<CmsListItem>(); List<I_CmsHistoryResource> list = getCms().readDeletedResources(m_resourcename, m_readTree); Iterator<I_CmsHistoryResource> iter = list.iterator(); while (iter.hasNext()) { I_CmsHistoryResource res = iter.next(); CmsListItem item = getList().newItem(res.getStructureId().toString()); String resourcePath = getCms().getSitePath((CmsResource)res); item.set(LIST_COLUMN_NAME, m_resourcename + "|" + resourcePath); LOG.info("deleted resource list, name = " + m_resourcename + "|" + resourcePath); item.set(LIST_COLUMN_DELETION_DATE, new Date(res.getDateLastModified())); item.set(LIST_COLUMN_VERSION, String.valueOf(res.getVersion())); item.set(LIST_COLUMN_TYPEID, String.valueOf(res.getTypeId())); ret.add(item); } return ret; }