Giter VIP home page Giter VIP logo

Comments (7)

AlexJitianu avatar AlexJitianu commented on June 26, 2024

Hi John,
Even if we publish such an API in the Git Client, currently plugins are isolated from one another so your plugin has no mechanism to use this API. We would have to first implement this cross-plugin communication within Oxygen.

Yes, you can poll ${git(short_branch_name)} to detect the change. If your plugin contributes a view, perhaps you can make these checks on a focus gain event.

from oxygen-git-client-addon.

kirkilj avatar kirkilj commented on June 26, 2024

Thanks for the quick response.

(1) This may be a kludge, but I'd like to know in concept if you think it could also work to have a project-specific custom editor variable that includes ${git(short_name)} as it's value. Would this be evaluated always if the branch changes?

(2) Do you think there would be other business drivers for Syncrosoft to consider adding a delegation proxy or broker in Oxygen core that could safely relay requests to another plugin via introspection or other such magic? For security's sake, this might involve asking the user if they want to allow plugin X to have certain privs on plugin Y, perhaps with the option to only allow it for digitally signed plugins.

I know this second one is not trivial by any means, but perhaps if you keep it in the back of your mind and discuss with your peers, it might form the basis for extending the Oxygen ecosystem or at lease allow custom plugin developers to leverage your many plugins in new ways.

Best regards,

John

from oxygen-git-client-addon.

AlexJitianu avatar AlexJitianu commented on June 26, 2024

Hi John,
Somehow I've missed your reply, sorry for that.
(1) Yes, there is no caching involved, so it should work.
(2) We don't have such a huge plugin community to justify it. If both plugins are developed by you, you can pass information between them through the PluginWorkspace.getOptionsStorage() API. One plugin writes options, the other listens on them. Thinking on this approach, one (maybe you :) could fork the Git Client project and implement a notification system based on the same principle like this:

  • Add a {{com.oxygenxml.git.service.GitEventListener}}
  • For each intercepted event you use PluginWorkspace.getOptionsStorage() to write a GIT_EVENTS option.
  • In your plugin you listen on this GIT_EVENTS and decide what to do.

from oxygen-git-client-addon.

AlexJitianu avatar AlexJitianu commented on June 26, 2024

What we could do fairly easy is to write a couple of options, like GIT_REPOSITORY or GIT_CHECKOUT_BRANCH. Your plugin could add listeners on these options and react immediately when once the user changes the repository or the branch. Are there other events you are interested in?

from oxygen-git-client-addon.

kirkilj avatar kirkilj commented on June 26, 2024

I'm a bit fried at the moment to consider other possible events, but for our current purposes, we just need a way to refresh our plugin's internal state when a branch change occurs while the user has the same project open. The events you mentioned would be perfect for this. Thanks.

from oxygen-git-client-addon.

AlexJitianu avatar AlexJitianu commented on June 26, 2024

We released version 5.2.0 in which we save these two options:

PLUGIN_CUSTOM_OPTIONS.com.oxygenxml.git.current.branch
PLUGIN_CUSTOM_OPTIONS.com.oxygenxml.git.selected.repository

This means that you can add a listener on ro.sync.exml.workspace.api.options.WSOptionsStorage from another plugin and you will be notified when they are changed. If you encounter any challenges, please write on our support email address and we will give you additional details and consulting.

from oxygen-git-client-addon.

kirkilj avatar kirkilj commented on June 26, 2024

Wow. Thanks so much for providing a way to do this.

from oxygen-git-client-addon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.