-
1. Re: Complex index page without recoding core
sgwood Mar 31, 2004 6:13 AM (in response to rebornspirit)
When you say "index page", I assume that you mean the default page someone sees.
You do not have to change the core really.
Create a module that has an operation that produces the page you want.public void welcome(Page page) { if (getApi().userLoggedIn()) { // render the page } else { page.sendRedirect("index.html"); } }
Have your own version of the nukes.ear/nukes.sar jboss-service.xml that has the CoreModule configured like:<attribute name="DefaultUserPage">index.html?module=myIndexPage&op=welcome</attribute>
Done!
Sherman -
2. Re: Complex index page without recoding core
rebornspirit Mar 31, 2004 6:50 AM (in response to rebornspirit)k, great, this will at least help me started.
But still some other issues concerning this:
- is it possible to have multiple templates (for the skeleton of the complete page, not an individual module). So that I can say that i.e. my start page has that skeleton design, but my other pages have another skeleton design
- I noticed that when rendering the body, this is done in a new frame, and the framelength is hard-coded in the core on 600 ... are their work arounds for that ...... ?
Thx -
3. Re: Complex index page without recoding core
rebornspirit Mar 31, 2004 7:11 AM (in response to rebornspirit)I wrote the custom indexpage module and that works, but it's not being called for my startpage. So I looked in the xml files and found an other attribute called StartPage. If I understand that correctly, that one calls a module.
But I don't understand what happens then, how can I say that for my startpage he needs to use the same url as the defaultuserpage, i.e.
index.html?module=dcaIndexPage&op=welcome
Grtz -
4. Re: Complex index page without recoding core
rebornspirit Mar 31, 2004 7:22 AM (in response to rebornspirit)Solved my problem for the startpage, i figured out that i needed a method called main in my custom module. Sometimes the answer is so stupid :) But I'm getting there.
The other questions, about the different skeletons templates are still open. -
5. Re: Complex index page without recoding core
sgwood Mar 31, 2004 7:53 AM (in response to rebornspirit)- is it possible to have multiple templates (for the skeleton of the complete page, not an individual module). So that I can say that i.e. my start page has that skeleton design, but my other pages have another skeleton design
Can you change the theme on the fly during login?- I noticed that when rendering the body, this is done in a new frame, and the framelength is hard-coded in the core on 600 ... are their work arounds for that ...... ?
Where is this hardcoding? This should all be in the theme.
Sherman -
6. Re: Complex index page without recoding core
rebornspirit Mar 31, 2004 8:14 AM (in response to rebornspirit)The hardcoding is in:
private void print(Page page, String fileId, String contentType, String content, Integer id)
{
Level level = secGetLevel(fileId + "::");
if (contentType == null || !contentType.startsWith("text/"))
{
page.openTable();
page.print("<iframe width=\"100%\" height=\"600\" src=\"" + page.getServerBase() + fileId + "\">");
page.print("Your browser do not support iframes");
page.print("");
page.closeTable();
return;
}
you can see that the height is set to 600.
-----
I know that a user can set his own template / theme. But that's not what I wanna do, I need to (portal look and feel):
- have a startpage with a specific layout
- have a bunch of other pages that have a complete different layout then the start page, so not only the template for the module.
Is just want to know what the easiest (and how) way is to do this. And all of these templates should come out of the database, but I allready know how to do this with the HtmlLoader so :) I know something :)
I just found a another problem, can css files or js files be stored (pff course BUT) in the database and then retrieved from them to be used inside the template, now all the examples just have a css file somewhere in their jar. -
7. Re: Complex index page without recoding core
rebornspirit Mar 31, 2004 8:16 AM (in response to rebornspirit)Forgot to mention that is hardcoding is in file: HtmlModule
sowry :(