. Multiple email recipient support in Create/Edit Rule and Run Action screens.

. Group emailing support added to MailActionExecutor (i.e. selecting Group(s) is supported in the screens as above)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2527 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-03-09 13:47:48 +00:00
parent f5d9aed0af
commit 15b01c8d5c
6 changed files with 575 additions and 271 deletions

View File

@@ -688,6 +688,7 @@ encoding=Encoding
encoding_utf8=UTF-8 encoding_utf8=UTF-8
rule_type=Rule Type rule_type=Rule Type
rule_background_info=If this option is selected the rule will execute in the background so the results may not appear immediately. rule_background_info=If this option is selected the rule will execute in the background so the results may not appear immediately.
selected_recipients=Select email recipients
# New Space Wizard messages # New Space Wizard messages
new_space_title=New Space Wizard new_space_title=New Space Wizard

View File

@@ -23,6 +23,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import javax.faces.model.SelectItem; import javax.faces.model.SelectItem;
import org.alfresco.config.Config; import org.alfresco.config.Config;
@@ -50,6 +53,8 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.TypeDefinition; import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.service.cmr.repository.MimetypeService; import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AuthorityService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
@@ -57,6 +62,7 @@ import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.data.IDataContainer; import org.alfresco.web.data.IDataContainer;
import org.alfresco.web.data.QuickSort; import org.alfresco.web.data.QuickSort;
import org.alfresco.web.ui.common.component.UIGenericPicker;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -100,9 +106,13 @@ public abstract class BaseActionWizard extends AbstractWizardBean
// new rule/action wizard specific properties // new rule/action wizard specific properties
protected boolean multiActionMode = false; protected boolean multiActionMode = false;
protected String action; protected String action;
protected ActionService actionService; protected ActionService actionService;
protected DictionaryService dictionaryService; protected DictionaryService dictionaryService;
protected MimetypeService mimetypeService; protected MimetypeService mimetypeService;
protected PersonService personService;
protected AuthorityService authorityService;
protected List<SelectItem> actions; protected List<SelectItem> actions;
protected List<SelectItem> transformers; protected List<SelectItem> transformers;
protected List<SelectItem> imageTransformers; protected List<SelectItem> imageTransformers;
@@ -112,8 +122,18 @@ public abstract class BaseActionWizard extends AbstractWizardBean
protected Map<String, String> actionDescriptions; protected Map<String, String> actionDescriptions;
protected Map<String, Serializable> currentActionProperties; protected Map<String, Serializable> currentActionProperties;
protected List<SelectItem> objectTypes; protected List<SelectItem> objectTypes;
/** cache of email templates that last 10 seconds - enough for a couple of page refreshes */ /** cache of email templates that last 30 seconds - enough for a few page refreshes */
protected ExpiringValueCache<List<SelectItem>> cachedTemplates = new ExpiringValueCache<List<SelectItem>>(1000*10); protected ExpiringValueCache<List<SelectItem>> cachedTemplates = new ExpiringValueCache<List<SelectItem>>(1000*30);
/** datamodel for table of selected email recipients */
protected DataModel emailRecipientsDataModel;
/** selected email recipients */
protected List<RecipientWrapper> emailRecipients;
// ------------------------------------------------------------------------------
// Wizard implementation
/** /**
* Initialises the wizard * Initialises the wizard
@@ -126,6 +146,8 @@ public abstract class BaseActionWizard extends AbstractWizardBean
this.users = null; this.users = null;
this.actions = null; this.actions = null;
this.actionDescriptions = null; this.actionDescriptions = null;
this.emailRecipientsDataModel = null;
this.emailRecipients = new ArrayList<RecipientWrapper>(4);
this.currentActionProperties = new HashMap<String, Serializable>(3); this.currentActionProperties = new HashMap<String, Serializable>(3);
@@ -321,14 +343,20 @@ public abstract class BaseActionWizard extends AbstractWizardBean
} }
else if (this.action.equals(MailActionExecuter.NAME)) else if (this.action.equals(MailActionExecuter.NAME))
{ {
// add the person(s) it's going to as a list of authorities
List<String> recipients = new ArrayList<String>(emailRecipients.size());
for (int i=0; i<emailRecipients.size(); i++)
{
RecipientWrapper wrapper = emailRecipients.get(i);
recipients.add(wrapper.authority);
}
actionParams.put(MailActionExecuter.PARAM_TO_MANY, (Serializable)recipients);
// add the actual email text to send // add the actual email text to send
actionParams.put(MailActionExecuter.PARAM_TEXT, actionParams.put(MailActionExecuter.PARAM_TEXT,
this.currentActionProperties.get(PROP_MESSAGE)); this.currentActionProperties.get(PROP_MESSAGE));
// add the person it's going to
actionParams.put(MailActionExecuter.PARAM_TO,
this.currentActionProperties.get(PROP_TO));
// add the subject for the email // add the subject for the email
actionParams.put(MailActionExecuter.PARAM_SUBJECT, actionParams.put(MailActionExecuter.PARAM_SUBJECT,
this.currentActionProperties.get(PROP_SUBJECT)); this.currentActionProperties.get(PROP_SUBJECT));
@@ -459,8 +487,31 @@ public abstract class BaseActionWizard extends AbstractWizardBean
String message = (String)actionProps.get(MailActionExecuter.PARAM_TEXT); String message = (String)actionProps.get(MailActionExecuter.PARAM_TEXT);
this.currentActionProperties.put(PROP_MESSAGE, message); this.currentActionProperties.put(PROP_MESSAGE, message);
// handle single email or multiple authority recipients
String to = (String)actionProps.get(MailActionExecuter.PARAM_TO); String to = (String)actionProps.get(MailActionExecuter.PARAM_TO);
this.currentActionProperties.put(PROP_TO, to); if (to != null)
{
this.currentActionProperties.put(PROP_TO, to);
}
else
{
List<String> recipients = (List<String>)actionProps.get(MailActionExecuter.PARAM_TO_MANY);
if (recipients != null && recipients.size() != 0)
{
// rebuild the list of RecipientWrapper objects from the stored action
for (String authority : recipients)
{
this.emailRecipients.add(
new RecipientWrapper(displayLabelForAuthority(authority), authority));
}
}
}
NodeRef templateRef = (NodeRef)actionProps.get(MailActionExecuter.PARAM_TEMPLATE);
if (templateRef != null)
{
this.currentActionProperties.put(PROP_TEMPLATE, templateRef.getId());
}
} }
else if (this.action.equals(ImporterActionExecuter.NAME)) else if (this.action.equals(ImporterActionExecuter.NAME))
{ {
@@ -474,6 +525,10 @@ public abstract class BaseActionWizard extends AbstractWizardBean
} }
} }
// ------------------------------------------------------------------------------
// Bean Getters and Setters
/** /**
* @return Returns the selected action * @return Returns the selected action
*/ */
@@ -503,7 +558,7 @@ public abstract class BaseActionWizard extends AbstractWizardBean
/** /**
* Sets the dictionary service * Sets the dictionary service
* *
* @param dictionaryService the dictionary service * @param dictionaryService The dictionary service
*/ */
public void setDictionaryService(DictionaryService dictionaryService) public void setDictionaryService(DictionaryService dictionaryService)
{ {
@@ -513,13 +568,46 @@ public abstract class BaseActionWizard extends AbstractWizardBean
/** /**
* Sets the mimetype service * Sets the mimetype service
* *
* @param mimetypeService The mimetype service * @param mimetypeService The mimetype service
*/ */
public void setMimetypeService(MimetypeService mimetypeService) public void setMimetypeService(MimetypeService mimetypeService)
{ {
this.mimetypeService = mimetypeService; this.mimetypeService = mimetypeService;
} }
/**
* @param personService The personService to set.
*/
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
/**
* @param authorityService The authorityService to set.
*/
public void setAuthorityService(AuthorityService authorityService)
{
this.authorityService = authorityService;
}
/**
* Returns the properties for email recipients JSF DataModel
*
* @return JSF DataModel wrapping the current email recipients
*/
public DataModel getEmailRecipientsDataModel()
{
if (this.emailRecipientsDataModel == null)
{
this.emailRecipientsDataModel = new ListDataModel();
}
this.emailRecipientsDataModel.setWrappedData(this.emailRecipients);
return this.emailRecipientsDataModel;
}
/** /**
* @return Returns the list of selectable actions * @return Returns the list of selectable actions
*/ */
@@ -989,4 +1077,112 @@ public abstract class BaseActionWizard extends AbstractWizardBean
return templates; return templates;
} }
// ------------------------------------------------------------------------------
// Action event handlers
/**
* Action handler called when the Add button is pressed to add an email recipient
*/
public void addRecipient(ActionEvent event)
{
UIGenericPicker picker = (UIGenericPicker)event.getComponent();
String[] results = picker.getSelectedResults();
if (results != null && results.length != 0)
{
for (String authority : results)
{
// first check the authority has not already been added to the list
boolean alreadyAdded = false;
for (int i=0; i<emailRecipients.size(); i++)
{
RecipientWrapper wrapper = emailRecipients.get(i);
if (wrapper.getAuthority().equals(authority))
{
alreadyAdded = true;
break;
}
}
if (alreadyAdded == false)
{
// find a display label for the authority if it is a known Person
String name = displayLabelForAuthority(authority);
// add the recipient to the list
RecipientWrapper wrapper = new RecipientWrapper(name, authority);
this.emailRecipients.add(wrapper);
}
}
}
}
protected String displayLabelForAuthority(String authority)
{
String label = authority;
if (this.personService.personExists(authority))
{
// create the node ref, then our node representation
NodeRef ref = personService.getPerson(authority);
Node node = new Node(ref);
// setup convience function for current user full name
label = (String)node.getProperties().get(ContentModel.PROP_FIRSTNAME) + ' ' +
(String)node.getProperties().get(ContentModel.PROP_LASTNAME);
}
return label;
}
/**
* Action handler called when the Remove icon is pressed to remove an email recipient
*/
public void removeRecipient(ActionEvent event)
{
RecipientWrapper wrapper = (RecipientWrapper)this.emailRecipientsDataModel.getRowData();
this.emailRecipients.remove(wrapper);
}
// ------------------------------------------------------------------------------
// Inner classes
/**
* Simple wrapper class for email recipient fields
*/
public static class RecipientWrapper
{
public RecipientWrapper(String name, String authority)
{
this.name = name;
this.authority = authority;
}
public String getName()
{
return this.name;
}
public String getAuthority()
{
return this.authority;
}
public boolean equals(Object obj)
{
if (obj instanceof RecipientWrapper)
{
return this.authority.equals( ((RecipientWrapper)obj).getAuthority() );
}
else
{
return false;
}
}
private String name;
private String authority;
}
} }

