Path

ez projects / nmcontent


NM Content

UNIX name Owner Status Version Compatible with
nmcontent Eirik Alfstad Johansen beta 0.2 4.x
This extension allows you to import specifications of content classes and content structures into eZ Publish.

Content classes

The process of creating/modifying content classes in eZ Publish consists of first planning your content class needs, and then executing the changes that need to be made in the eZ Publish class list. 

To aid in the process of creating a content class specification, we have created and made available a separate tool called ezclasspec (for more information, please go to http://projects.ez.no/ezclasspec). Once a specification is completed, it can be exported to a file which can then be imported into nmcontent making the specified changes to the content classes.

Import assumptions

The import process will make the following assumptions:

  • The first attribute is used as the object name pattern
  • All new classes are set to be containers
  • All new classes are stored in the "Content" glass group
  • All attributes of new classes are set to be searchable
  • The specification only includes changes to the given classes. For instance, if you want to add a new attribute to an existing class, the class specification only needs to include that specific attribute.

Usage

To start the import procedure, go to the URI /nmcontent/classimport

From here, you upload an specification file as produced by ezclasspec when selecting «Export».

When you click «Import», you will be presented with detailed information about what will happen to your classes once the import is completed.

Example of the information you get when clicking «Import» the first time.

By clicking import again, the specified changes will be made to your classes.

Content structure

The content structure import will convert a nested, unordered list into a node tree

in eZ Publish. Each node should be specified using the following format

[Node name] ([Class identifier/name])

Here is an example of a content structure:

  • Products (folder)
    • First product (product)
    • Second product (product)
  • Blog (blog)
    • First blog post (blog_post)
    • Second blog post (blog_post)
  • About us (folder)
    • Our history (article)
    • Board of directors (article)
  • Contact us (folder)

Notice that you can use either the class identifier, or the class name in the parantheses, but identifiers are preferred since they are unique.

The node names will be used as input in the first attribute of the given class (so be aware of objects with special object name patterns).

If a node exists with the same name and class on a given location in the node tree, it will not be duplicated.

Dummy content

If you want the nodes created to contain more information than just a name, you can create a set of dummy nodes which will be used as the basis for the new nodes. When a new node is created, it will check the dummy content container to see if there exists a node of the same class. If so, the dummy node and its contents will be copied and used as the basis for the new node.

TIP: If you find yourself reusing the same content classes with the same dummy content across projects, you might want to look into setting up the ezodf extension to handle multiupload of OpenOffice documents with this content. That way, you won't have to create each individual node in eZ Publish for each project. Check out the odf.ini file in the ezodf extension for more details.

Usage

To start the import procedure, go to the URI /nmcontent/structureimport

Here you will be prompted for the following informasjon:

  • Parent node ID
    • The id of the node under which you want the content structure to be placed.
  • Dummy content parent node id
    • The id of the node under which you have placed your dummy content.
  • Content structure
    • Your content structure as an unordered, nested list as specified above. TIP: You can of course copy and paste your structure from a Word or OpenOffice document.

When you're done, click «Import», and the content structure will be imported.

Known issues

Depending on from where the indented content tree is pasted, nmcontent might have problems parsing it. If possible, try copying and pasting from an OpenOffice document for best effect.

Screenshot

Screenshot
Screenshot

This project has no reviews yet. Be the first one to review it!