Tag Archive: Java

Getting the Correct Syntax for JavaScript in XPages

I was recently working on a project where my code was injecting XPage elements onto the page at runtime.  To do that, you need to know a lot of syntax.  Syntax that isn’t in the help file, or blogged about, or easily findable.  Sure, there’s this, but that isn’t exactly reader-friendly, nor are there examples of how to use the elements.  Just because you know you’re using “XspInputText”, doesn’t mean you know how to use it.  What’s the syntax for adding an attribute, for example?  Or maybe you know the syntax structure, but need to know what the parameter looks like in the code.

Designer Data Panel for Date Field For example, you want to add a Date field with certain parameters set.  You know how to set them in Designer in the data panel, but how do you set those parameters programmatically in JavaScript?

Thankfully, Toby Samples showed me a cheat to find out.  Create a dummy XPage, add your element and do whatever it is you want to do, i.e. set the parameters for your date field.  Save the page.  In Designer, go to Package Explorer and your nsf.  Expand the Local folder and then the xsp folder.  There you’ll see all of your custom controls and XPages with a .java extension.  Double-click on the XPage.java file.  It will open and there you’ll see the Java code used to generate that XPage, including your element and how the parameters were set programmatically.  This can be really useful when you’re adding something like an attribute via JavaScript and you can’t find any examples of HOW to add an attribute (or class or value binding or any other property).

Example, if you set the above “display format” to “Date and Time” in the picker, how is that set programmatically?

converter.setType(“both”);

With the parameter “both”.  Good luck figuring that out on your own.

File under: “Things you may have already known, but I didn’t, and I share it just in case you didn’t either” AND “Blog post titles I struggled with actually explaining what the post was about without actually typing the post in the title”

10 Lines or Less: Demo App and Slides

Julian Robichaux and I presented “10 Lines or Less: Interesting Things You Can Do With Java” at IBM ConnectED this January.  As promised (if not a bit delayed), here is the sample app, and a link to the slides.

ConnectED2015a.nsf 2

Review: Java Cookbook

Java Cookbook
by Ian F. Darwin
Publisher: O’Reilly Publishing

Content

  1. Getting Started: Compiling, Running, and Debugging
  2. Interacting with the Environment
  3. Strings and Things
  4. Pattern Matching with Regular Expressions
  5. Numbers
  6. Dates and Times – New API
  7. Structuring Data with Java
  8. Object-Oriented Techniques
  9. Functional Programming Techniques: Functional Interfaces, Streams, Parallel Collections
  10. Input and Output
  11. Directory and Filesystem Operations
  12. Media: Graphics, Audio, Video
  13. Network Clients
  14. Graphical User Interfaces
  15. Internationalization and Localization
  16. Server-Side Java
  17. Java and Electronic Mail
  18. Database Access
  19. Processing JSON Data
  20. Processing XML
  21. Packages and Packaging
  22. Threaded Java
  23. Reflection, or “A Class Named Class”
  24. Using Java with Other Languages

There are over 800 pages in this third edition of the Java Cookbook. The book states that it is not for beginners, and that is correct.  While some basics of Java are covered in order to move on to other topics, this is not a book for learning Java. Incidentally, the book includes a great resources section including many books for learning Java and general programming.

As you can see from the table of contents, this is a very thorough book covering many topics. I liked the format of “Problem”, “Solution”, and “Discussion”, however, it doesn’t “read” like a book. These are “recipes” lumped together by topic, but not necessarily sequential.  It made it hard for me to either browse the book or find any one particular problem.

The Java Cookbook is filled with loads of examples and sample code. There are tons of solutions to be found. I found it incredibly thorough, but very dry and a bit difficult to navigate.

Obtained From: Publisher
Payment: Free

SocialBizUg Articles: Notes Dev Tips February Edition

Great Sessions at IBM Connect 2014

Lots to see and do at IBM Connect 2014.  There was no way I could possibly see and do it all.  I tried my best to attend sessions that were important to me, and as usual, I still couldn’t see them all, but what I saw was great and always motivates me to learn even more.

This year, I attended a few stand out sessions (no one get upset if I don’t mention YOUR session; remember, I couldn’t attend them all!).

Read the article here.

Email is Dead – Long Live Email

We’ve been hearing it for a while, “email is dead”.  Well, apparently, email is what’s next.  IBM Mail Next, that is.  In a flurry of quick announcements at the end of the IBM Connect 2014 Opening General Session, we learned that whatever we are currently calling mail in IBM Lotus Notes and Domino Collaboration Services – Social Edition Mail (not an actual product name) will now be IBM Mail Next.

Read the full article here.

Improving Domino Designer

Julian Robichaux and I presented on Improving Domino Designer.  This month on SocialBizUg.org, I discuss my favorite tips from the session.

Read the article here.

IBM Connect 2014 Roundup

I’m back from my annual trip to Orlando for IBM Connect (formerly Lotusphere).  This year, like all the others before it, I returned home exhausted, worn out, full of knowledge and motivation.  Lots of questions and rumors floated around before the conference.  Would it be the same as years past?  Would there be enough technical content?  Would Kenexa take over and make it an entirely new conference?  So here is my take on what was the same, what was different, the good and the bad of IBM Connect 2014.

Read about it here.