Product Documentation

Customizing Connector UI

Dec 22, 2015

From CloudPortal Business Manager 2.1 onwards, the connector UI can be customized using an OSGI fragment bundle. This bundle will contain assets (jsp, js, css, tiles, MVC controllers) for connector UI customization.

Creation of connector fragment from Archetypes
  1. Run the cssdk-standard.jar installer and follow on-screen instructions.
  2. Create a new connector fragment maven project by following the steps:
    1. Goto File->New->Project.
    2. Select Maven->Maven Project.
    3. In the New Maven Project Wizard Screen, make sure Create a simple project is unchecked.
    4. Click Next.
    5. In the Catalog selection, select Newly added Archetype in Catalog dropdown.
    6. From the table select item with
      1. Group Id: com.citrix.cpbm
      2. Artifact Id: com-citrix-cpbm-connector-fragment-archetype
    7. Click Next .
    8. Enter the values for the following fields:
      1. GroupId - A group under which all services are offered. For instance, org.apache in case of CloudStack.
      2. ArtifactId - Name of the services which the above group offers .cloudstack.fragment in case of Apache CloudStack.
      3. Version - Version of the service offered. For example, for cloudstack.fragment, the version is 1.0.0.
      4. Package - Base Java package for the maven project .org.apache.cloudstack in case of Apache CloudStack
    9. Click Finish. This will create a Connector Fragment Project.
      Note: If project is not getting created try restarting the STS once.
Default Structure
META-INF 
 readme.txt 
 src 
 main 
  java 
    base package name 
     ExampleController.java 
  resources 
   css 
    ${artifactId} 
	 example.css 
   js 
	${artifactId} 
	 example.js 
	images 
	 ${artifactId} 
	  example.png 
   META-INF 
	MANIFEST.MF 
	WEB-INF 
	 default 
	  ${artifactId}-tiles-defs.xml 
	  jsp 
	   ${artifactId} 
		example.jsp 
	  applicationContext-${artifactId}-fragment.xml 
 build.properties 
 pom.xml 
 template.mf

File Description

  • ExampleController.java: It is a Spring MVC controller which will contain the url mapping, which is returned from the connector's view resolver. It returns a tile view.
  • MANIFEST.MF: It is the bundle's manifest specifying the bundle's information along with the fragment's host, it also contains package imports (if any).
  • applicationContext-${artifactId}-fragment.xml: Spring Context file whose beans will be loaded by the fragment's host. Any spring beans should go here.
  • ${artifactId}-tiles-defs.xml: An xml configuration file which contains tiles definitions for custom views which is loaded by fragment-host by file name.
  • example.jsp: An example jsp file which specifies which JSTL tags can be used in the JSP and also provides an example to include a css or a javascript file.
  • example.js: An example js file.
  • example.css: An example css file.
  • example.png: An example image file.
  • pom.xml: The maven project file for dependency and build management.(Add maven dependency for the connector project for which this fragment will provide views).