Actually the stylesheet is not the problem. Near the bottom of the screen
you will see 2 calls to the JavaScript function "comparePwds". These are not
resolving to the global.js in the /resources directory. They did before I
moved the screen to a subdirectory of the /screens directory?

Also I left out the addition I tried in both of these files, the screen and
the layout separately, that caused the blank layout. This was
<script language="JavaScript" src="$content.getURI("resources/global.js")"/>

It looks from what you have below I need more of the path in there. Like
<script language="JavaScript"
src="$content.getURI("/rwtransform/resources/global.js")"/>
But that causes a blank screen too?

I don't understand why the screen template broke just becuase I moved it one
subdirectory away from where it was. I would not think that would make a
difference to finding a resource in the resource directory. I even tried to
mimic the directory structure (/resource/Admin/global.js) and that does not
work either?

I have realised you don't want to stray too far from the Turbine straight
and narrow otherwise you end up spending 4 days of your life trying to
understand what has happen ;)

David

-----Original Message-----
From: Simon Moore [mailto:[EMAIL PROTECTED]]
Sent: 15 April 2002 17:41
To: Turbine Users List
Subject: RE: Finding path to resource


Wether or not default html tags appear or not depends on the class your
layout extends from.i.e

If it extends VelocityECSLayout, then the html tags are automatically
defined for you..

If you want to have complete control..try extending from VelocityOnly....

according to this....
public String getURI(String pathToContent)
 { return (
        getServerScheme() + //http
        "://" +
        getServerName() + //www.foo.com
        ":" +
        getServerPort() + //port webserver running on (8080 for TDK)
        //the context for tomcat adds a / so no need to add another
        contextpath + //the tomcat context
        "/" +
        pathToContent);
}
this is correct...

#set ( $fileName="style.css.${detector}")
#set ( $styleSheet=$content.getURI("resources/${fileName}"))

but here you're using the

$page.setStyleSheet($styleSheet)

all you should need is something like...

$page.setStyleSheet("Admin/style.css");

which is relative to your app root...no need for getURI() unless your
stylesheet is on another machine in which case you should use VelocityOnly
layout and physically define the styleshhet tag using
src="$content.getURI("resources/${fileName}")"

Hope that helps...

Saimon

