[opencms-dev] (6b1) Xml Content, The point of "unbounded" elements

Daniel Rhoden drhoden at iiwinc.com
Thu Mar 31 18:42:54 CEST 2005


I don't believe I know enough about the significance of a default locale 
and its impact on the schema driven interface to know if this is a 
viable option.  Below is the schema I defined for the 404 redirection 
tool.  Its root node is called Rules.  The idea is to have lots of 
'Rule' child nodes, that each organize their unique rule.  If you 
believe the option you propose will allow for this, I am happy to figure 
it out the rest of the way.  However, if after reviewing my schema you 
believe that what I hope to accomplish is not possible with the option 
you propose, please let me know.  I am happy contribute any changes that 
might make this concept valuable for others to use.

Thank you,

--Daniel Rhoden

--------------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified">
   
    <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>   

    <xsd:element name="Rules" type="OpenCmsRules"/>
   
    <xsd:complexType name="OpenCmsRules">
        <xsd:sequence>
            <xsd:element name="Rule" type="OpenCmsRule" minOccurs="0" 
maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="OpenCmsRule">
        <xsd:sequence>
            <xsd:element name="RequestedResource" type="OpenCmsVfsFile" 
minOccurs="1" maxOccurs="1" />
            <xsd:element name="TargetResource" type="OpenCmsVfsFile" 
minOccurs="1" maxOccurs="1" />
            <xsd:element name="Action" type="OpenCmsString" 
minOccurs="1" maxOccurs="1" />
            <xsd:element name="BeginAction" type="OpenCmsDateTime" 
minOccurs="1" maxOccurs="1" />
            <xsd:element name="EndAction" type="OpenCmsDateTime" 
minOccurs="1" maxOccurs="1" />
        </xsd:sequence>
        <xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
    </xsd:complexType>

    <xsd:annotation>
        <xsd:appinfo>
            <defaults>
                <default element="Action" value="301|302|FORWARD"/>
                <default element="BeginAction" value="${currenttime}" />
            </defaults>
            <layouts>
                <layout element="Action" widget="SelectorWidget" />
            </layouts>   
        </xsd:appinfo>
    </xsd:annotation> 
</xsd:schema>
--------------


Alexander Kandzior wrote:

> Why don't you use some default locale (e.g. "en") and store your 
> otherwise locale independent content below that node? We do that for 
> the configuration of the "templateone" for example.
>
> Best Regards,
> Alex.
>
> Alexander Kandzior
> Alkacon Software - The OpenCms Experts
> http://www.alkacon.com <http://www.alkacon.com/>
>
>  
>
>     ------------------------------------------------------------------------
>     *From:* opencms-dev-bounces at opencms.org
>     [mailto:opencms-dev-bounces at opencms.org] *On Behalf Of *Daniel Rhoden
>     *Sent:* Thursday, March 31, 2005 5:59 PM
>     *To:* The OpenCms mailing list
>     *Subject:* Re: [opencms-dev] (6b1) Xml Content, The point of
>     "unbounded" elements
>
>     If I understand you correctly, the maxOccurs is set to 'unbounded'
>     because you can have as many of those nodes as languages.  That
>     makes sense and definitely has enormous power.  However, I think
>     that XML/Structured content would be so much more powerful if it
>     were not assumed to have a single application (local specific
>     content).  Let me explain.
>
>     The idea of defining a schema driven interface would be very
>     powerful for the management of configuration files.  Because
>     configuration files would only be used internally, it doesn't
>     matter what local it belongs to.  Here is an example application. 
>     I am writing a custom 404 error page that, depending on the
>     settings/entries in the configuration file, will redirect (301 or
>     302) or forward the user to another resource based upon the
>     requested resource.  This would be used to preserve page rank
>     during a site's restructuring (and other purposes).  I think there
>     are so many other ways that a schema driven interface could be
>     used if it were not limited to a single application of
>     local-specific data.
>
>     With this example in mind, do you see a way that this feature can
>     be added to the interface without hurting the requirements of
>     local-specific data management?
>
>     Thank you very much for your time and thought,
>
>     --Daniel Rhoden
>
>     Alexander Kandzior wrote:
>
>>If you create a sibling of an XML{page|content} file in a different locale
>>folder, the editor will automatically give you the option to edit this
>>folders language version. You need to attach the "locale" property with the
>>different locale to  the folder of the sibling. 
>>
>>Best Regards,
>>Alex.
>>
>>Alexander Kandzior
>>Alkacon Software - The OpenCms Experts
>>http://www.alkacon.com
>>
>> 
>>
>>  
>>
>>>-----Original Message-----
>>>From: opencms-dev-bounces at opencms.org 
>>>[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Daniel Rhoden
>>>Sent: Thursday, March 31, 2005 12:22 AM
>>>To: The OpenCms mailing list
>>>Subject: [opencms-dev] (6b1) Xml Content, The point of 
>>>"unbounded" elements
>>>
>>>Why is it that all the examples of xml content schema have 
>>>the maxOccurs attribute of the first child element set to 
>>>"unbounded" when there is no way in the form editor to 
>>>actually create and edit another sibling?
>>>
>>>Will the form editor eventually have the ability to easily 
>>>manage multiple child elements?
>>>
>>>/xmlcontent/article.xsd
>>>-----------
>>>...
>>>    <xsd:complexType name="OpenCmsArticles">
>>>        <xsd:sequence>
>>>            <xsd:element name="Article" type="OpenCmsArticle" 
>>>minOccurs="0" maxOccurs="unbounded"/>
>>>        </xsd:sequence>
>>>    </xsd:complexType>
>>>...
>>>-----------
>>>
>>>Thanks,
>>>
>>>--Daniel Rhoden
>>>
>>>
>>>_______________________________________________
>>>This mail is send to you from the opencms-dev mailing list To 
>>>change your list options, or to unsubscribe from the list, 
>>>please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
>>>
>>>
>>>    
>>>
>>
>>
>>
>>_______________________________________________
>>This mail is send to you from the opencms-dev mailing list
>>To change your list options, or to unsubscribe from the list, please visit
>>http://mail.opencms.org/mailman/listinfo/opencms-dev
>>
>>  
>>
>------------------------------------------------------------------------
>
>
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050331/0f1ce62d/attachment.htm>


More information about the opencms-dev mailing list