As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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…
<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}'
<action id="send"> <label>Send email</label> <image>/images/icons/letter.gif</image> <action-listener>#{mail-attach.executeImpl}</action-listener> </action>
javax.faces.el.EvaluationException: Exception while invoking expression #{send.executeImpl} caused by: java.lang.NoSuchMethodException: es.sic.executer.MailAttachActionExecuter.executeImpl(javax.faces.event.ActionEvent)
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)
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>
<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