Re: [jira] Resolved: (CAY-1167) Create model schema XSD

From: Andrey Razumovsky (razumovsky.andre..mail.com)
Date: Wed Jun 10 2009 - 05:57:11 EDT

  • Next message: Aristedes Maniatis: "Re: [jira] Resolved: (CAY-1167) Create model schema XSD"

    We just need to change second URL to "
    http://cayenne.apache.org/schema/3.0/modelMap.xsd". Now I when I changed
    that manually, I get the following validation problem with pre-persist
    *listener* attached to ObjEntity:

    <obj-entity name="Calendar" className="com.nic.aspu.data.Calendar"
    dbEntityName="calendar"
    superClassName="com.nic.tomato.cayenne.CayenneDataObject">
            <obj-attribute name="active" type="java.lang.Boolean"
    db-attribute-path="active"/>
            <obj-attribute name="bydefault" type="java.lang.String"
    db-attribute-path="bydefault"/>
            <obj-attribute name="dbuser" type="java.lang.String"
    db-attribute-path="dbuser"/>
            <obj-attribute name="dbusercr" type="java.lang.String"
    db-attribute-path="dbusercr"/>
            <obj-attribute name="deleted" type="java.lang.Boolean"
    db-attribute-path="deleted"/>
            <obj-attribute name="maclabel" type="java.lang.String"
    db-attribute-path="maclabel"/>
            <obj-attribute name="name" type="java.lang.String"
    db-attribute-path="name"/>
            <obj-attribute name="time" type="java.lang.String"
    db-attribute-path="calendartime"/>
            <obj-attribute name="timestamp" type="java.lang.Long"
    db-attribute-path="timestamp"/>
            <obj-attribute name="timestampcr" type="java.lang.Long"
    db-attribute-path="timestampcr"/>
            <entity-listener class="com.nic.aspu.data.event.SetActiveListener">
                <pre-persist method-name="prePersist"/>
            </entity-listener>
        </obj-entity>

    Problem:
    cvc-complex-type.2.4.b: The content of element 'obj-entity' is not complete.
    One of '{"http://cayenne.apache.org/schema/3.0/modelMap":pre-persist}' is
    expected.

    2009/6/10 Aristedes Maniatis <ar..aniatis.org>

    > Yes, absolutely. The schemaLocation should end in .xsd
    >
    > That's a bummer. We need to fix that in Cayenne code itself, but in the
    > meantime, maybe we can redirect
    > http://cayenne.apache.org/schema/3.0/modelMap to
    > http://cayenne.apache.org/schema/3.0/modelMap.xsd. Does anyone know
    > whether we can add .htaccess files to the Cayenne web site?
    >
    > Ari Maniatis
    >
    >
    > On 10/6/09 7:40 PM, Andrey Razumovsky wrote:
    >
    >> Hi Ari,
    >>
    >> Here is Datamap.xml header generated by CM:
    >>
    >> <data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
    >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >> xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap
    >> http://cayenne.apache.org/schema/3.0/modelMap"
    >> project-version="3.0">
    >>
    >> I think it fails because second url in xsi:schemaLocation (
    >> http://cayenne.apache.org/schema/3.0/modelMap) points to HTML, not to
    >> XSD.
    >>
    >> 2009/6/10 Aristedes Maniatis<ar..aniatis.org>
    >>
    >> Hi Andrey
    >>>
    >>> What is the schema location is it trying to load from?
    >>>
    >>> How did you generate the datamap XML? Did you create a new project in
    >>> Cayenne Modeler? If you like, send me the XML offlist and I can see if I
    >>> can
    >>> reproduce the problem.
    >>>
    >>>
    >>> Ari Maniatis
    >>>
    >>>
    >>>
    >>> On 10/6/09 5:18 PM, Andrey Razumovsky wrote:
    >>>
    >>> Hi Ari,
    >>>>
    >>>> I've created a JIRA issue. Seems that Eclipse is trying to download XSD
    >>>> from
    >>>> specified location, but it is simple HTML.
    >>>>
    >>>> 2009/6/5 Aristedes Maniatis<ar..aniatis.org>
    >>>>
    >>>> On 5/6/09 7:19 PM, Andrey Razumovsky wrote:
    >>>>
    >>>>> I started getting problems with validating DataMap XMLs in Eclipse. It
    >>>>>
    >>>>>> says
    >>>>>> "Referenced file [i.e. our xsd schema] contains errors". And there are
    >>>>>> a
    >>>>>> lot
    >>>>>> of errors in details. Does anyone have such problems?
    >>>>>>
    >>>>>> I haven't seen any problems, but I'm not terribly surprised given
    >>>>>> that
    >>>>>>
    >>>>> there hasn't been any enforced validation until now. If you have some
    >>>>> details I am sure we can work through them to figure out what needs to
    >>>>> be
    >>>>> tweaked. For example, the XSD is sensitive to the order of elements: I
    >>>>> think
    >>>>> I got the order right, but maybe something is mixed up.
    >>>>>
    >>>>> Ari Maniatis
    >>>>>
    >>>>>
    >>>>>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Wed Jun 10 2009 - 05:57:44 EDT