Skip to content

Allow a plugin to provide (read-only) scripts through an extension point #82

@jbsarrodie

Description

@jbsarrodie

As more and more people use jArchi, it now become important in enterprise contexts to be able to harmonize scripts that are deployed on each Archi setup. For the moment this is usually done by making those "standard" scripts available in some places, relying on people to copy them locally. Some also use git to do this.

These approaches have several drawbacks: its hard to know which version of the scripts are installed locally, and users can mess things up if they edit those scripts.

Would it be possible for a plugin to hook to jArchi through an extension point, in such a way that jArchi would list the folders defined in this extension point in the scripts manager, but would not allow the Edit action on them.

Example:
Lets imagine that a user has already created some scripts (A.ajs and B.ajs) and folders (folder_1, folder_2) in its scripts manager, leading to this:

> folder_1/
> folder_2/
  A.ajs
  B.ajs

Now, this user adds a plugin into archi, and this plugin uses the new extension point to expose one of its internal folders named Utils and containing some scripts like Remove all bendpoints.ajs). The user should now see this in its scripts manager:

> folder_1/
> folder_2/
v Utils/
    Remove all bendpoints.ajs
  A.ajs
  B.ajs

So the plugin contributed scripts would be seen like any other scripts, except that they can't be edited, renamed or moved. They should also appear in the dynamic script menu.

I can see one edge cases if there is a collision on folder names (plugin exposes a Utils folder while the user already created one). A simple way to solve this (if the framework allows it) would be to simply show to Utils folders in the scripts manager.

Another potential limitation would be that user scripts won't be able to easily load scripts from such contributed folders, because the real path will not be under __SCRIPTS_DIR__, but that might not be a big issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions