mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
- Fixed various delete issues
- Add new delete icons for forums types git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2100 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,7 +32,9 @@ import org.alfresco.model.ForumModel;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
@@ -128,5 +130,52 @@ public class NewDiscussionWizard extends NewTopicWizard
|
||||
context.getApplication().getNavigationHandler().handleNavigation(context, null, "dialog:createDiscussion");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.wizard.AbstractWizardBean#cancel()
|
||||
*/
|
||||
@Override
|
||||
public String cancel()
|
||||
{
|
||||
// if we cancel the creation of a discussion all the setup that was done
|
||||
// when the wizard started needs to be undone i.e. removing the created forum
|
||||
// and the discussable aspect
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
UserTransaction tx = null;
|
||||
|
||||
try
|
||||
{
|
||||
tx = Repository.getUserTransaction(context);
|
||||
tx.begin();
|
||||
|
||||
// remove the discussable aspect from the node we were going to discuss!
|
||||
this.nodeService.removeAspect(this.discussingNodeRef, ForumModel.ASPECT_DISCUSSABLE);
|
||||
|
||||
// delete the forum space created when the wizard started
|
||||
this.browseBean.setActionSpace(this.navigator.getCurrentNode());
|
||||
this.browseBean.deleteSpaceOK();
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// rollback the transaction
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
context, Repository.ERROR_GENERIC), e.getMessage()), e);
|
||||
}
|
||||
|
||||
// do cancel processing
|
||||
super.cancel();
|
||||
|
||||
// as we are cancelling the creation of a discussion we know we need to go back
|
||||
// to the browse screen, this also makes sure we don't end up in the forum that
|
||||
// just got deleted!
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
||||
AlfrescoNavigationHandler.DIALOG_SEPARATOR + "browse";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -43,9 +43,15 @@ public class NewForumWizard extends NewSpaceWizard
|
||||
@Override
|
||||
public String finish()
|
||||
{
|
||||
super.finish();
|
||||
String outcome = super.finish();
|
||||
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
// if we had a successful outcome from the creation close the dialog
|
||||
if (outcome != null);
|
||||
{
|
||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -43,9 +43,15 @@ public class NewForumsWizard extends NewSpaceWizard
|
||||
@Override
|
||||
public String finish()
|
||||
{
|
||||
super.finish();
|
||||
String outcome = super.finish();
|
||||
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
// if we had a successful outcome from the creation close the dialog
|
||||
if (outcome != null);
|
||||
{
|
||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,6 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.ForumModel;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.bean.ForumsBean;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
@@ -113,9 +112,15 @@ public class NewPostWizard extends CreateContentWizard
|
||||
this.content = Utils.replaceLineBreaks(this.content);
|
||||
}
|
||||
|
||||
super.finish();
|
||||
String outcome = super.finish();
|
||||
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
// if we had a successful outcome from the creation close the dialog
|
||||
if (outcome != null);
|
||||
{
|
||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -96,9 +96,15 @@ public class NewReplyWizard extends NewPostWizard
|
||||
// remove link breaks and replace with <br/>
|
||||
this.content = Utils.replaceLineBreaks(this.content);
|
||||
|
||||
super.finish();
|
||||
String outcome = super.finish();
|
||||
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
// if we had a successful outcome from the creation close the dialog
|
||||
if (outcome != null);
|
||||
{
|
||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -140,18 +140,22 @@ public class NewTopicWizard extends NewSpaceWizard
|
||||
@Override
|
||||
public String finish()
|
||||
{
|
||||
super.finish();
|
||||
String outcome = super.finish();
|
||||
|
||||
String outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
|
||||
if (this.editMode == false)
|
||||
// if we had a successful outcome work out the outcome to return
|
||||
if (outcome != null)
|
||||
{
|
||||
// if we are successful in creating the topic we need to setup
|
||||
// the browse context for the new topic and pass an override
|
||||
// outcome of 'showTopic'
|
||||
this.browseBean.clickSpace(this.createdNode);
|
||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
|
||||
outcome = outcome + AlfrescoNavigationHandler.DIALOG_SEPARATOR + "showTopic";
|
||||
if (this.editMode == false)
|
||||
{
|
||||
// if we are successful in creating the topic we need to setup
|
||||
// the browse context for the new topic and pass an override
|
||||
// outcome of 'showTopic'
|
||||
this.browseBean.clickSpace(this.createdNode);
|
||||
|
||||
outcome = outcome + AlfrescoNavigationHandler.DIALOG_SEPARATOR + "showTopic";
|
||||
}
|
||||
}
|
||||
|
||||
return outcome;
|
||||
|
Reference in New Issue
Block a user