Change persistance of J2SE session in ilog jrules - ilog

I have created a J2SE session in jrules to test my business rules. the rule engine is searching for the rule app in the /res_data directory by default. Is it possible to change the configuration of the rule engine to give a custom path.

You have to load a custom ra.xml in your classpath.
You can find the default ra.xml (default_ra.xml) in the META-INF folder of the lib jrules-res-execution-x.x.x.jar.
Then search for "DIRECTORY=res_data".

Related

Deploying ZF2 application to a shared hosting

I have a domain name as addon on. It is called www.myapp.cöm and because it ais an addon domain it is located at çtp://myrealdomain.cöm/myapp/
How I'll put those ZF2 files? I don't want to put all of them under çtp://myrealdomain.cöm/ folder.
you had to place all you application public files in the myapp folder and can place all other files (modules) on different location and link it with the exact path in configuration file declaration for modules).
for ZEND library if your server configuration allow variable in .htaccess you can set ZF2=path to zend library and you can place the lib files any ware accessible in your host
Hi I had posted an answer for setting up zf2 application in shared hosting, hope this may help follow the link below
ZF2 in shared hosting environment

Configuring Lift for jQueryUI

Lift Framework seems to need a lot of very specific configuration to serve static files. This is pretty tough if you want to use something like jQueryUI with Lift. Can anyone point me to a Lift project that has all the configuration necessary to use jQueryUI?
No extra configuration is needed to use JQuery UI with Lift. Simply put the JS files into the webapp directory like you would with any other static resource. The servlet container will serve that exactly like it would for any other WAR application.
You only need to resource server stuff if you want to serve files from deep in your class path (like from another JAR for example)

Including resources outside context root with JSF2

I'm currently upgrading an application from JSF 1.2 and Richfaces 3.3 to JSF 2 and Richfaces 4.
I'm having issues getting my application to include stylesheets using JSF2's new h:outputStylesheet component
Here is my old code:
<a4j:loadStyle src="resource:///com/testing/test/html/css/style.xcss" />
And here is what I have for my new code (Not working):
<h:outputStylesheet library="resource:///com/testing/test/html/css/" name="style.xcss" />
I've tried various variations but none have worked.
I get a message saying RES_NOT_FOUND when using firebugs css tab.
Any ideas?
Thanks
<h:outputStylesheet library="resource:///com/testing/test/html/css/" name="style.xcss" />
will not work for one reason - the library name is not the location of the resource, rather it is used to determine the location of the resource.
The manner in which the JSF runtime serves resources is detailed in the JSF 2.0 specification in chapter 2 titled "Request Processing Lifecyle". Resource handling is performed outside the confines of the usual Execute and Render lifecyle of JSF (that is used to service View requests). At runtime, a ResourceHandler associated with the Application is responsible for serving Resource requests.
The ResourceHandler uses a path based approach for looking up requests. The default implementation allows for resources to be placed in two locations:
In the Web-Application Root. Resources with identifier have to be placed in the /resources directory under the Web Application root, as /resources/<resourceIdentifier>.
In the Classpath. Resources with identifier must be present in the Classpath under the META-INF/resources directory, again as META-INF/resources/<resourceIdentifier>. In a web application, I've noticed that the directory should be the Web Application Root/WEB-INF/classes/META-INF/resources directory or a META-INF/resources directory under one of the directories in the parent classloader(s), or even in a JAR present in the Classpath. Apparently, the last option is the one undertaken by JSF 2 libraries/frameworks like PrimeFaces.
The JSF specification also specifies how the <resourceIdentifier> may consist of locales, library versions and resource versions, apart from the resource name itself. This is dealt with in a concise manner, in the ResourceHandler API documentation:
Packaging Resources
ResourceHandler defines a path based packaging convention for
resources. The default implementation of ResourceHandler must support
packaging resources in the classpath or in the web application root.
See section JSF.2.6.1 of the spec prose document linked in the
overview summary for the normative specification of packaging
resources.
Briefly, The default implementation must support packaging resources
in the web application root under the path
resources/<resourceIdentifier>
relative to the web app root.
For the default implementation, resources packaged in the classpath
must reside under the JAR entry name
META-INF/resources/<resourceIdentifier>
consists of several segments, specified as
follows.
[localePrefix/][libraryName/][libraryVersion/]resourceName[/resourceVersion]
None of the segments in the resourceIdentifier may be relative paths,
such as ‘../otherLibraryName’. The implementation is not required to
support the libraryVersion and resourceVersion segments for the JAR
packaging case.
Note that resourceName is the only required segment.
Going by the above, the following may work:
<h:outputStylesheet library="com/testing/test/html/css" name="style.xcss" />
provided that the stylesheet style.xcss is present in the directory structure com/testing/test/html/css located in either of the two areas mentioned above. Going by your need to place it outside the context root, the only possible option would be Web Application Root/WEB-INF/classes/META-INF/resources or any of the other suitable directory/JAR in the classpath (containing a META-INF/resources directory. This is of course, assuming that RichFaces does not provide it's own implementation of a ResourceHandler; if it does provide one, you should be looking at how it extends the default implementation to allow for resources to be placed elsewhere.
In Mojarra, the com.sun.faces.application.resource.ResourceHandlerImpl class extends the ResourceHandler class. ResourceHanderImpl uses the com.sun.faces.application.resource.ResourceManager class for finding resources. In turn, the ResourceManager delegates the loading of resources to the com.sun.faces.application.resource.WebappResourceHelper and com.sun.faces.application.resource.ClasspathResourceHelper classes. As their names imply, the former is responsible for looking up resources in the Web Application root, while the former is responsible for loading resources from the classpath. Going through these classes, one would find that failed attempts to load libraries get logged in the server's log; the RES_NOT_FOUND value is not generated by these classes, rather it is due to the renderer responsible for generating the page output.

How to reuse Grails application's domain classes?

I have already create a Grails application. For some reasons I need to create another console application for someone to modify database data.
Is it possible to package Grails application as a JAR library, so that the console application can reuse those domain classes?
Or, I add/create some classes in Grails application and package it as a JAR and run as console application?
If no better answer, probably I will use the batch-launcher plugin to do that.
You can put the domain classes in a JAR and tell Grails that these are your domain classes by adding a Hibernate XML file (in grails-app/conf/hibernate) that refers to the classes in this JAR. You can use this JAR in any other Java/Groovy application, but obviously they'll only have the persistence methods (dynamic finders, save(), etc.) when used in a Grails app.

Is it possible to add Grails MVC classes at deployment time?

I'm writing a Grails app which I'd like 3rd parties to augment at runtime. Ideally they would be able to add a JAR/WAR to the webapp directory which contains new domain, controller and service classes, new views, and other content.
Is there a simple way to do this within grails? Would it be simplest to create a startup script which copies the new classes etc. into the relevant directories and then updates grails.xml and web.xml?
You will be able to do this in version 2 of grails in which plugins will be also OSGI plugins http://jira.codehaus.org/browse/GRAILS/fixforversion/15421
It seems that the Grails plugins will actually fit quite well for this: http://www.grails.org/Understanding+Plugins
A plugin can do just about anything... One thing a plugin cannot do though is modify the web-app/WEB-INF/web.xml or web-app/WEB-INF/applicationContext.xml files. A plugin can participate in web.xml generation, but not modify the file or provide a replacement. A plugin can NEVER change the applicationContext.xml file, but can provide runtime bean definitions

Resources