hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hensley, Richard" <Richard.Hens...@McKesson.com>
Subject RE: Schema Object Manipulate Question
Date Tue, 24 May 2005 21:55:28 GMT
James,

Thanks a bunch, I've added http://issues.apache.org/jira/browse/HIVEMIND-126
for tracking. I poked the code in there also. 

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Tuesday, May 24, 2005 2:52 PM
To: hivemind-user@jakarta.apache.org
Subject: RE: Schema Object Manipulate Question

I wouldn't mind just adding your push-content rule to HiveMind.  It seems
logical enough.  


-----Original Message-----
From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] 
Sent: Tuesday, May 24, 2005 5:44 PM
To: hivemind-user@jakarta.apache.org
Subject: Schema Object Manipulate Question

I have the following schema

    <schema id="ItemManager">
        <element name="server" content-translator="object" />
    </schema>

This above dictates the following xml:

<server>instance:package.class</server>

When I use it, I really want whatever the object provider produces using the
contents as one of the elements in my configuration list.

The following works, but does not have the syntax that I desire.

    <schema id="ItemManager">
        <element name="server">
            <attribute name="server" translator="object" required="true" />

            <rules>
			<push-attribute attribute="server" />
                <invoke-parent method="addElement" />
            <rules>
        </element>
    </schema>

The above dictates the following xml:

<server name="instance:package.class" />

Not really what I want. Does anybody have any suggestions?



At the moment I'm using the following custom rule.

public class PushContentRule extends BaseRule implements Rule {

    public void begin(SchemaProcessor processor, Element element) {
        String value = RuleUtils.processText(processor, element, element
            .getContent());
        Translator t = processor.getContentTranslator();
        Object finalValue = t.translate(processor.getContributingModule(),
            Object.class, value, element.getLocation());
        processor.push(finalValue);
    }

    public void end(SchemaProcessor processor, Element element) {
        processor.pop();
    }
}

with a schema that looks like.

        <element name="server" content-translator="object">
            <rules>
                <custom class="util.PushContentRule" />

                <invoke-parent method="addElement" />
            </rules>
        </element>


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message