a minor update to fix some issues with the standby widget for bootstrap is in xSnippets.
Found an issue with multiple triggering of the widget, this is hopefully fixed now, reported by David Leedy.
There is several ways how to add extensions into the IBM Notes client. But the best and simplest way that I have found is to do it this way.
Download the prefered Addon in my case I select the OpenNTF IBM XPages extension library, download the latest version to your computer. Unzip the file in your prefered location, Unzip the zipfile called updateSiteOpenNTF-designer.zip in a new folder.
In you Notes client create a new database in a folder on the server I call mine Client Updatessites and in the New database dialog select advanced templates and Eclipse Update site (9)
Give the database a name of that you like.
Open the database and click on Import Local update site find the site.xml in the client update site folder. (important it has to be the client update site) follow the steps when importing.
You might say, wait this is like installing this on the server, yes it is but we are adding client code in this case.
When you are done, go to the action menu and select show url:s a dialog appears.
Select the second option nrpc:// press the copy button besides this row.
Second step, importing the site into the client
On the right and side in you client there is a my Widget section
Click on the three lines at the right side
Now select Configure a widget from and then select Features and Plugins in a update site
paste the copied Url press load and press next selecting what you want to install , give the widget a good explaining name and finish.
you will also after a while get the approve install dialogs where you approve the installation.
After this your extension is ready to be used after a restart of the client. But the best thing is that you will get an icon in the “my Widget” section and if your right click that icon you can remove it. Send it to a collegue and an email or publish it to a widget catalog.
Easy simple administration of OpenNTF and other addons in the IBM Notes client & designer
The previous 5 steps in this series (part 1part 2part 3part 4part 5) has been getting data out to excel in different ways this part will show you how to get data back into Domino again thru your XPage, this will give you the possibility to roundtrip data handling. Export all customers mark the rows you have changed and re import the data. Because Apache POI is installed on the server as an OSGI we have access to these classes in all java code on the server and that is what I’m going to show you today and how to upload an Excel file and read some data from a cell.
In the example database for POI4XPages there is a class you really need and that is the ImportAction this is needed to open up a workbook of a xlsx file you don’t need it if you are only using xls. This class is used for changing the classpath of the jvm and some security stuff so you don’t need to modify the java.policy file on your server (Thanks Christian for pointing this out)
We start with some OpenNTF data in Excel
We create an java class
public String getData(java.io.File file,Integer row,Integer cell){
try {
String inputFile = file.getPath();
String CellVal=””;
ImportAction ioAction = new ImportAction();
HashMap<String, String> hsCurrent = new HashMap<String, String>();
hsCurrent.put(“FILE”, inputFile);
workbook = ioAction.run(null, hsCurrent);
if (ioAction.hasError()) {
Exception exLst = ioAction.getLastException();
throw(exLst);
}else{
Sheet worksheet=workbook.getSheetAt(0);
Row rowdata = worksheet.getRow(row);
Cell celldata = rowdata.getCell(cell);
CellVal= celldata.getStringCellValue();
}
return CellVal;
}catch(Exception e){
return “”;
}}
lets look at the parts of this class
ImportAction ioAction = new ImportAction();
HashMap<String, String> hsCurrent = new HashMap<String, String>();
hsCurrent.put(“FILE”, inputFile);
workbook = ioAction.run(null, hsCurrent);
if (ioAction.hasError()) {
Exception exLst = ioAction.getLastException();
}
This is the magic call the the ImportAction class that will create a Excel POI workbook Object.
The following rows will get the first sheet in the excel file get the first row and the first cell and return the string
Sheet worksheet=workbook.getSheetAt(0);
Row rowdata = worksheet.getRow(row);
Cell celldata = rowdata.getCell(cell);
CellVal= celldata.getStringCellValue();
Now we need to create the XPage to enable the upload of the Excel file
The interesting part is behind the read button onclick event
importPackage(com.xpagedeveloper)
var con = facesContext.getExternalContext();
var request:com.sun.faces.context.MyHttpServletRequestWrapper = con.getRequest();
var map:java.util.Map = request.getParameterMap();
var fileDataName = getClientId(“fileUpload1”) ;
var fileData:com.ibm.xsp.http.UploadedFile = map.get( fileDataName );
if( fileData == null ){
return;
}
var tempFile:java.io.File = fileData.getServerFile();
var Excel=new com.xpagedeveloper.ExcelData()
viewScope.data=Excel.getData(tempFile,0,0)
We get the uploaded file in fileData and retrieve the actual file using fileData.getServerFile() remember that this file is a server based temp file and with that I mean that you will not get the same same on the file as it was when the user uploaded it. And next I create an object of my class and call the getData function with the java io file object the row and the cell number remember that this has a zero based index so 0,0 is actual row 1 and cell 1, this is the result I get when running the code against the Excel sheet
If you are going to loop thru a full excel sheet you probably need to rewrite the code but this will give you a hint where to begin.
Looking back at 2014, I see the year that XPages really got accepted as the primary language for Domino.
IBM Bluemix got launched and the response was no XPage support in Bluemix, but in the last 2 months we saw that IBM had changed their minds and now there are talking of some kind of support for xPages apps in Bluemix. Great IBM that will get the community to start using the service even more if you can deploy your apps in a real scalable App Engine. The Domino OpenNTF API, evolved and have lot’s of great features like the graph database implementation.
My 2014 has been almost only XPages Development both internal with our application suite, custom applications for different companies and adding more customers to QNova:s application cloud that has been a real success for the company I work for. My board work with OpenNTF has just started, lots of things to understand and I hope to be able to contribute even more in 2015.
Hope you all out there have a great holiday and come back in 2015 with new contribution power because we all can do more if we do it together.
I have today released some small updates to SmallTalk and the tinyMce editor custom control.
SmallTalk needed some polishing to the attachment upload working in the client.
And for the tinyMce control I did some changes in the init scripts because they gave some strange js
errors in older internet explorer browsers so now it should work in IE7 also.
I found this interesting project on openntf.org yeasterday Ruby in XPages if you don’t know what this is it’s an implementation so you can write Ruby code inside an XPage. You might say I don’t know Ruby so how can this be of interest to me.
I don’t either know Ruby but I think the project it self has other interesting things because it shows how to implement another language into XPages, perhaps node.js, PHP or ASP.Net.
Another post about the possibilites to expand XPages was posted by Sven Hasselbach awhile ago show a way to write lotusscript code inside an xpage –>Post (use Chome or Rockmelt to get the post in english)
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.