此内容没有您所选择的语言版本。

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

  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.

      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.

      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.

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

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat