cancel
Showing results for 
Search instead for 
Did you mean: 

Content model for a Website

rmuduga
Champ in-the-making
Champ in-the-making
I am trying to build a website using Alfresco WCM. I was wondering if it is best to build a custom content model by extending the content model XML file available or should I use the Xforms approach to capture my meta data?

I would really appreciate a reply as I am new to Alfresco.Thanks

Smiley Happy
5 REPLIES 5

rdanner
Champ in-the-making
Champ in-the-making
I am trying to build a website using Alfresco WCM. I was wondering if it is best to build a custom content model by extending the content model XML file available or should I use the Xforms approach to capture my meta data?

I would really appreciate a reply as I am new to Alfresco.Thanks

Smiley Happy

It's hard to say with out knowing much more – but in general you should be able to do a lot with WCM without extending the content model.  Can you tell us a little about what you are trying to accomplish?

rmuduga
Champ in-the-making
Champ in-the-making
Thanks for the reply. Here is the situation

I am a Documentum Developer, trying to build a website using Alfresco WCM. The website has basic categories like "Products", "Services", "Customers"…just like the sample website. I am confused whether I have to create a new content model for these categories (Products, Services…). I have read the WCM documentation for the sample website and it uses the XForms approach for the content model (articles, multimedia…)

Should I build the model depending on the content type in XForms (articles, multimedia…) or object types(Products, Services…)?

eyestreet
Champ in-the-making
Champ in-the-making
You do not need to define your own content model when using WCM. Instead, use the xforms to define your content types.

As far a modeling goes, it is usually easier to define types based on content type when they easily map to page types. It can get a little complicated when the information is shared. For example, Product data may have associated Services.

vijay_alfresco
Champ in-the-making
Champ in-the-making
Hi Eyestreet,

I have similar requirement, could you please send few samples, i am not clear yet.

Thanks,
Vijay

eyestreet
Champ in-the-making
Champ in-the-making
Here is a simple xsd to define a product (product name, product image, relased services)

product.xsd:

<?xml version="1.0"?>
<!–
    Copyright (C) 2007 Eye Street Software Corporation.
–>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:alf="http://www.alfresco.org"
    xmlns:sample="http://www.eyestreet.com/sample"
    targetNamespace="http://www.eyestreet.com/sample"
    elementFormDefault="qualified">

    <!–
        call /cms/cms.jsp to build dynamic list of services:
        sample:serviceList

        <xs:include schemaLocation="/cms/cms.jsp"/>

        otherwise, define sample:serviceList locally:
    –>
            <xs:simpleType name="serviceList">
                <xs:restriction base="xs:string">
                    <xs:enumeration value="1">
                        <xs:annotation>
                            <xs:appinfo>
                                <alf:label>Onsite Training</alf:label>
                            </xs:appinfo>
                        </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="2">
                        <xs:annotation>
                            <xs:appinfo>
                                <alf:label>Professional Services</alf:label>
                            </xs:appinfo>
                        </xs:annotation>
                    </xs:enumeration>
                </xs:restriction>
            </xs:simpleType>
       

    <!– defines the form for creating a product  –>
    <xs:element name="product">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="name" type="xs:normalizedString"/>
                <xs:element name="image" type="xs:anyURI"/>
               
                <xs:element name="purchase_online" default="1" minOccurs="0" maxOccurs="1">
                    <xs:simpleType>
                        <xs:restriction base="xs:normalizedString">
                            <xs:enumeration value="1">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <alf:label>Yes</alf:label>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:enumeration>
                            <xs:enumeration value="0">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <alf:label>No</alf:label>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:enumeration>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
               
                <xs:element name="related-service" type="sample:serviceList" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                        <xs:appinfo>
                            <alf:label>Available Services</alf:label>
                            <alf:appearance>minimal</alf:appearance>
                        </xs:appinfo>
                    </xs:annotation>
                </xs:element>

            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>

and an ftl:

<#ftl ns_prefixes={"sample", "http://www.eyestreet.com/sample"}>
<#assign product = .vars["sample:product"]>
<html>
    <head>
        <style type="text/css">
            body
            {
            font-family: Tahoma, Arial, Helvetica, sans-serif;
            background-color: white;
            font-size: 12px;
            }

            .name
            {
            color: #003366;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 10px;
            }
        </style>
        <title>${product["sample:name"]}</title>
    </head>
    <body>
        <div class="name">name: ${product["sample:name"]}</div>
        <img src="${product["sample:image"]}></img>
        <div class="name">purchase_online: ${product["sample:purchase_online"]}</div>
        <div class="name">related-service: ${product["sample:related-service"]}</div>
    </body>
</html>

The related services list could be built dynamically in a jsp by reading from another template type.