Creating qBits

Build and publish your own qBits

Overview

Package your extensions as qBits to share across projects or with the community.

qBit Structure

A qBit project follows this structure:

Text
my-qbit/
├── pom.xml
├── src/main/java/
│   └── com/mycompany/qbits/myqbit/
│       ├── MyQBitMetaDataProducer.java
│       ├── MyQBitConfig.java
│       └── ... implementation classes
├── src/main/resources/
│   └── META-INF/
│       └── qbit.json
└── README.md

qbit.json Manifest

Define qBit metadata:

JSON
{
  "name": "my-qbit",
  "version": "1.0.0",
  "description": "My custom qBit functionality",
  "category": "platform",
  "author": "My Company",
  "qqqVersion": ">=1.0.0",
  "dependencies": [],
  "settings": [
    {
      "name": "apiKey",
      "required": true,
      "secret": true
    }
  ]
}

MetaData Producer

Expose qBit metadata:

Java
public class MyQBitMetaDataProducer implements QBitMetaDataProducer {
    @Override
    public void produce(QInstance qInstance, QBitConfig config) {
        // Register tables, processes, widgets, etc.
        qInstance.addTable(new MyQBitTable().produce(qInstance));
        qInstance.addProcess(new MyQBitProcess().produce(qInstance));
    }
}

Publishing

Publish to Maven repository:

Bash
mvn deploy

For the public qBits catalog, submit a PR to the qBits registry.

Testing

Test qBits in isolation:

Java
@Test
void testQBitIntegration() {
    QInstance qInstance = new QInstance();
    new MyQBitMetaDataProducer().produce(qInstance, testConfig());
    
    assertNotNull(qInstance.getTable("myQbitTable"));
}

Next Steps

  • qBits Catalog - See existing qBits
  • Develop qBits - Development guide
  • Powered by qqq