Changes for page Development-Custom Templates
Last modified by Pascal Robert on 2010/09/13 00:27
From version 3.1
edited by Quinton Dolan
on 2007/07/12 21:02
on 2007/07/12 21:02
Change comment:
There is no comment for this version
To version 4.1
edited by Pascal Robert
on 2007/09/03 15:11
on 2007/09/03 15:11
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Programming__WebObjects-WebApplications-Development-Custom Templates1 +Web Applications-Development-Custom Templates - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. qdolan1 +XWiki.probert - Content
-
... ... @@ -1,8 +1,8 @@ 1 -== Petite Abeille 1 +== Petite Abeille == 2 2 3 3 //The following solution is more involved than what is strictly needed. It may avoid the debug message, he is using some quasi-private stuff.// 4 4 5 -=== It can be quite easy 5 +=== It can be quite easy === 6 6 7 7 {{code}} 8 8 ... ... @@ -9,7 +9,7 @@ 9 9 protected WOElement myTemplate = null; 10 10 public WOElement template() { 11 11 if ( myTemplate == null ) { 12 - myTemplate = WOComponent.templateWithHTMLString( html, wod, null ); 12 + myTemplate = WOComponent.templateWithHTMLString( html, wod, null ); 13 13 } 14 14 return myTemplate; 15 15 } ... ... @@ -18,8 +18,8 @@ 18 18 19 19 A More Involved Solution: 20 20 21 -Here is a little example on how to overwrite WOComponent.template() so 22 -you can load the html template and wod from wherever you want )eg a jar 21 +Here is a little example on how to overwrite WOComponent.template() so 22 +you can load the html template and wod from wherever you want )eg a jar 23 23 file): 24 24 25 25 * First you will need to overwrite WOComponent.template() ... ... @@ -93,7 +93,7 @@ 93 93 private static InputStream componentStreamForResource(WOComponent aComponent, String aResource) { 94 94 if ( aResource != null ) { 95 95 File aDirectory = new File( System.getProperty( "user.dir" ) ); 96 - File aFile = new File( aDirectory, aResource ); 96 + File aFile = new File( aDirectory, aResource ); 97 97 if ( aFile.exists() == true ) { 98 98 try { 99 99 return new FileInputStream( aFile ); ... ... @@ -107,5 +107,3 @@ 107 107 } 108 108 109 109 {{/code}} 110 - 111 -Category:WebObjects