Template based messages.

2010-08-11 Thread sha...@arosys.com
Hi
My requirement is to send the mails in bulk on the basis of some
criteria (like age city etc.). Does it possible to prepare the templates to
send the mails.
How can I start with this?

Thanks
Shammi


mail2web.com – Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[email] Re: Template based messages.

2010-08-11 Thread Siegfried Goeschl

Hi Shammi,

commons-email is about creating (and sending) various forms of 
MimeMessages so you need some infrastructure to create the messages 
dynamically. Over the years I've done that using


+) embedded scripts
+) XSLT
+) Velocity

Cheers,

Siegfried Goeschl

On 11.08.10 09:38, sha...@arosys.com wrote:

Hi
 My requirement is to send the mails in bulk on the basis of some
criteria (like age city etc.). Does it possible to prepare the templates to
send the mails.
How can I start with this?

Thanks
Shammi


mail2web.com – Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[Logging] : Use of Jdk14Logger is not creating log file

2010-08-11 Thread Jasmin Mehta
Hi,

I'm using org.apache.commons.logging.impl.Jdk14Logger as my log class. 
Here is my commons.properties file which I have set it in the classpath 
while deploying on OC4J 10.1.3.5 App server. 

I am using Java 1.5.0.18

But its not creating the log file.  What is that I am doing wrong here?

Thanks

commons.properties


priority=1

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl

handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler

# file handler
java.util.logging.FileHandler.level = ALL
java.util.logging.FileHandler.pattern = vgcc.log
java.util.logging.FileHandler.limit = 5
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
# console handler
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = 
java.util.logging.SimpleFormatter



**
This email and any files transmitted with it are intended solely for 
the use of the individual or agency to whom they are addressed. 
If you have received this email in error please notify the Navy 
Exchange Service Command e-mail administrator. This footnote 
also confirms that this email message has been scanned for the
presence of computer viruses.

Thank You!
**



Re: [scxml] datamodel, custom actions and digester

2010-08-11 Thread Abigail Gertner


On 8/11/2010 12:29 AM, Rahul Akolkar wrote:
 snip/
 The way to obtain the live values of the datamodel is to use the
 expression evaluator, see interfaces mentioned here:

   http://commons.apache.org/scxml/guide/contexts-evaluators.html

   

Is it possible to call a method using the expression evaluator with an
argument that is a node in the XML tree, rather than just a string value?

 Might be worthwhile revisiting the need for using
 SCXMLParser#newInstance() rather than the static parse methods.


   
The reason I am doing this is that I am using xinclude to include a
separate xml file and I found that I needed to call setXIncludeAware()
on the parser to make it do the include. Is there some way to do this
using the static parse methods?

Thanks again,
-Abigail


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [scxml] datamodel, custom actions and digester

2010-08-11 Thread Rahul Akolkar
On Wed, Aug 11, 2010 at 2:19 PM, Abigail Gertner gert...@mitre.org wrote:


 On 8/11/2010 12:29 AM, Rahul Akolkar wrote:
 snip/
 The way to obtain the live values of the datamodel is to use the
 expression evaluator, see interfaces mentioned here:

   http://commons.apache.org/scxml/guide/contexts-evaluators.html



 Is it possible to call a method using the expression evaluator with an
 argument that is a node in the XML tree, rather than just a string value?

snip/

Executable content is open ended in SCXML, as largely speaking most
things are possible with custom actions. I'm afraid I've lost the
bigger picture of your scenario in the pin-pointed question above.

To obtain a node using the expression evaluator, use
Evaluator#evalLocation(...) which returns a Node.


 Might be worthwhile revisiting the need for using
 SCXMLParser#newInstance() rather than the static parse methods.



 The reason I am doing this is that I am using xinclude to include a
 separate xml file and I found that I needed to call setXIncludeAware()
 on the parser to make it do the include. Is there some way to do this
 using the static parse methods?

snap/

Not in the latest release (v0.9) so thats one of the cases where you
may indeed not be able to use the static parse methods. Based on what
I've read so far, it seems your best bet may be to register the
digester rules for your custom actions by hand after you obtain the
new instance and let the custom action do the appropriate expression
evaluation and datamodel / context processing.

