Catalog Zero
Catalog Zero is a sample Project Zero application that allows users to share packaged Project Zero applications and services. Anyone using the Catalog Zero web interface can browse, download, rate, and comment on packages. Authorized users can upload and manage packages. Catalog Zero provides an easy-to-use interface tailored to the Project Zero experience. It includes support for standalone and shared packages as well as an Ivy repository interface.
Installing Catalog Zero
Catalog Zero uses the following packages (in addition to zero.core):
- zero.catalogApp
- zero.service.catalog
- zero.service.comment
- zero.service.rating
- zero.widget.comment
- zero.widget.rating
Downloading Catalog Zero
Downloading from the Command Line Interface
From your Zero directory, execute
zero install zero.catalogApp
Downloading from SVN into Eclipse
If you want to download the Catalog Zero source from SVN into Eclipse, checkout the packages listed above from the SAMPLES tree in SVN.
Setting up the Database in Eclipse (MySQL)
- Put the MySQL connector jar file (mysql-connector-java-x.y.z.jar) into
zero.catalogApp/lib (if it is not already there)
- Open the zero.catalogApp project and right click on build.xml
- Select
Run As -> Ant Build_..._ (There are two Ant Build options, make sure you select the one with the ellipsis)
- Uncheck create-derby and check create-mysql.
- Open the Properties tab of the Ant Build dialog and uncheck Use global properties.
- Add a property called user with the value root
- If you have set a MySQL root password, add a property called password with the value being the MySQL root password.
- Now click OK. The script will attempt to connect to the database using the credentials provided and set up the database with all the required tables.

If there are any errors, make sure you drop the database before attempting to try again.
Setting up the Database using the Command Line Interface
- From the zero.catalogApp directory, run
ant create-mysql
Configuring Zero to use the Catalog Zero ivy repository
- See [Documentation.CoreDevelopersGuideDependencyResolution][Remote repositories]] for information on configuring a new remote Ivy repository
- Add the new Zero repository http://localhost:8084/repository/ to your remote repository chain.
- Ivy will now search the catalog repository when it resolves dependencies.
Running Catalog Zero in Eclipse
- To run zero.catalogApp, right click on the project and select
Run As->Project Zero Application
- The catalog will run on port 8084, so you can go to http://localhost:8084/index.html or http://localhost:8084/indexDebug.html to use the web interface
Running Catalog Zero using the Command Line Interface
- Change into the
/apps/CatalogApp directory.
- Type
zero run
- The catalog will run on port 8084, so you can go to http://localhost:8084/index.html or http://localhost:8084/indexDebug.html to use the web interface
Using Catalog Zero
Using the Catalog Zero web interface should be fairly intuitive. If it isn't, please let us know in the Development forum! However, here are some instructions to get you started.
Browsing Packages
Anyone can browse the contents of the catalog. By default, the latest versions of all available packages are listed on the catalog home page. If the list is too long, it can be filtered by clicking on one or more of the choices in the Filter List. Filters are also accessible from the little icon to the right of the list headings.
By clicking "Show Description", you can see more details on the package. You can also download a package directly from these details by clicking on the Download button.
Clicking on a package name will take you to a new page with even more details of the package.
Downloading Packages
To download a package, click on the Download button either in the package details on the catalog home page or on the package's Details page. For standalone packages, you will be prompted to save the file to your local disk. The file can then be extracted. To execute the extracted application, use the
zero run command from the application's directory.
For shared packages, you will be presented with instructions on how to download and install the package in Eclipse.
For command line users, copy and paste the Ivy dependency entry into your application's ivy.xml file and execute
zero resolve.
Rating and Commenting
To rate or comment on a package, you must sign in as a registered user. Catalog Zero uses the Project Zero file-based user security service. Users are configured in the file
/CatalogApp/config/zero.users. See the
User service documentation for information on adding additional users. For test purposes, you can sign in using the ID
test and password
password.
To rate a service, click on the number of reviews beside the stars. The number of stars can then be selected by clicking and dragging the mouse.
Comments can be added from the Details page of a package. Click on the Comments tab beside the package description.
Uploading Packages
To upload packages, you must sign in as an authorized user. Catalog Zero uses the Project Zero file-based user security service. Users are configured in the file
/CatalogApp/config/zero.users. See the
User service documentation for information on adding additional users. To have upload authority, a user must be in the "IBM" group. For test purposes, you can sign in using the ID
brett and password
password.
To upload a package, you first have to create one. See [[Documentation.CoreDevelopersGuideDependencyResolution][Packing to publish] in the Developers Guide for information on creating packages.
Once you have created a package, you can upload it by signing in to the catalog and clicking "Upload Package" in the upper right of the catalog home page. Find your package file (probably in your application's
export directory) and click
Upload. The file will be uploaded, and information will be extracted from the package's ivy.xml to prepopulate the catalog entry. You can change the package summary and description. When ready, click OK. Your package is now available for others to browse and download.
Uploading new releases
When you have a new release, just change the
revision in your ivy.xml and create a new package. Upload this new package, and Catalog Zero will automatically detect that you are adding a new release to an existing package. Enter some release notes and hit OK to share the new release. The new release will automatically be listed on the home page.
-- brettk - 14 Sep 2007