teqnology / alfresco-login-reset-share

Alfresco Share new materialize login page and an Activiti reset password workflow feature
GNU General Public License v3.0
2 stars 9 forks source link

TypeError disallowedUsers #1

Closed opeeters closed 9 years ago

opeeters commented 9 years ago

I'm getting the following error when requesting instructions for a password reset:

05290001 Wrapped Exception (with status template): 05290024 Failed to execute script 'classpath:alfresco/templates/webscripts/com/androgogic/login/forgot-password/forgot-password-workflow.post.json.js': 05290023 TypeError: disallowedUsers is not a function, it is object. (classpath:alfresco/templates/webscripts/com/androgogic/login/forgot-password/forgot-password-workflow.post.json.js#160)

There is a mail send form alfresco@demo.alfresco.org to my mail with a title "testing alfresco" and a message "testing alfresco mail settings". This probably means I should still configure something, but I cannot find anything I did not do in the instructions..

I'm on alfresco-5.0.d, the community edition on CentOS 6.6

teqnology commented 9 years ago

Hey, thanks for raising this. So, the fact that your Alfresco instance is sending you an email means that probably you have the test email setting configured in your tomcat/shared/classes/alfresco-global.properties file. See here: http://docs.alfresco.com/5.0/concepts/email-outboundsmtp-props.html. Regarding disallowedUsers there was a typo but it was fixed here https://github.com/teqnology/alfresco-login-reset-repo/commit/837088fcf7110a3ce2e9db510e7ee5dabe626d91. After that change I probably forgot to mention you should've rebuild the .amp file. I've done that for you, https://github.com/teqnology/alfresco-login-reset-repo/tree/master/target, so it should be all good now. Let me know if you have any more problems with this one. I'll leave the issue open until you validate it works.

opeeters commented 9 years ago

Thanks for the fast reply! I stoped Alfresco, pulled the new amp from https://github.com/teqnology/alfresco-login-reset-repo/tree/master/target to ./amp/, executed bin/apply_amps.sh. I reviewed my smtp settings according to http://docs.alfresco.com/5.0/concepts/email-outboundsmtp-props.html and tried several combinations. I am getting the test mail as I configured in tomcat/shared/classes/alfresco-global.properties when rebooting alfresco and for the rest alfresco is able to send mails as expected.

I am still getting the following error:

The email with the instructions was not sent. Please retry or contact your system administrator. Here is the detailed error: JavaException: org.alfresco.error.AlfrescoRuntimeException: 05300018 Failed to send email to:my@e.mail

Should I have updated alfresco-login-reset-share too?

teqnology commented 9 years ago

Hmm, Are you able to provide the complete stack of the error trace? It should print out something (and if the page is not exhaustive enough, just copy paste your catalina.out when you try to force the send email feature through the reset password page. My guess is it should be related to the template but without logs is almost impossible to say. Thanks

On 30 June 2015 at 21:24, opeeters notifications@github.com wrote:

Thanks for the fast reply! I stoped Alfresco, pulled the new amp from https://github.com/teqnology/alfresco-login-reset-repo/tree/master/target to ./amp/, executed bin/apply_amps.sh. I reviewed my smtp settings according to http://docs.alfresco.com/5.0/concepts/email-outboundsmtp-props.html and tried several combinations. I am getting the test mail as I configured in tomcat/shared/classes/alfresco-global.properties when rebooting alfresco and for the rest alfresco is able to send mails as expected.

I am still getting the following error:

The email with the instructions was not sent. Please retry or contact your system administrator. Here is the detailed error: JavaException: org.alfresco.error.AlfrescoRuntimeException: 05300018 Failed to send email to:my@e.mail

Should I have updated alfresco-login-reset-share too?

— Reply to this email directly or view it on GitHub https://github.com/teqnology/alfresco-login-reset-share/issues/1#issuecomment-117130415 .

413n 5ub4t

au.linkedin.com/in/alensubat/

as.armada@gmail.com | curiousnerd.me [image: Twitter] http://twitter.com/trip314 https://www.linkedin.com/in/alensubat [image: Blogger] http://alch3mi5t.blogspot.it/ [image: foursquare] https://it.foursquare.com/trip314 http://plus.google.com/110917739021870768051 [image: YouTube] http://www.youtube.com/user/alenthealchemist Contact me: [image: Skype] alens2000

opeeters commented 9 years ago

this is what I get in alfresco-5.0.d/tomcat/logs/catalina.out:

2015-06-30 14:11:49,681 DEBUG [repo.jscript.ScriptLogger] [http-apr-8080-exec-2] forgot-pasword workflow started with name: activiti$activitiAdhoc 2015-06-30 14:12:22,022 ERROR [action.executer.MailActionExecuter] [http-apr-8080-exec-2] Failed to send email to my@e.mail : org.springframework.mail.MailSendException: Failed messages: javax.mail.MessagingException: No MimeMessage content; message exceptions (1) are: Failed message 1: javax.mail.MessagingException: No MimeMessage content

teqnology commented 9 years ago

Could you please confirm that you have the right templates in place here: Data Dictionary/Email Templates/andro-email-template/? They should've been unpacked from the .acp in alfresco/bootstrap/ folder. I found this error a while ago, and it was because the .ftl template file wasn't in place. What happened there was that the acp email template files are extracted in the hardcoded path: Data Dictionary/Email Templates/andro-email-template/. The code as well tries to reach the template with a hardcoded path (I didn't have time to update git with a more dynamic approach (eg. companyhome object instead of "/Company Home" string). So just check the paths, and if you're using an Alfresco version different from English, adapt the paths inside the scripts, and you should be good to go. I'll fix them asap and update the git project as well.

opeeters commented 9 years ago

I see the following file: /opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/bootstrap/alfresco-email-template-bootstrap.acp

I cannot find a directory with this hierarchy: Data Dictionary/Email Templates/andro-email-template/

Where should this structure be? How do I manually unpack a .acp?

I found the following .ftl files (filtering on 'androgogic'): /opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/com/androgogic/login/forgot-password/forgot-password-workflow.post.json.ftl /opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/com/androgogic/login/list-users/list-users-workflow.post.json.ftl /opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/com/androgogic/login/reset-password/reset-password-workflow.post.json.ftl /opt/alfresco-5.0.d/tomcat/webapps/share/WEB-INF/classes/alfresco/templates/com/androgogic/base/login/reset-password.ftl /opt/alfresco-5.0.d/tomcat/webapps/share/WEB-INF/classes/alfresco/templates/com/androgogic/base/login/forgot-password.ftl /opt/alfresco-5.0.d/tomcat/webapps/share/WEB-INF/classes/alfresco/templates/com/androgogic/base/login/login.ftl

opeeters commented 9 years ago

OK, I was able to unzip /opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/bootstrap/alfresco-email-template-bootstrap.acp which gives me three file: alfresco-email-template-bootstrap.acp.xml alfresco-email-template-bootstrap/content0.txt alfresco-email-template-bootstrap/content1.txt

I assume content0.txt and content1.txt are not the good names and where should I move these files? Thanks!

teqnology commented 9 years ago

ACP are only content packages for Alfresco (that means, simple ZIP files). You can gather all the useful info from the xml file in the acp file (if you open it with a text editor you'll find the txt file names and proper extensions, eg. .ftl). if you go here: https://github.com/teqnology/alfresco-login-reset-repo you'll find a bit of a documentation about ACP and the files in it (follow the ACP Bootstrap headline and you'll see the ftl filenames. FYI

The HTML5 email templates are stored in the acp file inside the /src/main/amp/config/alfresco/bootstrap folder. There are two ACPs to be deployed:

-

alfresco-email-template-bootstrap.acp which contains:

Just make sure you have these files in your Data Dictionary/path and you should be good to go.

Also please verify why the acp wasn't uploaded and extracted in the first place. Please let me know the outcome :D rgds A.

On 1 July 2015 at 23:55, opeeters notifications@github.com wrote:

OK, I was able to unzip /opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/bootstrap/alfresco-email-template-bootstrap.acp which gives me three file: alfresco-email-template-bootstrap.acp.xml alfresco-email-template-bootstrap/content0.txt alfresco-email-template-bootstrap/content1.txt

I assume content0.txt and content1.txt are not the good names and where should I move these files? Thanks!

— Reply to this email directly or view it on GitHub https://github.com/teqnology/alfresco-login-reset-share/issues/1#issuecomment-117683605 .

413n 5ub4t

au.linkedin.com/in/alensubat/

as.armada@gmail.com | curiousnerd.me [image: Twitter] http://twitter.com/trip314 https://www.linkedin.com/in/alensubat [image: Blogger] http://alch3mi5t.blogspot.it/ [image: foursquare] https://it.foursquare.com/trip314 http://plus.google.com/110917739021870768051 [image: YouTube] http://www.youtube.com/user/alenthealchemist Contact me: [image: Skype] alens2000

opeeters commented 9 years ago

Hi, It is still not clear to me after having read the instructions where I should place these templates. I cannot find a directory with the name "Data Dictionary" anywhere. Where should I create this? In: /opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/module/alfresco-login-reset-repo/ and: /opt/alfresco-5.0.d/tomcat/webapps/share/WEB-INF/classes/alfresco/module/alfresco-login-reset-share/ maybe? This seems to be the place where all the rest has been deployed.

teqnology commented 9 years ago

The templates need to be inside Alfresco. Go to your Alfresco instance web interface (eg. localhost:8080/share/page/repository), and in the Company Home you'll find the Data Dictionary folder. Inside you'll find an "Email Templates" folder, that's where you need to create the folder "andro-email-template" and place the two .ftl files inside. As you can see in the code here: https://github.com/teqnology/alfresco-login-reset-repo/blob/master/src/main/amp/config/alfresco/templates/webscripts/com/androgogic/login/forgot-password/forgot-password-workflow.post.json.js on row 59 the path to look for the email template is: mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/andro-email-template/forgot-password-email.ftl" );

Let me know if you have any issues. rgds A.

On Fri, 3 Jul 2015 at 20:51 opeeters notifications@github.com wrote:

Hi, It is still not clear to me after having read the instructions where I should place these templates. I cannot find a directory with the name "Data Dictionary" anywhere. Where should I create this? In:

/opt/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/module/alfresco-login-reset-repo/ and:

/opt/alfresco-5.0.d/tomcat/webapps/share/WEB-INF/classes/alfresco/module/alfresco-login-reset-share/ maybe? This seems to be the place where all the rest has been deployed.

— Reply to this email directly or view it on GitHub https://github.com/teqnology/alfresco-login-reset-share/issues/1#issuecomment-118314484 .

Sent from my Android Inbox app.

opeeters commented 9 years ago

Ah ha! Now I finally got it :-) Inside of the Alfresco directory under {URL-of-the-share}share/page/repository "Data Dictionary" > "Email Templates" was a directory "custom-email-template". I created a directory "andro-email-template" and copied the two templates from "custom-email-template" to "andro-email-template" within the Alfresco-gui and I was good to go. All seems to work now. Thanks allot for you support!

teqnology commented 9 years ago

that was my bad, refactored the amp,without upgrading the acp as well. sorry for the fuss..hope all good now.. any feedback or suggestions are welcome enjoy!

On Fri, Jul 3, 2015, 10:32 PM opeeters notifications@github.com wrote:

Ah ha! Now I finally got it :-) Inside of the Alfresco directory under {URL-of-the-share}share/page/repository "Data Dictionary" > "Email Templates" was a directory "custom-email-template". I created a directory "andro-email-template" and copied the two templates from "custom-email-template" to "andro-email-template" within the Alfresco-gui and I was good to go. All seems to work now. Thanks allot for you support!

— Reply to this email directly or view it on GitHub https://github.com/teqnology/alfresco-login-reset-share/issues/1#issuecomment-118335154 .

Sent from my Android Inbox app.

teqnology commented 9 years ago

Closing as it seems fixed now