Customize Component
Connector Icon and Category
-
Find an Icon:
- Search for a suitable user interface icon for your component in
.svg
format.
- Search for a suitable user interface icon for your component in
-
Save the Icon:
- Place the icon in the following directory:
server/libs/modules/components/newcomponent/src/main/resources/assets/newcomponent.svg
.
- Place the icon in the following directory:
-
Choose a Category:
- Select a category for your component. Available categories can be found in ComponentCategory.
-
Update Component Handler:
- In
NewComponentComponentHandler
, override themodifyComponent(ModifiableComponentDefinition modifiableComponentDefinition)
method:@Overridepublic ModifiableComponentDefinition modifyComponent(ModifiableComponentDefinition modifiableComponentDefinition) {return modifiableComponentDefinition.icon("path:assets/newcomponent.svg").categories(ComponentCategory.HELPERS);}
- In
Connection
If your component requires custom authentication parameters, override the modifyConnection(ModifiableConnectionDefinition modifiableConnectionDefinition)
method in NewComponentComponentHandler
.
Refer to examples like ShopifyComponentHandler
, DiscordComponentHandler
, or PipelinerComponentHandler
for guidance.
Action
If some actions require properties not specified in the OpenAPI schema, override the modifyActions(ModifiableActionDefinition... actionDefinitions)
method in NewComponentComponentHandler
.
Refer to examples like DiscordComponentHandler
or ClickupComponentHandler
.
Dynamic Options
- Define Dynamic Options in OpenAPI Schema:
- Add
x-dynamic-options: true
to the parameter in your OpenAPI schema to indicate that it requires dynamic options. - If the dynamic options depend on another parameter, include
x-dynamic-options-dependency
with the relevant parameter name.
- Add
- Regenerate the Component:
- Run the following command to regenerate the component with updated dynamic options:
Terminal window ./bytechef.sh component init --open-api-path ../../server/libs/modules/components/newcomponent/openapi.yaml --output-path ../../server/libs/modules/components --name newcomponent
- Run the following command to regenerate the component with updated dynamic options:
- For each parameter with dynamic
options
, the options() andoptionsLookupDependsOn()
methods are automatically generated in theModifiableActionDefinition
class. - The
AbstractNewComponentUtils
class is generated, providing methods to retrieve dynamic options for various properties within the component. - Override the appropriate method in the
NewComponentUtils
class to load the correct options based on your specific requirements.
For implementation details, refer to examples from existing components such as Shopify
, Airtable
, and Hubspot
.
Dynamic Properties
- Define Dynamic Properties in OpenAPI Schema:
- Add
x-dynamic-properties: true
to the parameter in your OpenAPI schema to mark it as dynamic. - If the dynamic property depends on another parameter, include
x-dynamic-properties-dependency
with the relevant parameter name.
- Add
- Regenerate the Component:
- Run the following command to regenerate the component with updated dynamic options:
Terminal window ./bytechef.sh component init --open-api-path ../../server/libs/modules/components/newcomponent/openapi.yaml --output-path ../../server/libs/modules/components --name newcomponent
- Run the following command to regenerate the component with updated dynamic options:
- For each dynamic property, the
properties()
andpropertiesLookupDependsOn()
methods are generated in theModifiableActionDefinition
class. - The
AbstractNewComponentUtils
class is generated, offering methods to retrieve dynamic properties for various parameters within the component. - Override the necessary method in the
NewComponentUtils
class to load the correct properties based on your specific needs.
For implementation details, refer to examples from existing components such as Airtable
.