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">
    <Field name="Make" type="ShortText">
      <Description>e.g. Mazda, Ferrari etc.</Description>
    <Field name="Model" type="ShortText">
      <Description>e.g. RX-8, F-40 etc.</Description>
    <Field name="Style" type="Choice">
      <Description>Select one</Description>
          <Option selected="true">Sedan</Option>
    <Field name="StartingDate" type="DateTime">
      <Title>Starting Date</Title>
      <Description>Starting Date</Description>
    <Field name="Color" type="Color">
    <Field name="EngineSize" type="ShortText">
      <Title>Engine Size</Title>
      <Description>Engine Size (litres)</Description>
    <Field name="Power" type="ShortText">
      <Title>Power in hp</Title>
      <Description>Power in hp</Description>
    <Field name="Price" type="Number">
      <Title>Base price</Title>
      <Description>Base price $</Description>
    <Field name="Description" type="LongText">

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