Connector Fragment
Creation of connector fragment from Archetypes:
- Create a new connector fragment maven project by following the steps given below:
- Go to File->New->Project…
- Select Maven->Maven Project.
- In the New Maven Project Wizard screen, make sure Create a simple project is unchecked.
- Click Next.
- In the next screen, for the Catalog selection, select Default Local in Catalog drop down.
- From the table select item with:
- Group Id: com.citrix.cpbm
- Artifact Id: com-citrix-cpbm-connector-fragment-archetype
- Click Next .
- In the next screen, enter your values for the following fields:
- GroupId: A group under which all services are offered. For instance, org.apache in case of CloudStack.
- ArtifactId: Name of the services which the above group offers, cloudstack.fragment in case of Apache CloudStack.
- Version: Version of the service offered. For example, for cloudstack.fragment, the version is 1.0.0.
- Package: Base Java package for the maven project, org.apache.cloudstack in case of Apache CloudStack.
- Click Finish. This will create a Connector Fragment Project. Note: If project does not get 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 tiles view.
- MANIFEST.MF: It is the bundle manifest specifying the bundle information along with the fragment host. It also contains package imports (if any).
- applicationContext-${artifactId}-fragment.xml: Spring Context file whose beans will be loaded by the fragment 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.(Please add a maven dependency for the connector project for which this fragment will provide views).
Comments