Skip to content
Permalink
Browse files
Merge pull request #851 from nadment/HOP-2936
HOP-2936 Add help button on metadata dialog
  • Loading branch information
hansva committed Jun 4, 2021
2 parents 9b97012 + 495d8e4 commit c3020fee921b55bb16b15acf7bfd3c8b6e79bd59
Showing 20 changed files with 57 additions and 20 deletions.
@@ -64,7 +64,9 @@
key = "rdbms",
name = "Relational Database Connection",
description = "This contains all the metadata needed to connect to a relational database",
image = "ui/images/database.svg")
image = "ui/images/database.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/pipeline-run-config.html"
)
public class DatabaseMeta extends HopMetadataBase implements Cloneable, IHopMetadata {
private static final Class<?> PKG = Database.class; // For Translator

@@ -39,4 +39,6 @@
String description() default "";

String image() default "ui/images/folder.svg";

String documentationUrl() default "";
}
@@ -90,7 +90,7 @@ protected void addExtraClasses( Map<Class<?>, String> classMap, Class<?> clazz,

@Override
protected String extractDocumentationUrl( HopMetadata annotation ) {
return null;
return annotation.documentationUrl();
}

@Override
@@ -37,7 +37,8 @@
key = "partition",
name = "Partition Schema",
description = "Describes a partition schema",
image = "ui/images/partition_schema.svg"
image = "ui/images/partition_schema.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/partition-schema.html"
)
public class PartitionSchema extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -32,7 +32,8 @@
key = "pipeline-run-configuration",
name = "Pipeline Run Configuration",
description = "Describes how and with which engine a pipeline is to be executed",
image = "ui/images/pipeline_run_config.svg"
image = "ui/images/pipeline_run_config.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/pipeline-run-config.html"
)
public class PipelineRunConfiguration extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -96,7 +96,8 @@
key = "server",
name = "Hop Server",
description = "Defines a Hop Hop Server",
image = "ui/images/server.svg"
image = "ui/images/server.svg",
documentationUrl = "https://hop.apache.org/manual/latest/metadata-types/hop-server.html"
)
public class HopServer extends HopMetadataBase implements Cloneable, IXml, IHopMetadata {
private static final Class<?> PKG = HopServer.class; // For Translator
@@ -27,7 +27,8 @@
key = "workflow-run-configuration",
name = "Workflow Run Configuration",
description = "Describes how to execute a workflow",
image = "ui/images/workflow_run_config.svg"
image = "ui/images/workflow_run_config.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/workflow-run-config.html"
)
public class WorkflowRunConfiguration extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -27,7 +27,9 @@
key = "web-service",
name = "Web Service",
description = "Allows you to run a pipeline to generate output for a servlet on Hop Server",
image = "ui/images/server.svg")
image = "ui/images/server.svg",
documentationUrl = "https://hop.apache.org/manual/latest/metadata-types/web-service.html"
)
public class WebService extends HopMetadataBase implements IHopMetadata {

@HopMetadataProperty private boolean enabled;
@@ -36,7 +36,8 @@
key = "file-definition",
name = "Beam File Definition",
description = "Describes a file layout in a Beam pipeline",
image = "ui/images/folder.svg"
image = "ui/images/folder.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/beam-file-definition.html"
)
public class FileDefinition extends HopMetadataBase implements Serializable, IHopMetadata {

@@ -27,7 +27,9 @@
key = "pipeline-log",
name = "Pipeline Log",
description = "This metadata object type allows you to log activity of a pipeline with another pipeline",
image = "pipeline-log.svg")
image = "pipeline-log.svg",
documentationUrl = "https://hop.apache.org/manual/latest/metadata-types/pipeline-log.html"
)
public class PipelineLog extends HopMetadataBase implements IHopMetadata {

@HopMetadataProperty private boolean enabled;
@@ -30,7 +30,8 @@
key = "pipeline-probe",
name = "Pipeline Probe",
description = "This allows you to stream output rows of a transform to another pipeline",
image = "probe.svg")
image = "probe.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/pipeline-probe.html")
public class PipelineProbe extends HopMetadataBase implements IHopMetadata {

@HopMetadataProperty private boolean enabled;
@@ -27,7 +27,8 @@
key = "workflow-log",
name = "Workflow Log",
description = "This metadata object type allows you to log activity of a workflow with a pipeline",
image = "workflow-log.svg")
image = "workflow-log.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/workflow-log.html")
public class WorkflowLog extends HopMetadataBase implements IHopMetadata {

@HopMetadataProperty private boolean enabled;
@@ -41,7 +41,8 @@
key = "dataset",
name = "Data Set",
description = "This defines a data set, a static pre-defined collection of rows",
image = "dataset.svg"
image = "dataset.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/data-set.html"
)
public class DataSet extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -43,7 +43,8 @@
key = "cassandra-connection",
name = "Cassandra Connection",
description = "Describes a connection to a Cassandra cluster",
image = "Cassandra_logo.svg")
image = "Cassandra_logo.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/cassandra/cassandra-connection.html")
public class CassandraConnection extends HopMetadataBase implements IHopMetadata {

public static final String WIDGET_ID_HOSTNAME = "10000-hostname";
@@ -40,7 +40,8 @@
key = "neo4j-graph-model",
name = "Neo4j Graph Model",
description = "Description of the nodes, relationships, indexes... of a Neo4j graph",
image = "neo4j_logo.svg")
image = "neo4j_logo.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/neo4j/neo4j-graphmodel.html")
public class GraphModel extends HopMetadataBase implements IHopMetadata {

@HopMetadataProperty protected String description;
@@ -53,7 +53,8 @@
key = "neo4j-connection",
name = "Neo4j Connection",
description = "A shared connection to a Neo4j server",
image = "neo4j_logo.svg")
image = "neo4j_logo.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/neo4j/neo4j-connection.html")
public class NeoConnection extends HopMetadataBase implements IHopMetadata {

@HopMetadataProperty private String server;
@@ -42,7 +42,8 @@
key = "mongodb-connection",
name = "MongoDB Connection",
description = "Describes a MongoDB connection",
image = "MongoDB_Leaf_FullColor_RGB.svg")
image = "MongoDB_Leaf_FullColor_RGB.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/mongodb-connection.html")
public class MongoDbConnection extends HopMetadataBase implements IHopMetadata {

public static final String WIDGET_ID_HOSTNAME = "10000-hostname";
@@ -33,7 +33,8 @@
key = "splunk",
name = "Splunk Connection",
description = "This metadata type describes how you can connect to Splunk",
image = "splunk.svg")
image = "splunk.svg",
documentationUrl="https://hop.apache.org/manual/latest/metadata-types/splunk-connection.html")
public class SplunkConnection extends HopMetadataBase implements Cloneable, IHopMetadata {

@HopMetadataProperty private String hostname;
@@ -25,15 +25,19 @@
import org.apache.hop.core.exception.HopException;
import org.apache.hop.core.extension.ExtensionPointHandler;
import org.apache.hop.core.extension.HopExtensionPoint;
import org.apache.hop.core.plugins.IPlugin;
import org.apache.hop.core.plugins.PluginRegistry;
import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.metadata.api.HopMetadata;
import org.apache.hop.metadata.api.IHopMetadata;
import org.apache.hop.metadata.api.IHopMetadataSerializer;
import org.apache.hop.metadata.plugin.MetadataPluginType;
import org.apache.hop.ui.core.ConstUi;
import org.apache.hop.ui.core.dialog.ErrorDialog;
import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.hopgui.HopGui;
import org.apache.hop.ui.hopgui.perspective.metadata.MetadataPerspective;
import org.apache.hop.ui.util.HelpUtils;
import org.apache.hop.ui.util.SwtSvgImageUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
@@ -102,6 +106,12 @@ public Button[] createButtonsForButtonBar(final Composite parent) {
return null;
}

protected Button createHelpButton(final Shell shell) {
HopMetadata annotation = manager.getManagedClass().getAnnotation(HopMetadata.class);
IPlugin plugin = PluginRegistry.getInstance().getPlugin(MetadataPluginType.class, annotation.key());
return HelpUtils.createHelpButton(shell, HelpUtils.getHelpDialogTitle(plugin), plugin);
}

public HopGui getHopGui() {
return hopGui;
}
@@ -29,8 +29,6 @@
import org.apache.hop.ui.core.gui.WindowProperty;
import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
@@ -72,7 +70,7 @@ public String open() {
Button wCancel = new Button(shell, SWT.PUSH);
wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
wCancel.addListener(SWT.Selection, e -> cancel());

List<Button> buttons = new ArrayList<>();
buttons.add(wOk);
Button[] extras = editor.createButtonsForButtonBar(shell);
@@ -85,6 +83,14 @@ public String open() {
BaseTransformDialog.positionBottomButtons(
shell, buttons.toArray(new Button[0]), props.getMargin(), null);


Button wHelp = editor.createHelpButton(shell);
FormData fdHelp = new FormData();
fdHelp.bottom = new FormAttachment(100, 0);
fdHelp.left = new FormAttachment(0, 0);
wHelp.setLayoutData(fdHelp);


// Create editor content area
Composite area = new Composite(shell, SWT.NONE);
FormLayout layout = new FormLayout();

0 comments on commit c3020fe

Please sign in to comment.