/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() throws IOException, ServletException { Map params = new HashMap(); params.put(CmsHistoryList.PARAM_VERSION_1, getParamVersion1()); params.put(CmsHistoryList.PARAM_VERSION_2, getParamVersion2()); params.put(CmsHistoryList.PARAM_ID_1, getParamId1()); params.put(CmsHistoryList.PARAM_ID_2, getParamId2()); params.put(PARAM_LOCALE, getSelectedItem().get(LIST_COLUMN_LOCALE).toString()); params.put(PARAM_ELEMENT, getSelectedItem().get(LIST_COLUMN_ATTRIBUTE).toString()); params.put(PARAM_RESOURCE, getParamResource()); // forward to the element difference screen getToolManager().jspForwardTool(this, "/history/comparison/difference", params); }
/** * * @see org.opencms.workplace.list.A_CmsListDialog#executeListIndepActions() */ @Override public void executeListIndepActions() { if (getParamListAction().equals(LIST_IACTION_COMPARE_ALL)) { // called if all elements are to be compared Map params = new HashMap(); params.put(CmsHistoryList.PARAM_VERSION_1, getParamVersion1()); params.put(CmsHistoryList.PARAM_VERSION_2, getParamVersion2()); params.put(CmsHistoryList.PARAM_ID_1, getParamId1()); params.put(CmsHistoryList.PARAM_ID_2, getParamId2()); params.put(CmsPropertyComparisonList.PARAM_COMPARE, CmsResourceComparisonDialog.COMPARE_ALL_ELEMENTS); params.put(PARAM_RESOURCE, getParamResource()); // forward to the element difference screen try { getToolManager().jspForwardTool(this, "/history/comparison/difference", params); } catch (Exception e) { LOG.debug(e.getMessage(), e); } } super.executeListIndepActions(); }
getCms(), new CmsUUID(getParamId1()), getParamVersion1()); CmsFile resource2 = CmsResourceComparisonDialog.readFile( getCms(), new CmsUUID(getParamId2()), getParamVersion2()); Iterator<CmsElementComparison> diffs = new CmsXmlDocumentComparison( getCms(), resource1, resource2).getElements().iterator(); String locale = comparison.getLocale().toString(); String attribute = comparison.getName(); CmsListItem item = getList().newItem(locale + attribute); item.set(LIST_COLUMN_LOCALE, locale); item.set(LIST_COLUMN_ATTRIBUTE, attribute); item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_ADDED_0)); } else if (CmsResourceComparison.TYPE_REMOVED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_REMOVED_0)); } else if (CmsResourceComparison.TYPE_CHANGED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_CHANGED_0)); } else { if (!getList().getMetadata().getItemDetailDefinition(LIST_IACTION_SHOW).isVisible()) { item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_UNCHANGED_0)); new Date(Long.parseLong(value1)),
version1Col.setName(Messages.get().container( Messages.GUI_COMPARE_VERSION_1, CmsHistoryList.getDisplayVersion(getParamVersion1(), getLocale()))); version1Col.setWidth("35%"); version1Col.setSorteable(false); version2Col.setName(Messages.get().container( Messages.GUI_COMPARE_VERSION_1, CmsHistoryList.getDisplayVersion(getParamVersion2(), getLocale()))); version2Col.setWidth("35%"); version2Col.setSorteable(false);
CmsElementComparisonList contentDiff = new CmsElementComparisonList(getJsp());
getCms(), new CmsUUID(getParamId1()), getParamVersion1()); CmsFile resource2 = CmsResourceComparisonDialog.readFile( getCms(), new CmsUUID(getParamId2()), getParamVersion2()); Iterator diffs = new CmsXmlDocumentComparison(getCms(), resource1, resource2).getElements().iterator(); while (diffs.hasNext()) { CmsElementComparison comparison = (CmsElementComparison)diffs.next(); String locale = comparison.getLocale().toString(); String attribute = comparison.getName(); CmsListItem item = getList().newItem(locale + attribute); item.set(LIST_COLUMN_LOCALE, locale); item.set(LIST_COLUMN_ATTRIBUTE, attribute); item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_ADDED_0)); } else if (CmsResourceComparison.TYPE_REMOVED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_REMOVED_0)); } else if (CmsResourceComparison.TYPE_CHANGED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_CHANGED_0)); } else { if (!getList().getMetadata().getItemDetailDefinition(LIST_IACTION_SHOW).isVisible()) { item.set(LIST_COLUMN_STATUS, key(Messages.GUI_COMPARE_UNCHANGED_0)); new Date(Long.parseLong(value1)), DateFormat.SHORT, getCms().getRequestContext().getLocale());
Messages.get().container( Messages.GUI_COMPARE_VERSION_1, CmsHistoryListUtil.getDisplayVersion(getParamVersion1(), getLocale()))); version1Col.setWidth("35%"); version1Col.setSorteable(false); Messages.get().container( Messages.GUI_COMPARE_VERSION_1, CmsHistoryListUtil.getDisplayVersion(getParamVersion2(), getLocale()))); version2Col.setWidth("35%"); version2Col.setSorteable(false);
CmsElementComparisonList contentDiff = new CmsElementComparisonList(getJsp()); lists.add(contentDiff); lists.add(propertyDiff);
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() throws IOException, ServletException { Map<String, String[]> params = new HashMap<String, String[]>(); params.put(CmsHistoryList.PARAM_VERSION_1, new String[] {getParamVersion1()}); params.put(CmsHistoryList.PARAM_VERSION_2, new String[] {getParamVersion2()}); params.put(CmsHistoryList.PARAM_ID_1, new String[] {getParamId1()}); params.put(CmsHistoryList.PARAM_ID_2, new String[] {getParamId2()}); params.put(PARAM_LOCALE, new String[] {getSelectedItem().get(LIST_COLUMN_LOCALE).toString()}); params.put(PARAM_ELEMENT, new String[] {getSelectedItem().get(LIST_COLUMN_ATTRIBUTE).toString()}); params.put(PARAM_RESOURCE, new String[] {getParamResource()}); // forward to the element difference screen getToolManager().jspForwardTool(this, "/history/comparison/difference", params); }
/** * * @see org.opencms.workplace.list.A_CmsListDialog#executeListIndepActions() */ @Override public void executeListIndepActions() { if (getParamListAction().equals(LIST_IACTION_COMPARE_ALL)) { // called if all elements are to be compared Map<String, String[]> params = new HashMap<String, String[]>(); params.put(CmsHistoryList.PARAM_VERSION_1, new String[] {getParamVersion1()}); params.put(CmsHistoryList.PARAM_VERSION_2, new String[] {getParamVersion2()}); params.put(CmsHistoryList.PARAM_ID_1, new String[] {getParamId1()}); params.put(CmsHistoryList.PARAM_ID_2, new String[] {getParamId2()}); params.put( CmsPropertyComparisonList.PARAM_COMPARE, new String[] {CmsResourceComparisonDialog.COMPARE_ALL_ELEMENTS}); params.put(PARAM_RESOURCE, new String[] {getParamResource()}); // forward to the element difference screen try { getToolManager().jspForwardTool(this, "/history/comparison/difference", params); } catch (Exception e) { LOG.debug(e.getMessage(), e); } } super.executeListIndepActions(); }