-Rahul


 Thanks again,
 -Abigail


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [scxml] datamodel, custom actions and digester

2010-08-11 Thread Abigail Gertner


On 8/11/2010 3:36 PM, Rahul Akolkar wrote:
 On Wed, Aug 11, 2010 at 2:19 PM, Abigail Gertner gert...@mitre.org wrote:
   

 On 8/11/2010 12:29 AM, Rahul Akolkar wrote:
 
 snip/
 The way to obtain the live values of the datamodel is to use the
 expression evaluator, see interfaces mentioned here:

   http://commons.apache.org/scxml/guide/contexts-evaluators.html


   
 Is it possible to call a method using the expression evaluator with an
 argument that is a node in the XML tree, rather than just a string value?

 
 snip/

 Executable content is open ended in SCXML, as largely speaking most
 things are possible with custom actions. I'm afraid I've lost the
 bigger picture of your scenario in the pin-pointed question above.

 To obtain a node using the expression evaluator, use
 Evaluator#evalLocation(...) which returns a Node.
   

What I mean is, if I want to do something like:

onentry
  cs:var name=result expr=foo.bar(...)/
/onentry

Where the argument to foo.bar() is a Node from the datamodel, but with
the current context values included, how can I get that from the
expression evaluator. I tried using the Data('var','path') expression
but it doesn't seem to work for nodes.

 Might be worthwhile revisiting the need for using
 SCXMLParser#newInstance() rather than the static parse methods.



   
 The reason I am doing this is that I am using xinclude to include a
 separate xml file and I found that I needed to call setXIncludeAware()
 on the parser to make it do the include. Is there some way to do this
 using the static parse methods?

 
 snap/

 Not in the latest release (v0.9) so thats one of the cases where you
 may indeed not be able to use the static parse methods. Based on what
 I've read so far, it seems your best bet may be to register the
 digester rules for your custom actions by hand after you obtain the
 new instance and let the custom action do the appropriate expression
 evaluation and datamodel / context processing.
   
I'm trying to do it this way now and having trouble getting the custom
action to fire. I am using

dig.addObjectCreate(!*/onentry/sendMessage, SendMessage.class);

Where my custom action is called SendMessage.

Then in my scxml file I have

onentry
  sendMessage/
/onentry

The SendMessage object is being created when the file is parsed, but the
execute() method is not being called when the state is entered.
Do I have to do something else to get it to call execute()?

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Logging] : Can commons.logging be used without log4j

2010-08-11 Thread Jasmin Mehta
Brent,

I am using log4j.properties instead of log4j.xml. 

Will RepositorySelector  concept still work? What changes I should make 
into this method?

   private static void loadLog4JConfig(ServletConfig config,
   Hierarchy hierarchy)
throws ServletException {
try {
String log4jFile = /WEB-INF/log4j.xml;
InputStream log4JConfig =
config.getServletContext().getResourceAsStream(log4jFile);
Document doc = DocumentBuilderFactory.newInstance()
 .newDocumentBuilder()
 .parse(log4JConfig);
DOMConfigurator conf = new DOMConfigurator();
conf.doConfigure(doc.getDocumentElement(), hierarchy);
} catch (Exception e) {
throw new ServletException(e);
}
}




From:   Brent Worden brent.wor...@gmail.com
To: user@commons.apache.org
Date:   08/09/2010 09:56 AM
Subject:Re: [Logging] : Can commons.logging be used without log4j


On 8/9/2010 7:53 AM, Jasmin Mehta wrote:
 The log4j has limitation that if its used as a shared library then it 
can
 initiate only one configuration. So my all we applications which shares
 the same instance are populating the logs into only one log file (the 
web
 app which deployed first in order), rather than individual / separate 
log
 files configured in the path of each of the application's
 log4j.properties.


This isn't true.  Log4j allows for defining and using multiple log
configurations in a single JVM.  This is accomplished by using a
RepositorySelector to manage the multiple log hierarchies.  See
http://community.jboss.org/wiki/Log4jrepositoryselector for a web
container example.

Thanks,

