Posts Tagged ‘extlib’

So i felt it was time for an XPages Video Tutorial. I haven’t done one of these since March I think. In this video tutorial, I show you how to use the XPages Extension Library’s Navigator Control and modify the page’s content using partial refreshes.

Thanks to David Leedy for hosting this video on his NotesIn9 Series. He raises a very good point about the Dynamic Content Control and how it can be used in my example in this video to increase the performance of the XPage. Hopefully there will be a video on this soon.

I trust you will enjoy and please, as always, feel free to comment or ask questions.

1. This is an extended Post to David Leedy’sNotesIn9 Posting of “Intro to XPages and Relational Data – Part 2“.

2. I do apologize that this took a while to publish. This is one of the more challenging years to find some free time to contribute to the Domino and XPages community. Having said that, I have quite a few Video Tutorials planned before this year ends, so stay tuned

Now that that’s out the way…..this post is Part 2 to the “Integrating XPages with DB2 – Part 1“. In this Video I show you how to Create/Read/Update/Delete DB2 Data using XPages. More importantly, I show you how to empower the User to perform all these functions via a User Interface. It’s usually easy to write this logic in the back-end, but a little more involved when handing that power over to the User.

The good news is that it’s fairly straightforward. I show you some quick functions that will get you up and running in no time. As I explained in the Video though, there are much more advanced ways of integrating to DB2. This will involve some knowledge of DB2 itself. The keyword is…..”Stored Procedures“. This is where the power lies. A Stored Procedure is very much like a Sub Routine in LotusScript or a Function in Java or JavaScript, but you code in SQL Language. You can pass the Stored Procedure parameters, have all your logic neatly set out in a central place in DB2 and return values from the Stored Procedure which will allow you do things like create Child Documents, etc.

Later on in the near future, I will think up a straightforward Tutorial which will show you how this all works.

I hope you enjoy this Video. I really enjoyed making it. It was one of my smoothest recordings where everything went right the first time.

Hi everyone. With the merge of the DynamicContent and Switch Custom Controls in the XPages Extension Library, I am more and more practicing the art of adding multiple Custom Controls into a single XPage.

Now, before you shoot me, make sure you understand how the DynamicContent and Switch Control Works. In Short, they Add/Remove designs to your XPage in real time, meaning that you can load a certain Custom Control and its content when you need it, and not on the loading of the XPage. That is awesome stuff, and plays a big role in the performance of one’s XPages Application.

But this Post is not about these 2 controls. This Post is about having multiple Custom Controls reside in 1 XPage. Let’s say for whatever reason you have 10 forms that make up your Application, and you have a Custom Control for each Form. What you do now is use 1 XPage, and insert all 10 of these Custom Controls. This is all good and well, except when trying to open up your XPage Design Element in Domino Designer. It become horribly slow, and sometimes my Designer just hangs, forcing me to “Kill Notes”.

The reason for this is because your XPage loads all the design elements and controls that exist inside each of the 10 Custom Controls you added to the XPage, to provide you with a view of more or less how the XPage Looks with all those controls added.

So, how do we prevent the Load Time of opening the XPage Design Element? Simple. We use Design Definitions. What is a Design Definition? It’s the ability to make your Custom Control look different when adding it to an XPage, than what it would actually look like when viewing the Custom Control alone.

Let’s say you have a Custom Control that has 30 Combo Boxes running vertically { Please everyone, this is just an example }.

You now add this to your XPage, and it looks the same.

A Design Definition allows you to change the look of your Custom Control when it’s added to an XPage or other Custom Control.

Do the following:

1. Open one of your Custom Controls in Designer, and in the Properties Tab, navigate to the “Design Definition” Tab.

2. Add the following Code to the empty Box in this Tab. (All this does is create a div, style it, and add some text inside the Div)

4. Open your XPage where the Custom Control exists. If you haven’t added a Custom Control yet, create an XPage and do so.

You’ll see that instead of your Design Elements appearing in the XPage as it would look in the Custom Control, you now have a Blue Box with white Text inside it. If you double click in the Blue Box, you’ll be taken to your Custom Control, where you can view the original Design.

