Create HTML mails in SSJS using MIME
See the description at the top of the class for a description on how to use this class or read this article on my blog:
http://linqed.eu/?p=45
JavaScript (Server)
Mark Leusink
Overall rating is 4.86 by 14 person(s)
You have to login first to use 'My Favorites' feature
15 user(s) has marked as favorite:
Eric McCormick
Eric Tomenga
Fredrik Norling
Gavin Luo
Gunawan T Wicaksono
Joacim Boive
Johan Sundin
Leonardo Bertelli LB Bertelli
martin meijer
Michele Malaguti
Mike R Kelly
Niklas Heidloff
Petter Kjeilen
Steve Pridemore
Venkat T Jagaduri
Added 2011-Dec-07
emailBean : Send DominoDocument HTML Emails c/w Embedded Images, Attachments, Custom Header/Footer
Use the emailBean to create and send HTML/MIME emails based on a DominoDocument datasource. Use CKEditor bound to the datasource to compose the email content that can also include Embedded Images. Use the File Upload bound to the datasource to also include Attachments in the email. You can also specify your own custom Header and Footer (Signature) HTML content for the email.
Example:
emailBean.setSendTo("frank@renovations.com");
emailBean.setSubject("Todays Finance Report");
emailBean.setSenderEmail("samantha@renovations.com");
emailBean.setSenderName("Samantha - Renovations");
emailBean.setDocument(document1);
emailBean.setFieldName("Body");
emailBean.setBannerHTML("Hi,
");
emailBean.setFooterHTML("Kind regards,
Samantha
0012 3456 789
");
emailBean.send();
XPages
Tony McGuckin
Overall rating is 5.00 by 9 person(s)
You have to login first to use 'My Favorites' feature
14 user(s) has marked as favorite:
Angelo Pampalone
Cristian DAloisio
Dwain A Wuerfel
Grégory DEVISE
Jan1 Krunniniva
Joe L Bedolla
Leonardo Bertelli LB Bertelli
Marco Gajardo
Michele Malaguti
Mikael Grevsten
Serdar Basegmez
Son T Le
Terry Traphagen
Ulrich Krause
Added 2012-Apr-04
XAgent
Empty XAgent sample
XPages
Stephan Wissel
Overall rating is 4.72 by 18 person(s)
You have to login first to use 'My Favorites' feature
7 user(s) has marked as favorite:
Eric McCormick
Erskine Harris
Henry - Xu
Juan Ángel Celdrán Román
Niklas Heidloff
Patrick Kwintensson
Venkat T Jagaduri
Added 2011-Nov-15
SSJS Form Validation That Triggers ErrorMessage Controls
Using the built in validation on XPages controls has the disadvantage that the validation logic gets scattered all over the XPage source. While the other option of using SSJS for form validation does keep all the code in one place, but presents the problem of how to display the error messages back to the user. This is the best way I've found so far to keep the code in one place for maintainability, while using my preferred method of displaying errors to the user right next to the field that they need to fix.
Credit goes to Matt White for how to call validation in SSJS script library, to Andre Girrard for how to trigger the ErrorMessage control ( postValidationError() ), and to Tommy Valand for the $A() helper function, which allows my simple isEmpty() function to work properly with both single and multi-value fields. The following technique pulls all those together.
1. Create the SSJS script library "xpValidation" using the code snippet.
2. Add the "xpValidation" SSJS script library as a resource to the XPage.
3. Make the submit button's "Button Type" = "Button" (not "Submit")
4. In the button's OnClick event, click the "Add Group..." button, in the condition, call the validation function: validateForm()
5. Then inside the group, add a new "Save Data Sources" Simple Action and set the "Name of page to open next" (This will only execute if the validation is passed.)
JavaScript (Server)
Don Mottolo
Overall rating is 4.38 by 8 person(s)
You have to login first to use 'My Favorites' feature
6 user(s) has marked as favorite:
Anders Magnusson
Eric McCormick
Fa Sc
Ferhat BULUT
Gary J. Morin
jeniffer homes
Added 2011-Dec-14
Sorting a NotesDocumentCollection by multiple field values
Also available on http://per.lausten.dk/blog/2006/10/sorting-notesdocumentcollection-by.html
LotusScript
Per Henrik Lausten
Overall rating is 5.00 by 5 person(s)
You have to login first to use 'My Favorites' feature
6 user(s) has marked as favorite:
charles a ross
Guenter Tscharf
Henry - Xu
jimmy fan
Juan Ángel Celdrán Román
Rainer Fesslmeier
Added 2011-Dec-09
Wrap NotesDocument into NotesXspDocument
Use this function if you have NotesDocument and you need NotesXspDocument (eg. for data binding on xpage)
JavaScript (Server)
Mariusz Jakubowski
Overall rating is 4.20 by 5 person(s)
You have to login first to use 'My Favorites' feature
1 user(s) has marked as favorite:
Michele Malaguti
Added 2012-May-22
LtpaToken Generator for Multi-server SSO Configurations
This Java class generates a valid LtpaToken valid for any user name.
When using, you should sign the database with a user that is listed as 'Owner' or 'Administrator' in the SSO configuration. This version only supports Domino keys. Tokens imported from Websphere will not generate valid tokens. Since WAS token generation is not based on public API, it doesn't seem possible to do it without native libraries.
This class can be used for any customized login operations. You may specify any user with any name while creating the token.
UPDATE on 9th July, 2012:
- LMBCS encoding support has been added (see comments for details)
Java
Serdar Basegmez
Overall rating is 4.42 by 12 person(s)
You have to login first to use 'My Favorites' feature
6 user(s) has marked as favorite:
Eric N McCormick
Guglielmo Farina
Michele Malaguti
Serdar Basegmez
Steve Cochrane
Vikas Tiwari
Added 2012-May-26
Send Notes document as PDF attachment
This script is ideally placed on a form and allows the user to mail entire document as a PDF. The logic is as follows
- Copy and Paste UI doc into a temporary MS Word object
- Save MS Word as PDF
- Closes MS Word OLE Object
- Opens new mail & attaches PDF file
- Kills temporary file
LotusScript
Ben Menesi
Overall rating is 5.00 by 7 person(s)
You have to login first to use 'My Favorites' feature
2 user(s) has marked as favorite:
Erskine Harris
Wanda M Rosioara
Added 2015-May-19
Pure Java version of DbLookup & DbColumn, with cache, sort and unique
This is a completely rewritten version of the SSJS equivalent in pure Java, but without the 64k limit.
Now includes various tweaks to make it even faster.
Java
F. Kranenburg
Overall rating is 4.22 by 9 person(s)
You have to login first to use 'My Favorites' feature
4 user(s) has marked as favorite:
Eric McCormick
Erskine Harris
Tom MC Mennes
V. Watson
Added 2013-Feb-13
Custom Error Page c/w Cause and Stacktrace Information
Use this snippet to create a custom error XPage. Remember to set the Error Page in the Application Properties to point at your new custom error XPage.
If an exception occurs in your application, you'll see error output in the custom error page like this example:
An error has occurred:
com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression In the control : computedField7 At line 1, column 19 of: #{javascript:nonexistentObject.isDebugMode()}
com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)
javax.faces.component.UIOutput.getValue(UIOutput.java:159)
com.ibm.xsp.util.FacesUtil.convertValue(FacesUtil.java:1120)
com.ibm.xsp.renderkit.html_basic.OutputTextRenderer.encodeEnd(OutputTextRenderer.java:97)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeEnd(ReadOnlyAdapterRenderer.java:180)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:1005)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:856)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.component.UIViewRootEx._renderView(UIViewRootEx.java:1317)
com.ibm.xsp.component.UIViewRootEx.renderView(UIViewRootEx.java:1255)
com.ibm.xsp.application.ViewHandlerExImpl.doRender(ViewHandlerExImpl.java:641)
com.ibm.xsp.application.ViewHandlerExImpl._renderView(ViewHandlerExImpl.java:320)
com.ibm.xsp.application.ViewHandlerExImpl.renderView(ViewHandlerExImpl.java:335)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:103)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:264)
com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:248)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:205)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1281)
com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1265)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:661)
com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:481)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
XPages
Tony McGuckin
Overall rating is 5.00 by 6 person(s)
You have to login first to use 'My Favorites' feature
4 user(s) has marked as favorite:
Eric McCormick
F. Kranenburg
mitsuru katoh
Vincent BOITEUX
Added 2012-May-08
getComponentValue
Sometimes you use getValue() or getSubmittedValue() to get the value of component, this function will handle this problem
JavaScript (Server)
F van der Linden
Overall rating is 4.80 by 5 person(s)
You have to login first to use 'My Favorites' feature
4 user(s) has marked as favorite:
Dwain A Wuerfel
Eric McCormick
Martin Perrie
Mike R Kelly
Added 2011-Nov-15
Hack to use jQuery AMD widgets and Dojo together
The Dojo AMD loader in Xpages is causing issues with newer jQuery widgets. Examples with issues are jQuery Mobile, Select2 v4.0.0 and Bootbox (modal alert boxes).
Mark Roden blogged about this issue here: http://xomino.com/2015/06/02/select2-v4-needs-amd-fixing-in-domino-r9-xpages/
But what if you don't want to use "resource aggregation" and also don't want to manually edit these Javascripts? This is an alternative option.
The first script tag will temporary disable the Dojo AMD loader by removing "define.amd". After this script tag you should add all jQuery widgets that cause issues.
Last step is to add the a script tag to restore de Dojo AMD loader. That's it!
XPages
F. Kranenburg
Overall rating is 4.78 by 18 person(s)
You have to login first to use 'My Favorites' feature
6 user(s) has marked as favorite:
Angelo Pampalone
B Gleeson
Dan Soares
Eric McCormick
Peter Janzen
Steve Cochrane
Added 2015-Jun-03
Custom XPage file upload handler
Use this code if you want to implement a custom file upload solution like PLUpload or jQuery File Upload with XPages. See also: http://stackoverflow.com/questions/19723731/how-to-upload-a-file-from-mobile-phone-camera-to-xpages-with-phonegap-filetransf/19739712#19739712
Java
Mark Leusink
Overall rating is 5.00 by 2 person(s)
You have to login first to use 'My Favorites' feature
4 user(s) has marked as favorite:
Eric McCormick
Michele Malaguti
Serdar Basegmez
Steve Cochrane
Added 2014-Jul-04
Download all attachments (Java)
I always loved the feature of “Download all attachments” in Gmail. So I decided we should have this option available in XPages also. This snippet is the Java version of my XSnippet - Download all attachments. You can see the SSJS version here: http://openntf.org/XSnippets.nsf/snippet.xsp?id=download-all-attachments
The implementation steps are explained in comments at the start.
Parameters to query string
1. documentUNID – Universal ID of the document in which attachments are present. This is a mandatory parameter.
2. zipFileName – Name of zip file when the download box is shown to the user. This is optional and if this parameter is not specified then by default AllAttachments.zip name is taken.
Java
Naveen Maurya
Overall rating is 4.33 by 3 person(s)
You have to login first to use 'My Favorites' feature
3 user(s) has marked as favorite:
gupta ravi210
Markus Ch Haller
Tom MC Mennes
Added 2013-Feb-28
Link to attachments in Rich Text Fields from XPages and XPinC
The complete, correct format how to link to Attachments inside Rich Text Fields from XPages In Client:
http(s)://127.0.0.1:[theRandomXPINCPort]/xsp/[currentServer]!![yourCurrentApplication.nsf] /xsp/.ibmmodres/domino/OpenAttachment/[yourTargetServer]!![yourTargetapplication.nsf]/[UNID]/$File/[AttachmentName]?Open
see: http://techdriveactive.blogspot.com/2012/11/open-attachments-in-xpage-in-client.html
JavaScript (Server)
Arne Menting
Overall rating is 5.00 by 2 person(s)
You have to login first to use 'My Favorites' feature
1 user(s) has marked as favorite:
Lukas Slavicek
Added 2013-Jan-28