Bug 544082

Summary: server side plugin, unable to update configuration information
Product: [Other] RHQ Project Reporter: wes hayutin <whayutin>
Component: Plugin ContainerAssignee: John Mazzitelli <mazz>
Status: CLOSED NOTABUG QA Contact: wes hayutin <whayutin>
Severity: medium Docs Contact:
Priority: low    
Version: unspecified   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://10.16.120.173:7080/rhq/admin/plugin/plugin-details.xhtml?plugin=YumContentSourcePluginTest&deployment=SERVER&pluginType=org.rhq.enterprise.server.xmlschema.generated.serverplugin.content.ContentPluginDescriptorType
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-17 16:32:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 542757    
Attachments:
Description Flags
webui not updated w/ configuration changes none

Description wes hayutin 2009-12-03 21:30:32 UTC
Created attachment 375920 [details]
webui not updated w/ configuration changes

Description of problem:

server side plugin, unable to update configuration information.
The only configuration that I could update was the version, which works great.

I made a copy of the Yum Content Source Plugin and updated the configuration w/ the following values.


----------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>

<content-plugin name="YumContentSourcePluginTest"
                version="1.3"
                apiVersion="2.0"
                xmlns="urn:xmlns:rhq-serverplugin.content"
                xmlns:c="urn:xmlns:rhq-configuration">

   <contentSourceType name="YumSourceTest"
                      displayName="Yum Repository WES TEST NAME Content Source Test"
                      description="This content source WES TEST DESCRIPTION retrieves packages from a local or remote Yum repository."
                      lazyLoad="true"
                      downloadMode="filesystem"
                      apiClass="org.rhq.enterprise.server.plugins.yum.RepoProvider">

      <configuration>
         <c:simple-property 
             name="location" 
             type="string" 
             required="true"
             description="The URL or path WES TEST CONFIG DESCRIPTION to the Yum repository" />
     </configuration>
   </contentSourceType>

</content-plugin>
-----------------------------------------------------------------------------

The only item that is updated in the webui is the plugin version.  
The content source type display name I think should be updated. I'm not sure but I think this is a separate issue than bugzilla 544078


see screenshot for more info

Comment 1 John Mazzitelli 2009-12-03 22:06:32 UTC
this is "working as expected" - it's probably confusing you because the content plugins are more complex than, say, my sample generic plugin and its hard to see the distinction in the configuration metadata.

content plugins extend the server-side plugin xml schema - they allow you to add more information in the plugin descriptor like multiple content repos and configuration for those repos (the things you modified in your example here in this issue). Note that this configuration you changed is NOT the same as the PLUGIN configuration itself... what you changed was configuration definitions FOR CONTENT REPOS, not for the plugin. The only configuration you should see in the plugin UI is the plugin configuration itself.

I'll give an example using the sample server-side plugin descriptor:

http://git.fedorahosted.org/git/rhq/rhq.git?p=rhq/rhq.git;a=blob;f=etc/samples/custom-serverplugin/src/main/resources/META-INF/rhq-serverplugin.xml;hb=master

Notice the <plugin-configuration> and <scheduled-jobs> are DIRECT CHILD elements to the root <generic-plugin> element. These are plugin configuration and job configuration settings that are common across all plugins - there are one and only one instance of each per plugin - and it is these settings that you can modify in the plugin UI. Essentially, you are configuring the behavior OF THE SERVER PLUGIN ITSELF.

Contrast this with the plugin descriptor you illustrate in this issue. Notice first that under <content-plugin> root element, you have <contentSourceType> and UNDER THERE is its <configuration>. This is not the server plugin configuration, instead, this represents the configuration for CONTENT REPOS (as you can tell because <configuration> is a child element of <contentSourceType). You only edit this  config when you actually have a content repo created - and you can have multiple configurations because you can have multiple content repos created (see Administration>SystemConfiguration>Content).  In other words, these settings do not directly effect the behavior of the plugin itself, instead, they configure content repos that a user can create via the content UI. The plugin defines how the repos can be configured.

If you want to test this, then create a <plugin-configuration> element DIRECTLY UNDER <content-plugin> and redeploy the plugin. Or, use the sample server-side plugin that I point to above, as it has a large config already.

Comment 2 wes hayutin 2009-12-17 16:32:38 UTC
this is not a bug.. use the simiple report sample plugin to verify this kind of configuration