“runtime optimized resources” in conjunction with font-awesome

Last week I posted a question on the XPages forum (shameless plug) since I had some problems getting the ‘run-time optimized resources’ xsp property to work in conjunction with font-awesome.  During development I loaded the FA style-sheet via a theme. After staging and enabling the xsp property the icons failed loading.

In this post I will describe my way to have them work together.

My first attempt came after reading the following suggestion on Stack Overflow. This unfortunately did not work for me. Pulling the files via a theme kept on failing. It seems that the resource aggregation messes things up when CSS and JS is added through a theme.

Next I tried to load the new CSS file with only the @font-face part in it via the Resources on an XPage but this only worked with a complete URL, so including the HTTP protocol, which is not desired.

My third approach was by inserting an external style-sheet e.g.:

<head>
<link rel=”stylesheet” type=”text/css” href=”font-awesome-4.2.0/css/font-awesome-fontFamily.css”/>
</head>

This worked remarkably well.

As a result I have downsized the number of requests for Javascript from 63 to 10 and for CSS from 10 to 3.

If you suggest another solution please drop a line in the comments.

Advertisements

Lotusphere 2011 – Day X

So many Xpages sessions throughout LS2011 so I guess you  can call each day day X…

XPages 101 How to build a simple XPages application

Very ambitious of the presenters to ram through a large number of slides (which they failed). Although the application was simple I learned some tips.

Rated: 6

 

BP206 Working with Feeds

I must say that this was one of the best presentations I have seen on LS2011. Although the XPages factor was not touched in this session Julian Robichaux had interesting content in his presentation. Also they way he presented was more professional that the average speaker.

Rated: 9

 

AD113 How your Xpages in Style

Maybe I made a mistake but I had the idea that good design principles (hopefully related to oneUI) were gonna be explained but the session was about CSS for beginners. One of the rare sessions I walked away from.

Rated: 0

 

 

AD116 XPages extension library – Making development even easier

I had no idea why the presenters were presenting but they obviously were non at all interested in their audience. It was more mumbling and making jokes to each other that actually holding a presentation.

Rated: 3

 

 

INV107 Application Development Strategy

It was great to hear that IBM positions Notes/Domino as the RADD platform for developing collaborative workflow solutions. Where Domino stood in IBM’s software portfolio has been unclear for a while but this presentation took that away.

Philippe Riand also entered the stage and things were good. The social collaboration toolkit was explained and what that would mean for all IBM’s development platforms.

On the audience question when Domino Designer (applause from the crowd) is gonna be available for the script kiddies on Mac he did not dare to answer…

Rated: 9

 

 

BP211 XPages blast

1 hour – 30 tips on XPages development, some good, some too simple. At least enjoyable and well presented.

Rated: 9

Question on getComponent(fieldname).getValue();

I am building an app to be able to compare different applications (maybe one day it will become an appstore (used internally) but for now it’s definitely a catalog).

Basically you can turn on/off checkboxes and a table will be updated with a summary of corresponding applications. What happens in the background is that I perform a FT search, check which documents  match the selected items (fieldnames, values = ‘Yes’) and return a collection of documents.

Works great with one group of checkboxes, untill I thought to organize them into several groups (security, document management, messaging etcetera).

I use the getComponent(fieldname).getValue() function. This works fine, but I wonder what it returns actually. I assume an array.

However if I try to merch/join two result arrays via the concat() method it throws up an error.

My code looks like this:

var selectedFilter1 = getComponent(“checkboxgroup1”).getValue();
var selectedFilter2 = getComponent(“checkboxgroup1”).getValue();
var selectedFilter = selectedFilter1.concat(selectedFilter2);

What am I doing wrong? Thanks in advance, your help is much appreciated!

My second OpenNTF project

Today I have posted my second project on OpenNTF (@Vince: now I may rest for the next 5 years?). It is an application that I have posted before on this blog but now I made the time available to make some minor modifications and upload it to OpenNTF so it will probably be shared a bit more.

Another reason for starting the project on OpenNTF was that I received a question if the database could be shown in a presentation about design option in Lotus Notes.

About the project

This application can be used as the default template for new development projects for the Lotus Notes client.

The database is intended for Notes 7 / 8 audiences using the Notes Basic Client (no support for composite application). With a minimum of graphical elements (images) the database looks similar in both client versions.

The template is kept clean at a minimum BUT provides a simple, flexible, attractive framework to distribute your Forms and Views with/in.

The template provides 2 sample forms that demonstrate several layout options you can use:

– 1 or 2 column layout
– labels and input fields besides or below each other.

The example forms try to re-use design principles that can be found throughout the PIM applications in Notes 8.

Some thoughts

I like the concept of composite applications and the Java views in the PIM applications. However I can imagine that these techniques are not widespread in a lot or organizations (both with developers and with supporting Notes client installations).

So I assume the usage of old-fashioned frames in Notes client oriented will be common practice for a while, also because it gets a lot of things done in a short development time , even when it has its limitations.

Another thing what I have not seen is branding in composite applications. I would like to see some good examples about the options here, so I would be thankful if you could share me some samples / screenshots.

