Configurable Governance Artifacts (RXT) extend the functionality of WSO2 Governance Registry. The RXT feature provides you to define your own data model. For more information on configurable Governance artifacts (RXT), see Configurable Governance Artifacts (RXT).
...
Create a Java project by adding the following content (e.g.
populator.jar
).Info You need to implement the
DropDownDataPopulator
interface in the drop-down populator class.Code Block language java package org.sample.rxt.populator; import javax.servlet.ServletConfig; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.governance.generic.stub.beans.xsd.ContentArtifactsBean; import org.wso2.carbon.governance.generic.ui.clients.ManageGenericArtifactServiceClient; import org.wso2.carbon.governance.generic.ui.utils.DropDownDataPopulator; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.session.UserRegistry; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.governance.api.generic.GenericArtifactManager; import org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact; import org.wso2.carbon.governance.api.util.GovernanceArtifactConfiguration; import org.wso2.carbon.governance.api.util.GovernanceUtils; public class WSDLPopulator implements DropDownDataPopulator { private static final Log log = LogFactory.getLog(WSDLPopulator.class); String[] out = new String[1]; @Override public String[] getList(HttpServletRequest httpServletRequest, ServletConfig servletConfig) { try { ManageGenericArtifactServiceClient client = new ManageGenericArtifactServiceClient(servletConfig, httpServletRequest.getSession()); ContentArtifactsBean artifactsBean = client.listContentArtifacts("application/wsdl+xml"); if (artifactsBean.getName() != null && artifactsBean.getName().length > 0) { return artifactsBean.getName(); } else { out[0] = "None"; } } catch (RegistryException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return out; } }
- Place it in the
<G-REG_HOME>/repository/lib/
directory. - Log in to the Management Console of WSO2 G-Reg using the following URL and admin/admin credentials: https://<G-REG_HOST>:<G-REG_PORT>/carbon/
- Click Extensions, and then click Artifact Types in the Configure menu.
- Click the View/Edit link of the soapservice artifact type as shown below.
Add a new field after the Description field, and then click Save.
Code Block language xml <field type="options"> <name label="WSDL">WSDL</name> <values class="org.sampl.rxt.populator.WSDLPopulator"/> </field>
- Click Main, and then click SOAP Services in the Add menu. You view the new field added with the populated drop-down list in the Add SOAP Service screen as shown below.
- Log in to the G-Reg Publisher using the following URL and admin/admin credentials: http://<G-REG_HOST>:<G-REG_PORT>/publisher
- Click the Add button in the SOAP Services box.
- Select Add a SOAP Service manually, and then click Continue. You view the new field added with the populated drop-down list in the Add SOAP Service screen as shown below.