ProjectLifecycle CheckList is a sample about how can a user able to use the "Lifecycle status" in his project development cycle.
First Architect designs 'Use case diagrams and other designs' and let the Developers to implement it.
After finishing the implementation task, Developers promote the resource to QAs to validate the resource/product. After passing all the tests, QAs
allow customers to deploy the product/project. It has six states.
Initialize
Designed
Created
Tested
Deployed
Deprecated
Running the sample
Edit the registry.xml file with following xml snippet
copy the org.wso2.carbon.governance.samples.lsm-2.0.0.jar to
GREG_HOME/webapps/ROOT/WEB-INF/plugins/console folder
start the server.
Go to mangement console.
Add a Collection.
Add a resource into that collection.
Navigate to new resource.
At the "Life cycle mangement' panel, Add " Project check list" to the resource.
Check all the options and 'Promote'
Go to "environment/design" folder, where resource is stored with new life cycle state.
Select that resource and promote. It can be found in "environmet/development' folder with next state.
Your resource will be promoted to
/environment/init
/environment/design
/environment/development
/environment/qa
environment/prod
/environment/Deprecated
Your resource will be demoted to relevant folder.
Note:- Rather than editing the "registry.xml" file, you can easily add your
LC configurations via the administration console, by adding "New LifeCycle Configuration",
which you can find under "Lifecycles" menu. These added configurations will availabele for
a resource to enable Lifecycle functionality .
WS-API for file upload Sample
This is useful when uploading large files, since atom based remote registry API is not that efficient in uploading large files.
Before getting the sample to work you have to run ant from GREG_HOME/bin and start the registry server.
Edit the build.xml by filling the path element with GREG-HOME and the AXIS2-HOME.
Steps to get this sample to work
Edit the build.xml by filling the path element with GREG-HOME and the AXIS2-HOME.
Run the ant build file. i.e.( ant upload)
Provide keystore path which is provided with bin distribution "GREG_HOME/resources/security/client-truststore.jks".
Provide filepath which you want to upload.
Browsing to the resource
Go to admin console "Resource Browser" menu. Where you can find that your resource will available with the
name called "testpath".
Note:- You need "AXIS2" distribution to run this sample.
Exporting/importing a file to Remote registry
Introduction
This sample demonstrates how to export a local file system into a remote registry, and how to import a remote registry into a local file system. We can build our content in the local file system with the directory hierarchy we want, including any type of content. Then we can use the registry API to export our local file system into the registry.
Once we upload a local file system into the registry we have "socially enabled" it. We can comment on resources, we can tag, we can rate, etc...
We can also build our hierarchy in the Registry with the structure we want, and then we can download or import the remote registry into our local file system. Then the registry will create the exact same directory structure and download all the files in the registry.
Running the sample
Running the sample is just a matter of executing an ant file. If you don't
have ant, you can download it at http://ant.apache.org/. Run 'ant' at the 'bin' directory
of the distribution.
Exporting local file system into a remote registry
Run "ant upload" inside the "samples/filesample" directory. You will be asked for:
Keystore file path : Provide GREG_HOME/resources/security/client-truststore.jks
Registry URL : Provide "https://localhost:9443/registry"
[If your registry is in somewhere else then give that path]
User name : If you have not changed the admin user then pass ?admin?
Password : Use "admin"
FromPath : Location in the file system to export from. Enter the
full path to the "resources" directory(eg:- C:\test\test.txt)
ToPath : Where to put the resource. In this sample let's use
"/sample/file"
If you login to the management console you can see that all the files have been
moved and the registry has the same structure as the filesystem under 'Resources' table.
Importing a file into the local file system
Now we go the other way. Again, run "ant download" first, and provide values:
Keystore file path : Provide GREG_HOME/resources/security/client-truststore.jks
Registry URL : Provide "https://localhost:9443/registry"
[If your registry is in somewhere else then give that path]
User name : If you have not changed the admin user then pass ?admin?
Password : Use "admin"
FromPath : Resource path, such as "/sample/file"
ToPath : Where to put the resource in the local filesystem. For this
sample let's use "C:\Documents and Settings\test"
Once you run ant you will see a newly created folder hierarchy in the path you specified.
Note:-You should put all the required jars into the "GREG_HOME\lib" folder.
org.wso2.carbon.registry.core-2.0.0.jar (Find at GREG_HOME\webapps\ROOT\WEB-INF\plugins\common folder)
axis2-transport-base-1.0.0.wso2v1.jar(Find at GREG_HOME\webapps\ROOT\WEB-INF\plugins\common folder)
Keep all those jars in "GREG_HOME/lib directory"
ProjectProposalHandler Sample
Introduction
The idea of this sample is to demonstrate how to use media type handlers. The sample application is to process project proposals, so we'll be using a component that intercepts Registry put() requests with a particular "porposal" media-type. The Handler will read the proposal and mark it as valid or not. In order to be a valid proposal there should be a number of fields - if all of them are there then the handler will mark the proposal as valid. If one or more fields are missing then the proposal would be invalid.
Build the distribution.
Copy the 'org.wso2.carbon.registry.samples.handler-*.jar' into
GREG_HOME/repository/components/dropins.
Edit the registry.xml file which is in 'conf' folder with the following xml snippet.
Select the 'Upload content from file' from 'Method' dropdown.
Select your project proposal and type the media type as'pp'(you can use whatever the media type you prefer).
And 'Add' it.
Browse to the added project proposal. You could see Properties and the Tag has added to the resource.
Note:- Sample project proposals are available in "resources" folder.
Custom UI Sample
This file explains the usage of the custom UI sample (Adding endpoint references as custom resources).
Adding an endpoint reference as a resource
Drop the following jars into GREG_HOME/webapps/ROOT/WEB-INF/plugins.
Put the "org.wso2.carbon.registry.samples.mgt.ui.custom.topics-*.jar" into the "plugins/server" folder.
Put the "org.wso2.carbon.registry.samples.ui.custom.topics-*.jar" into the "plugins/console" folder.
Add the following bundle info details that is in the "bundles.info" file which is located at
"GREG_HOME/webapps/ROOT/WEB-INF/eclipse/configuration/org.eclipse.equinox.simpleconfigurator".