Skip to content

Commit

Permalink
Fix examples and annotations on Flux command implementations
Browse files Browse the repository at this point in the history
With the Flux validator in the Metafacture IDE, the `@In` and `@Out`
annotations on the Flux command implementation classes are processed
to check the workflows (see [1]). With the current Flux examples in
metafacture-core, the IDE reports some errors and warnings which
this commit fixes:

- Update morph-marc21.flux to use the new `encode-literals` command
- Fix `@In` and `@Out` annotations of `TripleCount`
- Add some missing `@In`, `@Out`, and `@Description` annotations

[1] culturegraph/metafacture-ide#23
  • Loading branch information
fsteeg committed Jun 13, 2013
1 parent 205a527 commit d624acb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/morph/morph-marc21.flux
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ open-file|
as-lines|
decode-marc21|
morph(FLUX_DIR + "morph-marc21.xml")|
encode("literals")|
encode-literals|
write("stdout");
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import org.culturegraph.mf.exceptions.FormatException;
import org.culturegraph.mf.framework.DefaultObjectPipe;
import org.culturegraph.mf.framework.StreamReceiver;
import org.culturegraph.mf.framework.annotations.Description;
import org.culturegraph.mf.framework.annotations.In;
import org.culturegraph.mf.framework.annotations.Out;


/**
Expand All @@ -31,6 +34,9 @@
* @author Markus Michael Geipel, Christoph Böhme
*
*/
@Description("Parses a raw Mab2 stream (UTF-8 encoding expected).")
@In(String.class)
@Out(StreamReceiver.class)
public final class MabDecoder
extends DefaultObjectPipe<String, StreamReceiver> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import org.culturegraph.mf.exceptions.FormatException;
import org.culturegraph.mf.framework.DefaultObjectPipe;
import org.culturegraph.mf.framework.StreamReceiver;
import org.culturegraph.mf.framework.annotations.Description;
import org.culturegraph.mf.framework.annotations.In;
import org.culturegraph.mf.framework.annotations.Out;
import org.culturegraph.mf.stream.converter.IllegalEncodingException;


Expand All @@ -31,6 +34,9 @@
*
* @author Markus Michael Geipel, Christoph Böhme
*/
@Description("Parses a raw Marc string (UTF-8 encoding expected).")
@In(String.class)
@Out(StreamReceiver.class)
public final class MarcDecoder
extends DefaultObjectPipe<String, StreamReceiver> {

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/culturegraph/mf/stream/pipe/ObjectTee.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import org.culturegraph.mf.framework.DefaultTee;
import org.culturegraph.mf.framework.ObjectPipe;
import org.culturegraph.mf.framework.ObjectReceiver;
import org.culturegraph.mf.framework.annotations.Description;
import org.culturegraph.mf.framework.annotations.In;
import org.culturegraph.mf.framework.annotations.Out;

/**
* Sends an object to more than one receiver.
Expand All @@ -27,6 +30,9 @@
* @author Christoph Böhme
*
*/
@Description("Sends an object to more than one receiver.")
@In(Object.class)
@Out(Object.class)
public final class ObjectTee<T> extends DefaultTee<ObjectReceiver<T>>
implements ObjectPipe<T, ObjectReceiver<T>> {

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/culturegraph/mf/stream/pipe/StreamTee.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@
import org.culturegraph.mf.framework.DefaultTee;
import org.culturegraph.mf.framework.StreamPipe;
import org.culturegraph.mf.framework.StreamReceiver;
import org.culturegraph.mf.framework.annotations.Description;
import org.culturegraph.mf.framework.annotations.In;
import org.culturegraph.mf.framework.annotations.Out;

/**
* Replicates an event stream to an arbitrary number of {@link StreamReceiver}s.
*
* @author Christoph Böhme, Markus Michael Geipel
*
*/
@Description("Replicates an event stream to an arbitrary number of stream receivers.")
@In(StreamReceiver.class)
@Out(StreamReceiver.class)
public final class StreamTee extends DefaultTee<StreamReceiver>
implements StreamPipe<StreamReceiver> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
*
*/
@Description("Counts triples")
@In(NamedValue.class)
@Out(NamedValue.class)
@In(Triple.class)
@Out(Triple.class)
public final class TripleCount extends AbstractTripleSort {

public static final String DEFAULT_COUNTP_REDICATE = "count";
Expand Down

0 comments on commit d624acb

Please sign in to comment.