mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. Added NodeEventListener calls to BrowseBean setActionSpace() and setDocument() methods
- Allows code "extensions" to the web-client such as Forums and TaskList to no longer add code directly to existing managed beans DocumentDetailsBean or SpaceDetailsBean - Also as a side-effect nicely fixes an unreported bug where the CheckIn action in the Document Details page was not correctly using the forums specific CheckIn resolver git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2435 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -229,6 +229,10 @@ public class BrowseBean implements IContextListener
|
|||||||
*/
|
*/
|
||||||
public void setActionSpace(Node actionSpace)
|
public void setActionSpace(Node actionSpace)
|
||||||
{
|
{
|
||||||
|
for (NodeEventListener listener : getNodeEventListeners())
|
||||||
|
{
|
||||||
|
listener.created(actionSpace, actionSpace.getType());
|
||||||
|
}
|
||||||
this.actionSpace = actionSpace;
|
this.actionSpace = actionSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,6 +249,10 @@ public class BrowseBean implements IContextListener
|
|||||||
*/
|
*/
|
||||||
public void setDocument(Node document)
|
public void setDocument(Node document)
|
||||||
{
|
{
|
||||||
|
for (NodeEventListener listener : getNodeEventListeners())
|
||||||
|
{
|
||||||
|
listener.created(document, document.getType());
|
||||||
|
}
|
||||||
this.document = document;
|
this.document = document;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,7 +21,6 @@ import java.text.MessageFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -32,7 +31,6 @@ import javax.transaction.UserTransaction;
|
|||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.ForumModel;
|
|
||||||
import org.alfresco.repo.content.MimetypeMap;
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.service.cmr.lock.LockService;
|
import org.alfresco.service.cmr.lock.LockService;
|
||||||
import org.alfresco.service.cmr.repository.ContentData;
|
import org.alfresco.service.cmr.repository.ContentData;
|
||||||
@@ -227,14 +225,6 @@ public class DocumentDetailsBean
|
|||||||
return getDocument().hasAspect(ContentModel.ASPECT_INLINEEDITABLE);
|
return getDocument().hasAspect(ContentModel.ASPECT_INLINEEDITABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return true if the Document has a discussion attached to it
|
|
||||||
*/
|
|
||||||
public boolean isBeingDiscussed()
|
|
||||||
{
|
|
||||||
return getDocument().hasAspect(ForumModel.ASPECT_DISCUSSABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of objects representing the versions of the
|
* Returns a list of objects representing the versions of the
|
||||||
* current document
|
* current document
|
||||||
|
@@ -29,7 +29,6 @@ import javax.faces.model.SelectItem;
|
|||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.ForumModel;
|
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
@@ -155,14 +154,6 @@ public class SpaceDetailsBean
|
|||||||
return getSpace().getName();
|
return getSpace().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return true if the Space has a discussion attached to it
|
|
||||||
*/
|
|
||||||
public boolean isBeingDiscussed()
|
|
||||||
{
|
|
||||||
return getSpace().hasAspect(ForumModel.ASPECT_DISCUSSABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the WebDAV URL for the current space
|
* Returns the WebDAV URL for the current space
|
||||||
*
|
*
|
||||||
|
@@ -176,12 +176,12 @@
|
|||||||
</a:actionLink>
|
</a:actionLink>
|
||||||
|
|
||||||
<%-- discussion --%>
|
<%-- discussion --%>
|
||||||
<a:booleanEvaluator value="#{DocumentDetailsBean.beingDiscussed == true}">
|
<a:booleanEvaluator value='#{DocumentDetailsBean.document.properties["beingDiscussed"] == true}'>
|
||||||
<a:actionLink value="#{msg.discuss}" image="/images/icons/forum.gif" actionListener="#{ForumsBean.discuss}">
|
<a:actionLink value="#{msg.discuss}" image="/images/icons/forum.gif" actionListener="#{ForumsBean.discuss}">
|
||||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||||
</a:actionLink>
|
</a:actionLink>
|
||||||
</a:booleanEvaluator>
|
</a:booleanEvaluator>
|
||||||
<a:booleanEvaluator value="#{DocumentDetailsBean.beingDiscussed == false}">
|
<a:booleanEvaluator value='#{DocumentDetailsBean.document.properties["beingDiscussed"] == false}'>
|
||||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="CreateChildren">
|
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="CreateChildren">
|
||||||
<a:actionLink value="#{msg.start_discussion}" image="/images/icons/create_forum.gif" actionListener="#{CreateDiscussionDialog.startWizard}">
|
<a:actionLink value="#{msg.start_discussion}" image="/images/icons/create_forum.gif" actionListener="#{CreateDiscussionDialog.startWizard}">
|
||||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||||
|
@@ -121,12 +121,12 @@
|
|||||||
</a:actionLink>
|
</a:actionLink>
|
||||||
</r:permissionEvaluator>
|
</r:permissionEvaluator>
|
||||||
|
|
||||||
<a:booleanEvaluator value="#{SpaceDetailsBean.beingDiscussed == true}">
|
<a:booleanEvaluator value='#{SpaceDetailsBean.space.properties["beingDiscussed"] == true}'>
|
||||||
<a:actionLink value="#{msg.discuss}" image="/images/icons/forum.gif" actionListener="#{ForumsBean.discuss}">
|
<a:actionLink value="#{msg.discuss}" image="/images/icons/forum.gif" actionListener="#{ForumsBean.discuss}">
|
||||||
<f:param name="id" value="#{SpaceDetailsBean.id}" />
|
<f:param name="id" value="#{SpaceDetailsBean.id}" />
|
||||||
</a:actionLink>
|
</a:actionLink>
|
||||||
</a:booleanEvaluator>
|
</a:booleanEvaluator>
|
||||||
<a:booleanEvaluator value="#{SpaceDetailsBean.beingDiscussed == false}">
|
<a:booleanEvaluator value='#{SpaceDetailsBean.space.properties["beingDiscussed"] == false}'>
|
||||||
<r:permissionEvaluator value="#{SpaceDetailsBean.space}" allow="CreateChildren">
|
<r:permissionEvaluator value="#{SpaceDetailsBean.space}" allow="CreateChildren">
|
||||||
<a:actionLink value="#{msg.start_discussion}" image="/images/icons/create_forum.gif" actionListener="#{CreateDiscussionDialog.startWizard}">
|
<a:actionLink value="#{msg.start_discussion}" image="/images/icons/create_forum.gif" actionListener="#{CreateDiscussionDialog.startWizard}">
|
||||||
<f:param name="id" value="#{SpaceDetailsBean.id}" />
|
<f:param name="id" value="#{SpaceDetailsBean.id}" />
|
||||||
|
Reference in New Issue
Block a user