Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free up action #23

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open

Free up action #23

wants to merge 20 commits into from

Conversation

vicding-mi
Copy link
Collaborator

This PR decouples the actions from the main package. After adoption of the package, extra actions can be invoked by adding particular actions to the config file

    <actions>
        <format match="prefix" value="http://www.clarin.eu/cmd/1">
...
            <action type="nl.knaw.huc.di.sd.HelloWorldAction" file="extra-actions.jar" />
            <action type="nl.mpi.oai.harvester.action.SplitAction" />
        </format>
    </actions>

The line <action type="nl.knaw.huc.di.sd.HelloWorldAction" file="extra-actions.jar" />, indicates a new action and informs where to get the jar contains the definition of it.

<action type="nl.mpi.oai.harvester.action.SplitAction" /> indicates that when there is no jar file given, the harvester will fall back to class path for action look up. The internal split action is used but called with its full qualified name.

The action JAR should implement, for example

package nl.knaw.huc.di.sd;


import nl.mpi.oai.harvester.action.Action;
import nl.mpi.oai.harvester.metadata.Metadata;

import java.util.List;

public class HelloWorldAction implements Action {
    @Override
    public boolean perform(List<Metadata> list) {
        System.out.println("Hello World! Performing!");
        return false;
    }

    @Override
    public Action clone() {
        System.out.println("Hello World! Cloning!");
        return null;
    }
}

@vicding-mi
Copy link
Collaborator Author

Almost accidentally removed the whole branch, merge the freed up action into dev first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants