With a little side of applesauce...

Monday, July 28, 2008

cfinclude - mapping questions are over

Thanks to this blog entry:

my questions about cfinclude paths is over...

Tuesday, July 22, 2008

Coldfusion - print string representation of XML

Sometimes, you just don't want the graph representation of XML that is printed with cfdump...

The following prints a string representation of the first xmlElement from an OpenDocument Format file (content.xml):

<cfzip action="read" file="#path#" entrypath="content.xml" variable="xmlContent"> 

<cfset variables.content = xmlParse(variables.xmlContent)>

<!--- now, let's insert our information into the document (username, time/date, state, comments, title) --->
<cfset variables.text = xmlSearch(variables.content, "/office:document-content/office:body/office:text")>

<cfset x = #toString(variables.content.xmlRoot.XmlChildren[2].XmlChildren[1].XmlChildren[1])#>
<cfoutput>#HtmlEditFormat( x )#</cfoutput>


Friday, July 18, 2008

zoho - alternative to Google Docs

I just found this as an alternative to google docs. Interesting, but I wonder how it can compare to the integration of Google?

There is a MS Office synchronizer here, plus, the openoffice2googledocs extension will also sync with Zoho.

openOffice2GoogleDocs - java issues on Debian Sid (July 18 update)

I ran into issues getting ooo2gd to upload docs to Google Docs due to a Java issue on my Debian Sid. First, ooo2gd needs sun java 1.6, so:

apt-get install sun-java6-jdk (since I also program in java)


update-alternatives --config java

(possibly needed?)

update-java-alternatives -s java-6-sun

Now, on Debian, openoffice.org uses GCJ by default, so you will need to configure it to use sun java:


Sun Microsystems Inc. 1.6.0_07 (currently)

Save, then restart openoffice. Now when you try to upload a file to Google Docs, it will prompt you for configuration information.

Here is the related swing error that is blocking the configuration dialogue:

Exception in thread "Thread-68" java.lang.NoClassDefFoundError: org.openoffice.gdocs.ui.dialogs.ConfigDialog
at java.lang.Class.initializeClass(libgcj.so.90)
at org.openoffice.gdocs.GDocs$1.run(GDocs.java:173)
at java.lang.Thread.run(libgcj.so.90)
Caused by: java.lang.ClassNotFoundException: javax.swing.GroupLayout not found in com.sun.star.lib.unoloader.UnoClassLoader{urls=[file:/usr/lib/openoffice/program/classes/java_uno.jar,file:/usr/lib/openoffice/program/classes/juh.jar,file:/usr/lib/openoffice/program/classes/jurt.jar,file:/usr/lib/openoffice/program/classes/ridl.jar,file:/usr/lib/openoffice/program/classes/unoil.jar,file:/usr/lib/openoffice/program/classes/ScriptFramework.jar,file:/home/speeves/.openoffice.org2/user/uno_packages/cache/uno_packages/Z6rcbL_/gdocs-1.1.2.oxt/GDocs.jar], parent=java.net.URLClassLoader{urls=[file:/usr/lib/openoffice/program/classes/unoloader.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/java/bsh.jar,file:/usr/share/java/xml-apis.jar,file:/usr/share/java/xercesImpl.jar,file:/usr/share/java/xalan2.jar,file:/usr/share/java/serializer.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}}
at java.net.URLClassLoader.findClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.Class.forName(libgcj.so.90)
at java.lang.Class.initializeClass(libgcj.so.90)
...2 more

Monday, July 14, 2008

XML synopsis

Here is a nice synopsis of XML from "OASIS OpenDocument Essentials
Using OASIS OpenDocument XML":


Wednesday, July 9, 2008

CFLDAP - query differences

Interesting... If you specify the attributes to return:

cfldap name="example"

The query is an array. If you choose to return all attributes:

cfldap name="example"

The query is a dictionary, hash, (choose your nomenclature). It makes sense...

Tuesday, July 1, 2008

Coldfusion - sleep

lt;cfset thread = CreateObject("java", "java.lang.Thread")gt;
lt;cfset thread.sleep(5000)gt;