03-25-2010 11:19 AM
03-25-2010 11:31 AM
Hi,
Anybody knows if there is a way to have the "send email" action in the document_browse_menu?
Actually, the only way to get to this action is by "Execute action" option…
03-25-2010 11:37 AM
<action-handlers>
<handler name="mail-attach" class="es.sic.handlers.MailAttachHandler" />
</action-handlers>
…
<action id="send">
<label>Send email</label>
<image>/images/icons/letter.gif</image>
<action-listener>#{mail-attach.executeImpl}</action-listener>
</action>
<action-group id="document_browse_menu">
<action idref="send" />
</action-group>
javax.faces.el.ReferenceSyntaxException: Expression: #{mail-attach.executeImpl}
caused by:
org.apache.myfaces.el.ValueBindingImpl$NotVariableReferenceException: Parsed Expression of unsupported type for this operation. Expression class: org.apache.commons.el.BinaryOperatorExpression. Expression: '#{mail-attach.executeImpl}'
03-25-2010 11:51 AM
<action id="send">
<label>Send email</label>
<image>/images/icons/letter.gif</image>
<action-listener>#{mail-attach.executeImpl}</action-listener>
</action>
03-25-2010 11:57 AM
javax.faces.el.EvaluationException: Exception while invoking expression #{send.executeImpl}
caused by:
java.lang.NoSuchMethodException: es.sic.executer.MailAttachActionExecuter.executeImpl(javax.faces.event.ActionEvent)
03-25-2010 12:06 PM
I have all the custom actions in web-client-config-custom.xml and the only one with I'm having problemas is this one…
I'm having this error:javax.faces.el.EvaluationException: Exception while invoking expression #{send.executeImpl}
caused by:
java.lang.NoSuchMethodException: es.sic.executer.MailAttachActionExecuter.executeImpl(javax.faces.event.ActionEvent)
03-26-2010 03:54 AM
public class MailAttachHandler extends BaseActionHandler
{
public static final String PROP_TO = "to";
public static final String PROP_FROM = "from";
public static final String PROP_MESSAGE = "message";
public static final String PROP_SUBJECT = "subject";
public static final String PROP_TEMPLATE = "template";
public String getJSPPath()
{
return getJSPPath(MailAttachActionExecuter.NAME);
}
public void prepareForSave(Map<String, Serializable> actionProps,
Map<String, Serializable> repoProps)
{
// get hold of the current wizard so we can extract some data from it
BaseActionWizard wizard = (BaseActionWizard)Application.
getWizardManager().getBean();
// add the person(s) it's going to as a list of authorities
List<String> recipients = new ArrayList<String>(wizard.getEmailRecipients().size());
for (int i=0; i < wizard.getEmailRecipients().size(); i++)
{
RecipientWrapper wrapper = wizard.getEmailRecipients().get(i);
recipients.add(wrapper.getAuthority());
}
repoProps.put(MailAttachActionExecuter.PARAM_TO_MANY, (Serializable)recipients);
// add the actual email text to send
repoProps.put(MailAttachActionExecuter.PARAM_TEXT, actionProps.get(PROP_MESSAGE));
// add the subject for the email
repoProps.put(MailAttachActionExecuter.PARAM_SUBJECT, actionProps.get(PROP_SUBJECT));
// add the from address
String from = Application.getClientConfig(FacesContext.getCurrentInstance()).getFromEmailAddress();
repoProps.put(MailAttachActionExecuter.PARAM_FROM, from);
// add the template if one was selected by the user
if (wizard.getUsingTemplate() != null)
{
repoProps.put(MailAttachActionExecuter.PARAM_TEMPLATE, new NodeRef(Repository.getStoreRef(),
wizard.getUsingTemplate()));
}
}
public void prepareForEdit(Map<String, Serializable> actionProps,
Map<String, Serializable> repoProps)
{
// get hold of the current wizard so we can extract some data from it
BaseActionWizard wizard = (BaseActionWizard)Application.
getWizardManager().getBean();
String subject = (String)repoProps.get(MailAttachActionExecuter.PARAM_SUBJECT);
actionProps.put(PROP_SUBJECT, subject);
String message = (String)repoProps.get(MailAttachActionExecuter.PARAM_TEXT);
actionProps.put(PROP_MESSAGE, message);
// handle single email or multiple authority recipients
String to = (String)repoProps.get(MailAttachActionExecuter.PARAM_TO);
if (to != null)
{
actionProps.put(PROP_TO, to);
}
else
{
List<String> recipients = (List<String>)repoProps.get(MailAttachActionExecuter.PARAM_TO_MANY);
if (recipients != null && recipients.size() != 0)
{
// rebuild the list of RecipientWrapper objects from the stored action
for (String authority : recipients)
{
wizard.getEmailRecipients().add(
new RecipientWrapper(wizard.displayLabelForAuthority(authority),
authority));
}
}
}
NodeRef templateRef = (NodeRef)repoProps.get(MailAttachActionExecuter.PARAM_TEMPLATE);
if (templateRef != null)
{
actionProps.put(PROP_TEMPLATE, templateRef.getId());
wizard.setUsingTemplate(templateRef.getId());
}
}
public String generateSummary(FacesContext context, IWizardBean wizard,
Map<String, Serializable> actionProps)
{
BaseActionWizard actionWizard = (BaseActionWizard)wizard;
String addresses = (String)actionProps.get(PROP_TO);
if (addresses == null || addresses.length() == 0)
{
if (actionWizard.getEmailRecipients().size() != 0)
{
StringBuilder builder = new StringBuilder();
for (int i=0; i < actionWizard.getEmailRecipients().size(); i++)
{
RecipientWrapper wrapper = actionWizard.getEmailRecipients().get(i);
if (i != 0)
{
builder.append(", ");
}
builder.append(wrapper.getName());
}
addresses = builder.toString();
}
}
return MessageFormat.format(Application.getMessage(context, "action_mail_attach"),
new Object[] {addresses});
}
}
<action-handlers>
<handler name="mail" class="org.alfresco.web.bean.actions.handlers.MailAttachHandler" />
</action-handlers>
05-26-2011 07:57 AM
<beans>
<bean id="myAction"
class="es.sia.alfresco.action.executer.MyActionExecuter"
parent="actionexecuter">
<property name="nodeService">
<ref bean="NodeService" />
</property>
</bean>
<bean id="extension.actionResourceBundles" parent="actionResourceBundles">
<property name="resourceBundles">
<list>
<value>alfresco.extension.custodiaactionmessages</value>
</list>
</property>
</bean>
</beans>
javax.faces.el.EvaluationException: Exception while invoking expression #{myAction.executeImpl}
caused by:
javax.faces.el.PropertyNotFoundException: Base is null: myAction
08-31-2011 03:56 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.