GraphQL スキーマ

MintJams CMS のデータアクセスは GraphQL に集約されています。コンテンツ(JCR)、ワークスペース、クラスター、BPM、EIP を、ひとつの API から扱えます。

エンドポイントと呼び出し

POST /bin/graphql.cgi/<workspace>
GET  /bin/graphql.cgi/<workspace>?query=...
  • <workspace> は対象のワークスペース名(例: systemweb
  • 認証済みセッションが必要です(ゲストは拒否)
  • Content-Type: application/json、本文は標準の GraphQL リクエスト(query と任意の variables
  • レスポンスは { "data": ..., "errors": [...] }
  • Subscription は SSE(Server-Sent Events)で配信されます

クエリ(抜粋・ドメイン別)

コンテンツ(JCR)

  • node(path) — パスでノード取得
  • children(path, first, after) / references(path, ...) — 子・参照元の一覧
  • query(statement, language, ...) / xpath(query, ...) / search(text, path, ...) — 検索(JCR-SQL2 / XPath / 全文)
  • accessControl(path) / versionHistory(path) — ACL・バージョン履歴

ワークスペース / クラスター / アプリ

  • workspaces / cluster / apps(path, ...)

BPM

  • processDefinitions(...) / processInstances(...) / tasks(...) / taskCounts(...) / incidents(...)(および単体取得の processDefinition / processInstance / task / incident

EIP

  • camelContexts / routes(...) / components / routeTemplates / endpoints
  • routeStats(...) / historyExchanges(...) / historyExchange(exchangeId)

一覧クエリは Relay 形式の Connection(edges { node cursor } pageInfo { hasNextPage endCursor } totalCount)を返します。

ミューテーション(抜粋)

コンテンツ: createFolder / createFile / deleteNode / renameNode / setProperties / addMixin / deleteMixin / lockNode / unlockNode / setAccessControl / deleteAccessControl / checkin / checkout / restoreVersion

アップロード: initiateMultipartUpload / appendMultipartUploadChunk / completeMultipartUpload / abortMultipartUpload

ワークスペース: createWorkspace / deleteWorkspace(ジョブとして非同期実行)

BPM: startProcess / suspendProcessInstance / cancelProcessInstance / claimTask / assignTask / completeTask / setTaskVariables / deployProcess / setJobRetries / resolveIncident / migrateProcessInstance

EIP: startRoute / stopRoute / suspendRoute / resumeRoute / createRoute / updateRoute / deleteRoute / sendToEndpoint / startCamelContext

Subscription(SSE)

  • nodeChanged(path, deep) / queryChanged(statement, ...)
  • taskAssigned(assignee) / taskCompleted(processInstanceId) / processStarted(definitionKey) / processEnded(definitionKey)
  • routeStateChanged(routeId) / systemNotification

スカラーと主な列挙

  • スカラー: DateTimeLongJSONBase64
  • 列挙(抜粋): SortOrderWorkspaceStateONLINE/STARTING/FAILED)、TaskSortFieldRouteStateNodeEventTypeNotificationType

主な型

  • Nodepath / name / nodeType / uuid / 監査項目 / ファイル属性(mimeType / size / downloadUrl)/ ロック / properties / children / parent
  • PropertynamepropertyValue(型ごとの値のユニオン、スカラー/配列の 22 種)
  • PropertyInput / PropertyValueInputsetProperties 用。stringValue / longValue / dateValue / referenceValue などのいずれか 1 つ
  • Workspace / ProcessInstance / Task / Route / AccessControl — それぞれの状態・関連を保持

ノードの取得:

{
  node(path: "/content/page1") {
    path name nodeType modified
    properties { name propertyValue { __typename ... on StringPropertyValue { value } } }
  }
}

プロパティの更新:

mutation {
  setProperties(path: "/content/page1", properties: [
    { name: "title", value: { stringValue: "New Title" } },
    { name: "tags",  value: { stringArrayValue: ["a", "b"] } }
  ]) { node { path } errors { propertyName message } }
}

プロセスの開始:

mutation {
  startProcess(input: {
    definitionKey: "approvalProcess", businessKey: "DOC-12345",
    variables: [{ name: "amount", type: "Long", value: 10000 }]
  }) { id businessKey startTime }
}

データモデルの考え方は「JCR データモデル・Schema」を参照してください。