AVM Compare functionality added to classic (JSF) client

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10300 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2008-08-08 21:48:34 +00:00
parent d7e1aa7bb0
commit 1824fcc35d
13 changed files with 1610 additions and 542 deletions

View File

@@ -612,6 +612,28 @@ invite_content_step1_desc=Select the users and roles they will play for this con
remove_content_user_info=To remove an invited user from this content, click Yes. remove_content_user_info=To remove an invited user from this content, click Yes.
content_owner=User ''{0}'' is the current owner of this content. content_owner=User ''{0}'' is the current owner of this content.
# AVM Compare
snapshot_compare_to_current=Compare To Current Snapshot
snapshot_compare_to_current_description=View list of modifications between snapshot ''{0}'' and current snapshot
snapshot_compare_to_previous=Compare to Previous Snapshot
snapshot_compare_to_previous_description=View list of modifications between snapshot ''{0}'' and ''{1}''
snapshot_compare_to_any=Compare to Any Snapshot
snapshot_compare_to_any_description=View list of modifications between snapshot ''{0}'' and a user selected snapshot
store_title=Store
version_title=Version
avm_compare_newer=Newer
avm_compare_older=Older
avm_compare_conflict=Conflict
avm_compare_directory=Directory
avm_compare_same=Same
error_version_validate=Number of version is not valid
snapshot_name=Name
snapshot_path=Path
snapshot_status=Status
increment_button_hint=Next valid version
decrement_button_hint=Previous valid version
refresh_button_hint=Refresh
# System Users messages # System Users messages
create_user=Create User create_user=Create User
change_password=Change Password change_password=Change Password

View File

@@ -308,6 +308,43 @@
title-id="link_validaton_dialog_title" title-id="link_validaton_dialog_title"
description-id="link_validaton_dialog_desc" /> description-id="link_validaton_dialog_desc" />
<!-- AVM Compare -->
<dialog name="compareToCurrentSnapshot" page="/jsp/wcm/compare-to-current-snapshot.jsp"
managed-bean="CompareToCurrentSnapshot" icon="/images/icons/comparetocurrent_large.png"
show-ok-button="false"
title-id="snapshot_compare_to_current" description-id="snapshot_compare_to_current_description" />
<!-- AVM Compare -->
<dialog name="compareToPreviousSnapshot" page="/jsp/wcm/compare-to-current-snapshot.jsp"
managed-bean="CompareToPreviousSnapshot" icon="/images/icons/comparetoprevious_large.png"
show-ok-button="false"
title-id="snapshot_compare_to_previous" description-id="snapshot_compare_to_previous_description" />
<!-- CompareToAnySnapshot -->
<dialog name="compareToAnySnapshot" page="/jsp/wcm/compare-to-any-snapshot.jsp"
managed-bean="CompareToAnySnapshot" icon="/images/icons/comparetoany_large.png"
show-ok-button="false"
title-id="snapshot_compare_to_any" description-id="snapshot_compare_to_any_description" />
<!-- manage permissions -->
<dialog name="setPermissions" page="/jsp/wcm/set-permissions.jsp"
managed-bean="SetPermissionsDialog" icon="/images/icons/users_large.gif"
title-id="set_permissions_title" description-id="set_permissions_subtitle" />
<dialog name="removePermissions" page="/jsp/wcm/remove-permissions.jsp"
managed-bean="RemovePermissionsDialog" icon="/images/icons/delete_large.gif"
title-id="remove_permissions_title" />
<dialog name="editPermissions" page="/jsp/wcm/edit-permissions.jsp"
managed-bean="EditPermissionsDialog" icon="/images/icons/edituser_large.gif"
title-id="edit_permissions_title" description-id="edit_permissions_subtitle" />
<dialog name="managePermissions" page="/jsp/wcm/manage-permissions.jsp"
managed-bean="ManagePermissionsDialog" icon="/images/icons/edituser.gif"
actions-config-id="set_permission_menu"
show-ok-button="false"
title-id="view_permissions_title" description-id="manage_permissions_subtitle" />
<dialog name="editUserDetails" page="/jsp/users/edit-user-details.jsp" managed-bean="EditUserDetailsDialog" <dialog name="editUserDetails" page="/jsp/users/edit-user-details.jsp" managed-bean="EditUserDetailsDialog"
icon="/images/icons/edituser_large.gif" title-id="edit_user_details" icon="/images/icons/edituser_large.gif" title-id="edit_user_details"
description-id="edit_user_details_description" /> description-id="edit_user_details_description" />

View File

