Showing posts with label orbeon. Show all posts
Showing posts with label orbeon. Show all posts

Friday, July 18, 2008

XPath: First Weekday Following a Given Date

You are given a date d. If that date does not fall on a weekday, you would like to find the first weekday date that follows d. The following XPath code will do the trick:

for $start in xs:date('2008-07-19') return
(: Get date plus two following dates, i.e. candidate dates :)
(for $i in (0 to 2) return
$start + xs:dayTimeDuration(concat('P', $i, 'D')))
(: Only keep date on week dates :)
[number(format-date(., '[F0]', 'en', (), ())) le 5]
(: Take first possible date :)
[1]
In the above expression, the date (7/19/2008) is just provided as a string, so you can quickly test this, for instance in the XPath Sandbox. The expression uses the XSLT format-date() function to find the day of the week for a given date. Unfortunately this function is strictly speaking not an XPath function, but some engine will bend the rule and still expose it to you for convenience, as does Orbeon Forms.

You can also check if a given date is a weekday with:
number(format-date(xs:date('2008-08-26'),
'[F0]', 'en', (), ())) le 5

Wednesday, February 27, 2008

Installing BEA WebLogic on Mac OS X

WebLogic Server is not supported on Mac OS X, but you can still run WebLogic on Mac OS X and here is how. (Of course I wouldn't doing this in production, but doing this in development should be fine.)

  1. Download WebLogic Server listed in the Package Installer section. In the Select OS drop-down, choose IBM AIX. This will give you the WebLogic generic package.
  2. From the command line, run: java -Dos.name=unix -jar server922_generic.jar. Follow the wizard to complete the installation.
  3. Edit the file ~/bea/weblogic92/samples/domains/wl_server/bin/setDomainEnv.sh look for the line where the MEM_ARGS environment variable is set. Add this declaration: -XX:MaxPermSize=128m.
  4. Start WebLogic: ~/bea/weblogic92/samples/domains/wl_server/bin/startWebLogic.sh. Once the server is started you will see the following message on the console: Server started in RUNNING mode.
  5. Access your instance of WebLogic at http://localhost:7001/. You should see the WebLogic "getting started" page.
To deploy a web application (war file):
  1. Uncompress the war file in the directory where you would like the application to be deployed.
  2. Go to the WebLogic Administration Console from http://localhost:7001/console/. The default login/password is weblogic/weblogic.
  3. Click the Lock & Edit button (top left).
  4. Under Deployments select Install.
  5. Select the directory you created in #1. Two screens later, under Source accessibility, make sure you select the radio button I will make the deployment accessible from the following location. This way WebLogic won't copy your web application to its own private directory but will instead use directly the files in the directory you mentioned.
  6. Finish the deployment, save. Under Deployments, start the application.
  7. Access your application from http://localhost:7001/orbeon/, if orbeon was the name the directory you choose in step #5.
Once your application is running, you might want to monitor the following log files:
  • ~bea/weblogic92/samples/domains/wl_server/servers/examplesServer/logs/examplesServer.log - The main WebLogic log file.
  • bea/weblogic92/samples/domains/logs/orbeon.log - If the application you are deploying is Orbeon Forms, then this will be the location of the Orbeon Forms log file.
References:

Friday, November 09, 2007

Upgrading eXist in Orbeon Forms

Getting closer to a version 1.1.2, the eXist team has started releasing pre-release builds. Since those build are quite stable, we are looking into shipping Orbeon Forms with one of those builds. Of particular interest to us:

  • When sending a query using the REST API, with a GET, passing the query with the _query parameter, the response used to have an incorrect content type. The incorrect content type meant you could sent a query with GET from XForms in Orbeon Forms. You always had to use a POST, which in many cases is inconvenient.
  • You can now mount eXist though WebDAV on the Mac in read-write mode. (It previously used to work in read-only mode.)
  • New versions of eXist feature many performance improvements, sometimes quite drastic.
A few notes about the upgrade:
  • eXist now uses a number of new jar files: quartz-1.6.0.jar, jta.jar, commons-collections-3.1.jar, exist-ngram-module.jar, and stax-api-1.0.1.jar. That's quite a few jar files, and it increases the changes of incompatibilities with particular application servers.
  • eXist also uses an XML collection class from xercesImpl-2.9.1.jar. eXist looks for this class using the explicit package org.apache.xerces. Since Orbeon Forms uses a rerooted version of Xerces, eXist can't find this class. We might need to modify the eXist code for this. This is still open.
  • When starting eXist, we are getting a non-fatal exception: java.lang.IllegalStateException: error while returning XMLReader: org.exist.validation.resolver.eXistXMLCatalogResolver. This is still open.