OpenSite/Reference/Commands/Extension commands

From BathAfrica Documentation
Revision as of 13:06, 29 October 2026 by BathAfrica (talk | contribs) (Publish Cursor documentation reconciled with OpenSite source 77c3fee; tests not rerun)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Review notice: Development documentation for OpenSite 0.0.1, source snapshot 77c3fee (Phase 13C). Reviewed against implementation on 29 October 2026. Tests and the Windows desktop were not rerun for this publication; this is not a released-product support claim.

Create an extension instance from a template, group it, relate it, and remove a member or an object.

Stable identifier
opensite.extension

Implementation milestone

Roadmap phase 7A.

Units

A template quantity is copied in canonical SI with the unit id stored on the field. A group membership is an object id. It is not a calculation input.

Terminal example

opensite-python --development-host --runtime <prefix>\runtime --plugins <plugins> examples\python\extension_platform.py

Python access

opensite.execute('extension.instantiate', {'document': document, 'template': 'sample_native.starter'})

Output

extension.instantiate and extension.create_group return object. extension.add_member and extension.remove_object return no fields.

Errors

command_unavailable when the template or type is not registered. duplicate_id when the member is already in the group. invalid_argument when a group would contain itself. A later document.save keeps the object. Phase 7A refused that save with extension_not_persistent. Phase 9 preserves the payload.

Limitations

These commands mutate the open document; call document.save to persist it. Plugin provider/type/schema and payload are preserved, including a read-only placeholder when the provider is unavailable. Group membership is not a calculation dependency. These are service commands, not automatic GUI-menu contributions.

Verification evidence

Repository evidence references (not rerun for this publication): CTest application.extension and python.development. The script is examples/python/extension_platform.py. docs/verification/Phase-7A-Acceptance.md.


The provider is opensite. Each command uses document.edit and one document transaction. The handler does not commit that transaction.

extension.instantiate
Required document handle and template id. Copies the template's input values into a new instance. Returns the object id.
extension.create_group
Required document handle. Optional label, default Group. Returns the group id. The group type is opensite.document.group.
extension.add_member
Required document handle, group id, and member id. A repeated member is duplicate_id. A group that would contain itself is invalid_argument.
extension.remove_member
Required document handle, group id, and member id. The member object stays in the document. A missing member is unknown_object.
extension.relate
Required document handle, source id, and target id. Optional label, default Relationship. Returns the relationship id. The two ids must differ. A relationship is not a calculation dependency.
extension.remove_object
Required document handle and object id. Removing a group leaves its members. Removing a member takes it out of groups and drops relationships that name it.


Documentation basis

Source-reviewed against development commit 77c3fee13944bcc4b5d487c77eb1f82fbe4c6ea7, branch feature/phase-13c-properties-python-expressions. This review inspected the implementation and repository evidence; it did not run the Windows application or repeat CTest.

  • src/cli/main.cpp
  • src/cli/document_commands.cpp
  • src/cli/preference_commands.cpp
  • src/application/builtins.cpp

OpenSite overview · Reference · Guides