View File

@@ -41,9 +41,16 @@ import org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator;
import org.alfresco.repo.action.evaluator.HasAspectEvaluator; import org.alfresco.repo.action.evaluator.HasAspectEvaluator;
import org.alfresco.repo.action.evaluator.InCategoryEvaluator; import org.alfresco.repo.action.evaluator.InCategoryEvaluator;
import org.alfresco.repo.action.evaluator.IsSubTypeEvaluator; import org.alfresco.repo.action.evaluator.IsSubTypeEvaluator;
import org.alfresco.repo.action.executer.AddFeaturesActionExecuter;
import org.alfresco.repo.action.executer.CheckInActionExecuter; import org.alfresco.repo.action.executer.CheckInActionExecuter;
import org.alfresco.repo.action.executer.CopyActionExecuter;
import org.alfresco.repo.action.executer.ImageTransformActionExecuter;
import org.alfresco.repo.action.executer.ImporterActionExecuter;
import org.alfresco.repo.action.executer.LinkCategoryActionExecuter;
import org.alfresco.repo.action.executer.MailActionExecuter;
import org.alfresco.repo.action.executer.SimpleWorkflowActionExecuter; import org.alfresco.repo.action.executer.SimpleWorkflowActionExecuter;
import org.alfresco.repo.action.executer.SpecialiseTypeActionExecuter; import org.alfresco.repo.action.executer.SpecialiseTypeActionExecuter;
import org.alfresco.repo.action.executer.TransformActionExecuter;
import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionCondition; import org.alfresco.service.cmr.action.ActionCondition;
import org.alfresco.service.cmr.action.ActionConditionDefinition; import org.alfresco.service.cmr.action.ActionConditionDefinition;
@@ -1336,7 +1343,7 @@ public class NewRuleWizard extends BaseActionWizard
summary.append(" "); summary.append(" ");
// define a summary to be added for each action // define a summary to be added for each action
if ("add-features".equals(actionName)) if (AddFeaturesActionExecuter.NAME.equals(actionName))
{ {
String aspect = (String)this.currentActionProperties.get(PROP_ASPECT); String aspect = (String)this.currentActionProperties.get(PROP_ASPECT);
@@ -1350,7 +1357,7 @@ public class NewRuleWizard extends BaseActionWizard
} }
} }
} }
else if ("simple-workflow".equals(actionName)) else if (SimpleWorkflowActionExecuter.NAME.equals(actionName))
{ {
// just leave the summary as the title for now // just leave the summary as the title for now
String approveStepName = (String)this.currentActionProperties.get(PROP_APPROVE_STEP_NAME); String approveStepName = (String)this.currentActionProperties.get(PROP_APPROVE_STEP_NAME);
@@ -1382,13 +1389,13 @@ public class NewRuleWizard extends BaseActionWizard
summary.append(rejectMsg); summary.append(rejectMsg);
} }
} }
else if ("link-category".equals(actionName)) else if (LinkCategoryActionExecuter.NAME.equals(actionName))
{ {
NodeRef cat = (NodeRef)this.currentActionProperties.get(PROP_CATEGORY); NodeRef cat = (NodeRef)this.currentActionProperties.get(PROP_CATEGORY);
String name = Repository.getNameForNode(this.nodeService, cat); String name = Repository.getNameForNode(this.nodeService, cat);
summary.append("'").append(name).append("'"); summary.append("'").append(name).append("'");
} }
else if ("transform".equals(actionName)) else if (TransformActionExecuter.NAME.equals(actionName))
{ {
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION); NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
String name = Repository.getNameForNode(this.nodeService, space); String name = Repository.getNameForNode(this.nodeService, space);
@@ -1408,7 +1415,7 @@ public class NewRuleWizard extends BaseActionWizard
String msg = MessageFormat.format(summary.toString(), new Object[] {name, transformer}); String msg = MessageFormat.format(summary.toString(), new Object[] {name, transformer});
summary = new StringBuilder(msg); summary = new StringBuilder(msg);
} }
else if ("transform-image".equals(actionName)) else if (ImageTransformActionExecuter.NAME.equals(actionName))
{ {
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION); NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
String name = Repository.getNameForNode(this.nodeService, space); String name = Repository.getNameForNode(this.nodeService, space);
@@ -1429,18 +1436,38 @@ public class NewRuleWizard extends BaseActionWizard
String msg = MessageFormat.format(summary.toString(), new Object[] {name, transformer, option}); String msg = MessageFormat.format(summary.toString(), new Object[] {name, transformer, option});
summary = new StringBuilder(msg); summary = new StringBuilder(msg);
} }
else if ("copy".equals(actionName) || "move".equals(actionName) || "check-out".equals(actionName)) else if (CopyActionExecuter.NAME.equals(actionName) || "move".equals(actionName) || "check-out".equals(actionName))
{ {
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION); NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
String spaceName = Repository.getNameForNode(this.nodeService, space); String spaceName = Repository.getNameForNode(this.nodeService, space);
summary.append("'").append(spaceName).append("'"); summary.append("'").append(spaceName).append("'");
} }
else if ("mail".equals(actionName)) else if (MailActionExecuter.NAME.equals(actionName))
{ {
String address = (String)this.currentActionProperties.get(PROP_TO); String address = (String)this.currentActionProperties.get(PROP_TO);
summary.append("'").append(address).append("'"); if (address != null && address.length() != 0)
{
summary.append("'").append(address).append("'");
}
else
{
if (this.emailRecipients.size() != 0)
{
summary.append("'");
for (int i=0; i<this.emailRecipients.size(); i++)
{
RecipientWrapper wrapper = this.emailRecipients.get(i);
if (i != 0)
{
summary.append(", ");
}
summary.append(wrapper.getName());
}
summary.append("'");
}
}
} }
else if ("check-in".equals(actionName)) else if (CheckInActionExecuter.NAME.equals(actionName))
{ {
String comment = (String)this.currentActionProperties.get(PROP_CHECKIN_DESC); String comment = (String)this.currentActionProperties.get(PROP_CHECKIN_DESC);
Boolean minorChange = (Boolean)this.currentActionProperties.get(PROP_CHECKIN_MINOR); Boolean minorChange = (Boolean)this.currentActionProperties.get(PROP_CHECKIN_MINOR);
@@ -1458,7 +1485,7 @@ public class NewRuleWizard extends BaseActionWizard
String msg = MessageFormat.format(summary.toString(), new Object[] {change, comment}); String msg = MessageFormat.format(summary.toString(), new Object[] {change, comment});
summary = new StringBuilder(msg); summary = new StringBuilder(msg);
} }
else if ("import".equals(actionName)) else if (ImporterActionExecuter.NAME.equals(actionName))
{ {
NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION); NodeRef space = (NodeRef)this.currentActionProperties.get(PROP_DESTINATION);
String spaceName = Repository.getNameForNode(this.nodeService, space); String spaceName = Repository.getNameForNode(this.nodeService, space);

View File

@@ -470,6 +470,14 @@
<property-name>rulesBean</property-name> <property-name>rulesBean</property-name>
<value>#{RulesBean}</value> <value>#{RulesBean}</value>
</managed-property> </managed-property>
<managed-property>
<property-name>personService</property-name>
<value>#{PersonService}</value>
</managed-property>
<managed-property>
<property-name>authorityService</property-name>
<value>#{AuthorityService}</value>
</managed-property>
</managed-bean> </managed-bean>
<managed-bean> <managed-bean>
@@ -507,6 +515,14 @@
<property-name>mimetypeService</property-name> <property-name>mimetypeService</property-name>
<value>#{MimetypeService}</value> <value>#{MimetypeService}</value>
</managed-property> </managed-property>
<managed-property>
<property-name>personService</property-name>
<value>#{PersonService}</value>
</managed-property>
<managed-property>
<property-name>authorityService</property-name>
<value>#{AuthorityService}</value>
</managed-property>
</managed-bean> </managed-bean>
<managed-bean> <managed-bean>

View File

@@ -1,241 +1,274 @@
<%-- <%--
Copyright (C) 2005 Alfresco, Inc. Copyright (C) 2005 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1 Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a with a permitted attribution clause. You may obtain a
copy of the License at copy of the License at
http://www.alfresco.org/legal/license.txt http://www.alfresco.org/legal/license.txt
Unless required by applicable law or agreed to in writing, Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific either express or implied. See the License for the specific
language governing permissions and limitations under the language governing permissions and limitations under the
License. License.
--%> --%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %> <%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_create_action_email"> <r:page titleId="title_create_action_email">
<script language="JavaScript1.2"> <script language="JavaScript1.2">
window.onload = pageLoaded; window.onload = pageLoaded;
function pageLoaded() function pageLoaded()
{ {
document.getElementById("action-email:subject").focus(); document.getElementById("action-email:subject").focus();
checkButtonState(); checkButtonState();
} }
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("action-email:subject").value.length == 0 || if (document.getElementById("action-email:subject").value.length == 0)
document.getElementById("action-email:address").value.length == 0) {
{ document.getElementById("action-email:next-button").disabled = true;
document.getElementById("action-email:next-button").disabled = true; document.getElementById("action-email:finish-button").disabled = true;
document.getElementById("action-email:finish-button").disabled = true; }
} else
else {
{ document.getElementById("action-email:next-button").disabled = false;
document.getElementById("action-email:next-button").disabled = false; document.getElementById("action-email:finish-button").disabled = false;
document.getElementById("action-email:finish-button").disabled = false; }
} }
} </script>
</script>
<f:view>
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<%-- load a bundle of properties with I18N strings --%> <f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptCharset="UTF-8" id="action-email">
<h:form acceptCharset="UTF-8" id="action-email">
<%-- Main outer table --%>
<%-- Main outer table --%> <table cellspacing="0" cellpadding="2">
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<%-- Title bar --%> <tr>
<tr> <td colspan="2">
<td colspan="2"> <%@ include file="../../parts/titlebar.jsp" %>
<%@ include file="../../parts/titlebar.jsp" %> </td>
</td> </tr>
</tr>
<%-- Main area --%>
<%-- Main area --%> <tr valign="top">
<tr valign="top"> <%-- Shelf --%>
<%-- Shelf --%> <td>
<td> <%@ include file="../../parts/shelf.jsp" %>
<%@ include file="../../parts/shelf.jsp" %> </td>
</td>
<%-- Work Area --%>
<%-- Work Area --%> <td width="100%">
<td width="100%"> <table cellspacing="0" cellpadding="0" width="100%">
<table cellspacing="0" cellpadding="0" width="100%"> <%-- Breadcrumb --%>
<%-- Breadcrumb --%> <%@ include file="../../parts/breadcrumb.jsp" %>
<%@ include file="../../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<%-- Status and Actions --%> <tr>
<tr> <td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> <td bgcolor="#EEEEEE">
<td bgcolor="#EEEEEE">
<%-- Status and Actions inner contents table --%>
<%-- Status and Actions inner contents table --%> <%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> <table cellspacing="4" cellpadding="0" width="100%">
<table cellspacing="4" cellpadding="0" width="100%"> <tr>
<tr> <td width="32">
<td width="32"> <h:graphicImage id="wizard-logo" url="/images/icons/new_rule_large.gif" />
<h:graphicImage id="wizard-logo" url="/images/icons/new_rule_large.gif" /> </td>
</td> <td>
<td> <div class="mainTitle"><h:outputText value="#{NewActionWizard.wizardTitle}" /></div>
<div class="mainTitle"><h:outputText value="#{NewActionWizard.wizardTitle}" /></div> <div class="mainSubText"><h:outputText value="#{NewActionWizard.wizardDescription}" /> '<h:outputText value="#{DocumentDetailsBean.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{NewActionWizard.wizardDescription}" /> '<h:outputText value="#{DocumentDetailsBean.name}" />'</div> </td>
</td> </tr>
</tr> </table>
</table>
</td>
</td> <td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td> </tr>
</tr>
<%-- separator row with gradient shadow --%>
<%-- separator row with gradient shadow --%> <tr>
<tr> <td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td> <td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td> <td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td> </tr>
</tr>
<%-- Details --%>
<%-- Details --%> <tr valign=top>
<tr valign=top> <td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td> <td>
<td> <table cellspacing="0" cellpadding="3" border="0" width="100%">
<table cellspacing="0" cellpadding="3" border="0" width="100%"> <tr>
<tr> <td width="20%" valign="top">
<td width="20%" valign="top"> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> <h:outputText styleClass="mainSubTitle" value="#{msg.steps}"/><br>
<h:outputText styleClass="mainSubTitle" value="#{msg.steps}"/><br> <a:modeList itemSpacing="3" iconColumnWidth="2" selectedStyleClass="statusListHighlight"
<a:modeList itemSpacing="3" iconColumnWidth="2" selectedStyleClass="statusListHighlight" value="2" disabled="true">
value="2" disabled="true"> <a:listItem value="1" label="1. #{msg.action}" />
<a:listItem value="1" label="1. #{msg.action}" /> <a:listItem value="2" label="2. #{msg.action_settings}" />
<a:listItem value="2" label="2. #{msg.action_settings}" /> <a:listItem value="3" label="3. #{msg.summary}" />
<a:listItem value="3" label="3. #{msg.summary}" /> </a:modeList>
</a:modeList> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> </td>
</td>
<td width="100%" valign="top">
<td width="100%" valign="top">
<a:errors message="#{msg.error_wizard}" styleClass="errorMessage" />
<a:errors message="#{msg.error_wizard}" styleClass="errorMessage" />
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<table cellpadding="2" cellspacing="2" border="0" width="100%"> <tr>
<tr> <td colspan="2" class="mainSubTitle"><h:outputText value="#{NewActionWizard.stepTitle}" /></td>
<td colspan="2" class="mainSubTitle"><h:outputText value="#{NewActionWizard.stepTitle}" /></td> </tr>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr> <tr><td colspan="2" class="paddingRow"></td></tr>
<tr> <tr>
<td><h:outputText value="#{msg.subject}"/>:</td> <td><h:outputText value="#{msg.subject}"/>:</td>
<td width="90%"> <td width="90%">
<h:inputText id="subject" value="#{NewActionWizard.actionProperties.subject}" <h:inputText id="subject" value="#{NewActionWizard.actionProperties.subject}" size="75" maxlength="1024"
size="75" maxlength="1024" onkeyup="javascript:checkButtonState();" />&nbsp;*
onkeyup="javascript:checkButtonState();"/>&nbsp;* </td>
</td> </tr>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr><td colspan="2" class="paddingRow"></td></tr> <tr><td colspan="2" class="mainSubTitle"><h:outputText value="#{msg.action_mail_message_text}"/></td></tr>
<tr><td colspan="2" class="mainSubTitle"><h:outputText value="#{msg.action_mail_message_text}"/></td></tr> <tr>
<tr> <td valign="top"><h:outputText value="#{msg.message}"/>:</td>
<td valign="top"><h:outputText value="#{msg.message}"/>:</td> <td>
<td> <h:inputTextarea value="#{NewActionWizard.actionProperties.message}"
<h:inputTextarea value="#{NewActionWizard.actionProperties.message}" rows="4" cols="75" />
rows="5" cols="75" /> </td>
</td> </tr>
</tr> <tr><td colspan="2" class="paddingRow"></td></tr>
<tr><td colspan="2" class="paddingRow"></td></tr> <tr><td colspan="2" class="mainSubTitle"><h:outputText value="#{msg.action_mail_template_text}"/></td></tr>
<tr><td colspan="2" class="mainSubTitle"><h:outputText value="#{msg.action_mail_template_text}"/></td></tr> <tr>
<tr> <td valign="top"><h:outputText value="#{msg.action_mail_template}"/>:</td>
<td valign="top"><h:outputText value="#{msg.action_mail_template}"/>:</td> <td>
<td> <%-- Templates drop-down selector --%>
<%-- Templates drop-down selector --%> <h:selectOneMenu value="#{NewActionWizard.actionProperties.template}">
<h:selectOneMenu value="#{NewActionWizard.actionProperties.template}"> <f:selectItems value="#{NewActionWizard.templates}" />
<f:selectItems value="#{NewActionWizard.templates}" /> </h:selectOneMenu>
</h:selectOneMenu> </td>
</td> </tr>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr><td colspan="2" class="paddingRow"></td></tr> <tr><td colspan="2" class="mainSubTitle"><h:outputText value="#{msg.selected_recipients}" /></td></tr>
<tr> <tr>
<td valign="top"><h:outputText value="#{msg.to}"/>:</td> <td></td>
<td> <%-- Picker to select Users/Groups --%>
<h:selectOneMenu id="address" value="#{NewActionWizard.actionProperties.to}" <td>
onchange="javascript:checkButtonState();"> <a:genericPicker id="picker" filters="#{InviteSpaceUsersWizard.filters}"
<f:selectItems value="#{NewActionWizard.users}" /> queryCallback="#{InviteSpaceUsersWizard.pickerCallback}"
</h:selectOneMenu> actionListener="#{NewActionWizard.addRecipient}" />
</td> </td>
</tr> </tr>
<tr><td class="paddingRow"></td></tr>
<tr> <tr>
<td colspan="2"><h:outputText value="#{NewActionWizard.stepInstructions}" /></td> <td valign="top"><h:outputText value="#{msg.to}"/>:</td>
</tr> <td>
</table> <h:dataTable value="#{NewActionWizard.emailRecipientsDataModel}" var="row"
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> rowClasses="selectedItemsRow,selectedItemsRowAlt"
</td> styleClass="selectedItems" headerClass="selectedItemsHeader"
cellspacing="0" cellpadding="4"
<td valign="top"> rendered="#{NewActionWizard.emailRecipientsDataModel.rowCount != 0}">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> <h:column>
<table cellpadding="1" cellspacing="1" border="0"> <f:facet name="header">
<tr> <h:outputText value="#{msg.name}" />
<td align="center"> </f:facet>
<h:commandButton id="next-button" value="#{msg.next_button}" action="#{NewActionWizard.next}" styleClass="wizardButton" /> <h:outputText value="#{row.name}" />
</td> </h:column>
</tr> <h:column>
<tr> <a:actionLink actionListener="#{NewActionWizard.removeRecipient}" image="/images/icons/delete.gif"
<td align="center"> value="#{msg.remove}" showLink="false" style="padding-left:6px" />
<h:commandButton value="#{msg.back_button}" action="#{NewActionWizard.back}" styleClass="wizardButton" /> </h:column>
</td> </h:dataTable>
</tr> <a:panel id="no-items" rendered="#{NewActionWizard.emailRecipientsDataModel.rowCount == 0}">
<tr> <table cellspacing='0' cellpadding='2' border='0' class='selectedItems'>
<td align="center"> <tr>
<h:commandButton id="finish-button" value="#{msg.finish_button}" action="#{NewActionWizard.finish}" styleClass="wizardButton" /> <td colspan='2' class='selectedItemsHeader'><h:outputText id="no-items-name" value="#{msg.name}" /></td>
</td> </tr>
</tr> <tr>
<tr><td class="wizardButtonSpacing"></td></tr> <td class='selectedItemsRow'><h:outputText id="no-items-msg" value="#{msg.no_selected_items}" /></td>
<tr> </tr>
<td align="center"> </table>
<h:commandButton value="#{msg.cancel_button}" action="#{NewActionWizard.cancel}" styleClass="wizardButton" /> </a:panel>
</td> </td>
</tr> </tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> <tr><td class="paddingRow"></td></tr>
</td> <tr>
</tr> <td colspan="2"><h:outputText value="#{NewActionWizard.stepInstructions}" /></td>
</table> </tr>
</td> </table>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</tr> </td>
<%-- separator row with bottom panel graphics --%> <td valign="top">
<tr> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td> <table cellpadding="1" cellspacing="1" border="0">
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td> <tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td> <td align="center">
</tr> <h:commandButton id="next-button" value="#{msg.next_button}" action="#{NewActionWizard.next}" styleClass="wizardButton" disabled="#{NewActionWizard.emailRecipientsDataModel.rowCount == 0}" />
</td>
</table> </tr>
</td> <tr>
</tr> <td align="center">
</table> <h:commandButton value="#{msg.back_button}" action="#{NewActionWizard.back}" styleClass="wizardButton" />
</td>
</h:form> </tr>
<tr>
</f:view> <td align="center">
<h:commandButton id="finish-button" value="#{msg.finish_button}" action="#{NewActionWizard.finish}" styleClass="wizardButton" />
</td>
</tr>
<tr><td class="wizardButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel_button}" action="#{NewActionWizard.cancel}" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page> </r:page>

