| 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).
base_url: /wlpProxy
or
base_url: http://wlphost.mydomain.com:7001/wlpApp
ok
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: mywlp.mydomain.com
proxy_port: 8080
proxy_context_root: /myWlpApp
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
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 options can be found in vendor/plugins/weblogic_portal/config/weblogic_portal.yml
Access via the get method:
wlp_cfg = WeblogicPortal:Configuration.instance
each parameter is an attribute: wlp_config.base_url, etc.
return the configuration settings in a human readable form
# File lib/weblogic_portal/configuration.rb, line 140
140: def inspect
141: config.collect {|k,v| "#{k}: #{v}\n"}.join
142: end