With XPages support in the 8.5.1 Notes client I wonder how far I will actually come, using Java views and so?…

Bildr project – The progress so far

I want to thank everyone for helping me so far with re-writing the web-interface for my Bildr project on OpenNTF in Xpages.

So far I am nearly done with rewriting the initial start-page. Actually I have been adding some additional functionality which is with pre-xpage domino development more difficult to achieve.

Nevertheless, the main eye-catcher on the startpage is the slider which enables you to navigate through some picture previews with your mouse-wheel.

The technique is straight forward. Just feed the ImageFlow some html and it will transform the data for you.

I used to use computed text for this:

@Implode(@DbColumn(“”:””;””:””;”$v-piximageflow”;1))

But when I use a computed field in XPages I see that I get some extra html with it which breaks the functionality:

<span id=”view:_id1:_id22:_id66:_id67:computedField1″>

I tried other approaches (a data table or a dynamic data table via a repeat control) but they all provide me unnessecary HTML formatting.

  • Do you have a clue how I can resolve this formatting?

Since this is my first ‘real’ transformation of a Domino application with XPages your help is highly appreciated. Remember: Never as good as the first time 😉

My first experience(s) with Domino Designer 8.5plus

I am testing the latest drop-code for Domino Designer 8.5plus and it is my first development experience with XPages. I just thought I will write down my first experiences, maybe it may be useful one time. At first I was not sure enough to publish this, but it was announced that design partners may write about the design program I fell more confident to do so. For now working with  XPages can not be described as love on first sight.

First impression

Coming from a generation of Notes developers prior to 4.5 this version of Designer impresses me most. It makes Notes 5 as ‘super human software’ a joke. The other releases 6 and 7 where not spectacular, you just saw Notes getting behind other development platforms.

So 8.5plus gives a refreshment and hope for the future.

My experiences

With high expectations come also delusions.

As learning example I use a workshop designing in XPages by Emvege and  Declan Lynch lines of articles how to create a basic XPages based application. I also followed the short tutorial in the Designer Help for as long at that one is helpful. Their is definitely a need for adequate developer’s tutorials IBM, you can’t release a new way of developing without providing proper educational material. The Developers Help is just not supportive enough.

Application (database) properties

Much better!  The prior properties box for database was difficult to read. Too bad that text / labels can not be copied as text to the clipboard.

DIVs are poorly visualized

In Declan’s tutorial he uses DIV’s to position blocks of data. When editing the XPage in Designer the present of DIV’s are seen when looking at the source code. Some nice mouse-over with dotted lines would make this more clear.

Okej this gets reduced when you place your DIV’s in custom controls.

Line numbering and being able to collapse blocks of code are nice new add-ons.

Source code view

Oh boy your XPages are a mess when you view the source code. Some people like to indent their code, since they know someone after them are going to give support on the applications. Indenting the source code is a disaster. Tab forward is doable for multiple lines of code but tab backwards? I wonder how the code for IBM templates will look like… Please take a look to example at good WYSIWYG editors where you can indent blocks of text via buttons.

I guess no-one wants to be hand-over unreadable messy-spreaded code, do you?

OneUI Theme

I guess you have to do your homework a bit for understanding the oneUI theme (or other defaut themes). When I tried to apply some common styles from that theme on elements on my XPage I got some unwanted results. This forces me to go back to my common CSS knowledge and not able to exploit the features in the oneUI theme. Does anyone know a good description for all the styleClasses?

Dojo

Dojo is still a mystic for me, I have worked a lot with Prototype and Scriptaculous before, but basic knowledge of Dojo seems to be necessary if you want to go beyond basic XPage development. New courses seem to become available but in these low economic times budgets are frozen. Okej for now I could do with a good book on Dojo.

Performance

I do not know what your experiences are but XPages are far from fast. Just put in a rich text field and see how many files are being called.

Advanced programming

From moving to a senior Domino programmer into a novice XPage developer feels a bit awkward. Some goals you want to achieve are so basic knowledge in previous Domino development. In XPages I find it hard to find a way to solve the question. I guess my more novice co-workers will find it even hard to understand how they must develop in XPages. Best practices, tutorials that have  broad range of topics and go beyond using the default usages of core controls are rare. So no head-starts here.

I guess I am not alone in this area, so maybe an official IBM place where you can post your question and get some leads how to solve you problem would be a winner for most developers. I guess for now the 8.5 forum is that place to be. We all know that that place has never won a price for usability (sigh).

Road ahead

I guess finally we will come to a point where we release our first XPage based application and where we are proud of. For now we are far from that. Luckily the winter starts early in Sweden and it will be long so we have a lot of time to be inside and read and study.

In the meantime I am just saving all your XPages blog-posts in a Notes database so I can use that as a reference when my colleagues start developing in XPages. “Good practice does follow” so please keep contributing your findings via blogs…

Disclaimer

IBM Lotus Notes/Domino and Lotus Notes Traveler 8.5.1 is prerelease code and there are no guarantees from IBM that the functionality presented or discussed will be in the final shipping product.