View File

@@ -39,8 +39,7 @@
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("new-rule-email:subject").value.length == 0 || if (document.getElementById("new-rule-email:subject").value.length == 0)
document.getElementById("new-rule-email:address").value.length == 0)
{ {
document.getElementById("new-rule-email:ok-button").disabled = true; document.getElementById("new-rule-email:ok-button").disabled = true;
} }
@@ -131,9 +130,8 @@
<tr> <tr>
<td><h:outputText value="#{msg.subject}"/>:</td> <td><h:outputText value="#{msg.subject}"/>:</td>
<td width="90%"> <td width="90%">
<h:inputText id="subject" value="#{NewRuleWizard.actionProperties.subject}" <h:inputText id="subject" value="#{NewRuleWizard.actionProperties.subject}" size="75" maxlength="1024"
size="75" maxlength="1024" onkeyup="javascript:checkButtonState();" />&nbsp;*
onkeyup="javascript:checkButtonState();"/>&nbsp;*
</td> </td>
</tr> </tr>
@@ -143,7 +141,7 @@
<td valign="top"><h:outputText value="#{msg.message}"/>:</td> <td valign="top"><h:outputText value="#{msg.message}"/>:</td>
<td> <td>
<h:inputTextarea value="#{NewRuleWizard.actionProperties.message}" <h:inputTextarea value="#{NewRuleWizard.actionProperties.message}"
rows="5" cols="75" /> rows="4" cols="75" />
</td> </td>
</tr> </tr>
<tr><td colspan="2" class="paddingRow"></td></tr> <tr><td colspan="2" class="paddingRow"></td></tr>
@@ -159,13 +157,46 @@
</tr> </tr>
<tr><td colspan="2" class="paddingRow"></td></tr> <tr><td colspan="2" class="paddingRow"></td></tr>
<tr><td colspan="2" class="mainSubTitle"><h:outputText value="#{msg.selected_recipients}" /></td></tr>
<tr>
<td></td>
<%-- Picker to select Users/Groups --%>
<td>
<a:genericPicker id="picker" filters="#{InviteSpaceUsersWizard.filters}"
queryCallback="#{InviteSpaceUsersWizard.pickerCallback}"
actionListener="#{NewRuleWizard.addRecipient}" />
</td>
</tr>
<tr> <tr>
<td valign="top"><h:outputText value="#{msg.to}"/>:</td> <td valign="top"><h:outputText value="#{msg.to}"/>:</td>
<td> <td>
<h:selectOneMenu id="address" value="#{NewRuleWizard.actionProperties.to}" <h:dataTable value="#{NewRuleWizard.emailRecipientsDataModel}" var="row"
onchange="javascript:checkButtonState();"> rowClasses="selectedItemsRow,selectedItemsRowAlt"
<f:selectItems value="#{NewRuleWizard.users}" /> styleClass="selectedItems" headerClass="selectedItemsHeader"
</h:selectOneMenu> cellspacing="0" cellpadding="4"
rendered="#{NewRuleWizard.emailRecipientsDataModel.rowCount != 0}">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.name}" />
</f:facet>
<h:outputText value="#{row.name}" />
</h:column>
<h:column>
<a:actionLink actionListener="#{NewRuleWizard.removeRecipient}" image="/images/icons/delete.gif"
value="#{msg.remove}" showLink="false" style="padding-left:6px" />
</h:column>
</h:dataTable>
<a:panel id="no-items" rendered="#{NewRuleWizard.emailRecipientsDataModel.rowCount == 0}">
<table cellspacing='0' cellpadding='2' border='0' class='selectedItems'>
<tr>
<td colspan='2' class='selectedItemsHeader'><h:outputText id="no-items-name" value="#{msg.name}" /></td>
</tr>
<tr>
<td class='selectedItemsRow'><h:outputText id="no-items-msg" value="#{msg.no_selected_items}" /></td>
</tr>
</table>
</a:panel>
</td> </td>
</tr> </tr>