What is Content Type Definition?

You don't have to be a programming guru to be able to define new Content Types in the ECMS part of Sense/Net Portal Engine TNG.

Content Types define the structure of an enterprise content in the ECMS. Content can be anything that you want to store, display, list, search, query, set access rights to and so on. Content can be anything, a word document, a contract, az ISO document or memo, a web article, a piece of news, a blog entry, a forum topic, a page, a picture - everything that has some content that someone can view and comprehend. In the PFS, everything is a Content, even a Content Type Definition is a Content. So sites, pages, templates, folders and documents, WCMS contents, forum topics, projects, forms, groups, roles, users, portlets, applications, CSS files, static HTML are also contents in this ECMS.

The PFS provides services for all contents, such as

  • storing Content in a tree structure (taxonomy)
  • storing and indexing metadata for fast search and filtering
  • check in and check out
  • versioning and version history
  • managing permissions in a hierarchical way
  • delegation of permission settings
  • displaying lists and editor forms
  • friendly URL
  • event modell and workflow interface

The following screesnhot shows the Portal Explorer open at the folder where content type definitions are stored. To create a new content type, you just have to add a new definition, to the /System/Schema/ContentTypes folder in the PFS. The Content Type Definition or CTD is just a simple XML, that describes the Fields of the Content. On the shot, you can see the GenericContent type, which, as its name would suggest, is a generic type for creating other types with inheritance. All the fields of an ancestor are inherited to the new type.

The example below is the CTD for a Car, which is inherited from the generic type. I think the XML speaks for itself. If you were to store your companies Cars in a databalse, think again, and use an ECMS. The only thing you need is this CTD file (which you can copy-paste and modify) and you have dozens of services, including a GUI and enterprise level security, etc.

<ContentType name="Car" parentType="GenericContent" handler="SenseNet.PortalEngine.Content.GenericContent" xmlns="http://schemas.sensenet.hu/PortalEngine/ContentTypeDefinition">
  <Title>Car</Title>
  <Description>Car</Description>
  <Icon>Car</Icon>
  <Fields>
    <Field name="Make" type="ShortText">
      <Title>Make</Title>
      <Description>e.g. Mazda, Ferrari etc.</Description>
      <Icon>field.gif</Icon>
    </Field>
    <Field name="Model" type="ShortText">
      <Title>Model</Title>
      <Description>e.g. RX-8, F-40 etc.</Description>
      <Icon>field.gif</Icon>
    </Field>
    <Field name="Style" type="Choice">
      <Title>Style</Title>
      <Description>Select one</Description>
      <Icon>field.gif</Icon>
      <Configuration>
        <Type>SingleSelect</Type>
        <ExtraField>true</ExtraField>
        <Options>
          <Option selected="true">Sedan</Option>
          <Option>Coupe</Option>
          <Option>Cabrio</Option>
          <Option>Roadster</Option>
          <Option>SUV</Option>
          <Option>Van</Option>
        </Options>
      </Configuration>
    </Field>
    <Field name="StartingDate" type="DateTime">
      <Title>Starting Date</Title>
      <Description>Starting Date</Description>
      <Icon>field.gif</Icon>
    </Field>
    <Field name="Color" type="Color">
      <Title>Colour</Title>
      <Description>Colour</Description>
      <Icon>field.gif</Icon>
    </Field>
    <Field name="EngineSize" type="ShortText">
      <Title>Engine Size</Title>
      <Description>Engine Size (litres)</Description>
      <Icon>field.gif</Icon>
    </Field>
    <Field name="Power" type="ShortText">
      <Title>Power in hp</Title>
      <Description>Power in hp</Description>
      <Icon>field.gif</Icon>
    </Field>
    <Field name="Price" type="Number">
      <Title>Base price</Title>
      <Description>Base price $</Description>
      <Icon>field.gif</Icon>
    </Field>
    <Field name="Description" type="LongText">
      <Title>Description</Title>
      <Description>Description</Description>
      <Icon>field.gif</Icon>
    </Field>
  </Fields>
</ContentType>

Comments are closed

Welcome to the blog!

Sense/Net ECM is ever evolving. Community means the world to us so we want to keep you apprised on what’s happening on our side of the woods. Want to make us happy? Add a comment and tell us what you think!

Month List