Exporting a portal page with the CLI

In this recipe, we will export the sitemap page managed resource from the portal using the CLI.

Getting ready

The following are required for this recipe:

  • GateIn-3.2.0.Final
  • Deploying the CLI to GateIn recipe from this chapter to have been completed

How to do it...

To export the sitemap page from the portal:

  1. Start the server.
  2. Open an SSH connection to the CLI by entering the following command:
    > ssh -p 2000 root@localhost
    
  3. Enter the password for root when requested. With the standard GateIn install, the password is gtn.
  4. At the shell prompt, enter the following:
    > mgmt connect
    
  5. Enter the password for root user again.
  6. At the shell prompt, enter the following:
    > export --file /tmp --filter site-name:classic;page-name:sitemap;nav-uri:sitemap /mop
    

    Note

    When using the CLI, all directories and files referenced in import or export commands are references to the GateIn server system, and not the system in which the ssh command was issued from.

  7. Opening the ZIP file that was created in /tmp with a filename of mop_timestamp.zip will show the following contents:
    How to do it...

How it works...

Step 6 executes the export command on the mop managed resource, with filters on the site-name, page-name, and nav-uri. Filtering on site-name will restrict the contents of the ZIP file to the site specified, in this case classic. Filtering on page-name and nav-uri with the value sitemap will restrict the content of pages.xml and navigation.xml to those entries related to the sitemap pages and navigation configuration.

There's more...

Now we will see how to achieve the same outcome using the RESTful interface.

Exporting a portal page with RESTful Interface

The CLI commands used in this recipe to export a ZIP file that contains the sitemap page and navigation are equivalent to the following REST URLs:

  • http://localhost:8080/rest/private/managed-components/mop/portalsites/classic.zip?filter=page-name:sitemap;nav-uri:sitemap
  • http://localhost:8080/rest/private/managed-components/mop.zip?filter=site-name:classic;page-name:sitemap;nav-uri:sitemap

See also

  • The Removing a portal page from the navigation recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.138.178