Ajax pop-up summary panel code refactored into generic library.

First cut of the My Tasks webscript..
Added "url.context" help object to template model for TemplateContentServlet.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5549 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-04-25 14:33:29 +00:00
parent 4a22fc137a
commit eecfcd3485
16 changed files with 510 additions and 112 deletions

View File

@@ -11,8 +11,8 @@
<#assign navurl="/navigate/showSpaceDetails/"> <#assign navurl="/navigate/showSpaceDetails/">
</#if> </#if>
<#assign navurl=navurl + node.nodeRef.storeRef.protocol + '/' + node.nodeRef.storeRef.identifier + '/' + node.nodeRef.id> <#assign navurl=navurl + node.nodeRef.storeRef.protocol + '/' + node.nodeRef.storeRef.identifier + '/' + node.nodeRef.id>
<td width=24><center><a href='${absurl(navurl)}'><img src='${absurl("/images/icons/View_details.gif")}' style='cursor:pointer' width=12 height=16 border=0 title="Details" alt="Details"></a></center></td> <td width=24><center><a href='${url.context}${navurl}'><img src='${url.context}/images/icons/View_details.gif' style='cursor:pointer' width=12 height=16 border=0 title="Details" alt="Details"></a></center></td>
<td width=14 align=right><img src='${absurl("/images/icons/close_panel.gif")}' onclick="AlfNodeInfoMgr.close('${node.nodeRef}');" style='cursor:pointer' width=14 height=14 border=0 title="Close" alt="Close"></td> <td width=14 align=right><img src='${url.context}/images/icons/close_panel.gif' onclick="AlfNodeInfoMgr.close('${node.nodeRef}');" style='cursor:pointer' width=14 height=14 border=0 title="Close" alt="Close"></td>
</tr> </tr>
</table> </table>
</td> </td>
@@ -23,27 +23,27 @@
<#assign isImage=node.isDocument && (node.mimetype = "image/gif" || node.mimetype = "image/jpeg" || node.mimetype = "image/png")> <#assign isImage=node.isDocument && (node.mimetype = "image/gif" || node.mimetype = "image/jpeg" || node.mimetype = "image/png")>
<#assign isVideo=node.isDocument && node.mimetype?starts_with("video/")> <#assign isVideo=node.isDocument && node.mimetype?starts_with("video/")>
<#if isImage> <#if isImage>
<a href="${absurl(node.url)}" target="new"><img src="${absurl(node.url)}" width=120 border=0></a> <a href="${url.context}${node.url}" target="new"><img src="${url.context}${node.url}" width=120 border=0></a>
<#elseif isVideo> <#elseif isVideo>
<object width="320" height="240" border="0" id="player"> <object width="320" height="240" border="0" id="player">
<param name="UIMode" value="none" /> <param name="UIMode" value="none" />
<param name="URL" value="${absurl(node.url)}" /> <param name="URL" value="${url.context}${node.url}" />
<param name="autoStart" value="true" /> <param name="autoStart" value="true" />
<#--<embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" src="${absurl(node.url)}" showcontrols="1" showdisplay="0" showstatusbar="0" autosize="1" autoplay="0" autoStart="0" height="240" width="320"></embed>--> <#--<embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" src="${url.context}${node.url}" showcontrols="1" showdisplay="0" showstatusbar="0" autosize="1" autoplay="0" autoStart="0" height="240" width="320"></embed>-->
<embed width="320" height="240" src="${absurl(node.url)}" border="0" showcontrols="1" showdisplay="0" showstatusbar="0" autosize="1" autoplay="0" autoStart="0"></embed> <embed width="320" height="240" src="${url.context}${node.url}" border="0" showcontrols="1" showdisplay="0" showstatusbar="0" autosize="1" autoplay="0" autoStart="0"></embed>
</object> </object>
<#else> <#else>
<table cellspacing=0 cellpadding=0 border=0> <table cellspacing=0 cellpadding=0 border=0>
<tr> <tr>
<td> <td>
<div style="border: thin solid #cccccc; padding:4px"> <div style="border: thin solid #cccccc; padding:4px">
<a href="${absurl(node.url)}" <#if node.isDocument>target="new"</#if>><img src="${absurl(node.icon32)}" width=32 height=32 border=0></a> <a href="${url.context}${node.url}" <#if node.isDocument>target="new"</#if>><img src="${url.context}${node.icon32}" width=32 height=32 border=0></a>
</div> </div>
</td> </td>
<td><img src="${absurl('/images/parts/rightSideShadow42.gif')}" width=6 height=42></td> <td><img src="${url.context}/images/parts/rightSideShadow42.gif" width=6 height=42></td>
</tr> </tr>
<tr> <tr>
<td colspan=2><img src="${absurl('/images/parts/bottomShadow42.gif')}" width=48 height=5></td> <td colspan=2><img src="${url.context}/images/parts/bottomShadow42.gif" width=48 height=5></td>
</tr> </tr>
</table> </table>
</#if> </#if>

