Yes. The problem is that no mail gets sent, which is the purpose of
the notification. I reread my initial post, and now I understand your
confusion. I didn't explicitly state that the class wasn't working.
I'm using XWiki Enterprise manager 1.3 with platform version 1.5.2.
Dan
> Do you actually encounter a problem, besides the error in the logs ?
> I believe those logs are generated when you call getRenderedContent on
> your blog article, so I maintain they have nothing to do with your
> notification class.
> Which version of XWiki Enterprise are you using ?
>
> Jerome.
>
> Dan Svoboda wrote:
>> Hi,
>>
>> See below
>>
>> Dan Svoboda wrote:
>>>> Hi,
>>>>
>>>> I'm trying to use the notification system to trigger the sending of
>>>> email whenever a comment is added to a blog article. I'm
>>>> patterning my
>>>> groovy class after the pircbot example on the xwiki snippets site.
>>>>
>>>> My system is xwiki workspaces as a virtual xwiki under xem. The
>>>> platform version is 1.5.2.
>>>>
>>>> Here's my groovy class (XWSNotify.BlogMailNotificationGroovyClass):
>>>>
>>>> /* Groovy Class #* */
>>>>
>>>> import com.xpn.xwiki.api.XWiki;
>>>> import com.xpn.xwiki.XWikiContext;
>>>> import com.xpn.xwiki.notify.XWikiDocChangeNotificationInterface;
>>>> import com.xpn.xwiki.notify.DocObjectChangedRule;
>>>> import com.xpn.xwiki.notify.XWikiNotificationRule;
>>>> import com.xpn.xwiki.doc.XWikiDocument;
>>>>
>>>> public class BlogMailNotificationGroovyClass implements \
>>>>
>>>> XWikiDocChangeNotificationInterface
>>>>
>>>> {
>>>> def xwiki;
>>>> def rule;
>>>> def name;
>>>>
>>>> public void initClasses(XWikiContext context)
>>>> {
>>>> this.xwiki = context.getWiki();
>>>> // listen to notifications
>>>> this.rule = DocObjectChangedRule(this);
>>>>
>>>> context.getWiki().getNotificationManager().addGeneralRule(rule);
>>>> }
>>>>
>>>> public void notify(XWikiNotificationRule rule, XWikiDocument
>>>> newdoc, \
>>>> XWikiDocument olddoc, int event, XWikiContext
>>>> context)
>>>> {
>>>> def length = newdoc.getSpace().length();
>>>> def lastFour = length - 4;
>>>> if(newdoc.getSpace().substring(lastFour) == "Blog") {
>>>>
>>>> def ms = xwiki.getPlugin("mailsender");
>>>> def nb = ms.sendHtmlMessage(context.getUser(),
>>>> "myAddress(a)myHost.org <mailto:myAddress@myHost.org>
>>>> ", \
>>>> context.get("ccrecipients"),
>>>> context.get("bccrecipients"), \
>>>> context.get("subject"),
>>>> newdoc.getRenderedContent(), \
>>>> newdoc.getContent(),
>>>> newdoc.getAttachments());
>>>> }
>>>> }
>>>> }
>>>>
>>>> /* *# */
>>>>
>>>> Here's a velocity script I'm using to initialize/test:
>>>>
>>>> #set($sc =
>>>> $context.getContext().getEngineContext().getServletContext())
>>>> $sc.getAttribute("blgmailnotif")<br/>
>>>> #set($blgmlnotif =
>>>> $
>>>> xwiki
>>>> .parseGroovyFromPage("XWSNotify.BlogMailNotificationGroovyClass"))
>>>> #set($ok = $sc.setAttribute("blgmailnotif", $blgmlnotif))
>>>> #set($blgmailnotif = $sc.getAttribute("blgmailnotif"))
>>>> $sc.getAttribute("blgmailnotif")<br/>
>>>> #set($ok = $blgmlnotif.initClasses($context))
>>>> #set($ok = $blgmlnotif.notify($blgmlnotif.rule,$newdoc,$newdoc,
>>>> 3,$context))
>>>>
>>>> Here's the output from the velocity script:
>>>>
>>>> BlogMailNotificationGroovyClass@68e4a47
>>>> BlogMailNotificationGroovyClass@3c401d45
>>>>
>>>> So, the groovy class gets initialized to a new reference
>>>> successfully
>>>> each time parseGroovyFromPage is called.
>>>>
>>>> Here's what appears in the log after running the velocity script:
>>>>
>>>> [ERROR] Left side ($request.title) of '!=' operation has null
>>>> value.
>>>> Operation not possible. [line 53, column 43]
>>>> [WARNING] Cannot retrieve method notify from object of class
>>>> BlogMailNotificationGroovyClass due to security restrictions.
>>>>
>>>> If I alter the velocity script to:
>>>>
>>>> #set($sc =
>>>> $context.getContext().getEngineContext().getServletContext())
>>>> $sc.getAttribute("blgmailnotif")<br/>
>>>>
>>>> Here's what appears in the log:
>>>>
>>>> [ERROR] Left side ($request.title) of '!=' operation has null
>>>> value.
>>>> Operation not possible. [line 53, column 43]
>>>>
>>>> So, the [WARNING] is the only log entry pertaining to the groovy
>>>> class.
>>>>
>>>> If I add a comment to a Blog article (with or without the
>>>> BlogMailNotificationGroovyClass initialized), the following
>>>> appears in
>>>> the log:
>>>>
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>> [ERROR] Left side ($index) of addition operation has null value.
>>>> Operation not possible. [line 20, column 25]
>>>>
>>>> The number of lines corresponds to the number of comments present
>>>> in
>>>> the Blog article. There's nothing in the log pertaining to the
>>>> groovy
>>>> class.
>>
>>> Indeed, this has nothing to do with your groovy notification. This
>>> is
>>> generated by the velocity engine.
>>> Is your skin customized ? Is the blog application modified ? (The
>>> log
>>> says that somewhere a variable $index is trying to add something to
>>> "null". Might be the pagination of blog articles ?)
>>>
>>> Jerome.
>>
>> I can't find a variable $index in any arithmetical expression in any
>> velocity script anywhere on the site.
>>
>> The skin is customized only to the extent of some inconsequential
>> tweaks. Same with blog app.
>>
>> There's no pagination of blog articles.
>>
>> Would someone please review the basic mechanics of how groovy classes
>> work, particularly as it pertains to my notification class?
>>
>> Also, I see by reading source that there's a newer way of monitoring
>> events through the "observation manager". Would someone please review
>> how to use this system?
>>
>> Thanks,
>>
>> Dan
he XWiki development team is pleased to announce the release of XWiki
Enterprise 1.7 Milestone 3.
Go grab it at http://www.xwiki.org/xwiki/bin/view/Main/Download
Last milestone of the XWiki Enterprise 1.7 version.
Main changes:
* Webdav support
* Groovy upgrade
* New script macro
Important bug fixes:
* The old LDAP authenticator is still used by default in some cases
Note that general goals for XWiki Enterprise 1.7 are
* Working and usable (i.e. users can use them for their day to day
work instead of the old Syntax and old WYSIWYG editor) versions of new
rendering and new WYSIWYG editor.
* Working JCR (can be used for day to day work instead of Hibernate).
* French XE
* Blog revamping
* Webdav integration
For more information see the Release notes at:
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWikiEnterprise17M3
Thanks, The XWiki dev team
I ran into the same issue Jonathan mentioned the other day with
wysiwyg/wiki editor after applying servlet mapping changes etc to get
'Short URLs' working. There appears to be 2 solutions, one is that you
have to adjust servlet mappings for all directories & .js files at the top
level (*.js, tiny_mce, wiki_editor, yui) in order for everything to play
nice together.
A work around I've found if you don't want to do that (or have easy access
to it) is that everything does appear to work if you move those
directories under /skins/ & adjust the references to those files, in
javascript.vm & editwysiwyg.vm (there may be a couple other references
...)
I'm using a custom skin built on top of the defaults, which has the
advantage that I can have my own versions of those files & not have to
worry about changing paths to those js libraries in the default skin files
upon future upgrades.
I'm undecided which the better method is (servlet mapping vs. moving those
dirs), but in either case, this might be good info to add to the Short
URL instructions - unless Jonathan & I are the only ones who have
encountered this , in which case, not sure where we went wrong in our
respective configurations :-)
Incidentally, the adaptation of XWiki I'm working on is a pilot product
for www.boston.com (http://www.boston.com/yourtown/wiki/Newton/ - not
quite ready for prime time however ;-) as we get it more solidified I'll
be happy to share with the XWiki community & get more involved -
specifically I may be able to contribute some tips & tricks & shortcuts to
the custom skin documentation ...
Best,
Ricky Brennan
rbrennanjr(a)boston.com
Hi,
See below
Dan Svoboda wrote:
> Hi,
>
> I'm trying to use the notification system to trigger the sending of
> email whenever a comment is added to a blog article. I'm patterning my
> groovy class after the pircbot example on the xwiki snippets site.
>
> My system is xwiki workspaces as a virtual xwiki under xem. The
> platform version is 1.5.2.
>
> Here's my groovy class (XWSNotify.BlogMailNotificationGroovyClass):
>
> /* Groovy Class #* */
>
> import com.xpn.xwiki.api.XWiki;
> import com.xpn.xwiki.XWikiContext;
> import com.xpn.xwiki.notify.XWikiDocChangeNotificationInterface;
> import com.xpn.xwiki.notify.DocObjectChangedRule;
> import com.xpn.xwiki.notify.XWikiNotificationRule;
> import com.xpn.xwiki.doc.XWikiDocument;
>
> public class BlogMailNotificationGroovyClass implements \
>
> XWikiDocChangeNotificationInterface
>
> {
> def xwiki;
> def rule;
> def name;
>
> public void initClasses(XWikiContext context)
> {
> this.xwiki = context.getWiki();
> // listen to notifications
> this.rule = DocObjectChangedRule(this);
>
> context.getWiki().getNotificationManager().addGeneralRule(rule);
> }
>
> public void notify(XWikiNotificationRule rule, XWikiDocument
> newdoc, \
> XWikiDocument olddoc, int event, XWikiContext
> context)
> {
> def length = newdoc.getSpace().length();
> def lastFour = length - 4;
> if(newdoc.getSpace().substring(lastFour) == "Blog") {
>
> def ms = xwiki.getPlugin("mailsender");
> def nb = ms.sendHtmlMessage(context.getUser(), "myAddress(a)myHost.org
> ", \
> context.get("ccrecipients"),
> context.get("bccrecipients"), \
> context.get("subject"),
> newdoc.getRenderedContent(), \
> newdoc.getContent(),
> newdoc.getAttachments());
> }
> }
> }
>
> /* *# */
>
> Here's a velocity script I'm using to initialize/test:
>
> #set($sc =
> $context.getContext().getEngineContext().getServletContext())
> $sc.getAttribute("blgmailnotif")<br/>
> #set($blgmlnotif =
> $
> xwiki
> .parseGroovyFromPage("XWSNotify.BlogMailNotificationGroovyClass"))
> #set($ok = $sc.setAttribute("blgmailnotif", $blgmlnotif))
> #set($blgmailnotif = $sc.getAttribute("blgmailnotif"))
> $sc.getAttribute("blgmailnotif")<br/>
> #set($ok = $blgmlnotif.initClasses($context))
> #set($ok = $blgmlnotif.notify($blgmlnotif.rule,$newdoc,$newdoc,
> 3,$context))
>
> Here's the output from the velocity script:
>
> BlogMailNotificationGroovyClass@68e4a47
> BlogMailNotificationGroovyClass@3c401d45
>
> So, the groovy class gets initialized to a new reference successfully
> each time parseGroovyFromPage is called.
>
> Here's what appears in the log after running the velocity script:
>
> [ERROR] Left side ($request.title) of '!=' operation has null value.
> Operation not possible. [line 53, column 43]
> [WARNING] Cannot retrieve method notify from object of class
> BlogMailNotificationGroovyClass due to security restrictions.
>
> If I alter the velocity script to:
>
> #set($sc =
> $context.getContext().getEngineContext().getServletContext())
> $sc.getAttribute("blgmailnotif")<br/>
>
> Here's what appears in the log:
>
> [ERROR] Left side ($request.title) of '!=' operation has null value.
> Operation not possible. [line 53, column 43]
>
> So, the [WARNING] is the only log entry pertaining to the groovy
> class.
>
> If I add a comment to a Blog article (with or without the
> BlogMailNotificationGroovyClass initialized), the following appears in
> the log:
>
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
> [ERROR] Left side ($index) of addition operation has null value.
> Operation not possible. [line 20, column 25]
>
> The number of lines corresponds to the number of comments present in
> the Blog article. There's nothing in the log pertaining to the groovy
> class.
Indeed, this has nothing to do with your groovy notification. This is
generated by the velocity engine.
Is your skin customized ? Is the blog application modified ? (The log
says that somewhere a variable $index is trying to add something to
"null". Might be the pagination of blog articles ?)
Jerome.
I can't find a variable $index in any arithmetical expression in any
velocity script anywhere on the site.
The skin is customized only to the extent of some inconsequential
tweaks. Same with blog app.
There's no pagination of blog articles.
Would someone please review the basic mechanics of how groovy classes
work, particularly as it pertains to my notification class?
Also, I see by reading source that there's a newer way of monitoring
events through the "observation manager". Would someone please review
how to use this system?
Thanks,
Dan
How can the admin (or other user with admin privileges) modify another
user's picture/avatar?
The only way that I've found of doing this is attaching a file to the
user page and editing the XWiki.XWikiUsers "avatar" class item
manually. It looks like the regular avatar upload page doesn't work
properly for anyone but the user in question.
/DS
Hi
I have been running xwiki on a hosting server with 128Mb private JVM for a
few weeks with no problems - but all of a sudden today i seem to be getting
OutOfMemory errors whenever I try to run the app (i.e. go to the main page).
Is there any links / advice for performance tuning - i was reading something
about the attachment cache taking lots of memory (I would be happy to
disable this cache).
What would be the recommended memory for running xwiki?
It all seems strange as i have been running it for 3 weeks with no probs, I
have other hibernate apps but they are running fine.
reagrds,
rob.
Greetings
I have a problem with AdminSheet. When I select "Administrate wiki" to change some configurations, verify
that no menu image was showed and when I try to export something I recive this error:
A problem occured while trying to service your request. Please contact the support if this happens again.
Detailed information:
Error number 11015 in 11: Exception while exporting
Wrapped Exception: null
com.xpn.xwiki.XWikiException: Error number 11015 in 11: Exception while exporting
Wrapped Exception: null
at com.xpn.xwiki.web.ExportAction.render(ExportAction.java:64)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:216)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
at org.mortbay.http.HttpServer.service(HttpServer.java:954)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Wrapped Exception:
java.lang.NullPointerException
at com.xpn.xwiki.web.ExportAction.exportXAR(ExportAction.java:230)
at com.xpn.xwiki.web.ExportAction.render(ExportAction.java:57)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:216)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
at org.mortbay.http.HttpServer.service(HttpServer.java:954)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
I don't remeber of changing the AdminSheet page, but in the begining it show these functions:
$xwiki.jsx.use("XWiki.AdminSheet") $xwiki.ssx.use("XWiki.AdminSheet")
I send a screenShot of this.
Can anyone give me some clue?
Thanks in advance
Bruno Neves
How does one generate new key/value pair for form based authentication?
i.e. new values for;
xwiki.authentication.validationKey=totototototototototototototototo
xwiki.authentication.encryptionKey=titititititititititititititititi
Will anything else have to be changed after changing these values?
Also, what is the meaning of:
xwiki.authentication.cookiedomains=xwiki.com,wiki.fr
Should this be set to my own domain?
Cheers.
Dan Svoboda
Research Assistant Professor
U Pitt Center for HIV Protein Interactions
(412)648-7262
dsvoboda(a)structbio.pitt.edu
My network admin asked the following question when I asked him to let
his email server accept messages for forwarding from my xwiki server:
is your code secure? is there much chance that a malicious bot could
harvest email and start injecting messages through your server?
What should I tell him?
Dan Svoboda
Research Assistant Professor
U Pitt Center for HIV Protein Interactions
(412)648-7262
dsvoboda(a)structbio.pitt.edu
Hi,
I'm trying to use the notification system to trigger the sending of
email whenever a comment is added to a blog article. I'm patterning my
groovy class after the pircbot example on the xwiki snippets site.
My system is xwiki workspaces as a virtual xwiki under xem. The
platform version is 1.5.2.
Here's my groovy class (XWSNotify.BlogMailNotificationGroovyClass):
/* Groovy Class #* */
import com.xpn.xwiki.api.XWiki;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.notify.XWikiDocChangeNotificationInterface;
import com.xpn.xwiki.notify.DocObjectChangedRule;
import com.xpn.xwiki.notify.XWikiNotificationRule;
import com.xpn.xwiki.doc.XWikiDocument;
public class BlogMailNotificationGroovyClass implements \
XWikiDocChangeNotificationInterface
{
def xwiki;
def rule;
def name;
public void initClasses(XWikiContext context)
{
this.xwiki = context.getWiki();
// listen to notifications
this.rule = DocObjectChangedRule(this);
context.getWiki().getNotificationManager().addGeneralRule(rule);
}
public void notify(XWikiNotificationRule rule, XWikiDocument
newdoc, \
XWikiDocument olddoc, int event, XWikiContext
context)
{
def length = newdoc.getSpace().length();
def lastFour = length - 4;
if(newdoc.getSpace().substring(lastFour) == "Blog") {
def ms = xwiki.getPlugin("mailsender");
def nb = ms.sendHtmlMessage(context.getUser(), "myAddress(a)myHost.org
", \
context.get("ccrecipients"),
context.get("bccrecipients"), \
context.get("subject"),
newdoc.getRenderedContent(), \
newdoc.getContent(),
newdoc.getAttachments());
}
}
}
/* *# */
Here's a velocity script I'm using to initialize/test:
#set($sc = $context.getContext().getEngineContext().getServletContext())
$sc.getAttribute("blgmailnotif")<br/>
#set($blgmlnotif =
$xwiki.parseGroovyFromPage("XWSNotify.BlogMailNotificationGroovyClass"))
#set($ok = $sc.setAttribute("blgmailnotif", $blgmlnotif))
#set($blgmailnotif = $sc.getAttribute("blgmailnotif"))
$sc.getAttribute("blgmailnotif")<br/>
#set($ok = $blgmlnotif.initClasses($context))
#set($ok = $blgmlnotif.notify($blgmlnotif.rule,$newdoc,$newdoc,
3,$context))
Here's the output from the velocity script:
BlogMailNotificationGroovyClass@68e4a47
BlogMailNotificationGroovyClass@3c401d45
So, the groovy class gets initialized to a new reference successfully
each time parseGroovyFromPage is called.
Here's what appears in the log after running the velocity script:
[ERROR] Left side ($request.title) of '!=' operation has null value.
Operation not possible. [line 53, column 43]
[WARNING] Cannot retrieve method notify from object of class
BlogMailNotificationGroovyClass due to security restrictions.
If I alter the velocity script to:
#set($sc = $context.getContext().getEngineContext().getServletContext())
$sc.getAttribute("blgmailnotif")<br/>
Here's what appears in the log:
[ERROR] Left side ($request.title) of '!=' operation has null value.
Operation not possible. [line 53, column 43]
So, the [WARNING] is the only log entry pertaining to the groovy class.
If I add a comment to a Blog article (with or without the
BlogMailNotificationGroovyClass initialized), the following appears in
the log:
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
[ERROR] Left side ($index) of addition operation has null value.
Operation not possible. [line 20, column 25]
The number of lines corresponds to the number of comments present in
the Blog article. There's nothing in the log pertaining to the groovy
class.
What am I doing wrong? Is there a way to put additional groovy
debugging information into the log?
Thanks,
Dan Svoboda
University of Pittsburgh Center for HIV Protein Interactions