Search This Blog

Re: [mobicents-public] deploy-config.xml constants

Yeah, definitely it would be a good "hack" to be added to the documentation while a more elaborate solution isn't available.

--
Alexandre Mendonça // JBoss R&D
http://ammendonca.blogspot.com/



2011/3/28 Vilius Panevėžys <vilius@elitnet.lt>
Yes! Sorry, if the wording was not clear. :)

The problem that I described in the first post is solved adequately by XML entities - no need for replacefilters and such.

Might be worth mentioning this possibility in the User Guide so that it is not lost in the archives of this list. :)


--
Vilius Panevėžys
Elitnet



On 2011-03-28 16:35, Eduardo Martins wrote:
So the workaround works?

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco



2011/3/28 Vilius Panevėžys<vilius@elitnet.lt>:
I've realized my mistake in declaring the ENTITY.

Entities must be declared inside a DOCTYPE declaration for root element of
the document:
====== SNIPPET START ======
<!DOCTYPE deploy-config [
       <!ENTITY commonProp1 "val1">
       <!ENTITY commonProp2 "val2">
]>
====== SNIPPET END ======

Thanks again for the suggestion, Wozza.


--
Vilius Panevėžys
Elitnet

On 2011-03-28 14:45, Vilius Panevėžys wrote:

Thanks, just tested your suggestion but deployment of the DU fails with a
SAXParseException. Not sure I used the entity correctly, what I tried is
something like:
declaring
<!ENTITY cprop "value">

referencing
&cprop;

This fails with an error saying that the document is not well-formed
whether I
place the ENTITY declaration inside the root node or before it.


--
Vilius Panevėžys
Elitnet

On 2011-03-28 14:24, WozZa XiNg wrote:

I believe you could declare an XML entity and reference it within the
document.
May achieve the same goal. Entities can be single characters or entire
fragments.

Eduardo Martins wrote:

Sounds a reasonable enhancement, can you contribute with it? :)

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco



2011/3/28 Vilius Panevėžys<vilius@elitnet.lt>:

Hi,
is there a possibility to define constants in deploy-config.xml ?

As it's not mentioned in User Guide and AFAICT is not allowed in the
XSD
schema, I would suggest this as a useful extension. If I'm wrong I'd be
interested in learning how to use that.

Example use case would be when we have to define multiple RA Entities
with
numerous properties most of which have identical values for all of them
except for only a couple of them that differ in all of the entities. In
this
case I would prefer to define the common values in a common set of
variables
(constants) at the top of the file (deploy-config.xml) and reference
those
in properties section of each of the entities. That's just common sense
but
it would really ease maintenance of such deployments.

The first idea that comes to mind for this is to allow declaring
strings,
e.g.
====== SNIPPET START ======
<!-- [...] -->
<!-- section of common properties -->
<xs:string name="commonPropertyValue">cpv</xs:string>

<!-- [...] -->
<!-- properties of a particular RA entity-->
<properties>
<property name="commonProperty"
type="java.lang.String" value="{$commonPropertyValue}" />
<!-- [...] -->
</properties>
<!-- [...] -->
====== SNIPPET END ======

Thanks!


--
Vilius Panevėžys
Elitnet