Class WeblogicPortal::Configuration
In: lib/weblogic_portal/configuration.rb
Parent: Object

Singleton to hold the configuration for WebLogic Portal plugin.

The configuration is read from config/weblogic_portal.yml, which should be coppied to your project on plugin install. You can run the plugin’s install.rb to re-install the configuration file (Note: This will overwrite any existing configuration file).

Primary configuration settings

base_url
Important: base_url is required to be set. You must set base_url to the url representing the context-root of your portal webapp. This can be a uri relative to the rails app domain (in which case you are using some sort of proxy to access the wlp app, like the proxy included with the plugin, or apache mod_weblogic or something), or an absolute url (i.e. starting with http:) to a portal server. Examples:
  base_url: /wlpProxy

or

  base_url: http://wlphost.mydomain.com:7001/wlpApp

ok

use_proxy
If set to true, install the WeblogicPortal::ProxyController. Defaults to false. Setting this parameter also requires proxy_host, proxy_port, and proxy_context_root to be set (both proxy_host and proxy_port have defaults, so they are not really required if the defaults are good).

The use of the proxy also assumes (requires) that you have set the base_url to a simple path (like /wlpRoot) and not a full url (starting with http:)

Setting use_proxy causes the following route to be automatically installed as the first route:

   map.connect ':wlp_base_uri/*wlp_any_uri',
         :controller=>'WeblogicPortal::Proxy',
         :action=>'proxy',
         :wlp_base_uri=>/myWlpBaseUrl/

where myWlpBaseUrl is the value from this configuration, with leading and trailing slashes removed.

The controller is installed via the WeblogicPortal::ProxyRouting mixin. If you don’t want to do it this way, you can install the above route manually (in routes.rb), and set proxy_host, proxy_port, and proxy_context_root.

proxy_host
Host name (address) of your WebLogic Portal server. Defaults to localhost. Example:
  proxy_host: mywlp.mydomain.com
proxy_port
Port number for your WebLogic Portal server. Defaults to +7001+. Example:
  proxy_port: 8080
proxy_context_root
The context-root of your Portal WebApp. Should match the setting in your application.xml for that web module. Required if using the proxy (either via use_proxy or a manual route setting. Example:
   proxy_context_root: /myWlpApp
embedded_default
Set the default value for the :embedded option for render (see WeblogicPortal::RenderPortler) The :embedded option tells the render method how to render the portlet: as ajax, or in an iframe.

Browser security restrictions generally require that the portlet come from the same host and port as the containing page (the rails view or template in this case).

If embedded_default is not set, then the default value is based on the base_url. When base_url is a full url (starts with http:). the default for :embedded is true (iframe). Otherwise, the default is false (ajax).

When embedded_default is set, it becomes the default value for the :embedded option, regardless of how base_url is configured.

The most common use for this would be to force some mode like iframe, as in:

   embedded_default: true

Environment overrides

Any setting in weblogic_portal.yml can be set or overriden per-environment, by adding a specific section for that environment.

For example, in this file:

    base_url: /wlpOnRails
    use_proxy: false
    development:
        use_proxy: true
        proxy_host: localhost
        proxy_port: 7001
        proxy_context_root: myWlpWar
    production:
      base_url: /wlpMapped
      embedded_default: false

In the developmennt environment, the base_url would be /wlpOnRails and the WeblogicPortal::ProxyController would be used to contact a portal server at localhost:7001/myWlpWar. In production, base_url will be /wlpMapped and no proxy will be used (maybe we are proxying both portal and rails through apache). Production also forces the default embedding mode to ajax.

Other configuration settings

Other configuration options can be found in vendor/plugins/weblogic_portal/config/weblogic_portal.yml

Accessing the configuration

Access via the get method:

  wlp_cfg = WeblogicPortal:Configuration.instance

each parameter is an attribute: wlp_config.base_url, etc.

Methods

Included Modules

Singleton

Public Instance methods

return the configuration settings in a human readable form

[Source]

     # File lib/weblogic_portal/configuration.rb, line 140
140:     def inspect
141:       config.collect {|k,v| "#{k}: #{v}\n"}.join
142:     end

[Source]

     # File lib/weblogic_portal/configuration.rb, line 130
130:     def method_missing attr #:nodoc
131:       config[attr.to_s]
132:     end

string representation of the configuration

[Source]

     # File lib/weblogic_portal/configuration.rb, line 135
135:     def to_s
136:       config.to_s
137:     end

[Validate]