Sign in

E-mail *, (xx@domain.com)
Password *

Register | Forgot password

Recent blogs

RSS - Blogs
December 24, 2008
The year has almost ended...
December 9, 2008
5 Spring pitfalls
December 9, 2008
Like A Version
October 22, 2008
New certification process
October 17, 2008
Search quest [3/3] - improvements

All Blogs...


Stop making sense

August 19, 2008

Don't you also need a good picture of the world around you to keep a firm grasp on things? I know I do. Sometimes people come to me with some claim and I go "that's impossible!" without even looking just because it does not fit Reality As I Know It(tm).

The same thing also goes for software like GX WebManager. It needs a good understanding of its components in order to do sane things. Let's take a look at my favourite type of WCB: the presentation WCB.

Here we have a bunch of resources that WebManager would love to be close with, especially the JSP files. So how does WebManager get to know them all?

First of all the contents of your beautiful WCB will be unpacked to specific directories. At regular intervals the directories containing JSPs are scanned for XML descriptor files. So WebManager builds its world image basically from two things:

  • the presentation directories to scan
  • the contents of the descriptor files
Let us look more closely at these two.

Presentation directories

The directories that WebManager scans for descriptor files can be set per website in the "General configuration" tab of the setup tool.


By default it is set as follows:

website_settings.presentation_jsps_url:

  • /WEB-INF/project
  • /WEB-INF/wm/jsp

It is important to know that the order of the directories matters; WebManager will scan the directories in the order they are entered. As a result, in the case of double entries (more on that later) the first descriptor file encountered "wins".

The directory "/WEB-INF/project" is a general one. If you are going to work with multiple presentations and multiple websites, you will probably want to insert a more specific directory above it, e.g.:

website_settings.presentation_jsps_url:

  • /WEB-INF/project/site1
  • /WEB-INF/project/shared
  • /WEB-INF/project
  • /WEB-INF/wm/jsp

This order will ensure that presentations in the "site1" directory take precedence over those in the "shared" directory, and they all take precedence over all other presentations.

Note: NEVER remove the "/WEB-INF/project" directory!

Why? The standard out-of-the-box design that WM comes with also resides in that directory. By removing the directory, it will no longer be found and the default WM presentations will no longer exist according to WebManager. Needless to say, this will cause all sorts of mischief on your website.


Descriptor files

Now that we learned how WebManager knows where to find files, it is time to look at those files themselves.

Let's start off by quoting the great Yoda: "Always two there are". JSP files always are paired with a XML descriptor file. They have exactly the same filename, except for the postfix. So "site1BigTextElement.jspf" comes with a "site1BigTextElement.xml" in the same directory.

Let's take a look at this "site1BigTextElement.xml" up close:

<presentation>
  <name>S1 BigTextElement</name>
  <display-name>Site1 Big Text</display-name>
  <scope>TextElement</scope>
</presentation>

This descriptor file contains the bare minimum of tags to make WebManager understand the "site1BigTextElement.jspf". The tags are:

  • name: a unique identifier used for internal referencing by WebManager
  • display-name: a pretty print name that editors will see in the presentation selection pulldown.
  • scope: the place where this presentation will be used. This particular presentation is for the TextElement only.

Note that if the same name is used twice, the order of the directories in the website_settings comes into play. The presentation that is discovered first, will be used. The other presentation will be ignored. This can lead to strange and hard to debug behaviour, which is why you should always make sure you have a unique value for the name tag in your descriptor file. The first thing I always do after copying the XML file is changing the value of the name tag!

So there we have it; WebManager's grasp of the world of presentations laid out. It's all about the order of directories, the names in the descriptor files and the scope where they are valid.

Easy, huh? If only things would stop making sense.


Catch you later!

Patrick


markvc | 19-08-2008 12:19

Hi Patrick,

I'd like to add some information to this post, because you can find more than one presentation_jsps_url setting in the tab you mention.

There is a backend_system_settings.presentation_jsps_url and for each webinitiatif there is a website_settings.presentation_jsps_url. The story you describe applies to the website_settings configuration set and is therefore specific to a single webinitiatif.

The setting in the backend_system_settings configuration set is the place where WebManager will extract the resources from the presentation WCBs (only the first value will be used; I don't know why you can supply multiple paths). This settings is installation-wide (as are WCBs).

Gr,
Mark



patricka | 19-08-2008 15:31

You are very right, Mark! I have changed the text a bit to make sure that people realize I'm talking about the website_settings.presentation_jsps_url.
Thanks!

Greetings,

Patrick



Jeroen | 14-11-2008 16:08

photoshopper!

what i always missed in the website_settings.presentation_jsps_url is a ordering system.

now i swap the lines


About the Author

Return to all blogs

 

Patrick Atoon

Patrick Atoon has gained nuff respect as one of the most experienced web architects in the GX Webmanager community or even the global hip hop community for that matter.

Read all Patricks blog entries

Other blog entries:

December 9, 2008
Like A Version
August 4, 2008
Namaste!
July 7, 2008
Japanese encore (日本のアンコール)
May 20, 2008
All amped up
May 7, 2008
No soup for you!
April 16, 2008
Live in effect
April 14, 2008
Lacking chemistry
March 20, 2008
About cars and software
March 17, 2008
Scope, que?!
March 11, 2008
Maven FTW!


Share:

del.icio.us
digg
Technorati
Slashdot
Reddit
YahooMyWeb
NewsVine
ekudos
© 2008 GX creative online development B.V.

Disclaimer

This website (GXdeveloperweb.com) may discuss or contain opinions, (sample) coding, software or other information that does not include GX official interfaces, instructions or guidelines and therefore is not supported by GX. Changes made based on this information are not supported.  GX will not be held liable for any damages caused by using or misusing the information, software, instructions, code or methods suggested on this website, and anyone using these methods does so at his/her own risk. GX offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this website, including any liability resulting from incompatibility between the content of this website and the materials and services offered by GX. By using this website you will not hold, or seek to hold, GX responsible or liable with respect to the content of this website.