-
1. Re: How To Change Banner ?
julien1 Oct 6, 2003 3:31 AM (in response to software)currently we don't have support for that. if you want a custom banner you need to modify or create a theme.
julien -
2. Re: How To Change Banner ?
giorgio42 Nov 7, 2003 3:49 AM (in response to software)Has this been added in the meantime, or is there any intention to do that?
Georg -
3. Re: How To Change Banner ?
julien1 Nov 7, 2003 5:13 AM (in response to software)actually I am not sure of what you want. You want to change what banner ?
-
4. Re: How To Change Banner ?
giorgio42 Nov 7, 2003 10:01 AM (in response to software)The banner at the top of the page. You don't want to have "Nukes on JBoss" there on your corporate web site.
It should be possible to configure a theme at least in a basic way without starting to write Java code.
BTW: It would be a good idea to remove the PHP references of the other two themes (JBoss Nukes is not enhanced by PHP, is it?)
Thanks for listening!
Georg -
5. Re: How To Change Banner ?
julien1 Nov 7, 2003 10:24 AM (in response to software)there is a theme that is generic and is in the nukes-website module. it takes stuff in the html module. I can port it, is it enough ?
you can have a look at the code at (in the CVSView on sf.net) :
nukes-website/src/main/org/jboss/website/themes/impact/ImpactTheme.java
cheers,
julien -
6. Re: How To Change Banner ?
mikkokamarainen Nov 21, 2003 6:04 PM (in response to software)You can make a general theme (using stuff from html module) and thus have html module (browser) editing for most of the stuff (header, footer, block, tablestart etc.)
make a theme - follow the tutorial:
an example of such a theme:
1) the theme class:
------------------------------------ start HtmlTheme.java
/*
* a generic theme getting its data from the html module
* -- mikko
*/
package fi.provoke.jboss.nukes.themes;
import org.jboss.nukes.block.Block;
import org.jboss.nukes.core.modules.html.File;
import org.jboss.nukes.core.modules.html.HtmlModule;
import org.jboss.nukes.html.Page;
import org.jboss.nukes.html.ThemeSupport;
import org.jboss.nukes.resources.Resource;
public class HtmlTheme extends ThemeSupport {
public HtmlTheme() {
super("HtmlTheme");
}
// called when the caller wants to open a table
public void openTable1(Page page) {
page.print(renderHtmlContent("theme/openTable1.html"));
}
// called when the caller wants to close a table
public void closeTable1(Page page) {
page.print(renderHtmlContent("theme/closeTable1.html"));
}
public void openTable2(Page page) {
page.print(renderHtmlContent("theme/openTable2.html"));
}
public void closeTable2(Page page) {
page.print(renderHtmlContent("theme/closeTable2.html"));
}
// called after just Nukes has outputed
// the beginning of the page
public void header(Page page) {
page.print(renderHtmlContent("theme/header.html"));
page.print("<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">");
page.print("");
page.print("");
page.blocks(Page.SIDE_LEFT);
page.print("");
page.print("");
page.blocks(Page.SIDE_CENTRE);
}
// called after Nukes has invoked the module
public void footer(Page page) {
page.print("");
page.print("");
page.blocks(Page.SIDE_RIGHT);
page.print("");
page.print("");
page.print("");
page.print(renderHtmlContent("theme/footer.html"));
}
// called when Nukes wants to display a block
public void block(Page page, int side, Block block, int index) {}
// render a file as a String (from the html module)
public String renderHtmlContent(String fileId) {
boolean printed = false;
String str = new String("");
try {
Resource res =
(Resource) server.invoke(
HtmlModule.OBJECT_NAME,
"getResource",
new Object[] { fileId },
new String[] { String.class.getName()});
if (res instanceof File) {
File file = (File) res;
str = (file.getContentAsString());
printed = true;
}
} catch (Exception e) {
log.error("Error while retrieving file with fileId=" + fileId, e);
}
if (!printed)
str = ("file not available");
return str;
}
}
------------------------------------ end HtmlTheme.java
2) jboss-service.xml:
<?xml version="1.0" encoding="UTF-8"?>
<mbean
code="fi.provoke.jboss.nukes.themes.HtmlTheme"
name="nukes.themes:name=htmlTheme"
xmbean-dd=""
xmbean-code="org.jboss.nukes.component.NukesMBean">
nukes.modules:name=core
3) in nukes: create the html files given in the class above, upload images you use in the html files etc. A good start for each html-file is the tutorial example theme: a simple table
(modify the class above if you do not want a table but rely on a different way to lay out the page / layers etc.)
4) build, package the .sar and deploy
5) edit the html-files as needed until you get the result you hoped for
6) update the nukes database to make the new theme the default theme
works.
Mikko -
7. Re: How To Change Banner ?
mikkokamarainen Nov 21, 2003 6:08 PM (in response to software)oops.
the block method was empty.
the tutorial method can be used:
--
public void block(Page page, int side, Block block, int index)
{
page.print("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">");
page.print("");
page.print("");
// displays block's title
block.displayTitle(page);
page.print("");
page.print("");
page.print("");
page.print("");
// displays block's content
block.displayContent(page);
page.print("");
page.print("");
page.print("");
}
--
Mikko -
8. Re: How To Change Banner ?
julien1 Nov 21, 2003 6:10 PM (in response to software)I have started working on porting the template stuff from the bb module to the nukes, so now it is possible to make a theme without making a class, just one text file.
I have to commit that though :-) -
9.
prab Dec 11, 2003 1:15 AM (in response to software)hello,
where can i fin the following file
CVSView on sf.net) :
nukes-website/src/main/org/jboss/website/themes/impact/ImpactTheme.java
pls reply imdly.