Geronimo
  1. Geronimo
  2. GERONIMO-4628

Console plan wizards need to save plans

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.5, 2.2
    • Component/s: None
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      Currently we have a lot of console wizards that are great at creating basic plans for datasources, security realms, etc etc. However once you've deployed the plan through the wizard the plan is gone gone gone never to be seen again.

      The wizards need to do something so the plans are saved on disk somehow.

      One possibliity is that deployment could always save the plan into the car file, like the car-maven-plugin does. I'm not certain but I think this would fix the admin console wizard problem as well.

      Also it would be very handy if the wizard inserted a comment mentioning the intended target artifact, such as which tranql adapter to use for a datasource plan.

      Furthermore you ought to be able to specify all components of the artifact id (groupId, etc) in all the wizards. In fact you should be able to set the default groupId for the whole admin console – probably your company wants all the groupIds the same.

      1. GERONIMO-4628-b21-updated.patch
        1 kB
        Rex Wang
      2. Geronimo-4628-b21-new.patch
        10 kB
        Rex Wang
      3. GERONIMO-4628-b21.patch
        7 kB
        Rex Wang

        Issue Links

          Activity

          Hide
          Rex Wang added a comment -

          Hi David, I'd like to work on this jira and prefer the deployment could always save the plan into car file. I think this cound be achieved in the Deployer GBean, that is, we can get the plan file either the outside one or the inside one and then save it in the META-INF with the uniform name -"plan.xml".
          Any thoughts?

          -Rex

          Show
          Rex Wang added a comment - Hi David, I'd like to work on this jira and prefer the deployment could always save the plan into car file. I think this cound be achieved in the Deployer GBean, that is, we can get the plan file either the outside one or the inside one and then save it in the META-INF with the uniform name -"plan.xml". Any thoughts? -Rex
          Hide
          David Jencks added a comment -

          I'm not sure it will be practical to figure out what an inside plan is in the DeploymentGBean. I'm also not entirely sure we have enough info about where the configuration is saved in the DeploymentGBean. However I think I'd be happy for 2.2 if we only saved external plans under META-INF/plan.xml – internal plans are already in the car file in some form.

          So, I think this is a great way to proceed.

          Show
          David Jencks added a comment - I'm not sure it will be practical to figure out what an inside plan is in the DeploymentGBean. I'm also not entirely sure we have enough info about where the configuration is saved in the DeploymentGBean. However I think I'd be happy for 2.2 if we only saved external plans under META-INF/plan.xml – internal plans are already in the car file in some form. So, I think this is a great way to proceed.
          Hide
          Rex Wang added a comment -

          Because I can not make a trunk build these days, I just made a patch for branch 2.1 (for comments
          This patch add a new api call "savePlan()" to ConfigurationStore.java, and the Deployer Gbean then uses that to save the external specific plan/console generated plan to the META-INF dir of the car with the name "plan.xml".
          I only implements the savePlan method in the RepositoryConfigurationStore..

          -Rex

          Show
          Rex Wang added a comment - Because I can not make a trunk build these days, I just made a patch for branch 2.1 (for comments This patch add a new api call "savePlan()" to ConfigurationStore.java, and the Deployer Gbean then uses that to save the external specific plan/console generated plan to the META-INF dir of the car with the name "plan.xml". I only implements the savePlan method in the RepositoryConfigurationStore.. -Rex
          Hide
          David Jencks added a comment -

          I'm no longer sure this is a good way to proceed. This functionality ought to be able to work with any kind of configuration store, such as one where the plugins are still packed jars, and we can't write the plan into them.

          I now think that each config builder needs to save the plan it comes up with into the configuration. The config builder does have write access to whatever its building.

          I haven't looked at the code today... maybe the Deployer has access to the DeploymentContext and can use that to write the plan?

          Show
          David Jencks added a comment - I'm no longer sure this is a good way to proceed. This functionality ought to be able to work with any kind of configuration store, such as one where the plugins are still packed jars, and we can't write the plan into them. I now think that each config builder needs to save the plan it comes up with into the configuration. The config builder does have write access to whatever its building. I haven't looked at the code today... maybe the Deployer has access to the DeploymentContext and can use that to write the plan?
          Hide
          Rex Wang added a comment -

          Currently, there are only RepositoryConfigurationStore and geronimo-farm's MasterConfigurationStore, different store might have different behavior when deploy packages.
          I think the "save plan" action is better to go along with the action that intalling the config.ser.
          So in the Deployer, after store.install(configurationData) which will generate the config.ser, config.info, I add the store.savePlan(configurationData, planFile).

          -Rex

          Show
          Rex Wang added a comment - Currently, there are only RepositoryConfigurationStore and geronimo-farm's MasterConfigurationStore, different store might have different behavior when deploy packages. I think the "save plan" action is better to go along with the action that intalling the config.ser. So in the Deployer, after store.install(configurationData) which will generate the config.ser, config.info, I add the store.savePlan(configurationData, planFile). -Rex
          Hide
          David Jencks added a comment -

          Adding a method to ConfigurationStore is just not acceptable to solve this. Deployer has access to the DeploymentContext. I think you can use one of the deploymentContext.addFile methods to add the plan without changing any apis. I think this could be called right after Deployer line 256.

          Show
          David Jencks added a comment - Adding a method to ConfigurationStore is just not acceptable to solve this. Deployer has access to the DeploymentContext. I think you can use one of the deploymentContext.addFile methods to add the plan without changing any apis. I think this could be called right after Deployer line 256.
          Hide
          Rex Wang added a comment -

          Thanks very much, David! That is a good way to solve this, here is the updated patch.

          -Rex

          Show
          Rex Wang added a comment - Thanks very much, David! That is a good way to solve this, here is the updated patch. -Rex
          Hide
          Rex Wang added a comment -

          and I will make a trunk patch later if this patch has np~ thanks.

          Show
          Rex Wang added a comment - and I will make a trunk patch later if this patch has np~ thanks.
          Hide
          David Jencks added a comment -

          Rev 790327. I modified the patch to not overwrite an existing plan file. I modified the car-maven-plugin to not install the plan file and let the deployer do it. I also fixed an apparent oversight in DeploymentContext with adding class files, delegating to the resourceContext.

          Show
          David Jencks added a comment - Rev 790327. I modified the patch to not overwrite an existing plan file. I modified the car-maven-plugin to not install the plan file and let the deployer do it. I also fixed an apparent oversight in DeploymentContext with adding class files, delegating to the resourceContext.
          Hide
          Rex Wang added a comment -

          Geronimo-4628-b21-new.patch is the new one for branch 2.1 based on trunk rev790327 & 790633.

          -Rex

          Show
          Rex Wang added a comment - Geronimo-4628-b21-new.patch is the new one for branch 2.1 based on trunk rev790327 & 790633. -Rex
          Hide
          Ivan added a comment -

          Commit the patch to 2.1.5 -snapshot At revision: 797382, thanks Rex !

          Show
          Ivan added a comment - Commit the patch to 2.1.5 -snapshot At revision: 797382, thanks Rex !

            People

            • Assignee:
              David Jencks
              Reporter:
              David Jencks
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development