11-02-2007 07:25 AM
11-02-2007 08:31 AM
11-05-2007 03:02 AM
/**
* (Based on Alfresco 2.1.)
*/
protected void renderReadOnlyAssociations(FacesContext context, ResponseWriter out, NodeService nodeService) throws IOException
{
if (this.originalAssocs.size() > 0)
{
out.write("<table cellspacing='0' cellpadding='2' border='0'>");
Iterator iter = this.originalAssocs.values().iterator();
while (iter.hasNext())
{
out.write("<tr><td>");
ChildAssociationRef assoc = (ChildAssociationRef)iter.next();
NodeRef targetNode = assoc.getChildRef();
// if the node represents a person, show the username instead of the name
if (ContentModel.TYPE_PERSON.equals(nodeService.getType(targetNode)))
{
out.write(User.getFullName(nodeService, targetNode));
}
else if (ContentModel.TYPE_AUTHORITY_CONTAINER.equals(nodeService.getType(targetNode)))
{
// if the node represents a group, show the group name instead of the name
int offset = PermissionService.GROUP_PREFIX.length();
String group = (String)nodeService.getProperty(targetNode,
ContentModel.PROP_AUTHORITY_NAME);
out.write(group.substring(offset));
}
else
{
/* Original:
out.write(Repository.getDisplayPath(nodeService.getPath(targetNode)));
out.write("/");
out.write(Repository.getNameForNode(nodeService, targetNode));
*/
out.write("<a href=\"/alfresco/navigate/showDocDetails/workspace/SpacesStore/");
out.write(targetNode.getId());
//out.write("/");
//out.write(Repository.getNameForNode(nodeService, targetNode));
out.write("\">");
out.write(Repository.getNameForNode(nodeService, targetNode));
out.write("</a>");
}
out.write("</tr></td>");
}
out.write("</table>");
}
Instead of this, I'd generate an action, as it is done in BaseAssociationEditor.java:/* … */
out.write("' onclick=\"");
out.write(generateFormSubmit(context, Integer.toString(ACTION_SHOW_DIALOG_FOR_LINK)));
out.write("\"/>");
11-05-2007 03:50 AM
11-05-2007 04:05 AM
/* … */
out.write("' onclick=\"");
out.write(generateFormSubmit(context, Integer.toString(ACTION_SHOW_DIALOG_FOR_LINK+ ACTION_SEPARATOR + targetRef.toString()))));
out.write("\"/>");
3/ I think the decode method can be kept unchanged and you can modify the broadcast method to manage the ACTION_SHOW_DIALOG_FOR_LINK event.11-05-2007 04:11 AM
public void setupContentAction(String id, boolean invalidate)
11-05-2007 05:29 AM
public void broadcast(FacesEvent event) throws AbortProcessingException
{
boolean handled = false;
if (event instanceof AssocEditorEvent)
{
AssocEditorEvent assocEvent = (AssocEditorEvent)event;
Node node = (Node)getValue();
if (assocEvent.Action == ACTION_OPEN_ASSOC_LINK) {
// get browse bean
FacesContext fc = FacesContext.getCurrentInstance();
BrowseBean browseBean = (BrowseBean)FacesHelper.getManagedBean(fc, BrowseBean.BEAN_NAME);
// redirect
String targetID = assocEvent.RemoveRef; // TODO: RemoveRef is re/mis-used!!
logger.debug("ACTION_OPEN_ASSOC_LINK: moving to link target node " + targetID + ".");
browseBean.setupContentAction(targetID, true); // TODO: true or false?
handled = true;
}
}
if (!handled)
super.broadcast(event);
}
11-05-2007 08:11 AM
11-05-2007 08:59 AM
11-05-2007 09:17 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.