Categories
Community XPages

NotesIn9: Will Kinda… Let’s talk about MWLug!

I’m going to MWLug.  One of the best community conferences that’s run by the community and put on for the community.  Their Dev track is OUTSTANDING this year.

Here’s a little video I put together talking about the conference.  Hopefully I can convince you to come and say hi!

http://www.mwlug.com/mwlug/mwlug2015.nsf/Home.xsp

August 19-21 2015

Categories
Community

Need an XPages/Web Developer Job?

I just saw this come across my email.

http://www.hersheyjobs.com/jobs/descriptions/programmer-analyst-hershey-pennsylvania-job-1-5225766

I basically interviewed for this job back in 2008/2009ish.  It is in a great facility right next to the amusement parks “Hershey Park” and “Chocolate World”.  They seem to do a lot of neat things.  At the time I did not get the job – supposedly I came in 2nd due to my lack of web experience. While that was a bit of a blow back then it worked out for the best for had I gotten that job I would have missed out on my current dream job.

But anyway – I wanted to just through this out there in case anyone is interested.  I don’t know any of the people involved so I don’t have any more information other then this link.

As an added bonus this is in Hershey Pa so you’d be very near to me.  Hmm maybe that’s not a bonus.

🙂

Categories
Community

And now we take a moment to eat…

This Sunday is the International Food Festival at my kids school.

For the third year in a row I’ll be dusting off my crack BBQ team and we will be manning a table of smoked Pulled Pork, Brisket, Burnt Ends, and our new item Bacon Tater Bombs.

It’s always a fun event.  We sold out the first year then last year I doubled the amount we made and sold out twice as fast.  This year I’m bringing enough there’s no way we’re selling out.  I think at least.  🙂

Anyway if anyone is in the local area please feel free to stop by for some BBQ and International offerings. They even have a ton of desserts.

This year my wife made a new “Pub Style” menu with the help of her laser engraver.  Yep – we go all out for this event. 🙂

IMG_2475

 

Categories
Community XPages

Would you like to play the Tree on a Truck game?

tree2014It’s the time of year again. Every year my family plays a simple game to get into the holiday spirit.  It’s competitive and borderline cut-throat at times but at the core it’s simple.  We count the number of Christmas Trees that we see on cars and trucks.  By count I mean the first one who sees it and calls it gets a point.  And by calls it I mean the first person who shouts “TREE!” get’s that tree as a point.  It’s actually loads of fun while still stressful haha.

Last year I made a website – http://treeonatruck.com and wrote a quick little XPages Mobile Controls app where you could sign up, enter all the players in your family and keep track of the score.  Last year there were 25 groups from several different countries and several hundred trees spotted.  That was pretty cool.

Anyway – this year I waited too long to start working on it but I ditched the mobile Controls app and relaunched the website app using XPages, Bootstrap and the really cool BootCards project.

I’m still working on the site in my off hours.  I hope to get the leaderboard working next and integrate pictures.  Once it’s all done I’m sure it’ll be coming to NotesIn9 as well.

Anyway, if you want to play along – just sign up.  Add members to your team.  Read the rules.  It’s an honor system thing so play fair.  🙂  The game starts FRIDAY.  Not before.  We’ve already seen one tree on a car AND a whole truck carrying trees to a store. And even though they didn’t count I’m still ticked that certain family members called them before I could.

I just added a comment section so please leave me a note if you have any problems with the site.

Categories
Community Notes In 9

Email Do’s and Don’ts

I’ve been getting a lot more emails from NotesIn9 viewers lately. Many are asking for XPages help with a particular problem.

While I prefer questions unrelated to Ni9 to be asked on StackOverFlow.com with the tag “xpages”, just so the question and answer is public and can therefore benefit more people, I’m always happy to get the email and will certainly try and help where I can.  I can’t always.  But I will try.  Some of the emails say something like “I don’t expect a personal response”.  Umm  If you’re going to email me you will most likely get a personal response!

Just tonight I got 2 emails.  1 was about a problem with the Ext. Library and update sites.  That I don’t know a ton about.  The other was a problem reading values from a notes document.  That I think I have a good handle on.  🙂

The Ext. Library email started like this:

Hi David, here me again.

Sorry if I’m disturbing you, but I need some help.

Again – it’s email – you can’t “disturb” me and I’m always happy to help.

The second email which was more up my ally BUT started like this:

Help Needed:

Phone # does not show up in the export to Excel. It shows up blank on the exported Excel spreadsheet.

 That email then continued in with a description and included maybe 70 lines of code.

If you’re asking for help…  especially if I don’t know you. Say hello first!  Tell me about yourself. Tell a joke.  Tell me what you like or don’t like about NotesIn9.  I don’t care but add a little personal touch please.  Remember I’m just a customer. I’m not a BP looking for clients. I do this all on my own time.  I’m ALWAYS happy to try and help where I can as I’m sure most of the people in the community are also willing to try and assist.  StackOverFlow is proof of that.

I don’t really have a good wrap up to this.  I guess just a reminder to be nice to the people you’re asking for help and they’ll likely be more willing to go the extra mile for you in return.  You get what you give.

Categories
Community Notes In 9

Announcing the NotesIn9 Hackathon: Race to 199

hackathon-MediumIt’s time.

It’s time for me to get off my duff a little bit and try and “kick this up a notch”.

It’s time for YOU who are reading this post to get a little more involved and “Join the Conversation”

To me a Hackathon is an event were people come together to contribute small pieces to complete a bigger puzzle.

I’ve been thinking of this ever since someone came up with the #CodeForTim hashtag.  When we lost Tim, I changed the motto of NotesIn9 to “Learn, Code, Share” to honor my friend and better reflect the mission of NotesIn9.  Well that’s what this Hackathon is all about.

I want to try and increase the output of NotesIn9. More shows with a better range of subjects.  I want to try and get NEW CONTRIBUTORS. And I want to try and get more questions, answers, ideas, comments and discussion going.

Typically when I get a new contributor on the show, it’s someone I’ve noticed and I’ve reached out to them privately and begged, pressured, or plain out annoyed them until they decided to come on the show.

Today I’m calling for Open Submissions.  If you’re working with XPages – no matter how basic – you have content you can share.  Think up an idea and email me and lets talk about it!  There’s no reason to be scared. You do NOT need to be an “expert” on the topic.  If you do a show the worst possible outcome is that someone comments that there’s a better way to get the same result.  Now you and others will learn that better way.  Win Win!  If you simply can’t share, because your company forbids it, then start leaving comments by asking a question, validating the material or simply just thank the contributor for their effort.  Let your voice be heard!  The more comments and people interacting, the easier it is to get contributors on the show.

I’ll post later some suggested topics but pretty much everything is open to discussion.  Even non XPages based shows. Learning is learning.  Period.

Unlike when I did “DriveTo99” a couple years ago there’s no “End Date” for this.  I’m going to push until we get to 199.  Then I’ll likely take a vacation.  🙂

So what’s in this for you?  I firmly believe the more you share the more you gain.  You start by gaining knowledge, experience, and confidence. From there you might gain friends, start speaking at different events and who knows, maybe even get a dream job. That’s what happened to me.

In the event that isn’t enough there will even be prizes!  Details will be forthcoming.

Let’s all see what we can build and then let’s all share it!

My email address is dleedy at notesin9 . com

I look forward to hearing from you.

Categories
Community Notes In 9

Big NotesIn9 news coming next week

It’s time…

 

 

 

Categories
Community Notes In 9 Podcast XPages

NotesIn9 143: Component vs Value binding in XPages

In this show Tim Tripcony explains that while we’ve typically been binding to a value all this time, it’s possible to bind to a component inside your XPages Development.

This show was originally published elsewhere and I basically grabbed this to try and improve the visibility and get Tim’s information as much exposure as possible.

I have 2 new unpublished videos from Tim coming next.

#codefortim

Categories
Community Learning XPages XPages

Tim explains JSON-RPC #codefortim

