/** * Converts an attribute list to a string.<p> * * @param properties a list of compared properties to be converted to a string * @return a string respresentation of the attribute list */ public String[] getPropertiesAsString(List properties) { Iterator i = properties.iterator(); StringBuffer res1 = new StringBuffer(512); StringBuffer res2 = new StringBuffer(512); while (i.hasNext()) { CmsAttributeComparison compare = (CmsAttributeComparison)i.next(); res1.append(compare.getName()).append(": ").append(compare.getVersion1()).append("\n"); res2.append(compare.getName()).append(": ").append(compare.getVersion2()).append("\n"); } return new String[] {res1.toString(), res2.toString()}; }
/** * @see com.google.common.base.Predicate#apply(java.lang.Object) */ public boolean apply(CmsAttributeComparison input) { return !Objects.equal(input.getVersion1(), input.getVersion2()); } }
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 {
prop = i.next(); comparedProperties.add( new CmsAttributeComparison(prop.getName(), "", prop.getValue(), CmsResourceComparison.TYPE_ADDED)); prop = i.next(); comparedProperties.add( new CmsAttributeComparison(prop.getName(), prop.getValue(), "", CmsResourceComparison.TYPE_REMOVED)); if (value1.equals(value2)) { comparedProperties.add( new CmsAttributeComparison(prop.getName(), value1, value2, CmsResourceComparison.TYPE_UNCHANGED)); } else { comparedProperties.add( new CmsAttributeComparison(prop.getName(), value1, value2, CmsResourceComparison.TYPE_CHANGED));
/** * Gets the value for the first version.<p> * * @return the first version's value */ @Column(header = "V1 (%(v1))", order = 20) public String getV1() { return m_comp.getVersion1(); }
/** * Gets the value for the second version.<p> * * @return the second version's value */ @Column(header = "V2 (%(v2))", order = 30) public String getV2() { return m_comp.getVersion2(); }
/** * Gets the attribute name.<p> * * @return the attribute name */ @Column(header = Messages.GUI_HISTORY_DIALOG_COL_PROPERTY_0, order = 10) public String getProperty() { String result = m_comp.getName(); if (result.startsWith("GUI_")) { result = CmsVaadinUtils.getMessageText(result); } return result; }
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 {
while (i.hasNext()) { prop = (CmsProperty)i.next(); comparedProperties.add(new CmsAttributeComparison( prop.getName(), "", while (i.hasNext()) { prop = (CmsProperty)i.next(); comparedProperties.add(new CmsAttributeComparison( prop.getName(), prop.getValue(), String value2 = ((CmsProperty)properties2.get(properties2.indexOf(prop))).getValue(); if (value1.equals(value2)) { comparedProperties.add(new CmsAttributeComparison( prop.getName(), value1, CmsResourceComparison.TYPE_UNCHANGED)); } else { comparedProperties.add(new CmsAttributeComparison( prop.getName(), value1,
while (diffs.hasNext()) { CmsAttributeComparison comparison = (CmsAttributeComparison)diffs.next(); CmsListItem item = getList().newItem(comparison.getName()); item.set(LIST_COLUMN_PROPERTY_NAME, key(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 {
/** * Converts an attribute list to a string.<p> * * @param properties a list of compared properties to be converted to a string * @return a string respresentation of the attribute list */ public String[] getPropertiesAsString(List<?> properties) { Iterator<?> i = properties.iterator(); StringBuffer res1 = new StringBuffer(512); StringBuffer res2 = new StringBuffer(512); while (i.hasNext()) { CmsAttributeComparison compare = (CmsAttributeComparison)i.next(); res1.append(compare.getName()).append(": ").append(compare.getVersion1()).append("\n"); res2.append(compare.getName()).append(": ").append(compare.getVersion2()).append("\n"); } return new String[] {res1.toString(), res2.toString()}; }
comparedAttributes.add(new CmsAttributeComparison( Messages.GUI_HISTORY_COLS_SIZE_0, String.valueOf(resource1.getLength()), comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_LABEL_DATE_RELEASED_0, release1, release2)); String expire1; if (CmsResource.DATE_EXPIRED_DEFAULT == resource1.getDateExpired()) { comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_LABEL_DATE_EXPIRED_0, expire1, expire2)); comparedAttributes.add(new CmsAttributeComparison( Messages.GUI_PERMISSION_INTERNAL_0, String.valueOf(resource1.isInternal()), DateFormat.SHORT, cms.getRequestContext().getLocale()); comparedAttributes.add(new CmsAttributeComparison( Messages.GUI_LABEL_DATE_LAST_MODIFIED_0, dateLastModified1, String type1 = OpenCms.getResourceManager().getResourceType(resource1.getTypeId()).getTypeName(); String type2 = OpenCms.getResourceManager().getResourceType(resource2.getTypeId()).getTypeName(); comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_HISTORY_COLS_FILE_TYPE_0, type1, type2)); } catch (CmsLoaderException e) { LOG.debug(e.getMessage(), e); DateFormat.SHORT, cms.getRequestContext().getLocale()); comparedAttributes.add(new CmsAttributeComparison( Messages.GUI_HISTORY_COLS_DATE_PUBLISHED_0,
while (diffs.hasNext()) { CmsAttributeComparison comparison = (CmsAttributeComparison)diffs.next(); CmsListItem item = getList().newItem(comparison.getName()); item.set(LIST_COLUMN_PROPERTY_NAME, key(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 {
/** * Converts an attribute list to a string.<p> * * @param attributes a list of compared attributes to be converted to a string * @return a string respresentation of the attribute list */ public String[] getAttributesAsString(List<?> attributes) { Iterator<?> i = attributes.iterator(); StringBuffer res1 = new StringBuffer(512); StringBuffer res2 = new StringBuffer(512); while (i.hasNext()) { CmsAttributeComparison compare = (CmsAttributeComparison)i.next(); res1.append(key(compare.getName())).append(": ").append(compare.getVersion1()).append("\n"); res2.append(key(compare.getName())).append(": ").append(compare.getVersion2()).append("\n"); } return new String[] {res1.toString(), res2.toString()}; }
new CmsAttributeComparison( Messages.GUI_HISTORY_COLS_SIZE_0, String.valueOf(resource1.getLength()), comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_LABEL_DATE_RELEASED_0, release1, release2)); String expire1; if (CmsResource.DATE_EXPIRED_DEFAULT == resource1.getDateExpired()) { comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_LABEL_DATE_EXPIRED_0, expire1, expire2)); comparedAttributes.add( new CmsAttributeComparison( Messages.GUI_PERMISSION_INTERNAL_0, String.valueOf(resource1.isInternal()), cms.getRequestContext().getLocale()); comparedAttributes.add( new CmsAttributeComparison(Messages.GUI_LABEL_DATE_LAST_MODIFIED_0, dateLastModified1, dateLastModified2)); try { String type1 = OpenCms.getResourceManager().getResourceType(resource1.getTypeId()).getTypeName(); String type2 = OpenCms.getResourceManager().getResourceType(resource2.getTypeId()).getTypeName(); comparedAttributes.add(new CmsAttributeComparison(Messages.GUI_HISTORY_COLS_FILE_TYPE_0, type1, type2)); } catch (CmsLoaderException e) { LOG.debug(e.getMessage(), e); cms.getRequestContext().getLocale()); comparedAttributes.add( new CmsAttributeComparison(Messages.GUI_HISTORY_COLS_DATE_PUBLISHED_0, dateCreated1, dateCreated2)); try { String userLastModified1 = resource1.getUserLastModified().toString();
/** * Converts an attribute list to a string.<p> * * @param attributes a list of compared attributes to be converted to a string * @return a string respresentation of the attribute list */ public String[] getAttributesAsString(List attributes) { Iterator i = attributes.iterator(); StringBuffer res1 = new StringBuffer(512); StringBuffer res2 = new StringBuffer(512); while (i.hasNext()) { CmsAttributeComparison compare = (CmsAttributeComparison)i.next(); res1.append(key(compare.getName())).append(": ").append(compare.getVersion1()).append("\n"); res2.append(key(compare.getName())).append(": ").append(compare.getVersion2()).append("\n"); } return new String[] {res1.toString(), res2.toString()}; }