> -----Mensaje original-----
> De:   David Wynter [SMTP:[EMAIL PROTECTED]]
> Enviado el:   lunes 15 de abril de 2002 18:12
> Para: Turbine Users List
> Asunto:       RE: Finding path to resource
>
>
> The screen ( in webapps/myapp/templates/app/screens/Admin/ManageUser.vm )
> is
> like this
>
> ------------------------
> $page.setTitle("Manage User")
>
> ## Set up entries in the roleType drop-down
> #set ( $userRoles = $entitylist.getAllRoles() )
> #if (!$selectedRole && ($userRoles.size()>0) )
>       #set ( $selectedRole=$userRoles.get(0) )
> #end
>
> ## make the first entity selected, if no entity has already been selected
>
> #set ( $users = $entitylist.getAllUsers() )
> #if (!$selectedUser && ($users.size()>0) )
>       #set ( $selectedUser = $users.get(0) )
> #end
> #set ( $selectedUserName = $selectedUser.getUserName() )
> #set ( $selectedPassword = $selectedUser.getPassword() )
>
> <form name="userForm" method="post"
> action="$link.setPage("Admin,ManageUser.vm").setAction("Admin.CrudUser")">
>       <input type="hidden" name="selectedUserName"
> value="$!selectedUserName"/>
> ...etc
>
> etc...
> ## See onClick test for Update, it checks that the same string is entered
> in
> both 'password' and 'repassword' when Create is clicked
> ## If an Update is clicked and they have not entered anything in the
> password inputs then that is OK, we leave them as they are
> ## If they have entered them the strings need to be the same and an update
> occurs.
>                       <td width="$ui.screenWidgetWidth">
>                               <input type="button" name="reset"
> value="Clear"
> onClick="clearFormElements(this.form)"/>
>                               <input type="submit"
> name="eventSubmit_doCreate" value="Create"
> onClick="comparePwds(this.form)"/>
>                               <input type="submit"
> name="eventSubmit_doUpdate" value="Update"
> onClick="comparePwds(this.form)"/>
>                               <input type="submit"
> name="eventSubmit_doDelete" value="Delete"/>
>                       </td>
>               </tr>
> ## Probably would need to add a search by login, first and last name here
>       </table>
> </form>
>
> Then the layout ( in webapps/myapp/templates/app/layouts/Admin/Default.vm
> )
> is like this
>
> ---------------------------------------
>
> #set ( $fileName="style.css.${detector}")
> #set ( $styleSheet=$content.getURI("resources/${fileName}"))
>
>
> $page.setStyleSheet($styleSheet)
>
> <table width="$ui.totalLayoutWidth" cellspacing="5">
>   <tr>
>     <td colspan="3">
>       $navigation.setTemplate("/DefaultTop.vm")
>     </td>
>   </tr>
>   <tr>
>     <td width="$ui.menuWidth" align="left" valign="top">
>       $navigation.setTemplate("/Admin/Default.vm")
>     </td>
>       <td BGCOLOR="#86BE40" width="1">
>               <img src="$content.getURI("images/apixltgrn.gif")"
> height="100%"
> width="1">
>       </td>
>     <td align="left" valign="top" width="$ui.screenTableWidth">
>       $screen_placeholder
>     </td>
>   </tr>
>   <tr>
>     <td colspan="3">
>       $navigation.setTemplate("/DefaultBottom.vm")
>     </td>
>   </tr>
> </table>
>
>
> I did not do the template structures and names originally so changing them
> has been a struggle. Maybe I need explicit <body> tags somewhere, I
> thought
> they must be implict in the template somewhere?
>
> David
>
> -----Original Message-----
> From: Simon Moore [mailto:[EMAIL PROTECTED]]
> Sent: 15 April 2002 17:07
> To: Turbine Users List
> Subject: RE: Finding path to resource
>
>
> what does your layout screen look like...?
>
>
>
>
> > -----Mensaje original-----
> > De: David Wynter [SMTP:[EMAIL PROTECTED]]
> > Enviado el: lunes 15 de abril de 2002 17:33
> > Para:       Turbine Users List
> > Asunto:     RE: Finding path to resource
> >
> > Saimon,
> >
> > I get the same result using the
> > src="$content.getURI("resources,global.js")"/> , a blank screen. I think
> > the
> > screen template substituted for the $screenholder in the layout is
> inside
> > the <html> tag, not sure this works?
> >
> > What I find strange is that it found this URI without any directive
> > before.
> > Just moving the template referring to the resource should not change
> this.
> > It makes sense for tempalte, navigation and layouts, but I am not so
> sure
> > about resources.
> >
> > David
> >
> > -----Original Message-----
> > From: Simon Moore [mailto:[EMAIL PROTECTED]]
> > Sent: 15 April 2002 15:58
> > To: Turbine Users List
> > Subject: RE: Finding path to resource
> >
> >
> > that's not what it was designed for but I thought you might be
> interested
> > ;)
> >
> > but try
> >
> > src="$content.getURI("resources,global.js")"/>
> >
> > hope that helps...
> >
> >
> > (You'll have to wait as I have it at home somewhere....I have to dig it
> > up)
> >
> > Personally, after implementing it..I then decided I wanted to try and
> > avoid
> > javascript in my apps as much as possible...ironic isn't it..;)
> >
> >
> > Saimon,
> >
> > > -----Mensaje original-----
> > > De:       David Wynter [SMTP:[EMAIL PROTECTED]]
> > > Enviado el:       lunes 15 de abril de 2002 16:48
> > > Para:     Turbine Users List
> > > Asunto:   RE: Finding path to resource
> > >
> > >
> > >
> > > Sure, if it shows me how to include the JavaScript from a template in
> a
> > > sub
> > > directory off /screens. I have found the architecture hard to follow,
> > > mainly
> > > because of the documentation. I have found the Flux implementation has
> > > answered most of my questions when someone reminded me it was there!
> > >
> > > David
> > >
> > > -----Original Message-----
> > > From: Simon Moore [mailto:[EMAIL PROTECTED]]
> > > Sent: 15 April 2002 15:37
> > > To: Turbine Users List
> > > Subject: RE: Finding path to resource
> > >
> > >
> > > I submitted a javascript implementation for intake a while back now,
> > that
> > > you might be interested in...
> > >
> > > If so..I'll see if I can dig it up...
> > >
> > > Saimon
> > >
> > > > -----Mensaje original-----
> > > > De:     David Wynter [SMTP:[EMAIL PROTECTED]]
> > > > Enviado el:     lunes 15 de abril de 2002 16:31
> > > > Para:   Turbine-User
> > > > Asunto: Finding path to resource
> > > >
> > > > I have just moved my .vm templates to subdirectories of
> > > > webapps/myapp/modules/app/screens that represent the roles that use
> > > them.
> > > > I
> > > > have implemented a much simpler version of what Scott Weaver
> presented
> > > in
> > > > his extended security model. The last hurdle to overcome is finding
> my
> > > > JavaScript resources. I have a file 'global.js' located in the
> > > > webapps/myapp/resources directory. In this global.js file is a
> > function
> > > > called comparePwds. It is address from a tempalte as follows:
> > > > <input type="submit" name="eventSubmit_doCreate" value="Create"
> > > > onClick="comparePwds(this.form)"/>
> > > >
> > > > It cannot find it now that the template has moved to
> > > > webapps/myapp/modules/app/screens/Admin.
> > > >
> > > > I tried adding this to the top of the template and separately to the
> > top
> > > > of
> > > > the layout template.
> > > > <script language="JavaScript"
> > > > src="$content.getURI("resources/global.js")"/>
> > > > I ended up with blank screens in both cases but no error about not
> > > finding
> > > > the script. I found a reference to this is in the  arhive, but this
> > had
> > > > <html> and <body> tags which my templates do not. I could not find
> > > > anything
> > > > on where these tags are implicitly in the Velocity templates. I
> > > understand
> > > > that I need to put the above <script ... in between the <html> and
> > > <body>
> > > > tags but where do these occur?
> > > >
> > > > thanks
> > > >
> > > > David Wynter
> > > > roamware Ltd.
> > > > (+44) (0) 208 922 7539 B.
> > > > (+44) (0) 7879 605 706 M.
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > > For additional commands, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to