Implement the News Document

Updated: April 14, 2017 Page Information Edit on GitHub

In this section, we will:

  • Create the News document type,
  • Create the content template with News Folder,
  • Add a button dedicated to News creation.

For this section, it is recommended to take a look at the following guides for a step-by-step approach:

Before You Start

Make sure the Nuxeo JSF UI target package is checked in your project's Application Definition to get all the needed features in Nuxeo Studio.

Create the News Document Type

  1. Create a new document type called News.

    A document type must have a container. However if you do not want your document type to be displayed in the available document list window, you can select Document type as the container.

  2. On the Definition tab, ensure that the our News document extends the Document type.
  3. On the Schema tab:
    • Add the files schema (necessary so that pictures that are uploaded with a HTML widget are stored).
    • Under Add a custom schema a field body of type String.
  4. Create the layouts of the document:

    • Creation layout metadata: dc:title as text widget, news:body as a HTML text widget.
    • Edit layout metadata: import Creation layout (it is the same).
    • View layout metadata: import Creation layout and add dc:valid as DateTime widget on a third row.

    The News document type is now created. However, there is no way to access the creation form for now.

Create the Structure Template for News Folder to Be Available Automatically

  1. Create a new Structure Template:
    • ID: Workspace
    • Target Document Type: Workspace
  2. Add a new built-in type: Folder

    • Node Name: NewsFolder
    • Title: News Folder

    Now, every time a workspace is created, a folder called "News Folder" will automatically be created in it by the system.

Add the News Creation Button

Here are the steps to create the button to create news from a Workspace into the News Folder:

  1. Create a new User Action. Its properties:
    • ID: CreateNewsButton
    • Label: Create news
    • Category: Folder toolbar
  2. Activation conditions:
    • User has permission: Edit
    • Current document has type: Workspace
  3. Create new operation chain CreateNewsChain:
    - Repository.GetDocument:
        value: ./NewsFolder
    - WebUI.NavigateTo
    - WebUI.ShowCreateForm:
        type: News
    Now when you click on the Create News button, a News document will be created for the Workspace and stored directly in the News folder.
4 months ago Solen Guitter NXDOC-1181: Add JSF UI package prerequisite
6 months ago Solen Guitter NXDOC-1087: Use new previous/next navigation
8 months ago Solen Guitter Fix screenshot size, remove empty lines and ' ', update review dates
8 months ago Solen Guitter NXDOC-966: Review Implement the news document
9 months ago Andrew Goodricke Add content-review-lts2016 to labels
9 months ago Kevin Leturc NXP-19481: Update MarkLogic page to detail how to configure range element indexes
a year ago Manon Lumeau 17 | ix Studio menu label
2 years ago Solen Guitter 16 | Update Schema tab step
2 years ago Manon Lumeau 15 | replace "Write" by "Edit"
2 years ago Manon Lumeau 14
2 years ago Manon Lumeau 13
2 years ago Manon Lumeau 12
2 years ago Manon Lumeau 11
3 years ago Alain Escaffre 10
7 years ago Solen Guitter 8 | updated reference howtos
7 years ago Solen Guitter 9
7 years ago Solen Guitter 7
7 years ago Solen Guitter 6
7 years ago Solen Guitter 5 | moving workspace content view section
7 years ago Solen Guitter 4 | added all content type and structure instructions
7 years ago Alain Escaffre 2
7 years ago Alain Escaffre 3
7 years ago Alain Escaffre 1
History: Created by Alain Escaffre