ModeShape tools allows you to publish and unpublish resources to the ModeShape repositories you have made available through your workspace. These repositories are persisted within the workspace, from session to session.
The ModeShape registry is persisted from session to session.
This section outlines the concepts that are assumed information when performing tasks with ModeShape tools.
ModeShape is a component that maintains repositories of resources for your application server, through the implementation of a JCR (Java Content Repository) view. The resources stored can come from many different kinds of systems.
To your applications, ModeShape looks and behaves like a regular JCR repository. Using the standard JCR API, applications can search, navigate and listen for changes in content. However, ModeShape retrieves its content by federating multiple back-end systems (such as databases, services and other repositories). This allows those systems to maintain ownership of the information, while ensuring the unified repository remains current.
ModeShape repositories can be used in a variety of applications. One such application is provisioning and management. In provisioning and management it is critical to understand and keep track of the metadata for models, databases, services, components, applications, clusters, machines, and other systems used in an enterprise environment. Governance takes this further, by also tracking the policies and expectations against which performance can be verified. In these cases, a repository is an excellent mechanism for managing this complex and highly-varied information.
A ModeShape repository does not have to be large and complex. It could be setup to only manage configuration information for an application, or provide a JCR interface on top of non-JCR systems.
This section outlines different tasks that can be achieved through the use of the ModeShape tools.
Registering a repository on a new server is achieved through the ModeShape view. To open the ModeShape view navigate to → → . From the Show View dialog select the folder followed by the view and click .
To add a ModeShape repository, click on the Create a new server icon that appears in the Modeshape view. This view is located in the lower section of your interface, along with other views such as Severs and Console.
The New Server dialog will then appear asking for the URL of the server to connect and your authentication information. You can test your connection to the server by clicking the button and then clicking the button to add the server to the ModeShape view.
Upon testing the connection, if a connection cannot be established, the ModeShape server can still be created. Use the
button on the ModeShape View's toolbar to try and connect again at a later time.Once the server with the ModeShape repository has been added three new options become available within the ModeShape view. These options allow you to Edit server properties, Delete a server from the server registry and Reconnect to the selected server. To perform one of these actions either right-click on a server and select from the presented menu of actions, or use the buttons beside the Create a new server button seen in Figure 3.2, “Adding a new server for ModeShape repositories”.
It is possible for a ModeShape server instance to have numerous ModeShape repositories stored on it. Once you have registered a connection to the server you will have access to all ModeShape repositories on the server. You do not need to register a new connection for each repository on the same server.
Having registered your ModeShape server instances in Section 3.1, “Register a repository on a new server”, you can now publish files to the repositories on these servers.
Right-clicking on one or more projects, folders, or files in your Eclipse workspace will display the context menu for those files. This menu will now include a ModeShape submenu that allows you to publish or unpublish the resources to your ModeShape repository.
When only one resource is selected you can also view the locations where that resource has been published. The published locations of a resource can be viewed by right-clicking on an individual resource and navigating the ModeShape context submenu to the
option.The ModeShape publishing wizard is displayed when you select
or from the context menu.The publishing wizard (shown in Figure 3.5, “ModeShape publishing wizard”) allows you to choose which ModeShape Java Content Repositories (JCR) type repository to interact with and displays the selected files the operation will be performed on. When a project or folder is selected all their included files are acted upon.
Publishing to a Publish Area will automatically sequence your files to extract useful information and make it available to our repository users. Extracted information depends upon the type of file and the configuration of the ModeShape repository. The location where files will be published is constructed by appending the server URL, the names of the JCR repository and workspace, the path to the publish area, and the path of the files and folders within your Eclipse workspace.
As ModeShape now allows for the versioning of pubilshed files you will notice a checkbox labelled Version the published files (change default in your preferences). If you have selected to allow for file versioning in your ModeShape preferences then this checkbox will automatically be checked.
If your server instance does not permit the versioning of files, reguardless of the settings you choose in the preferences for ModeShape, the checkbox labelled Version the published files (change default in your preferences) will be greyed out.
When performing a publish operation, make sure you are aware of the following:
If you publish a file to a ModeShape repository where a version of the same file has previously been published to the repository by you or someone else, the publishing action will overwrite the file currently in the repository.
When performing an unpublish operation, make sure you are aware of the following:
If you are interacting with a multi-user repository, the version of the file you are unpublishing may have been updated by someone else after you.
It is important to be positive a file is no longer necessary when unpublishing as the file in question will be deleted from the repository with this operation.
When publishing or unpublishing files, you can see the operation output in the Console view. The type of information that you can view includes the repository where the operation took place, how long the operation took, the outcome for each file included in the operation, a hyperlink that allows you to open the file in an Eclipse editor, and a ModeShape repository workspace URL.
If you wish for certain folders or file types to never be published or unpublished, these conditions can be set through the ModeShape preferences dialog explained in Section 3.3, “Setting preferences”
The ModeShape Preferences dialog allows for resource versioning to be set along with specific file types and folders that you never wish to have published to or unpublished from a ModeShape repository. This dialog is accessed by navigating to → → .
This dialog allows you to set whether resource versioning will be used for your ModeShape repository or not. Ensure the Enable resource versioning checkbox is ticked for resource versioning to be activated.
To manage the resources to be published to the repository, click on the Preferences menu.
menu item under in the main leftAt this screen you can manage the resources that will not be published to your ModeShape repository. The current excluded file types and folders is presented in the list of checkbox items that appears under the Ignored Resources heading.
To add a new file extension type or folder name to be filtered from publishing, click on the
button, enter the details and click the button so that your preference changes are saved.Removing an entry is conducted by selecting an entry from the list in the Preferences dialog and clicking on the button. Ensure that you click the button so that your preference changes are saved.
As the Preferences dialog lists file types and folders that will never be published to a repository, it follows that those listed will never be unpublished. If you decide to never have a certain file type or folder publishable, though it has been in the past, ensure that all instances of these are unpublished before setting any preferences for the file type or folder.
Publishing folders or files of a certain file type before setting any preferences inhibiting the publishing of these file types, can be a way of ensuring that you will never remove these files (unpublish) from your ModeShape repositories by accident. However since preference settings are only local to your working environment, in a multi-user ModeShape repository someone else could still remove these files.