You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2003/05/29 04:39:16 UTC

XMLResources and demo mailet

Mark,

Attached is a new class, XMLResources.java, a sample mailet, and a
miResources.xml file.  To test it, I added:

         <mailet match="RecipientIs=xmltest@localhost" class="XMLTest">

<resources>/opt/james/apps/james/conf/miResources.xml</resources>
	    <LIST_NAME>The List</LIST_NAME>
	    <DOMAIN_NAME>The Domain</DOMAIN_NAME>
	    <ERROR_MESSAGE>Error Message</ERROR_MESSAGE>
	    <MEMBER_LIST xml:space="preserve">
Frodo
Sam
Boromir
Gandalf
Gimli
Legolas
Merry
Pippin
Strider
	    </MEMBER_LIST>
         </mailet>

to my config.xml.

As you can see from XMLTest.java, you can do replacement either at init time
or at service time, depending upon which is appropriate to a given
replacement field.  One thing that I had to do at the moment was use a full
path to the resources file because we don't yet expose a method to a mailet
that can do relative path translation.

Does this look like something you can work with?  I haven't gotten the
responses.properties table in there, yet, just the text files.  I can do
that, or you.  The real question is whether or not this works for you.

	--- Noel

RE: XMLResources and demo mailet

Posted by "Noel J. Bergman" <no...@devtech.com>.
Mark,

Would you like to revise the list manager to use XMLResources, and submit?
I'll go ahead and commit XMLResources.

Go ahead and remove CDATA except from the footer_html and admincommands text
resource elements.  Both of them need it, since they have embedded HTML.  If
you get it wrong you'll know from the parsing error at startup.

	--- Noel

-----Original Message-----
From: Mark Imel [mailto:james@imelshire.com]
Sent: Thursday, May 29, 2003 12:22
To: James Developers List
Subject: RE: XMLResources and demo mailet


Noel, there's a lot a like about this approach.  You have the convience
class 'XMLResources' that hides a lot of the heavy lifting, and makes the
client's task easy.

As i noted before in the ListManager proposal, anything to get the custom
resources out of the class path, and into an adminstratively editable place
was crucial to making the listManager useful.

Also, i really like the 'overloading' concept of the 'for' attribute in
regards to the matcher.  That provides a nice way to customize the resources
on a per group basis.

The only thing that i don't like, is mixing in actual content (the CDATA)
into the xml.  It's not that i object to the location of the CDATA, it just
makes for some ugly looking xml.  It's really just a minor nit, and at this
point, the positives far outweigh the negatives.

Nice work.
How do you want to proceed with this improvement?

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com]
Sent: Wednesday, May 28, 2003 8:17 PM
To: James Developers List
Subject: RE: XMLResources and demo mailet


> I haven't gotten the responses.properties table in there

They are present in the revision attached.

My expectation is that the groups would be used to organize messages for
each command, and the "for" matching would be used to allow a particular
mailing list to replace one or more message resources.

	--- Noel


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


RE: XMLResources and demo mailet

Posted by Mark Imel <ja...@imelshire.com>.
Noel, there's a lot a like about this approach.  You have the convience
class 'XMLResources' that hides a lot of the heavy lifting, and makes the
client's task easy.

As i noted before in the ListManager proposal, anything to get the custom
resources out of the class path, and into an adminstratively editable place
was crucial to making the listManager useful.

Also, i really like the 'overloading' concept of the 'for' attribute in
regards to the matcher.  That provides a nice way to customize the resources
on a per group basis.

The only thing that i don't like, is mixing in actual content (the CDATA)
into the xml.  It's not that i object to the location of the CDATA, it just
makes for some ugly looking xml.  It's really just a minor nit, and at this
point, the positives far outweigh the negatives.

Nice work.
How do you want to proceed with this improvement?

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com]
Sent: Wednesday, May 28, 2003 8:17 PM
To: James Developers List
Subject: RE: XMLResources and demo mailet


> I haven't gotten the responses.properties table in there

They are present in the revision attached.

My expectation is that the groups would be used to organize messages for
each command, and the "for" matching would be used to allow a particular
mailing list to replace one or more message resources.

	--- Noel


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


RE: XMLResources and demo mailet

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I haven't gotten the responses.properties table in there

They are present in the revision attached.

My expectation is that the groups would be used to organize messages for
each command, and the "for" matching would be used to allow a particular
mailing list to replace one or more message resources.

	--- Noel