This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 4, 2011, 6:50 PM
10 Posts

use "old way" resources in xpage app

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: css,html,existing code,migration
  • Replies: 5
Hi all.
 
I have an application that was built "the old way", meaning some CSS, JavaScript and even images are stored as documents in the application.  I would like to reuse these in new features that I'm adding to that application.  These new features use xpages of course.  How can I use a CSS that is stored in a document? How to link to some JavaScript librairies that are also stored as documents?
 
Also, is there something special to do if i want to just drop existing HTML code in an xpage?  Do I need to use a special tag for that HTML?
 
 
Thanks a lot, 
 
Ben 
 
 
Apr 4, 2011, 6:51 PM
22 Posts
Re: use "old way" resources in xpage app
With XPages just about everything is computable with SSJS. You can compute the URL of CSS using SSJS or read in the CSSS and render it within <style> ... <style> tags in a computed field.
 
 The only caveat to putting HTML directly onto the xpage in the source mode is it has to be XHTML compliant (IE: Make sure you close all the manually entered tags. So <br> is <br/>, etc.
 
Newbs
Apr 5, 2011, 1:08 PM
10 Posts
Re: use "old way" resources in xpage app
I'm asking because I couldn't figure out how to compute the values in the standard resources page options.  Do I have to add them in the source, just like we are doing in pre xpages dev?
 
All I have in the options are options to use stylesheet or JS file located directly in the design of the NSF, URL but it has to be a valid one and can't see how to get that computed...
Apr 5, 2011, 1:29 PM
50 Posts
Re: use "old way" resources in xpage app
You should just be able to copy and paste your css and js into a Resource > Stylesheet or a js Code > Script Library. Then you can just use those resources as you normally would in xpages. Typically, when I have done that, I have renamed the resource. So, for instance if I was using a page to store my css called style.css, I just named my new xpages stylesheet xspStyle.css. That way you don't touch the legacy stuff while you are redeveloping to xpages.
 
Also, as far as the html goes, you can pretty much copy and paste your existing html between the <xp view> tags in your xpage and it will be fine. You'll probably then need to go in an tweak it to get it to work/display correctly, but it beats starting all over from scratch. If you are using <Computed Value> in your html, that will all need to be removed and redone. By and large, the more strictly you adhered to html conventions the easier it will go for you.
Apr 12, 2011, 11:59 PM
64 Posts
Re: use "old way" resources in xpage app
- Computed text on a XPage is the <xp:text> tag:
 
<xp:text escape="false" disableTheme="true">
  <xp:this.value><![CDATA[#{javascript:
/* Put your computed text here.  EL (Formula-like) is generally supported, as is arbitrarily complex JS and Java.  Your imagination is literally the limit */
  }]]></xp:this.value>
<xp:text>
 
- The above will literally show up in DDE as { Computed }.

Shorter version (restrictions on what can be in the JS:

<xp:text escape="false" disableTheme="true" value=#{javascript:/* your js/el here */;}" />

- Don't disableTheme unless you have your own CSS, or you don't want automagic <span> ... </span> around your computed output.  I basically never want the automagic <span> ... </span> so I include that as a matter of course.

Hope this helps...
Apr 5, 2011, 10:20 PM
18 Posts
Re: use "old way" resources in xpage app
If you are trying to do CSS etc.. the old way so that users can edit them without designer then check out the link below.
The example uses file resources but I guess it can be used for other resources ( let me know if now )

http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Creating_an_Xpage_resource_file_via_DXL_without_a_temporary_file
 
Sean

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal