Enterprise Integration Zone is brought to you in partnership with:

Ross founded the open source Mule® project in 2003. Frustrated by integration "donkey work," he set out to create a new platform that emphasized ease of development and re-use of components. He started the Mule project to bring a modern approach, one of assembly, rather than repetitive coding, to developers worldwide. He is now the Founder and CTO of Mulesoft. Ross is a DZone MVB and is not an employee of DZone and has posted 97 posts at DZone. You can read more from them at their website. View Full User Profile

Change the Studio Category of your DevKit Component

  • submit to reddit

Anyone that has used to write a Mule extension and then wanted to add it to Studio, may have notice that the extension will appear under the Cloud Connectors category in the palette. This is not a problem when the extension is actually a Cloud Connector, but is sort of a problem when it was something else (for example a component like the LDAP connector). This is not an issue anymore since DevKit 3.3.2, as you can now use the @Category annotation at class definition level (Connector or Module) to select under which category you want your extension to be listed in:

@Connector(name = "ldap", schemaVersion = "3.4", friendlyName="LDAP", minMuleVersion="3.4", description="LDAP Connector that allows you to connect to any LDAP server and perform every LDAP operation")
@Category(name = "org.mule.tooling.category.core", description = "Components")
public class LDAPConnector

It is important to mention that:

  • You can only add the connector to one of the existing Studio categories (this means you cannot define your own category)
  • The values for name and description attributes of @Category need to have specific values (please don’t be creative), as shown in the following list:
    • Endpoints: org.mule.tooling.category.endpoints
    • Scopes: org.mule.tooling.category.scopes
    • Components: org.mule.tooling.category.core
    • Transformers: org.mule.tooling.category.transformers
    • Filters: org.mule.tooling.category.filters
    • Flow Control: org.mule.tooling.category.flowControl
    • Error Handling: org.mule.tooling.ui.modules.core.exceptions
    • Cloud Connectors (DEFAULT): org.mule.tooling.category.cloudconnector
    • Miscellaneous: org.mule.tooling.ui.modules.core.miscellaneous
    • Security: org.mule.tooling.category.security

Too ‘meh’ to build the category annotation yourself? Just copy/paste from the following gist:

import org.mule.api.annotations.Category;

// Endpoint
@Category(name = "org.mule.tooling.category.endpoints", description = "Endpoints")

// Scope
@Category(name = "org.mule.tooling.category.scopes", description = "Scopes")

// Component
@Category(name = "org.mule.tooling.category.core", description = "Components")

// Transformer
@Category(name = "org.mule.tooling.category.transformers", description = "Transformers")

// Filters
@Category(name = "org.mule.tooling.category.filters", description = "Filters")

// Flow Control
@Category(name = "org.mule.tooling.category.flowControl", description = "Flow Control")

// Error Handling
@Category(name = "org.mule.tooling.ui.modules.core.exceptions", description = "Error Handling")

// Cloud Connectors
@Category(name = "org.mule.tooling.category.cloudconnector", description = "Cloud Connectors")

// Miscellaneous
@Category(name = "org.mule.tooling.ui.modules.core.miscellaneous", description = "Miscellaneous")

// Security
@Category(name = "org.mule.tooling.category.security", description = "Security")

Hope this tip helps you place your Mule extensions under the right Studio category.

Related posts:

  1. Mule School: Invoking component methods using Entry Point Resolvers
  2. Mule Component Bindings
  3. Extending Mule with DevKit – the LDAPConnector
  4. Mule School: Invoking Java Component over HTTP


Published at DZone with permission of Ross Mason, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)