Not only does this keep your XPage tidy when it contains multiple Custom Controls, but it also stops the XPage from having to load all the Design Controls in your Custom Control for viewing in your XPage, which dramatically increases the speed of opening your XPage in Domino Designer.

I hope I didn’t ramble too much in this post. I trust you will find it useful.

1. On top you’ll see the XPages Debug Control that was created by Mark Leusink and is available on OpenNTF. It’s very cool in the sense that it allows you to print messages directly to the Control and not via the Server Console. It also allows you to see all Scoped Variables that are being used in the XPage. Finally, it has an awesome feature where you can execute SSJS Scripts and view the result. I am very happy with this Control.

2. I’m using the Application Layout to control the Look and Feel of the XPage. It’s always a massive time saver. Click here to view the Video from NotesIn9 that explains the Application Layout in more detail.

3. in the Left Section I’m using the Navigation Control made available in the XPages Extension Library. This was a trick and a half, but I managed to use Partial Refreshes for all my onclick events. This allows me to use 1 XPage and multiple Custom Controls.

4. Depending on loading time, you might see the XPage go into Standby during the Partial Refresh. This is thanks to the Standby Custom Control which is available for download from OpenNTF. This is an awesome feature that needs no additional resources to function.

5. I have 2 views in the Main Content Section. These are Data Views that I am using from the XPages Extension Library. It’s safe to say that I am currently using very basic functionality from the Data View. There’s a lot more that you can do with it.

6. The 2 Data Views exist in a Dynamic Content Control, also from the XPages Extension Library. I won’t go into too much detail about this except that the Dynamic Control keeps your XPage light, and only loads Controls when they are needed. Very awesome stuff.

I am quite happy with what I’ve achieved in the last 3 hours. I had to put a few hacks in place to make everything work with Partial Refreshes, but all in all it was quite easy to implement.

So, yesterday I faced a doozy. We wanted the XPages Extension Library installed on one of our Client’s Servers using the UpdateSite that ships with Lotus Domino 8.5.3. Interestingly enough, no matter what we tried, it just wouldn’t install.

FIRST THINGS FIRST

In order to use the UpdateSite to deploy OSGI plugins, you’ll need to do the following:

1. Create a Database called “Whatever UpdateSite” in the Domino Data Directory, using the UpdateSite Template that ships with the Lotus Domino 8.5.3 Server.

2. In the Domino Server’s notes.ini, add the following ini Variable:

OSGI_HTTP_DYNAMIC_BUNDLES=yourupdatesitefilename.nsf

3. In the UpdateSite Database, import your OSGI Plugins.

4. Restart the Domino Server. (Note: A Server restart is only required if you modified the notes.ini. Other than that, a Restart Task HTTP will do the trick).

5. During the restart of the HTTP Task, you should see at some point a message along the lines of installing OSGI plugins. If you don’t see this message, then it’s not working.

BACK TO THE MATTER AT HAND

If you’ve done everything mentioned above, and the Server still won’t install the OSGI plugins, then the problem most likely lies with the Security settings for the specific Domino Server. When you import the OSGI Plugins into the UpadateSite database, the System automatically performs a Signing of all the Imports that took place. This means that it will sign the Imported Profiles with your current Lotus Notes ID.

So, it’s important that your Notes ID has access to perform XPages based operations on that Specific Server. To confirm this, do the following:

1. In the Domino Server’s Address Book, navigate to the All Server Documents view, and open the relevant Server Document (Note: You’ll need some Admin Access to perform these operations)

2. Click on the Edit Server button.

3. Navigate to the Security Tab.

4. In the Top right section of the Security Tab, you’ll see a field called “Sign agents or XPages to run on behalf of the invoker:“. If this field is empty, then every signature will be authorized on that Server as a default. Otherwise, you’ll need to be part of the list either as a User or as part of a Group. If the list is not empty and you are not featured in any way, the OSGI Plugins will NOT be installed.

That should do the trick. I don’t know of any other reason that the OSGI plugins won’t install from the UpdateSite Database.