Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jbsarrodie opened this issue Nov 18, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@jbsarrodie
Copy link
Member

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.

@jbsarrodie jbsarrodie added the enhancement New feature or request label Nov 18, 2020
@Phillipus
Copy link
Member

The Scripts File Viewer framework would have to be re-written to accommodate this. Right now it maps onto one root directory and supports drag and drop etc on that file structure.

@jbsarrodie
Copy link
Member Author

The Scripts File Viewer framework would have to be re-written to accommodate this. Right now it maps onto one root directory and supports drag and drop etc on that file structure.

Ok, and what if these extension points only impact the dynamic menu? Would it be easier to implement ?

@Phillipus
Copy link
Member

Ok, and what if these extension points only impact the dynamic menu? Would it be easier to implement ?

I don't know, but whatever method it is requires some non-trivial refactoring.

@jbsarrodie
Copy link
Member Author

Ok, sor forgot it for the moment, I'll experiment on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants