[opencms-dev] bvr : Site Specific content ?? A replacement for the Bitch !!

Michael, Nick N Nick.Michael at standardbank.co.za
Mon Oct 10 14:08:36 CEST 2005


<%--

OpenCms is easy for channel specific Content 
but a Bitch for Site Specific Content

I have a different solution to this problem 
THE GOOD OLD HASHTABLE

I have a class in a second JSP that I include in my template
This class has two methods

In my Site Specific Content I can handle many foreign languages

and I just add as many new tokens as I want in my setupData() method

and I get the tokens back using my getTokens(TokenKey ) method
By using token calls in my JSP instead of text in my JSP template html tags
I have made every element other than the body text sit out side my template
in my Java Class

Has any one else done something similar ?

Now what would be nice if you could have one JSP and make different
instances on each site or sub site

also the tokens can be loaded from a properties file with an additional
method where you pass the filename / path


your comments ..........please
	
regards
Nico
	
--%> 

<%!   // you must use this tag if you want your jsp to hold a Java Class

public class TemplateData{
 Hashtable tokens= new Hashtable();
 
 public String getTokens(String key){ // THIS IS USED TO RETRIEVE ANY TOKEN
CONTENT
	String result3=(String) tokens.get(key);

  	if (result3!=null && result3.length()>0){
          	return result3;
  	}
  	result3="";
  	return result3; 
 }


  public void setupData(){ I first call this method of the class to set all
my tokens

    // TOKENS ARE USED FOR LABELS IMAGES URLS   AND HTML TAGS
    tokens.put("organizationName","Federation of Afrikaans Communities and
Associations of South Africa");
    tokens.put("organizationForeignName","hier kom die boere");
    tokens.put("mainAdverttext","The Webmasters Community Resources");
    tokens.put("mainAdvertForeigntext","hier kom die boere taal");
 
tokens.put("mainAdvertUrl","http://localhost:9090/opencms/opencms/Federation
/useful_information.html");
    tokens.put("webDesignerText","This web site was designed by the web
master (Nico Michael)");
    tokens.put("webDesignerURL","http://www.Afrikaans
.org.za/cmp/index.html#nick");
    tokens.put("hostingCoText","This Website is hosted by CMP");
 
tokens.put("hostingCoURL","http://www.orthodoxjohannesburg.org.za/Cmp/index.
html");
    tokens.put("emailUser","webmaster");
    tokens.put("emailSite","sa.org.za");
    tokens.put("bannerTags","AfrikaansFederation.jpg");
    tokens.put("menuTableWidth","width=" +QU + "153" +QU);
    tokens.put("styleSheetnName","../files/style.css");
  }
}
  TemplateData templateData=new TemplateData(); //instanciate object
%>


-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]On Behalf Of Jorge González
Sent: Tuesday, October 04, 2005 11:37
To: 'The OpenCms mailing list'
Subject: RE: [opencms] Re: [opencms-dev] Permissions to change JSPs


You can put all the jsp config stuff into a xml file (or properties file)
and let the user change it.



_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev

__________________________________________________________________________________________________________________________________

Standard Bank Disclaimer and Confidentiality Note

This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited
and/or its subsidiaries ("the Group"). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by
mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions
expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or
damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity
of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers
in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS).
For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za
___________________________________________________________________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20051010/9918c9aa/attachment.htm>


More information about the opencms-dev mailing list