Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

3.2. Publish or Unpublish a Resource

download PDF

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

  1. Open ModeShape Publishing Wizard.

    1. 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.
      ModeShape context submenu

      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.
    2. Select Publish to open the ModeShape Publishing Wizard.
      ModeShape publishing wizard

      Figure 3.5. ModeShape publishing wizard

  2. 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.
  3. 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.
  4. 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.
  5. 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 next to the file in the tree view.

3.2.3. Unpublish a Resource

Procedure 3.2. Unpublish files to a repository

  1. 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.
  2. 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 next 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.
Console output

Figure 3.6. Console output

Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.