websIDE
  • webside
    • Overview
  • API
    • General
      • Dialect
      • Version
      • Colors
      • Logo
      • Stats
      • Themes
      • Icons
      • Save Image
    • Changes
      • Retrieve changes
      • Apply a change
    • Changesets
      • Convert chunks to JSON changes
      • Convert JSON changes to chunks
    • Code
      • Autocompletions
        • Retrieve autocompletions
      • Categories
        • Retrieve categories
        • Retrieve usual categories
      • Classes
        • Retrieve classes
        • Retrieve a class
        • Retrieve categories
        • Retrieve variables
        • Retrieve class variables
        • Retrieve instance variables
        • Retrieve selectors
        • Retrieve methods
        • Retrieve method
        • Retrieve method history
        • Retrieve subclasses
        • Retrieve superclasses
        • Retrieve used categories
      • Methods
        • Retrieve methods
      • Packages
        • Retrieve packages
        • Retrieve a package
        • Retrieve package classes
        • Retrieve package methods
      • Search
      • Selectors
        • Find selector in source code
      • Templates
        • Retrieve class template
        • Retrieve method template
    • Debuggers
      • Retrieve active debuggers
      • Create a debugger
      • Delete debugger
      • Retrieve debugger frames
      • Retrieve debugger frame
      • Retrieve frame bindings
      • Restart debugger
      • Resume debugger
      • Step into debugger
      • Step over debugger
      • Step through debugger
      • Terminate debugger
    • Evaluations
      • Retrieve evaluations
      • Evaluate an expression
      • Cancel evaluation
      • Retrieve evaluation
      • Pause evaluation
      • Resume evaluation
    • Extensions
      • Retrieve extensions
      • Changes extensions
      • Export extensions
      • Search extensions
    • Commands
      • Retrieve command definitions
      • Invoke commands
    • Objects
      • Retrieve pinned objects
      • Pin object
      • Retrieve pinned object
      • Retrieve pinned object slots
        • Custom views
      • Unpin an object
      • Unpin all objects
    • Processes
      • Retrieve active processes
    • Profilers
      • Retrieve active profilers
      • Create a new profiler
      • Delete a profiler
      • Retrieve a profiler
      • Retrieve profiler ranking results
      • Retrieve profiler tree results
    • Testing
      • Run tests
      • Retrieve test run status
      • Retrieve test run results
    • Workspaces
      • Retrieve active workspaces
      • Create a new workspace
      • Delete a workspace
      • Retrieve a workspace
      • Update a workspace
      • Retrieve workspace bindings
Powered by GitBook
On this page
  • Specification
  • Example
  • Get mechanism
  • Default file name
  1. API
  2. Extensions

Export extensions

PreviousChanges extensionsNextSearch extensions

Last updated 2 months ago

This type of extension allows us to retrieve an exportable version of a given meta-model object. Like other extensions, specifications retrieved from this endpoint will enlarge the list of options available on the IDE.

Specification

An export extension must be like this:

{
	"type": "export",
	"elementType": "string",
	"label": "string",
	"description": "string",
	"get": "string",
	"defaultFilename": "boolean",
	"section": "string"
}

Where:

  • type as these are export extensions this property is export.

  • get a string specifying the way the export content will be obtained (see below).

  • defaultFilename (optional) the default file name.

The rest of the basic properties are described .

Example

Lets suppose we want to add a "File out" option to classes and that we count on a URI for that (/classes/{classname}/exports/chunks for instance). We could specify our extension like this:

{
	"type": "export",
	"elementType": "class",
	"label": "File out",
	"get": "/classes/{element.name}/exports/chunks",
	"defaultFilename": "{element.name}.ch"
}

Get mechanism

As mentioned above, get specifies the way the IDE will get the actual contents to be exported. This could be an URI (if it begins with /) or an attribute of the target element.

In both cases, the value might contain {element.xxxx} expressions, where element represents the meta-model object for which the export is requested (most likely the object selected in IDE), and xxxx is an valid attribute for such element. This expression will be replaced by the actual value element's attribute. In the example, assuming the action was triggered from the class MyClass, the contents will be retrieved from the URI /classes/MyClass/exports/chunks.

Default file name

As in the case of get property, defaultFilename is a string that can contain zero or more expression of the form {element.xxxx} that will be replaced by their actual value.

In our example, the default file name will be MyClass.ch.

Assuming the payload of requesting /classes/MyClass/exports/chunks is the follwing:

Object subclass: #MyClass
	instanceVariableNames: ''
	classVariableNames: ''
	package: 'MyPackage'!

!MyClass methodsFor: 'as yet unclassified' stamp: 'guille 3/31/2024 16:34'!
myMethod
  ^1! !

A file dialog will be opened and once the user confirms a file name, such contents will be saved.

Valid attributes can be extracted from the corresponding endpoints in the documentation (, , , , ).

pacakges
classes
variables
categories
methods
here