Brent Worden


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



**
This email and any files transmitted with it are intended solely for 
the use of the individual or agency to whom they are addressed. 
If you have received this email in error please notify the Navy 
Exchange Service Command e-mail administrator. This footnote 
also confirms that this email message has been scanned for the
presence of computer viruses.

Thank You!
**



Re: [scxml] datamodel, custom actions and digester

2010-08-11 Thread Rahul Akolkar
On Wed, Aug 11, 2010 at 3:51 PM, Abigail Gertner gert...@mitre.org wrote:


 On 8/11/2010 3:36 PM, Rahul Akolkar wrote:
 On Wed, Aug 11, 2010 at 2:19 PM, Abigail Gertner gert...@mitre.org wrote:


 On 8/11/2010 12:29 AM, Rahul Akolkar wrote:

 snip/
 The way to obtain the live values of the datamodel is to use the
 expression evaluator, see interfaces mentioned here:

   http://commons.apache.org/scxml/guide/contexts-evaluators.html



 Is it possible to call a method using the expression evaluator with an
 argument that is a node in the XML tree, rather than just a string value?


 snip/

 Executable content is open ended in SCXML, as largely speaking most
 things are possible with custom actions. I'm afraid I've lost the
 bigger picture of your scenario in the pin-pointed question above.

 To obtain a node using the expression evaluator, use
 Evaluator#evalLocation(...) which returns a Node.


 What I mean is, if I want to do something like:

 onentry
  cs:var name=result expr=foo.bar(...)/
 /onentry

 Where the argument to foo.bar() is a Node from the datamodel, but with
 the current context values included, how can I get that from the
 expression evaluator. I tried using the Data('var','path') expression
 but it doesn't seem to work for nodes.

snip/

Here are some ways to tackle this:

 * Break the above into smaller operations: (1) obtain a node, (2)
invoke the method. For example:

onentry
  my:node name=arg expr=.../
      cs:var name=result expr=foo.bar(arg)/
/onentry

  where my:node uses Evaluator#evalLocation(...) and creates a var
matching the name argument.

 * Use XPath as the expression language as its better equipped to deal
with XML nodes. The above would then become:

   onentry
     cs:var name=result expr=foo:bar($dataid/xpath/to/node)/
   /onentry

   However, the XPath evaluator isn't available in the latest release
however, but rather in a branch:

   
http://svn.apache.org/repos/asf/commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/env/xpath/

 * A bit of background - The Data() function is mostly limited to
values of leaf nodes (strings, integers) and is designed to satisfy
the rvalue of most assignment expressions. There is a corresponding
LData() -- I presume you're using JEXL -- that is meant to satisfy the
lvalue (and will return nodes) but these are implementation details so
resorting to using LData isn't recommended.


 Might be worthwhile revisiting the need for using
 SCXMLParser#newInstance() rather than the static parse methods.




 The reason I am doing this is that I am using xinclude to include a
 separate xml file and I found that I needed to call setXIncludeAware()
 on the parser to make it do the include. Is there some way to do this
 using the static parse methods?


 snap/

 Not in the latest release (v0.9) so thats one of the cases where you
 may indeed not be able to use the static parse methods. Based on what
 I've read so far, it seems your best bet may be to register the
 digester rules for your custom actions by hand after you obtain the
 new instance and let the custom action do the appropriate expression
 evaluation and datamodel / context processing.

 I'm trying to do it this way now and having trouble getting the custom
 action to fire. I am using

 dig.addObjectCreate(!*/onentry/sendMessage, SendMessage.class);

 Where my custom action is called SendMessage.

 Then in my scxml file I have

 onentry
  sendMessage/
 /onentry

 The SendMessage object is being created when the file is parsed, but the
 execute() method is not being called when the state is entered.
 Do I have to do something else to get it to call execute()?

snap/

Minimally, you'll have to add the SetNextRule (and maybe others, as
per your action needs), so this:

  dig.addSetNext(!*/onentry/sendMessage, addAction);

Also, best to use a different XML namespace for custom actions. See
Digester#setRuleNamespaceURI(...) for this purpose.

-Rahul

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org