mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V1.4 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3925 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3965 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3966 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -157,6 +157,8 @@ public class TrashcanBean implements IContextListener
|
||||
/** User filter search box text */
|
||||
private String userSearchText = null;
|
||||
|
||||
private boolean inProgress = false;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
@@ -784,43 +786,54 @@ public class TrashcanBean implements IContextListener
|
||||
*/
|
||||
public String recoverListedItemsOK()
|
||||
{
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
if (inProgress == true) return null;
|
||||
|
||||
// restore the nodes - the user may have requested a restore to a different parent
|
||||
List<NodeRef> nodeRefs = new ArrayList<NodeRef>(this.listedItems.size());
|
||||
for (Node node : this.listedItems)
|
||||
{
|
||||
nodeRefs.add(node.getNodeRef());
|
||||
}
|
||||
List<RestoreNodeReport> reports;
|
||||
if (this.destination == null)
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreArchivedNodes(nodeRefs);
|
||||
}
|
||||
else
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreArchivedNodes(nodeRefs, this.destination, null, null);
|
||||
}
|
||||
inProgress = true;
|
||||
|
||||
UserTransaction tx = null;
|
||||
try
|
||||
{
|
||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance(), true);
|
||||
tx.begin();
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
|
||||
saveReportDetail(reports);
|
||||
// restore the nodes - the user may have requested a restore to a different parent
|
||||
List<NodeRef> nodeRefs = new ArrayList<NodeRef>(this.listedItems.size());
|
||||
for (Node node : this.listedItems)
|
||||
{
|
||||
nodeRefs.add(node.getNodeRef());
|
||||
}
|
||||
List<RestoreNodeReport> reports;
|
||||
if (this.destination == null)
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreArchivedNodes(nodeRefs);
|
||||
}
|
||||
else
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreArchivedNodes(nodeRefs, this.destination, null, null);
|
||||
}
|
||||
|
||||
tx.commit();
|
||||
UserTransaction tx = null;
|
||||
try
|
||||
{
|
||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance(), true);
|
||||
tx.begin();
|
||||
|
||||
saveReportDetail(reports);
|
||||
|
||||
tx.commit();
|
||||
}
|
||||
catch (Throwable err)
|
||||
{
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||
// most exceptions will be caught and returned as RestoreNodeReport objects by the service
|
||||
String reason = err.getMessage();
|
||||
String msg = MessageFormat.format(
|
||||
Application.getMessage(fc, Repository.ERROR_GENERIC), reason);
|
||||
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
|
||||
fc.addMessage(null, facesMsg);
|
||||
}
|
||||
}
|
||||
catch (Throwable err)
|
||||
finally
|
||||
{
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||
// most exceptions will be caught and returned as RestoreNodeReport objects by the service
|
||||
String reason = err.getMessage();
|
||||
String msg = MessageFormat.format(
|
||||
Application.getMessage(fc, Repository.ERROR_GENERIC), reason);
|
||||
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
|
||||
fc.addMessage(null, facesMsg);
|
||||
inProgress = false;
|
||||
}
|
||||
|
||||
return OUTCOME_RECOVERY_REPORT;
|
||||
@@ -831,38 +844,49 @@ public class TrashcanBean implements IContextListener
|
||||
*/
|
||||
public String recoverAllItemsOK()
|
||||
{
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
if (inProgress == true) return null;
|
||||
|
||||
// restore all nodes - the user may have requested a restore to a different parent
|
||||
List<RestoreNodeReport> reports;
|
||||
if (this.destination == null)
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreAllArchivedNodes(Repository.getStoreRef());
|
||||
}
|
||||
else
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreAllArchivedNodes(Repository.getStoreRef(), this.destination, null, null);
|
||||
}
|
||||
inProgress = true;
|
||||
|
||||
UserTransaction tx = null;
|
||||
try
|
||||
{
|
||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance(), true);
|
||||
tx.begin();
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
|
||||
saveReportDetail(reports);
|
||||
// restore all nodes - the user may have requested a restore to a different parent
|
||||
List<RestoreNodeReport> reports;
|
||||
if (this.destination == null)
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreAllArchivedNodes(Repository.getStoreRef());
|
||||
}
|
||||
else
|
||||
{
|
||||
reports = this.nodeArchiveService.restoreAllArchivedNodes(Repository.getStoreRef(), this.destination, null, null);
|
||||
}
|
||||
|
||||
tx.commit();
|
||||
UserTransaction tx = null;
|
||||
try
|
||||
{
|
||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance(), true);
|
||||
tx.begin();
|
||||
|
||||
saveReportDetail(reports);
|
||||
|
||||
tx.commit();
|
||||
}
|
||||
catch (Throwable err)
|
||||
{
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||
// most exceptions will be caught and returned as RestoreNodeReport objects by the service
|
||||
String reason = err.getMessage();
|
||||
String msg = MessageFormat.format(
|
||||
Application.getMessage(fc, Repository.ERROR_GENERIC), reason);
|
||||
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
|
||||
fc.addMessage(null, facesMsg);
|
||||
}
|
||||
}
|
||||
catch (Throwable err)
|
||||
finally
|
||||
{
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||
// most exceptions will be caught and returned as RestoreNodeReport objects by the service
|
||||
String reason = err.getMessage();
|
||||
String msg = MessageFormat.format(
|
||||
Application.getMessage(fc, Repository.ERROR_GENERIC), reason);
|
||||
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
|
||||
fc.addMessage(null, facesMsg);
|
||||
inProgress = false;
|
||||
}
|
||||
|
||||
return OUTCOME_RECOVERY_REPORT;
|
||||
@@ -883,6 +907,10 @@ public class TrashcanBean implements IContextListener
|
||||
*/
|
||||
public String deleteListedItemsOK()
|
||||
{
|
||||
if (inProgress == true) return null;
|
||||
|
||||
inProgress = true;
|
||||
|
||||
try
|
||||
{
|
||||
List<NodeRef> nodeRefs = new ArrayList<NodeRef>(this.listedItems.size());
|
||||
@@ -897,6 +925,10 @@ public class TrashcanBean implements IContextListener
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||
}
|
||||
finally
|
||||
{
|
||||
inProgress = false;
|
||||
}
|
||||
|
||||
return OUTCOME_DIALOGCLOSE;
|
||||
}
|
||||
@@ -906,6 +938,10 @@ public class TrashcanBean implements IContextListener
|
||||
*/
|
||||
public String deleteAllItemsOK()
|
||||
{
|
||||
if (inProgress == true) return null;
|
||||
|
||||
inProgress = true;
|
||||
|
||||
try
|
||||
{
|
||||
this.nodeArchiveService.purgeAllArchivedNodes(Repository.getStoreRef());
|
||||
@@ -915,6 +951,10 @@ public class TrashcanBean implements IContextListener
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||
}
|
||||
finally
|
||||
{
|
||||
inProgress = false;
|
||||
}
|
||||
|
||||
return OUTCOME_DIALOGCLOSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user