3.2. Publish or Unpublish a Resource 3.2.1. Publish or Unpublish a Resource Having registered your ModeShape server instances in Section 3.1.1, "Register Repository on a New Server" , you can now publish files to the repositories on these servers and you can also unpublish these files. You can achieve this by using the ModeShape Publishing wizard. If you wish to prevent certain folders or file types from being published or unpublished, this requirement can be set through the ModeShape Preferences dialog explained in Section 3.3.2, "Ignored Resources" . 3.2.2. Publish a Resource You can publish the files to the repositories on the server by using the ModeShape Publishing wizard. Procedure 3.1. Publish files to a repository Open ModeShape Publishing Wizard. Right-click one or more projects, folders, or files in your Eclipse workspace to view the context menu for those files. The Context menu now includes a ModeShape submenu that allows you to publish or unpublish the resources to your ModeShape repository. Figure 3.4. ModeShape context submenu Note 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 an individual resource and navigating the ModeShape context submenu to the Show Published Locations option. Select Publish to open the ModeShape Publishing Wizard. Figure 3.5. ModeShape publishing wizard Choose ModeShape repository The 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. Choose Publish Area. 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. Version the published files. As ModeShape now allows for the versioning of published files, you will notice a checkbox labelled Version the published files (change default in your preferences) . If you have selected to allow file versioning in your ModeShape preferences, then this checkbox will be checked automatically. If your server instance does not permit the versioning of files, regardless of the settings you choose in the Preferences dialog for ModeShape, the checkbox labelled Version the published files (change default in your preferences) will be inactive. Publish the files. Choose any other options as appropriate and then select Finish to publish the files. Warning When performing a publish operation, if you publish a file to a ModeShape repository where a version of the same file has previously been published (by you or someone else), the publishing action will overwrite the file currently in the repository. Result When a file is published, a blue arrow will appear to the file in the tree view. 3.2.3. Unpublish a Resource Procedure 3.2. Unpublish files to a repository View the context menu. To unpublish the files, right-click one or more projects, folders, or files in your Eclipse workspace to view the context menu for those files. The Context menu includes a ModeShape submenu that allows you to unpublish the resources to your ModeShape repository. Unpublish the files. Select Unpublish to unpublish the files. Warning 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 sure that a file is no longer necessary when unpublishing, as the file in question will be deleted from the repository with this operation. Result When a file is unpublished, the blue arrow to the file in the tree view will be removed. 3.2.4. Viewing, Publishing or Unpublishing Output in Console View You can view publish/unpublish operation output in the Console view. You can view: 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. Figure 3.6. Console output

Commands: