Tuesday 9 November 2010

jasperreports checksum issue with maven

The link to jasperreport jar broke my build over the weekend



Seems there is some monkey business going on at jaspersoft. See here and here for details.

Quick Solution is to just add this repo setting to your pom

  
      jaspersoft
        http://www.jasperforge.org/maven2
        
          false
         
         
            false
         
  

Thursday 21 October 2010

insertClob

/**
  * http://www.coderanch.com/t/295768/JDBC/java/inserting-large-file-CLOB-Oracle
  * @param clob
  * @param value
  * @throws Exception
  */
 public void insertClob(oracle.sql.CLOB clob, String value) throws Exception {
  try {
   OutputStream outstream = clob.getAsciiOutputStream();
   outstream.flush();
   outstream.write(value.getBytes());
   outstream.close();
  } catch (Exception e) {
   e.printStackTrace();
  }
 }

Wednesday 15 September 2010

FCKEditor background color

An issue with the FCKeditor is that if you chance the background color for your main site, the editor background also changes, which makes editing a pain.

http://www.glfusion.org/forum/viewtopic.php?showtopic=30761

First find and edit

/public_html/fckeditor/fckconfig.js

Originally

FCKConfig.EditorAreaStyles = 'body { color:#000;margin-bottom:30px;} h1 {background:transparent;color:#000;font-size:1.4em;font-weight:700;margin:0 5px 0 0;} ul { list-style-position:outside;margin-left:5px;padding-left:15px;list-style:disc;vertical-align:middle;}' ;

Change to ( background:#FFFFFF ) is the main item

FCKConfig.EditorAreaStyles = 'body { background:#ffffff;margin-bottom:30px;} h1 {background:transparent;color:#000;font-size:1.4em;font-weight:700;margin:0 5px 0 0;} ul { list-style-position:outside;margin-left:5px;padding-left:15px;list-style:disc;vertical-align:middle;}' ;

The drupal boys also have some notes

http://drupal.org/node/204242

Friday 3 September 2010

JPA 1.0 Spring Context for an Embedded Derby DB




          
 
  
  
 
 
 
  
   
    create
    org.hibernate.dialect.DerbyDialect
    true 'T', false 'F'
    true
    5
    20
    600
    50
    false
   
  
 
  




    
    


          
          

          
               
                    
                    
                    
                    
               
          

          
               
                    
                    
                    
                                                
               
          

          
               
          

    
    
     
       
       
     

    
    
    
        
    
    
                    com.xx.xx.common.index.entity.CellEntity
                  


com.xx.xx.common.index.entity.APNEntity






CELL



APN





















the associated persistence.xml

 
    

Wednesday 1 September 2010

Add RestFB jars to maven

First download the restfb api and run the following maven command from the extracted dir.

mvn install:install-file -Dfile=restfb-1.5.3.jar 
-DgroupId=com.restfb -DartifactId=restfb -Dversion=1.5.3 -Dpackaging=jar -DgeneratePom=true

this installs the jar in your local mvn repo, and then add the following dependency to your pom


  com.restfb
  restfb
  1.5.3

Monday 23 August 2010

Google AppEngine 1.3.6 AND Maven

Install Google AppEngine 1.3.6 locally and then then use the following commands to register the various jars in your local maven repo.

mvn install:install-file -Dfile=lib/appengine-tools-api.jar -DgroupId=com.google -DartifactId=appengine-tools -Dversion=1.3.6 -Dpackaging=jar -DgeneratePom=true

mvn install:install-file -Dfile=lib/shared/appengine-local-runtime-shared.jar -DgroupId=com.google -DartifactId=appengine-local-runtime-shared -Dversion=1.3.6 -Dpackaging=jar -DgeneratePom=true

mvn install:install-file -Dfile=lib/user/appengine-api-1.0-sdk-1.3.6.jar -DgroupId=com.google -DartifactId=appengine-sdk-1.3.6-api -Dversion=1.3.6 -Dpackaging=jar -DgeneratePom=true

mvn install:install-file -Dfile=lib/user/orm/datanucleus-appengine-1.0.7.final.jar -DgroupId=org.datanucleus -DartifactId=datanucleus-appengine -Dversion=1.0.7.final -Dpackaging=jar -DgeneratePom=true

mvn install:install-file -Dfile=lib/shared/appengine-local-runtime-shared.jar -DgroupId=com.google -DartifactId=appengine-local-runtime-shared -Dversion=1.3.6 -Dpackaging=jar -DgeneratePom=true

mvn install:install-file -Dfile=lib/shared/jsp/repackaged-appengine-commons-logging-1.1.1.jar -DgroupId=com.google -DartifactId=repackaged-commons-logging -Dversion=1.1.1 -Dpackaging=jar -DgeneratePom=true

This is summary of posts from

http://twelves.blogspot.com/2009/04/google-appengine-maven-pom.html

http://shal.in/post/285908979/google-app-engine-and-maven

Wednesday 28 July 2010

Flickj API Examples

Use google code search to find current sample code.

http://www.google.com/codesearch?q=file:java+%22com.aetrion.flickr.Flickr%22&hl=en&btnG=Search+Code

Adding Flickrj 1.2 to maven

First download Flickrj and install locacally.

run this command from the install dir

mvn install:install-file 
-Dfile=flickrapi-1.2.jar 
-DgroupId=com.aetrion.flickr 
-DartifactId=flickrapi 
-Dversion=1.2 
-Dpackaging=jar

to reference the artifact in your pom add


com.aetrion.flickr
flickrapi
1.2

Thursday 3 June 2010

ANT - List all images with regex pattern

 



















${prop.dist.contents}

Sunday 2 May 2010

Stockholm Medal


Thursday 29 April 2010

ZFDataGrid table width?

Friday 26 March 2010

BHAA Results with Embedded IFrame

For the moment, we can just embed an iframe for each year.
- Polish the url links to open specific race results in a new tab.

Long term we migrate the results into the DB.

Eclipse Junit -EA Config Option?

Thursday 25 March 2010

Thursday 11 March 2010

org.jboss.tm.TransactionPropagationContextUtil

JBOSS 5.1.0 GA add jboss-integration.jar to the classpath

org.jboss.security.plugins.JBossSecurityContext

You need to add jbosssx-client.jar to your classpath

Monday 15 February 2010

Find class in jar unix script

Unix script to search for a class or package name in a set of jars. Handy for debugging ClassNotFoundExceptions


#!/bin/sh

JARDIR=$1
CLASS=$2
echo "Looking for class name `$CLASS` in directory $JARDIR"

for i in `find $JARDIR -name "*jar"`
do
echo "Looking in $i ..."
jar tvf $i | grep $CLASS
done


Create an alias


alias findinjars='~/poconnell/tools/scripts/findinjars.sh'

Sunday 10 January 2010

Flot - with x-axis ticks