Component Examples
This page demonstrates all custom components available in the MuleSoft Forge documentation. These components enable rich, interactive documentation that mirrors the functionality previously provided by GitBook.
Hint Component
The Hint component creates callout boxes for important information, tips, warnings, and errors. Use these to draw attention to critical information in your documentation.
Success Hints
Use success hints to confirm successful operations or indicate positive outcomes.
Info Hints
Use info hints for general information, tips, or additional context.
Warning Hints
Use warning hints to alert users about potential issues or important considerations.
Danger Hints
Use danger hints for critical information, errors, or actions that cannot be undone.
Tabs Component
The Tabs component allows you to present multiple code examples or platform-specific instructions in an organized, space-efficient way.
Basic Example
Here's how to configure a connection in different programming approaches:
@Configuration
public class MuleConfig {
@Bean
public ConnectionProvider getConnectionProvider() {
return new ConnectionProvider()
.withHost("api.example.com")
.withPort(443)
.withUsername("admin");
}
}Multi-Language Code Example
Platform-specific implementations for the same functionality:
public class DocumentProcessor {
public Document extractText(InputStream input) {
PDFTextExtractor extractor = new PDFTextExtractor();
String text = extractor.extract(input);
return new Document(text);
}
}Stepper Component
The Stepper component creates sequential, numbered step-by-step instructions for workflows and tutorials.
Basic Workflow Example
Install the Connector
<dependency>
<groupId>com.mulesoft.connectors</groupId>
<artifactId>mule-idp-connector</artifactId>
<version>1.0.0</version>
<classifier>mule-plugin</classifier>
</dependency>Run mvn clean install to download and install the connector.
Configure Global Connection
<idp:config name="IDP_Config">
<idp:connection
apiKey="${secure::idp.apiKey}"
endpoint="https://api.idp-service.com" />
</idp:config>Add Connector Operation
<flow name="documentProcessingFlow">
<http:listener path="/process" config-ref="HTTP_Config" />
<idp:extract-document config-ref="IDP_Config">
<idp:document>#[payload]</idp:document>
</idp:extract-document>
<logger level="INFO" message="#[payload]" />
</flow>Test Your Flow
curl -X POST http://localhost:8081/process \
-H "Content-Type: application/pdf" \
--data-binary "@sample-document.pdf"Advanced Deployment Workflow
Prepare Application
mvn clean test
mvn packageVerify the generated JAR file exists in the target directory.
Configure CloudHub Properties
# CloudHub Deployment Configuration
cloudhub.environment=production
cloudhub.region=us-east-1
cloudhub.workerType=MICRO
cloudhub.workers=1Deploy to CloudHub
mvn deploy -DmuleDeploy \
-Dcloudhub.environment=production \
-Dcloudhub.workerType=SMALLVerify Deployment
Once deployed:
- Check application logs for errors
- Verify health check endpoints respond correctly
- Test API endpoints with sample requests
- Monitor application metrics and performance
Combined Components Example
Here's a real-world scenario combining multiple components:
Troubleshooting Guide
Identify the Issue
- Navigate to Runtime Manager
- Select your application
- Click on "Logs" tab
- Filter by "ERROR" level
Analyze Error Pattern
Apply Fix and Redeploy
mvn clean package deploy -DmuleDeployUsage Guidelines
When to Use Each Component
- Hint (Success): Confirmations, successful completions, positive outcomes
- Hint (Info): Additional context, tips, non-critical information
- Hint (Warning): Cautions, important considerations, potential issues
- Hint (Danger): Errors, critical warnings, irreversible actions
- Tabs: Multi-platform code examples, alternative approaches, language-specific implementations
- Stepper: Sequential tutorials, installation guides, deployment workflows, troubleshooting procedures
Best Practices
- Keep hints concise - One or two sentences is ideal
- Use appropriate hint types - Match the severity to the content
- Organize tabs logically - Put the most common option first
- Make steps actionable - Each step should have a clear objective
- Combine components thoughtfully - Use hints within steps to highlight important details
These components form the foundation of rich, interactive documentation for MuleSoft Forge connectors. Use them to create engaging, professional documentation that helps users succeed.
