/** * * @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest) */ @Override protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) { super.initWorkplaceRequestValues(settings, request); try { m_resource1 = CmsResourceComparisonDialog.readResource( getCms(), new CmsUUID(getParamId1()), getParamVersion1()); m_resource2 = CmsResourceComparisonDialog.readResource( getCms(), new CmsUUID(getParamId2()), getParamVersion2()); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } m_resourceType = m_resource1.getTypeId(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() throws IOException, ServletException { // forward to the edit module screen 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_COMPARE, "properties"); params.put(PARAM_RESOURCE, getParamResource()); // forward to the difference screen getToolManager().jspForwardTool(this, "/history/comparison/difference", params); }
getCms(), getResource1(), getParamVersion1(), getResource2(), getParamVersion2()).iterator(); while (diffs.hasNext()) { CmsAttributeComparison comparison = diffs.next(); CmsListItem item = getList().newItem(comparison.getName()); item.set(LIST_COLUMN_PROPERTY_NAME, comparison.getName()); item.set(LIST_COLUMN_VERSION_1, CmsStringUtil.trimToSize(comparison.getVersion1(), TRIM_AT_LENGTH)); item.set(LIST_COLUMN_VERSION_2, CmsStringUtil.trimToSize(comparison.getVersion2(), TRIM_AT_LENGTH)); if (CmsResourceComparison.TYPE_ADDED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_ADDED_0)); } else if (CmsResourceComparison.TYPE_REMOVED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_REMOVED_0)); } else if (CmsResourceComparison.TYPE_CHANGED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_CHANGED_0)); } else { if (!getList().getMetadata().getItemDetailDefinition(LIST_IACTION_SHOW).isVisible()) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_UNCHANGED_0)); getList().getMetadata().getColumnDefinition(LIST_COLUMN_VERSION_1).setName( Messages.get().container( Messages.GUI_COMPARE_VERSION_1, CmsHistoryListUtil.getDisplayVersion(getParamVersion1(), getLocale()))); getList().getMetadata().getColumnDefinition(LIST_COLUMN_VERSION_2).setName(Messages.get().container( Messages.GUI_COMPARE_VERSION_1, CmsHistoryListUtil.getDisplayVersion(getParamVersion2(), getLocale())));
CmsPropertyComparisonList propertyDiff = new CmsPropertyComparisonList(getJsp()); CmsAttributeComparisonList attributeDiff = new CmsAttributeComparisonList(getJsp()); List lists = new ArrayList(); lists.add(attributeDiff); I_CmsResourceType resourceType = OpenCms.getResourceManager().getResourceType(propertyDiff.getResourceType()); } else if (propertyDiff.getResource1().isFile()) { String path1 = propertyDiff.getResource1().getRootPath(); String path2 = propertyDiff.getResource2().getRootPath(); byte[] content1 = readFile(getCms(), propertyDiff.getResource1().getStructureId(), getParamVersion1()).getContents(); byte[] content2 = readFile(getCms(), propertyDiff.getResource2().getStructureId(), getParamVersion2()).getContents();
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);
getCms(), getResource1(), getParamVersion1(), getResource2(), getParamVersion2()).iterator(); while (diffs.hasNext()) { CmsAttributeComparison comparison = (CmsAttributeComparison)diffs.next(); CmsListItem item = getList().newItem(comparison.getName()); item.set(LIST_COLUMN_PROPERTY_NAME, comparison.getName()); item.set(LIST_COLUMN_VERSION_1, CmsStringUtil.trimToSize(comparison.getVersion1(), TRIM_AT_LENGTH)); item.set(LIST_COLUMN_VERSION_2, CmsStringUtil.trimToSize(comparison.getVersion2(), TRIM_AT_LENGTH)); if (CmsResourceComparison.TYPE_ADDED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_ADDED_0)); } else if (CmsResourceComparison.TYPE_REMOVED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_REMOVED_0)); } else if (CmsResourceComparison.TYPE_CHANGED.equals(comparison.getStatus())) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_CHANGED_0)); } else { if (!getList().getMetadata().getItemDetailDefinition(LIST_IACTION_SHOW).isVisible()) { item.set(LIST_COLUMN_TYPE, key(Messages.GUI_COMPARE_UNCHANGED_0)); getList().getMetadata().getColumnDefinition(LIST_COLUMN_VERSION_1).setName( Messages.get().container( Messages.GUI_COMPARE_VERSION_1, CmsHistoryList.getDisplayVersion(getParamVersion1(), getLocale()))); getList().getMetadata().getColumnDefinition(LIST_COLUMN_VERSION_2).setName( Messages.get().container( Messages.GUI_COMPARE_VERSION_1,
CmsPropertyComparisonList propertyDiff = new CmsPropertyComparisonList(getJsp()); CmsAttributeComparisonList attributeDiff = new CmsAttributeComparisonList(getJsp()); List<A_CmsListDialog> lists = new ArrayList<A_CmsListDialog>(); lists.add(attributeDiff); I_CmsResourceType resourceType = OpenCms.getResourceManager().getResourceType(propertyDiff.getResourceType()); propertyDiff.getResource1().getStructureId(), getParamVersion1()).getContents(); byte[] content2 = readFile( getCms(), propertyDiff.getResource2().getStructureId(), getParamVersion2()).getContents(); } else if (propertyDiff.getResource1().isFile()) { CmsResource resource1 = propertyDiff.getResource1(); CmsResource resource2 = propertyDiff.getResource2(); String path1 = resource1.getRootPath(); String path2 = resource2.getRootPath();
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);
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() throws IOException, ServletException { // forward to the edit module screen 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_COMPARE, new String[] {"properties"}); params.put(PARAM_RESOURCE, new String[] {getParamResource()}); // forward to the difference screen getToolManager().jspForwardTool(this, "/history/comparison/difference", params); }
/** * * @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest) */ @Override protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) { super.initWorkplaceRequestValues(settings, request); try { m_resource1 = CmsResourceComparisonDialog.readResource( getCms(), new CmsUUID(getParamId1()), getParamVersion1()); m_resource2 = CmsResourceComparisonDialog.readResource( getCms(), new CmsUUID(getParamId2()), getParamVersion2()); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } m_resourceType = m_resource1.getTypeId(); }