View File

@@ -0,0 +1,48 @@
<div class="taskPopupPanel">
<table cellpadding='3' cellspacing='0'>
<tr>
<td colspan='2' class='mainSubTitle'>
<table cellspacing='0' cellpadding='0' width='100%' style='cursor:move' id='dragable'>
<tr>
<td class='mainSubTitle'>${task.description}</td>
<td width=14 align=right><img src='${url.context}/images/icons/close_panel.gif' onclick="TaskInfoMgr.close('${task.id}');" style='cursor:pointer' width=14 height=14 border=0 title="Close" alt="Close"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top'>
<table cellpadding='2' cellspacing='0'>
<tr><td>Type:</td><td>${task.type?html}</td></tr>
<tr><td>Name:</td><td>${task.name?html}</td></tr>
<tr><td>Start Date:</td><td>${task.startDate?date}</td></tr>
<tr><td>Due Date:</td><td>
<#if task.properties["bpm:dueDate"]?exists>
${task.startDate?date}
<#else>
<i>None</i>
</#if>
</td></tr>
<tr><td>Priority:</td><td>${task.properties["bpm:priority"]}</td>
<tr><td>Percent Completed:</td><td>${task.properties["bpm:percentComplete"]}</td>
<tr><td>Status:</td><td>${task.properties["bpm:status"]}</td>
<tr><td>Completed:</td><td>${task.isCompleted?string("Yes", "No")}</td>
</table>
</td>
</tr>
</table>
</div>
<STYLE type="text/css">
.taskPopupPanel
{
background-image: url(../images/parts/popup_bg.gif);
background-repeat: repeat-x;
background-color: #F9F1A8;
border: 1px solid #F6DEA0;
padding: 4px;
max-width: 700px;
margin: 0px 0px 0px 0px;
}
</STYLE>

View File

@@ -0,0 +1,7 @@
<webscript>
<shortname>My Tasks</shortname>
<description>Generate the My Tasks portlet page</description>
<url format="html" template="/mytasks?f={filter?}"/>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,173 @@
<link rel="stylesheet" href="${url.context}/css/main.css" TYPE="text/css">
<script type="text/javascript" src="/alfresco/scripts/ajax/yahoo/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="/alfresco/scripts/ajax/yahoo/connection/connection-min.js"></script>
<script type="text/javascript" src="/alfresco/scripts/ajax/yahoo/dom/dom-min.js"></script>
<script type="text/javascript" src="/alfresco/scripts/ajax/yahoo/event/event-min.js"></script>
<script type="text/javascript" src="/alfresco/scripts/ajax/yahoo/animation/animation-min.js"></script>
<script type="text/javascript" src="/alfresco/scripts/ajax/yahoo/dragdrop/dragdrop-min.js"></script>
<script type="text/javascript" src="/alfresco/scripts/ajax/common.js"></script>
<script type="text/javascript" src="/alfresco/scripts/ajax/summary-info.js"></script>
<script type="text/javascript">setContextPath('${url.context}');</script>
<script>
// create manager object for the pop-up summary panels
var TaskInfoMgr = new Alfresco.PanelManager("TaskInfoBean.sendTaskInfo", "taskId");
function taskMouseOver(el)
{
el._prevbg = el.style.backgroundColor;
el.style.backgroundColor = "#FFE500";
el.style.borderBottom = "1px solid #82770B";
el.style.borderTop = "1px solid #82770B";
}
function taskMouseOut(el)
{
el.style.backgroundColor = el._prevbg;
el.style.borderBottom = "1px solid #EBE398";
el.style.borderTop = "1px solid #FEF8BC";
}
</script>
<#-- get the filter mode from the passed in args -->
<#-- filters: 0=all, 1=today, 2=next week, 3=no due date, 4=overdue -->
<#if args.f?exists><#assign filter=args.f?number><#else><#assign filter=0></#if>
<table border=0 cellspacing=0 cellpadding=0 class="taskTable">
<tr>
<td width=36 bgcolor="#F9F3B0">&nbsp;</td>
<td align=center height=40 style="border-left: 1px solid #EBE398;">
<table border=0 cellspacing=8 cellpadding=0>
<tr>
<th><a class="filterLink <#if filter=0>filterLinkSelected</#if>" href="${url.service}?f=0">Tasks to do</a></th>
<th><a class="filterLink <#if filter=1>filterLinkSelected</#if>" href="${url.service}?f=1">Due Today</a></th>
<th><a class="filterLink <#if filter=2>filterLinkSelected</#if>" href="${url.service}?f=2">Next 7 days</a></th>
<th><a class="filterLink <#if filter=3>filterLinkSelected</#if>" href="${url.service}?f=3">No due date</a></th>
<th><a class="filterLink <#if filter=4>filterLinkSelected</#if>" href="${url.service}?f=4">Overdue</a></th>
</tr>
</table>
</td>
</tr>
<tr><td bgcolor="#F9F3B0">&nbsp;</td><td>
<div class="taskPanel">
<#assign weekms=1000*60*60*24*7>
<#list workflow.assignedTasks?sort_by('startDate') as t>
<#-- TODO: is it better to use a js script to pre-filter the list? -->
<#assign hasDue=t.properties["bpm:dueDate"]?exists>
<#if hasDue>
<#assign due=t.properties["bpm:dueDate"]>
</#if>
<#if (filter=0) ||
(filter=3 && !hasDue) ||
(filter=1 && hasDue && (dateCompare(date?date, due?date, 0, "==") == 1)) ||
(filter=2 && hasDue && (dateCompare(due?date, date?date) == 1 && dateCompare(date?date, due?date, weekms) == 1)) ||
(filter=4 && hasDue && (dateCompare(date?date, due?date) == 1))>
<div class="taskRow" onmouseover="taskMouseOver(this)" onmouseout="taskMouseOut(this)">
<div class="taskIndicator">
<#if hasDue>
<#-- items due today? -->
<#if (filter=0 || filter=1) && (dateCompare(date?date, due?date, 0, "==") == 1)>
<img src="${url.context}/images/icons/task_today.gif"></div><div class="taskItem taskItemToday">
<#-- items overdue? -->
<#elseif (filter=0 || filter=4) && (dateCompare(date?date, due?date) == 1)>
<img src="${url.context}/images/icons/task_overdue.gif"></div><div class="taskItem taskItemOverdue">
<#else>
</div><div class="taskItem">
</#if>
<#else>
</div><div class="taskItem">
</#if>
${t.description?html} [${t.name?html}]
<#if hasDue>
(Due: ${due?date})
</#if>
<div style="display:inline" onclick="TaskInfoMgr.toggle('${t.id}',this);">
<img src="${url.context}/images/icons/popup.gif" styleClass="popupImage" width="16" height="16" />
</div>
</div>
</div>
</#if>
</#list>
</div>
</td></tr>
</table>
<STYLE type="text/css">
a.filterLink:link, a.filterLink:visited
{
color: #5A5741;
font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
text-decoration: none;
padding-left: 4px;
padding-right: 4px;
}
a.filterLink:hover
{
color: #FFFFFF;
background-color: #FDB64F;
}
a.filterLinkSelected:link, a.filterLinkSelected:visited
{
color: #FFFFFF;
background-color: #FDB64F;
}
.taskTable
{
background-color: #FEF8BC;
border: 1px solid #EBE398;
}
.taskPanel
{
height: 300px;
width: 700px;
overflow: auto;
border-top: 1px solid #EBE398;
border-left: 1px solid #F6DEA0;
background-image: url(../images/logo/alf_task_bg.png);
background-repeat: no-repeat;
background-position: 0 0;
}
.taskRow
{
padding-top: 4px;
padding-left: 8px;
padding-right: 8px;
padding-bottom: 4px;
border-bottom: 1px solid #EBE398;
border-top: 1px solid #FEF8BC;
}
.taskItem
{
font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #5A5741;
margin: 0 0 0 24;
}
.taskItemOverdue
{
color: #DF3704;
font-weight: bold;
}
.taskItemToday
{
color: #399DF7;
}
.taskIndicator
{
float: left;
padding-top:6px;
padding-left:4px;
}
</STYLE>