@@ -0,0 +1,188 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.wcm;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
import org.alfresco.service.cmr.avm.VersionDescriptor;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.util.NameMatcher;
import org.alfresco.web.app.Application;
/**
* AVMCompare Utils
* @author ValerySh
*
*/
public class AVMCompareUtils
{
/**
* Get a difference map between two corresponding node trees.
* @param avmSyncService AVMSyncService
* @param srcVersion The version id for the source tree.
* @param srcPath The avm path to the source tree.
* @param dstVersion The version id for the destination tree.
* @param dstPath The avm path to the destination tree.
* @param excluder A NameMatcher used to exclude files from consideration.
* @return list of compared objects
*/
public static List<Map<String, String>> getComparedNodes(AVMSyncService avmSyncService, int srcVersion, String srcPath, int dstVersion, String dstPath, NameMatcher excluder)
{
FacesContext context = FacesContext.getCurrentInstance();
List<AVMDifference> compare = avmSyncService.compare(srcVersion, srcPath, dstVersion, dstPath, excluder);
List<Map<String, String>> result = new ArrayList<Map<String, String>>();
for (AVMDifference diff : compare)
{
String path = diff.getSourcePath();
Map<String, String> node = new HashMap<String, String>();
String sandboxPath = AVMUtil.getSandboxPath(path);
node.put("path", path.replaceFirst(sandboxPath, ""));
node.put("name", path.substring(path.lastIndexOf("/") + 1));
String status;
switch (diff.getDifferenceCode())
{
case AVMDifference.OLDER:
status = Application.getMessage(context, "avm_compare_older");
break;
case AVMDifference.NEWER:
status = Application.getMessage(context, "avm_compare_newer");
break;
case AVMDifference.SAME:
status = Application.getMessage(context, "avm_compare_same");
break;
case AVMDifference.DIRECTORY:
status = Application.getMessage(context, "avm_compare_directory");
break;
case AVMDifference.CONFLICT:
status = Application.getMessage(context, "avm_compare_conflict");
break;
default:
status = "";
}
node.put("status", status);
result.add(node);
}
return result;
}
/**
* checks the version of the first is accessible for Store
* @param avmService AVMService
* @param name The name of the AVMStore
* @param version Version
* @return true if version is first
*/
public static boolean isFirstVersion(AVMService avmService, String name, int version)
{
boolean result = false;
List<Integer> allVersions = getAllVersionID(avmService, name);
if (version == Collections.min(allVersions))
result = true;
return result;
}
/**
* checks the version of the last is accessible for Store
* @param avmService AVMService
* @param name The name of the AVMStore
* @param version Version
* @return true if version is latest
*/
public static boolean isLatestVersion(AVMService avmService, String name, int version)
{
boolean result = false;
List<Integer> allVersions = getAllVersionID(avmService, name);
if (version == Collections.max(allVersions))
result = true;
return result;
}
/**
* Get the versions id in an AVMStore
* @param avmService AVMService
* @param name The name of the AVMStore
* @return List versions id
*/
public static List<Integer> getAllVersionID(AVMService avmService, String name)
{
List<Integer> allVersions = new ArrayList<Integer>();
List<VersionDescriptor> listVersion = avmService.getStoreVersions(name);
for (VersionDescriptor vd : listVersion)
{
if ((vd.getTag() != null || AVMUtil.isUserStore(name)) && vd.getVersionID() > 2)
{
allVersions.add(vd.getVersionID());
}
}
return allVersions;
}
/** Get Previous Version Id
* @param avmService AVMService
* @param name The name of the AVMStore
* @param version Current version Id
* @return Previous Version Id
*/
public static int getPrevVersionID(AVMService avmService, String name, int version)
{
List<Integer> allVersions = getAllVersionID(avmService, name);
Collections.sort(allVersions);
int index = allVersions.indexOf(version);
if (index == 0)
return 0;
return allVersions.get(index - 1);
}
/**
* Receive Stores List
* @param avmService AVMService
* @return List Stores name
*/
public static List<String> receiveStoresList(AVMService avmService)
{
List<String> result = new ArrayList<String>();
List<AVMStoreDescriptor> storeDescs = avmService.getStores();
for (AVMStoreDescriptor storeDesc : storeDescs)
{
if (!storeDesc.getCreator().equalsIgnoreCase("system") && !AVMUtil.isPreviewStore(storeDesc.getName()))
result.add(storeDesc.getName());
}
return result;
}
}

View File

