Installing and Using Code Extensions (Custom Beans)
This comment was split from the discussion: Installing and Using Code Extensions (Custom Beans)
To get a feel for the process of using code extensions in Saffron I would like to deploy a minor modification to the HTMLParser. Given that I have it coded how might I do this?
Ultimately, the annotators I would like to deploy within Enterprise already extend classes. Rather than extending AbstractExtractorParser is there an interface I can implement?
Jamie
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Jim Fleming on 29 Apr, 2011 09:56 PM
Jamie, You need to put your code in a jar and add it to the smb/lib dir on the head node. You then need to add the bean definition to smb/conf/conf.d/global.xml (see smb/conf/SaffronEnterprise.xml for some examples). Then run 'rd' to sync it to the cluster. Restart your cluster and you should have the bean available in your space bean list to customize or use directly in you schema table.
There is an interface that you can implement but extending the class is much easier. Is there a reason why you don't want to extend the base class?
/Jim
3 Posted by Jamie Singer on 02 May, 2011 01:13 PM
The beans I want to deploy already extend 3rd-party classes. As for my bean class design, saffron interface implementation (is-a) is a possible approach, and aggregation (has-a) is the other.
I'd like to try both approaches in saffron.
Support Staff 4 Posted by Jim Fleming on 06 May, 2011 03:16 PM
Jamie, The interfaces are ResourceParser (interface to parse an entire resource) and ResourceElementParser (interface to parse a resource element: attribute or segment). They both extend an interface AttributeGenerator that declares the attribute categories that they create. I don't see that we published the JavaDocs for the last release, so let me do that now and I'll send you a link when they are posted.
Support Staff 5 Posted by Jim Fleming on 06 May, 2011 03:36 PM
Jamie, click on the "JavaDocs' link at the bottom of the release notes (see: http://docs.saffrontech.com/display/saffron2/Release+Notes) to download the JavaDocs.
Jim Fleming closed this discussion on 30 Sep, 2011 03:28 PM.