Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions assemblies/debug/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-naming</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-projects</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions assemblies/plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,12 @@
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-naming</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-passwords</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static synchronized void init() throws HopException {
init(
List.of(
LoggingPluginType.getInstance(),
org.apache.hop.core.naming.NamingSchemeTypePluginType.getInstance(),
ValueMetaPluginType.getInstance(),
DatabasePluginType.getInstance(),
ExtensionPointPluginType.getInstance(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
String CATEGORY_SERVER = "server";
String CATEGORY_DOC = "doc";
String CATEGORY_PYTHON = "python";
String CATEGORY_NAMING = "naming";

String id();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
documentationUrl = "/metadata-types/rdbms-connection.html",
hopMetadataPropertyType = HopMetadataPropertyType.RDBMS_CONNECTION,
supportsGlobalReplace = true)
@org.apache.hop.core.naming.NamingSchemeKind("hop-metadata")
public class DatabaseMeta extends HopMetadataBase implements Cloneable, IHopMetadata {
private static final Class<?> PKG = Database.class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public enum HopExtensionPoint {
AfterCheckTransforms("After a set of transforms has been checked for warnings/errors."),
BeforeCheckTransform("Right before a transform is about to be verified."),
AfterCheckTransform("After a transform has been checked for warnings/errors."),
AfterCheckActions("After a set of workflow actions has been checked for warnings/errors."),

HopServerInit("Right before the Hop server starts"),
HopServerStartup("Right after the Hop server has started and is fully functional"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hop.core.naming;

/**
* A kind of identifier that a {@code NamingScheme} can target (Hop field, transform, Data Vault
* hub, …). Implemented as a plugin so other plugins can add kinds without changing Hop core.
*/
public interface INamingSchemeType {

/** Stable code stored on schemes and annotations ({@code hop-field}, {@code dv-hub}). */
String getCode();

/** Human-readable label for combo boxes. */
String getName();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hop.core.naming;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Declares the naming-scheme kind of this type's identity {@code name} (including an inherited
* {@code HopMetadataBase.name}). Field-level {@code @HopMetadataProperty(namingSchemeType=...)}
* wins when both are present.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface NamingSchemeKind {

/** Type code such as {@code hop-transform} or {@code dv-hub}. */
String value();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hop.core.naming;

import org.apache.commons.lang3.StringUtils;

/** Helpers for {@link NamingSchemeKind} and field-level naming type codes. */
public final class NamingSchemeKinds {

private NamingSchemeKinds() {
// utility
}

/**
* @param type a class (may be null)
* @return the first {@link NamingSchemeKind} on the class or a superclass, or null
*/
public static String kindOf(Class<?> type) {
if (type == null) {
return null;
}
Class<?> cursor = type;
while (cursor != null && cursor != Object.class) {
NamingSchemeKind kind = cursor.getAnnotation(NamingSchemeKind.class);
if (kind != null && StringUtils.isNotEmpty(kind.value())) {
return kind.value();
}
cursor = cursor.getSuperclass();
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hop.core.naming;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/** Marks an {@link INamingSchemeType} implementation for the plugin registry. */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface NamingSchemeTypePlugin {

/** Plugin id and type code (for example {@code hop-field} or {@code dv-hub}). */
String id();

String name();

String description() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hop.core.naming;

import java.util.Map;
import org.apache.hop.core.plugins.BasePluginType;
import org.apache.hop.core.plugins.PluginAnnotationType;
import org.apache.hop.core.plugins.PluginMainClassType;

@PluginMainClassType(INamingSchemeType.class)
@PluginAnnotationType(NamingSchemeTypePlugin.class)
public class NamingSchemeTypePluginType extends BasePluginType<NamingSchemeTypePlugin> {

private static NamingSchemeTypePluginType pluginType;

private NamingSchemeTypePluginType() {
super(NamingSchemeTypePlugin.class, "NAMING_SCHEME_TYPE", "NamingSchemeType");
}

public static NamingSchemeTypePluginType getInstance() {
if (pluginType == null) {
pluginType = new NamingSchemeTypePluginType();
}
return pluginType;
}

@Override
protected String extractCategory(NamingSchemeTypePlugin annotation) {
return "";
}

@Override
protected String extractID(NamingSchemeTypePlugin annotation) {
return annotation.id();
}

@Override
protected String extractName(NamingSchemeTypePlugin annotation) {
return annotation.name();
}

@Override
protected String extractDesc(NamingSchemeTypePlugin annotation) {
return annotation.description();
}

@Override
protected String extractImageFile(NamingSchemeTypePlugin annotation) {
return null;
}

@Override
protected boolean extractSeparateClassLoader(NamingSchemeTypePlugin annotation) {
return false;
}

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, NamingSchemeTypePlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(NamingSchemeTypePlugin annotation) {
return null;
}

@Override
protected String extractCasesUrl(NamingSchemeTypePlugin annotation) {
return null;
}

@Override
protected String extractForumUrl(NamingSchemeTypePlugin annotation) {
return null;
}

@Override
protected String extractSuggestion(NamingSchemeTypePlugin annotation) {
return null;
}

@Override
protected String extractClassLoaderGroup(NamingSchemeTypePlugin annotation) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ Class<? extends IStringObjectConverter> injectionStringObjectConverter() default
*/
HopMetadataPropertyType hopMetadataPropertyType() default HopMetadataPropertyType.NONE;

/**
* Optional naming-scheme type code for this String field ({@code hop-field}, {@code
* hop-transform}, {@code dv-hub}, …). Empty means the field is not a name to validate. Does not
* replace {@link #hopMetadataPropertyType()}.
*/
String namingSchemeType() default "";

/**
* When serializing common objects sometimes we don't want to serialize every field. In this
* scenario you can specify the fields to serialize.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public enum HopMetadataPropertyType {
// STATIC SCHEMA
STATIC_SCHEMA_DEFINITION,

// NAMING
NAMING_SCHEME,

// VFS
VFS_GCP_CONNECTION,
VFS_AZURE_CONNECTION,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/hop-user-manual/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ under the License.
*** xref:metadata-types/variable-resolver/openbao-variable-resolver.adoc[OpenBAO variable resolver]
*** xref:metadata-types/variable-resolver/pipeline-variable-resolver.adoc[Pipeline variable resolver]
** xref:metadata-types/static-schema-definition.adoc[Static Schema Definition]
** xref:metadata-types/naming-scheme.adoc[Naming Scheme]
** xref:hop-server/web-service.adoc[Web Service]
** xref:metadata-types/webdav-connection.adoc[WebDAV Connection]
** xref:metadata-types/workflow-log.adoc[Workflow Log]
Expand Down
14 changes: 13 additions & 1 deletion docs/hop-user-manual/modules/ROOT/pages/hop-gui/shortcuts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ under the License.

= Hop Shortcuts

Shortcuts can now be found inside the application itself, In the setting perspective there is a tab named Keyboard Shortcuts that will give you an overview of the shortcuts and where to use them.
Most shortcuts can be found inside the application itself. In the Settings perspective there is a tab named Keyboard Shortcuts that lists global chords and where to use them.

Widget-local shortcuts (they apply to the focused field, not the whole window) are not listed there:

[options="header"]
|===
|Shortcut|Where|What it does
|`CTRL-SPACE`|`TextVar` / `ComboVar` that accept variables|Insert a `${variable}`
|`CTRL-SPACE`|Name fields that do *not* accept variables (transform/action/metadata names)|Apply a xref:metadata-types/naming-scheme.adoc[Naming Scheme] of the matching type
|`CTRL-SHIFT-N`|Any name field, field-name cell, table name, file/folder field, or F2 tree rename|List and apply a Naming Scheme. Replaces the current identifier (values that contain `${...}` are left unchanged)
|===

See xref:metadata-types/naming-scheme.adoc[Naming Scheme] for the *N* indicator, types, and the TableView bulk toolbar.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ xref:metadata-types/data-stream/data-stream.adoc[Data Stream]: A Data Stream can
* xref:metadata-types/mongodb-connection.adoc[MongoDB Connection]: Describes a MongoDB connection
* xref:metadata-types/mail-server-connection.adoc[Mail Server Connection]: Describes a mail server connection
* xref:metadata-types/minio-connection.adoc[Minio (S3) Connection]: Connect to one or more S3 endpoints using a Minio client
* xref:metadata-types/naming-scheme.adoc[Naming Scheme]: Reusable rules to normalize Hop field names, database identifiers, and file or folder names
* xref:metadata-types/webdav-connection.adoc[WebDAV Connection]: Named WebDAV or WebDAV-over-HTTPS endpoint used as a VFS scheme in file paths
* xref:metadata-types/neo4j/neo4j-connection.adoc[Neo4j Connection]: A shared connection to a Neo4j server
* xref:metadata-types/neo4j/neo4j-graphmodel.adoc[Neo4j Graph Model]: Description of the nodes, relationships, indexes, ... of a Neo4j graph
Expand Down
Loading
Loading