First I want to highlight OpenNTF’s recent post regarding Tim’s projects.  Let me simply say that I think the #codefortim idea is brilliant. Pure genius and so appropriate.  Tim shared.  Period. I just read that post like 5 minutes ago so I’m going to let it sink in before I talk any more about it.

Which brings us to the topic of today.  This email exchange I’m going to post was forwarded to me by my friend Dan.  He asked Tim a question and as usual got a great response back.  I’m so very thankful he sent this to me.  What make this really special is just how recent it is.  It was only a couple of days before Tim passed.  This is the last email I have to publish.  If anyone has any similar emails that they’d be willing to share I’d be very happy to publish them as well. Next up is some videos.

Dan asks:

On May 7, 2014 at 4:30:20 PM, Daniel wrote:

Hi Tim,

I was looking at an answer you gave Naveen on Stack Overflow on the use of the JSON-RPC control.

http://stackoverflow.com/questions/11356227/how-to-use-xejsonrpcservice

From how you describe the control, it sounds like an AJAX operation. Is my understanding correct?

I’m thinking of an application for it and I wonder if you could tell me if it’s the right tool.

I have an Xpage I’m building that accepts input from a proximity scanner. When an ID is scanned (badgeNo), I’d like to be able to query and SQL db to get the person’s EmpID number and use that to display his image on the screen. Would the JSON-RPC control be appropriate for that kind of operation?

Thanks,

Dan

Tim responds:

From:        Tim Tripcony

To:        Daniel

Date:        05/08/2014 02:15 AM

Subject:        Re: JSON-RPC control


In my opinion, that use case is almost definitely a good fit for JSON-RPC.

RPC stands for “remote procedure call”. Simply put, you’re telling the server to run a method — and how to run that method (in other words, passing method arguments) — and send back a result. So yes, this is AJAX, but it’s slightly different from partial refresh events in XPages.

Partial refresh events execute server-side code, of course, but upon completion they send back a specific visual representation of a portion of the page (namely, HTML) because that portion of the page might need to look different afterward as a result of the execution of that code. The archetypal example of this is an onChange event in a combo box that alters which select values are now valid for an additional combo box further down the page. As you’ve no doubt already seen in action, the platform automatically generates the JavaScript for you that causes the AJAX call to tell the server what code to run, but also handles taking the HTML that is returned and updating the affected portion of the page.

Similarly, submission of any data the user has entered is also automatic. While there are ways to override exactly how much data is sent for each specific event, the default is to just post the entire form to the server. This facilitates the “statefulness” of XPages — with each event, the server state of the page is essentially synchronized with what the client state now is, so both the browser and the server have some level of awareness of the user’s behavior, and both can account for that current state.

JSON-RPC, by comparison, might appear rather manual at first glance. Adding one of these components to your page and defining one or more methods is essentially defining an API that you can then call… but you still need to then add client-side code to actually call it, and also to respond to whatever data the server sends back to the browser. There are a few bits of good news in this regard, however:

– The platform still auto-generates some client-side JavaScript for you. To be precise, a global JavaScript object is created client-side and populated with methods that map to whatever server-side methods you defined for the RPC. These methods are even aware of what arguments you defined for each.

– The performance of this type of service is incredibly lean for two reasons. One reason is that it sends the absolute minimum amount of data in both directions. To be precise, it sends only identifiers for which service is being called and which method it should run, as well as the value of any arguments; in return, it sends back only whatever value you explicitly return from whichever method is called. So instead of posting the values of potentially dozens or even hundreds of fields and getting back a big blob of HTML, it might send only a single number (e.g. badge ID) to the server and get back a single string (e.g. employee ID)… although the response object can be as simple or complex as you want.

The other reason it’s faster is because the default behavior is to not save the component tree after an RPC method runs. It’s assuming that you’re doing something very similar to the use case you described, so there’s no need to re-serialize the entire page state, because you’re not sending a bunch of form data that should update a backing model bean, etc.; rather, you’re just sending it a badge ID and asking it to send back a corresponding employee ID, so there shouldn’t be a need for it to “remember” that it did once it has.