View File

@@ -297,8 +297,8 @@ public abstract class BaseTemplateContentServlet extends BaseServlet
} }
root.put("args", args); root.put("args", args);
// method to allow absolute client urls to be generated // method to allow client urls to be generated
root.put("absurl", new AbsoluteUrlMethod(req.getContextPath())); root.put("url", new URLHelper(req.getContextPath()));
return root; return root;
} }
@@ -311,4 +311,22 @@ public abstract class BaseTemplateContentServlet extends BaseServlet
return Utils.getFileTypeImage(getServletContext(), filename, small); return Utils.getFileTypeImage(getServletContext(), filename, small);
} }
}; };
/**
* Helper to return context path for generating urls
*/
public static class URLHelper
{
String context;
public URLHelper(String context)
{
this.context = context;
}
public String getContext()
{
return context;
}
}
} }

View File

@@ -39,6 +39,7 @@ import org.alfresco.repo.template.UrlEncodeMethod;
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;
import org.alfresco.service.cmr.repository.TemplateImageResolver; import org.alfresco.service.cmr.repository.TemplateImageResolver;
import org.alfresco.web.app.servlet.BaseTemplateContentServlet;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@@ -77,7 +78,7 @@ public class NodeInfoBean
if (this.nodeService.exists(nodeRef)) if (this.nodeService.exists(nodeRef))
{ {
Repository.getServiceRegistry(context).getTemplateService().processTemplate( Repository.getServiceRegistry(context).getTemplateService().processTemplate(
"/alfresco/templates/client/summary_panel.ftl", getModel(nodeRef), out); "/alfresco/templates/client/node_summary_panel.ftl", getModel(nodeRef), out);
} }
else else
{ {
@@ -104,12 +105,13 @@ public class NodeInfoBean
private Map<String, Object> getModel(NodeRef nodeRef) private Map<String, Object> getModel(NodeRef nodeRef)
{ {
FacesContext context = FacesContext.getCurrentInstance(); FacesContext context = FacesContext.getCurrentInstance();
Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); Map<String, Object> model = new HashMap<String, Object>(8, 1.0f);
// create api methods // create api methods
model.put("date", new Date()); model.put("date", new Date());
model.put("cropContent", new CropContentMethod()); model.put("cropContent", new CropContentMethod());
model.put("absurl", new AbsoluteUrlMethod(context.getExternalContext().getRequestContextPath())); model.put("url", new BaseTemplateContentServlet.URLHelper(
context.getExternalContext().getRequestContextPath()));
model.put("node", new TemplateNode( model.put("node", new TemplateNode(
nodeRef, nodeRef,
Repository.getServiceRegistry(context), Repository.getServiceRegistry(context),

View File

@@ -0,0 +1,130 @@
/*
* Copyright (C) 2005-2007 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.ajax;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.alfresco.repo.template.AbsoluteUrlMethod;
import org.alfresco.repo.template.CropContentMethod;
import org.alfresco.repo.template.TemplateNode;
import org.alfresco.repo.template.UrlEncodeMethod;
import org.alfresco.repo.template.Workflow;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.TemplateImageResolver;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.web.app.servlet.BaseTemplateContentServlet;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Bean used by an AJAX control to send information back on the requested workflow task.
*
* @author Kevin Roast
*/
public class TaskInfoBean
{
private WorkflowService workflowService;
/**
* Returns information on the node identified by the 'taskId'
* parameter found in the ExternalContext.
* <p>
* The result is the formatted HTML to show on the client.
*/
public void sendTaskInfo() throws IOException
{
FacesContext context = FacesContext.getCurrentInstance();
ResponseWriter out = context.getResponseWriter();
String taskId = (String)context.getExternalContext().getRequestParameterMap().get("taskId");
if (taskId == null || taskId.length() == 0)
{
throw new IllegalArgumentException("'taskId' parameter is missing");
}
WorkflowTask task = this.workflowService.getTaskById(taskId);
if (task != null)
{
Repository.getServiceRegistry(context).getTemplateService().processTemplate(
"/alfresco/templates/client/task_summary_panel.ftl", getModel(task), out);
}
else
{
out.write("<span class='errorMessage'>Task could not be found.</span>");
}
}
// ------------------------------------------------------------------------------
// Bean getters and setters
/**
* @param workflowService The WorkflowService to set.
*/
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
}
// ------------------------------------------------------------------------------
// Helper methods
private Map<String, Object> getModel(WorkflowTask task)
{
FacesContext context = FacesContext.getCurrentInstance();
Map<String, Object> model = new HashMap<String, Object>(8, 1.0f);
// create template api methods and objects
model.put("date", new Date());
model.put("url", new BaseTemplateContentServlet.URLHelper(
context.getExternalContext().getRequestContextPath()));
model.put("task", new Workflow.WorkflowTaskItem(
Repository.getServiceRegistry(context),
this.imageResolver,
task));
return model;
}
/** Template Image resolver helper */
private TemplateImageResolver imageResolver = new TemplateImageResolver()
{
public String resolveImagePathForName(String filename, boolean small)
{
return Utils.getFileTypeImage(FacesContext.getCurrentInstance(), filename, small);
}
};
}

View File

@@ -91,9 +91,8 @@ public class UINodeInfo extends SelfRenderingComponent
get(NODE_INFO_SCRIPTS_WRITTEN); get(NODE_INFO_SCRIPTS_WRITTEN);
if (present == null) if (present == null)
{ {
out.write("<script type=\"text/javascript\" src=\""); out.write("<script>var AlfNodeInfoMgr = new Alfresco.PanelManager(" +
out.write(context.getExternalContext().getRequestContextPath()); "\"NodeInfoBean.sendNodeInfo\", \"noderef\");</script>");
out.write("/scripts/ajax/node-info.js\"></script>");
context.getExternalContext().getRequestMap().put( context.getExternalContext().getRequestMap().put(
NODE_INFO_SCRIPTS_WRITTEN, Boolean.TRUE); NODE_INFO_SCRIPTS_WRITTEN, Boolean.TRUE);

View File

@@ -199,6 +199,11 @@ public class PageTag extends TagSupport
out.write(reqPath); out.write(reqPath);
out.write("/scripts/ajax/common.js\"></script>"); out.write("/scripts/ajax/common.js\"></script>");
// pop-up panel helper objects
out.write("<script type=\"text/javascript\" src=\"");
out.write(reqPath);
out.write("/scripts/ajax/summary-info.js\"></script>");
// set the context path used by some Alfresco script objects // set the context path used by some Alfresco script objects
out.write("<script type=\"text/javascript\">"); out.write("<script type=\"text/javascript\">");
out.write("setContextPath('"); out.write("setContextPath('");

View File

@@ -2936,40 +2936,40 @@
<property-name>nodeService</property-name> <property-name>nodeService</property-name>
<value>#{NodeService}</value> <value>#{NodeService}</value>
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<managed-bean> <managed-bean>
<description> <description>
The bean that backs up the Monitor Deployment Dialog The bean that backs up the Monitor Deployment Dialog
</description> </description>
<managed-bean-name>MonitorDeploymentDialog</managed-bean-name> <managed-bean-name>MonitorDeploymentDialog</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.MonitorDeploymentDialog</managed-bean-class> <managed-bean-class>org.alfresco.web.bean.wcm.MonitorDeploymentDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope> <managed-bean-scope>session</managed-bean-scope>
<managed-property> <managed-property>
<property-name>avmBrowseBean</property-name> <property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value> <value>#{AVMBrowseBean}</value>
</managed-property> </managed-property>
<managed-property> <managed-property>
<property-name>nodeService</property-name> <property-name>nodeService</property-name>
<value>#{NodeService}</value> <value>#{NodeService}</value>
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<managed-bean> <managed-bean>
<description> <description>
The bean that backs up the View Deployment Report Dialog The bean that backs up the View Deployment Report Dialog
</description> </description>
<managed-bean-name>ViewDeploymentReportDialog</managed-bean-name> <managed-bean-name>ViewDeploymentReportDialog</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.ViewDeploymentReportDialog</managed-bean-class> <managed-bean-class>org.alfresco.web.bean.wcm.ViewDeploymentReportDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope> <managed-bean-scope>session</managed-bean-scope>
<managed-property> <managed-property>
<property-name>avmBrowseBean</property-name> <property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value> <value>#{AVMBrowseBean}</value>
</managed-property> </managed-property>
<managed-property> <managed-property>
<property-name>nodeService</property-name> <property-name>nodeService</property-name>
<value>#{NodeService}</value> <value>#{NodeService}</value>
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<!-- ==================== COMPONENT GENERATOR BEANS ==================== --> <!-- ==================== COMPONENT GENERATOR BEANS ==================== -->
@@ -3177,6 +3177,19 @@
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<managed-bean>
<description>
Bean that returns information on a workflow task
</description>
<managed-bean-name>TaskInfoBean</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.ajax.TaskInfoBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>workflowService</property-name>
<value>#{WorkflowService}</value>
</managed-property>
</managed-bean>
<managed-bean> <managed-bean>
<description> <description>
Bean that returns manages the tree data for the navigator component Bean that returns manages the tree data for the navigator component
@@ -3217,14 +3230,14 @@
<property-name>schema2XFormsProperties</property-name> <property-name>schema2XFormsProperties</property-name>
<value>#{Schema2XFormsProperties}</value> <value>#{Schema2XFormsProperties}</value>
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<managed-bean> <managed-bean>
<description> <description>
Bean that returns deployment progress status Bean that returns deployment progress status
</description> </description>
<managed-bean-name>DeploymentProgressBean</managed-bean-name> <managed-bean-name>DeploymentProgressBean</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.DeploymentProgressBean</managed-bean-class> <managed-bean-class>org.alfresco.web.bean.wcm.DeploymentProgressBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope> <managed-bean-scope>request</managed-bean-scope>
</managed-bean> </managed-bean>
</faces-config> </faces-config>

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View File

@@ -1,103 +1,106 @@
// //
// Supporting JavaScript for the NodeInfo component // Supporting JavaScript for the Summary Info pop-up panel objects
// Gavin Cornwell 17-07-2006 // Kevin Roast 24-04-2007
// Kevin Roast 21-02-2007 (rewrite to use individual panel objects and convert to YUI)
// //
// NOTE: This script requires common.js - which needs to be loaded // NOTE: This script requires common.js - which needs to be loaded
// prior to this one on the containing HTML page. // prior to this one on the containing HTML page.
var zIndex = 99; var _zIndex = 99;
/** /**
* Node Info Manager constructor * Panel Manager constructor
*
* @param serverCall Server call to make on display e.g. NodeInfoBean.sendNodeInfo
* @param argName Argument name to pass panel ID object as e.g. nodeRef
*/ */
Alfresco.NodeInfoManager = function() Alfresco.PanelManager = function(serverCall, argName)
{ {
this.serverCall = serverCall;
this.argName = argName;
} }
/** /**
* Definition of the Node Info Manager class. * Definition of the Panel Manager class.
* Responsible for open/closing NodeInfoPanel dynamic summary panel objects. * Responsible for open/closing InfoPanel dynamic summary panel objects.
*/ */
Alfresco.NodeInfoManager.prototype = Alfresco.PanelManager.prototype =
{ {
panels: [], panels: [],
displayed: [], displayed: [],
serverCall: null,
argName: null,
/** /**
* Request toggle of the open/close state of a node info panel * Request toggle of the open/close state of an info panel
*/ */
toggle: function(nodeRef, launchElement) toggle: function(id, launchElement)
{ {
if (this.displayed[nodeRef] == undefined || this.displayed[nodeRef] == null) if (this.displayed[id] == undefined || this.displayed[id] == null)
{ {
var panel = this.panels[nodeRef]; var panel = this.panels[id];
if (panel == undefined || panel == null) if (panel == undefined || panel == null)
{ {
panel = new Alfresco.NodeInfoPanel(nodeRef, launchElement); panel = new Alfresco.InfoPanel(this, id, launchElement);
this.panels[nodeRef] = panel; this.panels[id] = panel;
} }
this.displayed[nodeRef] = true; this.displayed[id] = true;
panel.showNodeInfo(); panel.showInfo();
} }
else else
{ {
this.close(nodeRef); this.close(id);
} }
}, },
/** /**
* Request a Close of the node info panel * Request a Close of the Summary info panel
*/ */
close: function(nodeRef) close: function(id)
{ {
var panel = this.panels[nodeRef]; var panel = this.panels[id];
if (panel != undefined && panel != null) if (panel != undefined && panel != null)
{ {
this.displayed[nodeRef] = null; this.displayed[id] = null;
panel.hideNodeInfo(); panel.hideInfo();
} }
}, },
/** /**
* Return if a given node info panel is currently displayable * Return if a given info panel is currently displayable
*/ */
displayable: function(nodeRef) displayable: function(id)
{ {
return (this.displayed[nodeRef] != undefined && this.displayed[nodeRef] != null); return (this.displayed[id] != undefined && this.displayed[id] != null);
} }
} }
/**
* Construct the single Node Info Manager instance
*/
var AlfNodeInfoMgr = new Alfresco.NodeInfoManager();
/** /**
* Constructor for the Node Info Panel object * Constructor for the Info Panel object
*/ */
Alfresco.NodeInfoPanel = function(nodeRef, launchElement) Alfresco.InfoPanel = function(manager, id, launchElement)
{ {
this.nodeRef = nodeRef; this.manager = manager;
this.id = id;
this.launchElement = launchElement; this.launchElement = launchElement;
} }
/** /**
* Definition of the Node Info Panel object * Definition of the Info Panel object
*/ */
Alfresco.NodeInfoPanel.prototype = Alfresco.InfoPanel.prototype =
{ {
nodeRef: null, manager: null,
id: null,
launchElement: null, launchElement: null,
popupElement: null, popupElement: null,
visible: false, visible: false,
loading: false, loading: false,
/** /**
* Makes the AJAX request back to the server to get the node info. * Makes the AJAX request back to the server to get the panel info.
*/ */
showNodeInfo: function() showInfo: function()
{ {
if (this.loading == false) if (this.loading == false)
{ {
@@ -113,25 +116,25 @@ Alfresco.NodeInfoPanel.prototype =
YAHOO.util.Connect.asyncRequest( YAHOO.util.Connect.asyncRequest(
"POST", "POST",
getContextPath() + '/ajax/invoke/NodeInfoBean.sendNodeInfo', getContextPath() + '/ajax/invoke/' + this.manager.serverCall,
{ {
success: this.loadNodeInfoHandler, success: this.loadInfoHandler,
failure: handleErrorYahoo, // global error handler failure: handleErrorYahoo, // global error handler
argument: [this] argument: [this]
}, },
"noderef=" + this.nodeRef); this.manager.argName + "=" + this.id);
} }
else else
{ {
this.displayNodeInfo(); this.displayInfo();
} }
} }
}, },
/** /**
* Callback function for showNodeInfo() above * Callback function for showInfo() above
*/ */
loadNodeInfoHandler: function(response) loadInfoHandler: function(response)
{ {
var panel = response.argument[0]; var panel = response.argument[0];
@@ -156,13 +159,13 @@ Alfresco.NodeInfoPanel.prototype =
panel.loading = false; panel.loading = false;
// display the div for the first time // display the div for the first time
panel.displayNodeInfo(); panel.displayInfo();
}, },
/** /**
* Display the summary info panel for the node * Display the summary info panel for the panel
*/ */
displayNodeInfo: function() displayInfo: function()
{ {
var elImg = Alfresco.Dom.getElementByTagName(this.launchElement, "img"); var elImg = Alfresco.Dom.getElementByTagName(this.launchElement, "img");
if (elImg != null) if (elImg != null)
@@ -170,14 +173,14 @@ Alfresco.NodeInfoPanel.prototype =
elImg.src = getContextPath() + "/images/icons/popup.gif"; elImg.src = getContextPath() + "/images/icons/popup.gif";
} }
if (AlfNodeInfoMgr.displayable(this.nodeRef) == true) if (this.manager.displayable(this.id) == true)
{ {
if (this.popupElement != null && this.visible == false) if (this.popupElement != null && this.visible == false)
{ {
// set opacity in browser independant way // set opacity in browser independant way
YAHOO.util.Dom.setStyle(this.popupElement, "opacity", 0.0); YAHOO.util.Dom.setStyle(this.popupElement, "opacity", 0.0);
this.popupElement.style.display = "block"; this.popupElement.style.display = "block";
this.popupElement.style.zIndex = zIndex++; // pop to front this.popupElement.style.zIndex = _zIndex++; // pop to front
Alfresco.Dom.smartAlignElement(this.popupElement, this.launchElement, 700); Alfresco.Dom.smartAlignElement(this.popupElement, this.launchElement, 700);
@@ -194,9 +197,9 @@ Alfresco.NodeInfoPanel.prototype =
}, },
/** /**
* Hide the summary info panel for the node * Hide the summary info panel
*/ */
hideNodeInfo: function() hideInfo: function()
{ {
if (this.popupElement != null && this.visible == true) if (this.popupElement != null && this.visible == true)
{ {