Menu

2.1 Documentation?

Help
2013-02-13
2013-03-12
  • Scott R. Turner

    Scott R. Turner - 2013-02-13

    Is there any documentation available for 2.1? At least something that describes the changes in the configuration files?

     
    • Robert Bala

      Robert Bala - 2013-03-03

      Currently only the technical documentation (javadoc) is available for all new classes and those parts of the old code base that we have touched.
      As far as it comes about the configuration files there are almost no changes since 2.0 version. We have only finished what was started by Alex Wajda.
      I'll try to summarize major changes in news section for this project.

       
  • Scott R. Turner

    Scott R. Turner - 2013-03-05

    Thanks for the reply. Is there something that explains how to add a new plugin? It isn't obvious (at least to me!)

     
  • Piotr Dyraga

    Piotr Dyraga - 2013-03-05

    I believe that it's just like before - you have to extend org.webharvest.runtime.processors.WebHarvestPlugin and register your plugin. Registration has been simplified a little bit - now you need to put your plugin on classpath and annotate it with @Autoscanned & @TargetNamespace. For example:

    ~~~~~
    package org.webharvest.runtime.processors.plugins.db;

    // (imports & javadoc omitted)

    @Autoscanned
    @TargetNamespace({ "http://web-harvest.sourceforge.net/schema/2.1/jndi" })
    @Definition(value = "database", validAttributes = {
    DatabaseJNDIPlugin.JNDI_NAME_ATTRIBUTE })
    public final class DatabaseJNDIPlugin extends AbstractDatabasePlugin {

    /**
     * Name of XML attribute representing JNDI hook name.
     */
    public static final String JNDI_NAME_ATTRIBUTE = "name";
    
    @Inject
    @Named("jndi")
    private ConnectionFactory connectionFactory;
    
    /**
     * {@inheritDoc}
     */
    @Override
    protected Connection obtainConnection(final DynamicScopeContext context) {
        final String jndiHook = evaluateAttribute(JNDI_NAME_ATTRIBUTE, context);
        return connectionFactory.getConnection(jndiHook);
    }
    

    }
    ~~~~~~

     
    • Scott R. Turner

      Scott R. Turner - 2013-03-12

      I tried this using "SleepPlugin.java". I put the directory with the compiled class file in the classpath, started up WebHarvest and then tried to use <sleep>. I get an error

      cvc-complex-type.2.4.a:Invalid content was found starting with element 'sleep'

      followed by a long list of schemas. (BTW, that alert box is a bug!)

      Does this mean "sleep" needs to be defined in a schema file somewhere? Or it didn't get autoscanned?

       
  • Robert Bala

    Robert Bala - 2013-03-11

    Just a remark from my side.. The changes we did in 2.1 can be reassembled from closed tickets for this version as well from SVN commits history (we tend to write verbose comments). I know that it's not what someone could expect.

     

Log in to post a comment.