Category:Config

From JRapid

Revision as of 17:09, 14 April 2010 by NGarnil (Talk | contribs)
Jump to: navigation, search

The <config> element is used to declare global statements. A global statement affects all HTML pages inside the project.

This element is commonly used to import Community Items like Widgets, Views and Transformers and external JavaScript and CSS files into the project.

Contents

Usage:

<config 
        ((usescript|usestylesheet|usewidget|useview|restrict)*)
/>
  • <usescript>: used to call an external JavaScript file.
  • <usestylesheet>: used to call an external CSS file.
  • <useview>, <usewidget>: used to import either a View or Widget.
  • <restrict>: used to add global security for all your HTML pages. This is a powerful feature for adding security to JRapid Webforms.

Web IDE:

The web IDE counts with a Config Editor where you can edit or add new JavaScript or CSS declarations.

Editing Config Window

Examples:

  • Include a JavaScript file:
<app>
 ...
 <config>
     ...
     <usescript location="../js/scripts.js"/>
     ...
 </config>
 ...
</app>
  • Include a CSS file:
<app>
 ...
 <config>
     ...
     <usestylesheet location="../css/styles.css"/>
     ...
 </config>
 ...
</app>
  • Import Community items (View or Widget):

The <useview> and <usewidget> elements are automatically added to the <config> element after the first generation since the item is imported.

<app>
 ...
 <config>
     ...
     <useview ... />
     <usewidget ... />
     ...
 </config>
 ...
</app>
  • Adding Basic Access Authentication to all the HTML pages in the project:

This is done by using the restriction element.

<config>
   ...
   <restrict authentication="basic"> 
      <allow privilege="ADMIN" />
      <user name="your_username" password="your_password" privileges="ADMIN" /> 
   </restrict>
   ... 
</config> 

See also:

Pages in category "Config"

The following 3 pages are in this category, out of 3 total.

R

U

Personal tools