@@ -0,0 +1,192 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.wcm;
import java.text.MessageFormat;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Repository;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Base class for AVMCompare dialogs
*
* @author Dmitry Lazurkin
*
*/
public abstract class CompareSnapshotDialog extends BaseDialogBean
{
private static final Log logger = LogFactory.getLog(CompareSnapshotDialog.class);
private static final long serialVersionUID = 5483551383286687197L;
private final static String MSG_CLOSE = "close";
protected AVMBrowseBean avmBrowseBean;
transient private AVMService avmService;
transient private AVMSyncService avmSyncService;
protected NodeRef websiteRef;
protected String store;
protected NodeRef webProjectRef;
protected int version;
protected String sandbox;
protected String storeRoot;
protected boolean finished = false;
public abstract List<Map<String, String>> getComparedNodes();
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
// setup context for dialog
this.sandbox = parameters.get("sandbox");
String ver = parameters.get("version");
if (ver != null && ver.length() > 0)
{
this.version = Integer.parseInt(ver);
}
else
{
this.version = -1;
}
// get the store
this.store = parameters.get("store");
this.storeRoot = AVMUtil.buildSandboxRootPath(this.sandbox);
// get the web project noderef
String webProject = parameters.get("webproject");
if (webProject == null)
{
this.webProjectRef = this.avmBrowseBean.getWebsite().getNodeRef();
}
else
{
this.webProjectRef = new NodeRef(webProject);
}
if (logger.isDebugEnabled())
{
logger.debug("Initialising dialog compare snapshot: " + this.websiteRef);
}
}
@Override
public String getContainerDescription()
{
int prev = AVMCompareUtils.getPrevVersionID(getAvmService(), sandbox, version);
return MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), getDescription()), version, prev);
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CLOSE);
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return outcome;
}
/**
* Getter for avmBrowseBean
*
* @return avmBrowseBean
*/
public AVMBrowseBean getAvmBrowseBean()
{
return avmBrowseBean;
}
/**
* Setter for avmBrowseBean
*
* @param avmBrowseBean avm browse bean
*/
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
{
this.avmBrowseBean = avmBrowseBean;
}
/**
* Getter for avmService service
*
* @return avmService
*/
public AVMService getAvmService()
{
if (avmService == null)
{
avmService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMService();
}
return avmService;
}
/**
* Getter for avmSyncService service
*
* @return avmSyncService
*/
public AVMSyncService getAvmSyncService()
{
if (avmSyncService == null)
{
avmSyncService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMSyncService();
}
return avmSyncService;
}
/**
* Returns description message id for AVMCompare dialog
*
* @return description message id for dialog
*/
protected abstract String getDescription();
/**
* Returns sandbox name
*
* @return sandbox name
*/
public String getSandbox()
{
return sandbox;
}
}

View File

@@ -0,0 +1,268 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.wcm;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import org.alfresco.web.app.Application;
import org.alfresco.web.ui.common.Utils;
/**
* Class for compareToAnySnapshot dialog
*
* @author Dmitry Velichkevich
* @author Dmitry Lazurkin
*/
public class CompareToAnySnapshotDialog extends CompareSnapshotDialog
{
private static final long serialVersionUID = 5483432383286687197L;
private static final String COMPARE_TO_ANY_SNAPSHOT_DESCRIPTION_MESSAGE_TEXT_ID = "snapshot_compare_to_any_description";
public static final String MSG_ERROR_VERSION_NOT_VALID = "error_version_validate";
private int userSpecifiedVersion;
private boolean storeChanged;
private String userSpecifiedStore;
private String userSpecifiedRoot;
private List<Integer> availableVersionNumbers;
private int curAvailableVersionNumber;
private boolean compare;
/**
* Builds list of available version numbers
*/
private void buildAvailibleVersionNumbers()
{
this.curAvailableVersionNumber = -1;
this.availableVersionNumbers = AVMCompareUtils.getAllVersionID(getAvmService(), userSpecifiedStore);
}
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
userSpecifiedStore = sandbox;
userSpecifiedRoot = storeRoot;
userSpecifiedVersion = -1;
buildAvailibleVersionNumbers();
this.compare = true;
this.storeChanged = false;
}
/**
* @return true if snapshot's version is correct
*/
private boolean isCorrectVersion(int userSpecVersion)
{
return userSpecVersion == -1 || availableVersionNumbers.contains(userSpecVersion);
}
@Override
public List<Map<String, String>> getComparedNodes()
{
if (compare)
{
this.compare = false;
List<Map<String, String>> nodes = null;
if (isCorrectVersion(userSpecifiedVersion))
{
nodes = AVMCompareUtils.getComparedNodes(getAvmSyncService(), version, storeRoot, userSpecifiedVersion, userSpecifiedRoot, null);
}
return nodes;
}
else
{
return Collections.emptyList();
}
}
/**
* @return list of stores select items
*/
public List<SelectItem> getStoresList()
{
List<String> stores = AVMCompareUtils.receiveStoresList(getAvmService());
List<SelectItem> result = new ArrayList<SelectItem>();
for (String itemValue : stores)
{
result.add(new SelectItem(itemValue, itemValue, itemValue, false));
}
return result;
}
/**
* Action listener method that sets flag for starting compare
*
* @param event action event
*/
public void refreshComparePanel(ActionEvent event)
{
this.compare = true;
}
/**
* Getter for user specified version
*
* @return userSpecifiedVersion
*/
public int getUserSpecifiedVersion()
{
return userSpecifiedVersion;
}
/**
* Setter for user specified version
*
* @param userSpecifiedVersion user specified version
*/
public void setUserSpecifiedVersion(int userSpecifiedVersion)
{
if (this.storeChanged == false)
{
if (this.userSpecifiedVersion != userSpecifiedVersion)
{
if (userSpecifiedVersion != -1)
{
int index = availableVersionNumbers.indexOf(userSpecifiedVersion);
if (index != -1)
{
this.curAvailableVersionNumber = index;
this.userSpecifiedVersion = userSpecifiedVersion;
}
else
{
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(), MSG_ERROR_VERSION_NOT_VALID));
FacesContext.getCurrentInstance().renderResponse();
}
}
else
{
this.curAvailableVersionNumber = -1;
this.userSpecifiedVersion = -1;
}
}
}
else
{
this.storeChanged = false;
}
}
/**
* Getter for user specified Store
*
* @return userSpecifiedStore user specified store
*/
public String getUserSpecifiedSnapshot()
{
return userSpecifiedStore;
}
/**
* Setter for user specified snapshot
*
* @param setUserSpecifiedSnapshot user specified snapshot
*/
public void setUserSpecifiedSnapshot(String userSpecifiedSnapshot)
{
if (userSpecifiedSnapshot.equals(userSpecifiedStore) == false)
{
this.storeChanged = true;
this.userSpecifiedStore = userSpecifiedSnapshot;
this.userSpecifiedRoot = AVMUtil.buildSandboxRootPath(this.userSpecifiedStore);
this.userSpecifiedVersion = -1;
buildAvailibleVersionNumbers();
}
}
@Override
public String getSandbox()
{
return this.userSpecifiedStore;
}
@Override
protected String getDescription()
{
return COMPARE_TO_ANY_SNAPSHOT_DESCRIPTION_MESSAGE_TEXT_ID;
}
/**
* @return true if increment button for version is disabled
*/
public boolean isIncrementVersionButtonDisabled()
{
return (this.curAvailableVersionNumber + 1) == this.availableVersionNumbers.size();
}
/**
* @return true if decrement button for version is disabled
*/
public boolean isDecrementVersionButtonDisabled()
{
return this.curAvailableVersionNumber == -1;
}
/**
* Increments version number
*
* @param event action event
*/
public void incrementVersion(ActionEvent event)
{
this.curAvailableVersionNumber++;
this.userSpecifiedVersion = this.availableVersionNumbers.get(this.curAvailableVersionNumber);
}
/**
* Decrements version number
*
* @param event action event
*/
public void decrementVersion(ActionEvent event)
{
this.curAvailableVersionNumber--;
this.userSpecifiedVersion = (this.curAvailableVersionNumber != -1) ? (this.availableVersionNumbers.get(this.curAvailableVersionNumber)) : (-1);
}
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.wcm;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Class for compareToCurrentSnapshot dialog
* @author ValerySh
*
*/
public class CompareToCurrentSnapshotDialog extends CompareSnapshotDialog
{
private static final long serialVersionUID = 5483551383286687197L;
/** description for dialog */
private static final String MSG_COMPARE_TO_CURRENT_DESCRIPTION = "snapshot_compare_to_current_description";
@SuppressWarnings("unused")
private static final Log logger = LogFactory.getLog(CompareToPreviousSnapshotDialog.class);
/*
* (non-Javadoc)
*
* @see org.alfresco.web.bean.wcm.CompareSnapshot#getComparedNodes()
*/
public List<Map<String, String>> getComparedNodes()
{
if (finished)
{
finished = false;
return null;
}
finished = true;
return AVMCompareUtils.getComparedNodes(getAvmSyncService(), version, storeRoot, -1, storeRoot, null);
}
/*
* (non-Javadoc)
*
* @see org.alfresco.web.bean.wcm.CompareSnapshot#getDescription()
*/
protected String getDescription()
{
return MSG_COMPARE_TO_CURRENT_DESCRIPTION;
}
}

View File

@@ -0,0 +1,54 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.wcm;
import java.util.List;
import java.util.Map;
/**
* Class for compareToPreviousSnapshot dialog
*
* @author ValerySh
*
*/
public class CompareToPreviousSnapshotDialog extends CompareSnapshotDialog
{
private static final long serialVersionUID = 5483551384486687197L;
/** description for dialog */
private static final String MSG_COMPARE_TO_PREVIOUS_DESCRIPTION = "snapshot_compare_to_previous_description";
public List<Map<String, String>> getComparedNodes()
{
int prevVersion = AVMCompareUtils.getPrevVersionID(getAvmService(), sandbox, version);
return AVMCompareUtils.getComparedNodes(getAvmSyncService(), version, storeRoot, prevVersion, storeRoot, null);
}
protected String getDescription()
{
return MSG_COMPARE_TO_PREVIOUS_DESCRIPTION;
}
}

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2005-2007 Alfresco Software Limited. * Copyright (C) 2005-2008 Alfresco Software Limited.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@@ -51,6 +51,7 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMCompareUtils;
import org.alfresco.web.bean.wcm.AVMUtil; import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.DeploymentUtil; import org.alfresco.web.bean.wcm.DeploymentUtil;
import org.alfresco.web.ui.common.ComponentConstants; import org.alfresco.web.ui.common.ComponentConstants;
@@ -70,6 +71,9 @@ public class UISandboxSnapshots extends SelfRenderingComponent
{ {
private static final String ACT_SNAPSHOT_PREVIEW = "snapshot_preview"; private static final String ACT_SNAPSHOT_PREVIEW = "snapshot_preview";
private static final String ACT_SNAPSHOT_REVERT = "snapshot_revert"; private static final String ACT_SNAPSHOT_REVERT = "snapshot_revert";
private static final String ACT_SNAPSHOT_COMPARE_TO_CURRENT = "snapshot_compare_to_current";
private static final String ACT_SNAPSHOT_COMPARE_TO_PREVIOUS = "snapshot_compare_to_previous";
private static final String ACT_SNAPSHOT_COMPARE_TO_ANY = "snapshot_compare_to_any";
private static final String ACT_SNAPSHOT_DEPLOY = "snapshot_deploy"; private static final String ACT_SNAPSHOT_DEPLOY = "snapshot_deploy";
private static final String REQUEST_SNAPVERSION = "_snapVer"; private static final String REQUEST_SNAPVERSION = "_snapVer";
@@ -114,10 +118,10 @@ public class UISandboxSnapshots extends SelfRenderingComponent
public void restoreState(FacesContext context, Object state) public void restoreState(FacesContext context, Object state)
{ {
Object values[] = (Object[])state; Object values[] = (Object[]) state;
// standard component attributes are restored by the super class // standard component attributes are restored by the super class
super.restoreState(context, values[0]); super.restoreState(context, values[0]);
this.value = (String)values[1]; this.value = (String) values[1];
} }
public Object saveState(FacesContext context) public Object saveState(FacesContext context)
@@ -214,11 +218,11 @@ public class UISandboxSnapshots extends SelfRenderingComponent
} }
else if (FILTER_DATE_WEEK.equals(dateFilter)) else if (FILTER_DATE_WEEK.equals(dateFilter))
{ {
fromDate = new Date(toDate.getTime() - (1000L*60L*60L*24L*7L)); fromDate = new Date(toDate.getTime() - (1000L * 60L * 60L * 24L * 7L));
} }
else if (FILTER_DATE_MONTH.equals(dateFilter)) else if (FILTER_DATE_MONTH.equals(dateFilter))
{ {
fromDate = new Date(toDate.getTime() - (1000L*60L*60L*24L*30L)); fromDate = new Date(toDate.getTime() - (1000L * 60L * 60L * 24L * 30L));
} }
else else
{ {
@@ -241,7 +245,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
determineDeploymentStatus(context, webProjectRef, sandbox, nodeService, avmService); determineDeploymentStatus(context, webProjectRef, sandbox, nodeService, avmService);
Map requestMap = context.getExternalContext().getRequestMap(); Map requestMap = context.getExternalContext().getRequestMap();
for (int i=versions.size() - 1; i >= 0; i--) // reverse order for (int i = versions.size() - 1; i >= 0; i--) // reverse order
{ {
VersionDescriptor item = versions.get(i); VersionDescriptor item = versions.get(i);
@@ -280,10 +284,10 @@ public class UISandboxSnapshots extends SelfRenderingComponent
Map<String, String> params = new HashMap<String, String>(2, 1.0f); Map<String, String> params = new HashMap<String, String>(2, 1.0f);
params.put("sandbox", sandbox); params.put("sandbox", sandbox);
params.put("version", "#{" + REQUEST_SNAPVERSION + "}"); params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
action = createAction(context, sandbox, ACT_SNAPSHOT_REVERT, "/images/icons/revert.gif", action = createAction(context, sandbox, ACT_SNAPSHOT_REVERT, "/images/icons/revert.gif", "#{AVMBrowseBean.revertSnapshot}", null, null, params);
"#{AVMBrowseBean.revertSnapshot}", null, null, params);
} }
requestMap.put(REQUEST_SNAPVERSION, Integer.toString(item.getVersionID())); requestMap.put(REQUEST_SNAPVERSION, Integer.toString(item.getVersionID()));
Utils.encodeRecursive(context, action); Utils.encodeRecursive(context, action);
@@ -297,20 +301,73 @@ public class UISandboxSnapshots extends SelfRenderingComponent
Map<String, String> params = new HashMap<String, String>(2, 1.0f); Map<String, String> params = new HashMap<String, String>(2, 1.0f);
params.put("version", "#{" + REQUEST_SNAPVERSION + "}"); params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
params.put("store", sandbox); params.put("store", sandbox);
action = createAction(context, sandbox, ACT_SNAPSHOT_DEPLOY, "/images/icons/deploy.gif", action = createAction(context, sandbox, ACT_SNAPSHOT_DEPLOY, "/images/icons/deploy.gif", "#{DialogManager.setupParameters}", "dialog:deployWebsite",
"#{DialogManager.setupParameters}", "dialog:deployWebsite", null, params); null, params);
} }
Utils.encodeRecursive(context, action); Utils.encodeRecursive(context, action);
} }
// TODO: restore once preview of a store by version is implemented in vserver // TODO: restore once preview of a store by version is implemented in vserver
//out.write("&nbsp;&nbsp;"); // out.write("&nbsp;&nbsp;");
/*Utils.encodeRecursive(context, aquireAction( /*
context, sandbox, ACT_SNAPSHOT_PREVIEW, null, * Utils.encodeRecursive(context, aquireAction( context, sandbox, ACT_SNAPSHOT_PREVIEW, null, null, null)); out.write("&nbsp;");
null, null)); */
out.write("&nbsp;");*/
boolean isLatestVersion = AVMCompareUtils.isLatestVersion(avmService, sandbox, version);
// /////////////////////////////////////////////////////////////////////////
if (!isLatestVersion)
{
out.write("&nbsp;&nbsp;");
// Compare To Current Snapshot
action = findAction(ACT_SNAPSHOT_COMPARE_TO_CURRENT, sandbox);
if (action == null)
{
Map<String, String> params = new HashMap<String, String>(2, 1.0f);
params.put("sandbox", sandbox);
params.put("store", sandbox);
params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
action = createAction(context, sandbox, ACT_SNAPSHOT_COMPARE_TO_CURRENT, "/images/icons/comparetocurrent.png", "#{DialogManager.setupParameters}",
"dialog:compareToCurrentSnapshot", null, params);
}
Utils.encodeRecursive(context, action);
}
boolean isFirstVersion = AVMCompareUtils.isFirstVersion(avmService, sandbox, version);
if (!isFirstVersion)
{
out.write("&nbsp;&nbsp;");
// Compare To previous Snapshot
action = findAction(ACT_SNAPSHOT_COMPARE_TO_PREVIOUS, sandbox);
if (action == null)
{
Map<String, String> params = new HashMap<String, String>(2, 1.0f);
params.put("sandbox", sandbox);
params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
action = createAction(context, sandbox, ACT_SNAPSHOT_COMPARE_TO_PREVIOUS, "/images/icons/comparetoprevious.png", "#{DialogManager.setupParameters}",
"dialog:compareToPreviousSnapshot", null, params);
}
Utils.encodeRecursive(context, action);
}
out.write("&nbsp;&nbsp;");
// //Compare To Any Snapshot
action = findAction(ACT_SNAPSHOT_COMPARE_TO_ANY, sandbox);
if (action == null)
{
Map<String, String> params = new HashMap<String, String>(2, 1.0f);
params.put("sandbox", sandbox);
params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
action = createAction(context, sandbox, ACT_SNAPSHOT_COMPARE_TO_ANY, "/images/icons/comparetoany.png", "#{DialogManager.setupParameters}",
"dialog:compareToAnySnapshot", null, params);
}
Utils.encodeRecursive(context, action);
requestMap.remove(REQUEST_SNAPVERSION); requestMap.remove(REQUEST_SNAPVERSION);
out.write("</nobr></td></tr>"); out.write("</nobr></td></tr>");
@@ -324,7 +381,16 @@ public class UISandboxSnapshots extends SelfRenderingComponent
} }
catch (Throwable err) catch (Throwable err)
{ {
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {} try
{
if (tx != null)
{
tx.rollback();
}
}
catch (Exception tex)
{
}
throw new RuntimeException(err); throw new RuntimeException(err);
} }
} }
@@ -338,11 +404,9 @@ public class UISandboxSnapshots extends SelfRenderingComponent
* @param icon Icon to display for the action * @param icon Icon to display for the action
* @param actionListener Actionlistener for the action * @param actionListener Actionlistener for the action
* @param outcome Navigation outcome for the action * @param outcome Navigation outcome for the action
*
* @return UIActionLink component * @return UIActionLink component
*/ */
private UIActionLink aquireAction(FacesContext fc, String sandbox, String name, String icon, private UIActionLink aquireAction(FacesContext fc, String sandbox, String name, String icon, String actionListener, String outcome)
String actionListener, String outcome)
{ {
return aquireAction(fc, sandbox, name, icon, actionListener, outcome, null, null); return aquireAction(fc, sandbox, name, icon, actionListener, outcome, null, null);
} }
@@ -358,11 +422,9 @@ public class UISandboxSnapshots extends SelfRenderingComponent
* @param outcome Navigation outcome for the action * @param outcome Navigation outcome for the action
* @param url HREF URL for the action * @param url HREF URL for the action
* @param params Parameters name/values for the action listener args * @param params Parameters name/values for the action listener args
*
* @return UIActionLink component * @return UIActionLink component
*/ */
private UIActionLink aquireAction(FacesContext fc, String sandbox, String name, String icon, private UIActionLink aquireAction(FacesContext fc, String sandbox, String name, String icon, String actionListener, String outcome, String url, Map<String, String> params)
String actionListener, String outcome, String url, Map<String, String> params)
{ {
UIActionLink action = findAction(name, sandbox); UIActionLink action = findAction(name, sandbox);
if (action == null) if (action == null)
@@ -377,7 +439,6 @@ public class UISandboxSnapshots extends SelfRenderingComponent
* *
* @param name Of the action component to find * @param name Of the action component to find
* @param sandbox Sandbox the action component is tied to * @param sandbox Sandbox the action component is tied to
*
* @return UIActionLink component if found, else null if not created yet * @return UIActionLink component if found, else null if not created yet
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -387,11 +448,11 @@ public class UISandboxSnapshots extends SelfRenderingComponent
String actionId = name + '_' + sandbox; String actionId = name + '_' + sandbox;
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Finding action Id: " + actionId); logger.debug("Finding action Id: " + actionId);
for (UIComponent component : (List<UIComponent>)getChildren()) for (UIComponent component : (List<UIComponent>) getChildren())
{ {
if (actionId.equals(component.getId())) if (actionId.equals(component.getId()))
{ {
action = (UIActionLink)component; action = (UIActionLink) component;
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("...found action Id: " + actionId); logger.debug("...found action Id: " + actionId);
break; break;
@@ -411,15 +472,13 @@ public class UISandboxSnapshots extends SelfRenderingComponent
* @param outcome Navigation outcome for the action * @param outcome Navigation outcome for the action
* @param url HREF URL for the action * @param url HREF URL for the action
* @param params Parameters name/values for the action listener args * @param params Parameters name/values for the action listener args
*
* @return UIActionLink child component * @return UIActionLink child component
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private UIActionLink createAction(FacesContext fc, String sandbox, String name, String icon, private UIActionLink createAction(FacesContext fc, String sandbox, String name, String icon, String actionListener, String outcome, String url, Map<String, String> params)
String actionListener, String outcome, String url, Map<String, String> params)
{ {
javax.faces.application.Application facesApp = fc.getApplication(); javax.faces.application.Application facesApp = fc.getApplication();
UIActionLink control = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK); UIActionLink control = (UIActionLink) facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
String id = name + '_' + sandbox; String id = name + '_' + sandbox;
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
@@ -432,13 +491,12 @@ public class UISandboxSnapshots extends SelfRenderingComponent
if (actionListener != null) if (actionListener != null)
{ {
control.setActionListener(facesApp.createMethodBinding( control.setActionListener(facesApp.createMethodBinding(actionListener, UIActions.ACTION_CLASS_ARGS));
actionListener, UIActions.ACTION_CLASS_ARGS));
// add sandbox as the default action listener parameter // add sandbox as the default action listener parameter
if (params == null) if (params == null)
{ {
UIParameter param = (UIParameter)facesApp.createComponent(ComponentConstants.JAVAX_FACES_PARAMETER); UIParameter param = (UIParameter) facesApp.createComponent(ComponentConstants.JAVAX_FACES_PARAMETER);
param.setId(id + "_1"); param.setId(id + "_1");
param.setName("sandbox"); param.setName("sandbox");
param.setValue(sandbox); param.setValue(sandbox);
@@ -450,7 +508,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
int idIndex = 1; int idIndex = 1;
for (String key : params.keySet()) for (String key : params.keySet())
{ {
UIParameter param = (UIParameter)facesApp.createComponent(ComponentConstants.JAVAX_FACES_PARAMETER); UIParameter param = (UIParameter) facesApp.createComponent(ComponentConstants.JAVAX_FACES_PARAMETER);
param.setId(id + '_' + Integer.toString(idIndex++)); param.setId(id + '_' + Integer.toString(idIndex++));
param.setName(key); param.setName(key);
String value = params.get(key); String value = params.get(key);
@@ -483,8 +541,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void determineDeploymentStatus(FacesContext context, NodeRef webProjectRef, private void determineDeploymentStatus(FacesContext context, NodeRef webProjectRef, String sandbox, NodeService nodeService, AVMService avmService)
String sandbox, NodeService nodeService, AVMService avmService)
{ {
// if the store property holding the last deployment id is non null a // if the store property holding the last deployment id is non null a
// deployment has been attempted // deployment has been attempted
@@ -500,23 +557,20 @@ public class UISandboxSnapshots extends SelfRenderingComponent
if (attempt != null) if (attempt != null)
{ {
// retrieve the snapshot deployed // retrieve the snapshot deployed
Integer ver = (Integer)nodeService.getProperty(attempt, Integer ver = (Integer) nodeService.getProperty(attempt, WCMAppModel.PROP_DEPLOYATTEMPTVERSION);
WCMAppModel.PROP_DEPLOYATTEMPTVERSION);
if (ver != null) if (ver != null)
{ {
this.deployAttemptVersion = ver.intValue(); this.deployAttemptVersion = ver.intValue();
} }
// determine if all required reports are present // determine if all required reports are present
List<String> selectedServers = (List<String>)nodeService.getProperty( List<String> selectedServers = (List<String>) nodeService.getProperty(attempt, WCMAppModel.PROP_DEPLOYATTEMPTSERVERS);
attempt, WCMAppModel.PROP_DEPLOYATTEMPTSERVERS);
int numServersSelected = 0; int numServersSelected = 0;
if (selectedServers != null) if (selectedServers != null)
{ {
numServersSelected = selectedServers.size(); numServersSelected = selectedServers.size();
List<ChildAssociationRef> deployReportRefs = nodeService.getChildAssocs( List<ChildAssociationRef> deployReportRefs = nodeService.getChildAssocs(attempt, WCMAppModel.ASSOC_DEPLOYMENTREPORTS, RegexQNamePattern.MATCH_ALL);
attempt, WCMAppModel.ASSOC_DEPLOYMENTREPORTS, RegexQNamePattern.MATCH_ALL);
if (deployReportRefs.size() >= numServersSelected) if (deployReportRefs.size() >= numServersSelected)
{ {
@@ -528,8 +582,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
NodeRef report = ref.getChildRef(); NodeRef report = ref.getChildRef();
// get the deploy outcome // get the deploy outcome
Boolean successful = (Boolean)nodeService.getProperty(report, Boolean successful = (Boolean) nodeService.getProperty(report, WCMAppModel.PROP_DEPLOYSUCCESSFUL);
WCMAppModel.PROP_DEPLOYSUCCESSFUL);
if (successful != null) if (successful != null)
{ {
@@ -570,10 +623,9 @@ public class UISandboxSnapshots extends SelfRenderingComponent
private AVMService getAVMService(FacesContext fc) private AVMService getAVMService(FacesContext fc)
{ {
return (AVMService)FacesContextUtils.getRequiredWebApplicationContext(fc).getBean("AVMLockingAwareService"); return (AVMService) FacesContextUtils.getRequiredWebApplicationContext(fc).getBean("AVMLockingAwareService");
} }
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Strongly typed component property accessors // Strongly typed component property accessors
@@ -587,7 +639,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
ValueBinding vb = getValueBinding("value"); ValueBinding vb = getValueBinding("value");
if (vb != null) if (vb != null)
{ {
this.value = (String)vb.getValue(getFacesContext()); this.value = (String) vb.getValue(getFacesContext());
} }
return this.value; return this.value;
@@ -611,7 +663,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
ValueBinding vb = getValueBinding("dateFilter"); ValueBinding vb = getValueBinding("dateFilter");
if (vb != null) if (vb != null)
{ {
this.dateFilter = (String)vb.getValue(getFacesContext()); this.dateFilter = (String) vb.getValue(getFacesContext());
} }
return this.dateFilter; return this.dateFilter;

View File

@@ -4188,6 +4188,48 @@
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<!-- compare to currrent -->
<managed-bean>
<description>
The bean that AVM Compure to current snapshot
</description>
<managed-bean-name>CompareToCurrentSnapshot</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.CompareToCurrentSnapshotDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value>
</managed-property>
</managed-bean>
<!-- end compare to currrent -->
<!-- compare to previous -->
<managed-bean>
<description>
The bean that AVM Compure to prev snapshot
</description>
<managed-bean-name>CompareToPreviousSnapshot</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.CompareToPreviousSnapshotDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value>
</managed-property>
</managed-bean>
<!-- end compare to previous -->
<!-- CompareToAny -->
<managed-bean>
<managed-bean-name>CompareToAnySnapshot</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.CompareToAnySnapshotDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value>
</managed-property>
</managed-bean>
<!-- End CompareToAny -->
<managed-bean> <managed-bean>
<description> <description>
The bean that backs up the Change Expiration Date Dialog The bean that backs up the Change Expiration Date Dialog

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,84 @@
<%--
* Copyright (C) 2005-2008 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%>
<h:panelGrid columns="7">
<h:outputText id="sandbox-selection-description" value="#{msg.store_title}:" />
<h:selectOneMenu value="#{DialogManager.bean.userSpecifiedSnapshot}" onchange="document.forms['dialog'].submit(); return true;">
<f:selectItems value="#{DialogManager.bean.storesList}" />
</h:selectOneMenu>
<h:outputText id="version-selection-description" value="#{msg.version_title}:" />
<h:inputText id="version-value" size="5" value="#{DialogManager.bean.userSpecifiedVersion}" required="true">
<f:converter converterId="javax.faces.Integer" />
</h:inputText>
<h:commandButton id="increment-version-value-button" image="/images/icons/arrow_up.gif" title="#{msg.increment_button_hint}"
actionListener="#{DialogManager.bean.incrementVersion}" rendered="#{!DialogManager.bean.incrementVersionButtonDisabled}" />
<h:commandButton image="/images/icons/arrow_up_disabled.gif" title="#{msg.increment_button_hint}" rendered="#{DialogManager.bean.incrementVersionButtonDisabled}" disabled="true" />
<h:commandButton id="decrement-version-value-button" image="/images/icons/arrow_down.gif" title="#{msg.decrement_button_hint}"
actionListener="#{DialogManager.bean.decrementVersion}" rendered="#{!DialogManager.bean.decrementVersionButtonDisabled}" />
<h:commandButton image="/images/icons/arrow_down_disabled.gif" title="#{msg.decrement_button_hint}" rendered="#{DialogManager.bean.decrementVersionButtonDisabled}" disabled="true" />
<h:commandButton id="refresh-compare-panel" image="/images/icons/reset.gif" title="#{msg.refresh_button_hint}" actionListener="#{DialogManager.bean.refreshComparePanel}" />
<br />
<br />
</h:panelGrid>
<h:dataTable value="#{DialogManager.bean.comparedNodes}" var="row" width="100%" styleClass="selectedItems" headerClass="selectedItemsHeader" cellspacing="0"
cellpadding="4" style="margin-top: 4px; margin-bottom: 4px;">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.snapshot_name}" />
</f:facet>
<h:outputText value="#{row.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.snapshot_path}" />
</f:facet>
<h:outputText value="#{row.path}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.snapshot_status}" />
</f:facet>
<h:outputText value="#{row.status}" />
</h:column>
</h:dataTable>

View File

@@ -0,0 +1,55 @@
<%--
* Copyright (C) 2005-2008 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%>
<h:dataTable value="#{DialogManager.bean.comparedNodes}" var="row" width="100%" styleClass="selectedItems" headerClass="selectedItemsHeader" cellspacing="0"
cellpadding="4" style="margin-bottom: 4px;">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.snapshot_name}" />
</f:facet>
<h:outputText value="#{row.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.snapshot_path}" />
</f:facet>
<h:outputText value="#{row.path}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.snapshot_status}" />
</f:facet>
<h:outputText value="#{row.status}" />
</h:column>
</h:dataTable>