For both of these reasons, JSON-RPC tends to be lightning fast when compared to most partial refresh events, even under low-bandwidth / high latency conditions.

Here’s some pseudo-code to give you a feel for what this might look like if you decide to take the JSON-RPC approach. Somewhere in your XPage you’d have component markup that looks similar to the following:

<xe:jsonRpcService id=”scannerRpc” pathInfo=”scanner”>

<xe:this.methods>

<xe:remoteMethod name=”getEmployeeId” script=”return getEmployeeIDFromSQL(badgeId);”>

<xe:this.arguments>

<xe:remoteMethodArg type=”number” name=”badgeId” />

</xe:this.arguments>

</xe:remoteMethod>

</xe:this.methods>

</xe:jsonRpcService>

The assumption, of course, is that the getEmployeeIDFromSQL() function is already defined somewhere — presumably, in a SSJS library. So for what you’re describing, all that might really need to change in the above example is to alter the type of the badgeId argument (if, for instance, that should be a string, not a number) or to change the getEmployeeIDFromSQL reference to whatever code will be responsible for actually performing the SQL query, whether that be SSJS or perhaps a method of some Java bean.

The other half of this, then, is defining client-side code to call the remote method defined above. If that’s triggered by a “Search” button, for instance, you might end up with something like this:

<xp:button value=”Search” id=”button1″>

<xp:eventHandler event=”onclick” submit=”false”>

<xp:this.script><![CDATA[var badgeId = someCodeToGetIdFromScanner();

scanner.getEmployeeId(badgeId).addCallback(function(employeeId){

dojo.byId(“#{id:employeeId}”).attr(“value”, employeeId);

});]]></xp:this.script>

</xp:eventHandler>

</xp:button>

You might, of course, be setting the innerHTML of a div instead of the value of an input, but hopefully the above example illustrates the basic premise:

– Because the JSON-RPC service lists “scanner” as the value of its “pathInfo” attribute, the browser will automatically be aware of a global JavaScript object called “scanner”.

– Because the RPC service defines a remote method named “getEmployeeId” that accepts a single argument named “badgeId”, the global client-side object has a function called “getEmployeeId” that is also expecting a single argument.

– Calling that client-side function does not immediately send the AJAX request; rather, it returns an object that has a .addCallback method. Calling this method does immediately trigger the AJAX call… and passing a function to addCallback() defines what code will run when the AJAX call returns. Since we’re just expecting to get back a single string value, we specify that the function that we pass to addCallback() accepts a single argument, which we can then use inside the function to somehow update the page or otherwise inform the user that we now know what the scanned employee’s ID is.

No doubt there’s a myriad of valid approaches for your specific use case, but I’ve become rather fond of JSON-RPC for this type of functionality, both because of the relative ease of implementation and because of the comparative performance. Hopefully this overly verbose explanation gives you an indication of whether or not the JSON-RPC approach would, in fact, be a good fit for what you’re trying to do. 🙂


For anyone reading this information that’s interested in the JSON-RPC stuff.  I believe it’s come up on NotesIn9 a couple times as well. So there should be some examples available.

#codefortim

Categories
Community XPages

Tim Explains: SSJS Object Persistence

Below is an email thread between Serdar Basegmez, Tim Tripcony and myself. Serdar reminded me of it and re-sent it to me so I could share.  It’s a little dated but I’m reposting this because the quality of the information should be shared.

This is pretty much the marks the beginning of when I came to grips and realized that if I wanted to use XPages in a similar manner to how I developed for the Notes Client I needed to look past ServerSide JavaScript and focus on Java.  I liked building my applications around Custom Classes in LotusScript.  This email explains how that is no longer possible to do in XPages and that if I wanted to continue my client development “comfort zone” I needed to use Java for that.

Now this realization did not happen over night for me.  I believe this email came in right after my famous battle with Phil Riand. Where I said I’ll never use Java and SSJS should be made better and the “bug” should be fixed.  And he said it’s not really a “bug” and to use Java. we went back and forth a bit and I ended up losing royally and now I write with Java.  haha

 

So anyway here’s Serdar’s original question: