I would like to have a new wiki set up on the XWiki community farm. The
purpose of this site will be to test out XWiki as a platform for storage and
serving of business forms.
I am registered on xwiki.org as jimslaughter. My proposed server name is
DocsTestSite, however I am OK with another name if that is unavailable.
This is more of a proof of concept site at this time.
Thank you.
--
Jim Slaughter
Hi
I have made a skin for my xwiki installation but it doesnt show up when no
user is logged in. Is there a different space or persmiison for guest users
- i have set the View permission for my XWikiGuest group on the skin, but it
still doesnt show up.
regards
rob munro.
I've upgraded from Xwiki enterprise 1.3.2 to xwiki enterprise 1.6.1 on Linux
Centos distro using kernel 2.6.18-53.1.21.el5.
The upgrade has been performed as described in the documenation. In
principle removing the old xwiki dir and copying the contents of the new
1.6.1.WAR i9 in /opt/xwiki and making changes to the xwiki.cfg file. I
couldn't copy the old xwiki.cfg from the installed 1.3.2 because the
contents has changed between 1.3.2 and 1.6.1. The hibernate.cfg.xml however
hasn't changed between 1.3.2 and 1.6.1. Hence I could copy the old
hibernate.cfg.xml file to the WEB-INF dir of 1.6.1.
After the upgrade everything seemed OK. The content was still there as were
the created users and spaces. As version nummer 1.6.1 instead of 1.3.2 was
shown in the footer of each page. As of version 1.5 there is a new
Aministration application which afaik is bundled with xwiki enterprise. The
url is <url>/xwiki/bin/admin/XWiki/XWikiPreferences. When I try to access
this page on my upgraded system I get the message "The administration
application is not installed. Since XWiki Enterprise 1.5 the Administration
is distributed as an application. You can download it from
http://code.xwiki.org/xwiki/bin/view/Applications/AdministrationApplication.".
I've double checked it on my windows system with Stable:
xwiki-enterprise-installer-windows-1.6.1.exe. When entering the url I get
the new Administration tool. At this moment I can't admin my xwiki system.
PS. I did the upgrade at least twice. The first install was performing the
upgrade manually, the second time I used a shell script to make sure I
didn't make mistakes. In both cases I got the same results.
Unless I interpret things the wrong way something is wrong with my upgraded
system. Any help is very much appreciated.
Jan
--
View this message in context: http://n2.nabble.com/upgrade-from-1.3.2-to-1.6.1----new-administrations-too…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I have a few pages in my wiki, that "insist" on denying view rights from
registered users.
These pages are generated by form, using a template, following the todo app
example.
they should be created with view for all. edit rights are set by calling:
#setEditors($obj)
############ permissions ################################################
######## allowEdit #####################################################
## set rights to allow creator and contributors to edit
#macro(allowEdit $users)
#if($xwiki.checkAccess($doc.getFullName(),"edit"))
<!-- allowEdit (desObj) $doc $users -->
#set ($rights = $doc.getObject("XWiki.XWikiRights", true))
#set ($result = $rights.set("levels", "edit"))
#set ($result = $rights.set("users", $users))
#set ($result = $rights.set("allow", 1))
$doc.save()
#end
#end
########## setEditors ##################################################
## set owner, contributors, and edit rights
#########################################################################
#macro(setEditors $obj)
#set ($ownr = $obj.Owner)
#if ((!$ownr || $ownr == "" ) && !$doc.getURL.endWith("ClassSheet"))
#set ($needRefresh = true)
#set ($ownr = $doc.getCreator())
#if (!$ownr || $ownr == "")
#set ($ownr = $context.user)
#end
$doc.set("Owner",$ownr,$obj)
#end
#set ($contributors = $obj.Contributors)
##if ($context.user == $ownr)
#set($editors = $contributors+","+$ownr)
<!-- Editors: $editors -->
#allowEdit($editors)
##end
#end
## setEditors ##################################################
For some reason this doesn't always work.
Furthermore, for some pages (but not all), view rights are denied. I try to
set them right, and they revert to their problem state.
For example, in
http://patternlanguagenetwork.myxwiki.org/xwiki/bin/view/Patterns/VisualNar…
I set view on for all, but when I leave the page and come back, that right
has disappeared.
___________________________
Yishay Mor, Researcher, London Knowledge Lab
http://www.lkl.ac.uk/people/mor.htmlhttp://www.google.com/calendar/embed?src=yishaym%40gmail.com
+44-20-78378888 x5737
Hi All,
[Nabble told me my last post didn't get sent, so reposting, apologize if it
caused a duplication]
There are few tabs for comments/attachment etc in the new layout for XE 1.6
which is great. However, can I suggest we do not show the details by default
until users click? (which like version 1.5).
The reason is that currently every page made an authentication call. When we
are using LDAP for authentication this may take 1-2 seconds. Since the
comment field is opened by default, it's another 2 seconds delay for until
the page is completely loaded. Reducing this 2 seconds means 40-50% faster
per page which is very significance.
Many Thanks
Art.
--
View this message in context: http://n2.nabble.com/Comment-field-in-XE-1.6-for-page-display-tp1328527p132…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi
Does XWiki has any password policies ?. I could see that it accepts the
password even if it is a single character. Or is there any configuration
need to be provided for this ? Please help. I am using XE1.6
Regards
Syam
--
View this message in context: http://n2.nabble.com/Password-Policies-tp1459548p1459548.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi
I am facing a problem with user registration. An user registers by putting
all the required fields and he gets a page saying that 'Registration is
successfull'. A validation email is also been send to him. If he tries to
login without activation, XWiki logs him in and gives a message 'Your
account is not yet active, because your email has not yet been confirmed.'.
He goes back to his mail box, copies the activation link and paste it on the
same window. But the page remains the same and doesn't allow the user to
activate his account. He need to open a new browser or logout to activate
his account and login to XWiki. This looks like a bug. Any comments on this
? I am using XE 1.6.
Regards
Syam
--
View this message in context: http://n2.nabble.com/Issue-on-Registration-tp1449020p1449020.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
I am out of the office until 12/01/2008.
On holiday! :-)
I won't have my computer with me. If you need help with the IMCS Wiki,
please contact Micah Lau or Shawn Park. Thank you!
Note: This is an automated response to your message "users Digest, Vol 16,
Issue 64" sent on 11/27/08 6:00:04.
This is the only notification you will receive while this person is away.
Dear XWiki Users,
I have a little patch for the "docextra.vm" template which I would like
to submit to the issue tracker, but I am not sure where to post it.
The file to patch is in the SVN repository at
http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk
Which category / project in jira does this part belong to?
Is this still "XWiki Core" aka XWIKI or is it one of the skins,
e.g. "XWiki Toucan Skin" aka XSTOUCAN ?
Cheers,
Clemens
Dear all,
I would like to release XEclipse soon. During the last days I've fixed
many of the outstanding bugs thanks also to the effective collaboration
of Eduard Moraru who provided a lot of patches and I think that now
XEclipse is pretty stable, usable and functional.
This release incorporates a lot of features that have been implemented
during the last months. In particular a better integration with the
Eclipse ecosystem, object editor, translation management, page history,
syntax highlighting and completion (thanks to the work done by Malaka
during the last GSoC and Venkatesh) and many other improvements.
There are still many things to do but I think that it's a priority to
have a new version out asap in order to have more feedbacks from users
and to build upon it.
Due to some previous engagements I think I will be able to release it on
Friday or during the weekend.
WDYT?
-Fabio
The XWiki development team is pleased to announce the release of XWiki
Enterprise 1.7 RC 1.
Go grab it at http://www.xwiki.org/xwiki/bin/view/Main/Download
This is the first release candidate for the 1.7 version.
Changes from 1.7M3:
* Link feature implemented in the new WYSIWYG editor (link to wiki
page, web page, email).
* Work in progress on the new experimental WYSIWYG editor.
* Work in progress on the new XWiki Syntax v2.0
* Reorganized, documented and enhanced xwiki.cfg configuration file
Important bug fixes:
* XWIKI-2873 : Wrong user name is inserted in group during LDAP
membership synchronisation
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).
* Blog revamping
* Webdav integration
For more information see the Release notes at:
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWikiEnterprise17RC1
Thanks
-The XWiki dev team
Hi xwiki-users,
I have a question (or more of a request) regarding the upcoming Pygments
support in XWiki 1.7. We currently use XWiki at work to keep an internal
documentation wiki for our application. We've created a few plugins which
we've used in the following fashion perfectly (XWiki 1.0 syntax):
{code:sql}
DECLARE myDate DATETIME
SELECT myDate = '$xwiki.dateParser.parseDate( "-1b", "yyyyMMdd" )' -- this
gives us the previous business date in yyyyMMdd format
...
{code}
Vincent kindly gave me a heads up regarding XWiki 1.7's Pygments support
(seems to be supported by running it under Jython - VERY exciting :-D). So,
I was wondering... Would something like the above be supported (i.e.
verbatim code, but allow velocity macros to be run inside the code block)?
If not, are there any documentation out there (other than the source code)
detailing steps to create an XWiki macro (found
http://dev.xwiki.org/xwiki/bin/view/Drafts/Tutorial+to+Write+a+Macro+in+the…
does help a bit if viewed in the code viewer), so that maybe we can
build in support for something like that? Again, thanks for the great work!
Hi,
We (University of Nancy 1, France) are leading a study about enterprise wiki
software. 4 softwares have been selected, and one of them is XWIKI of course
in the XWIKI WORKSPACES version. Our goal is to open the wiki to every
students, teachers, work group, etc ... After some tests, we have some
questions :
The version is XWS 1.1.1, not in virtual mode, with LDAP Authentication.
* Is it impossible to access to the function "WATCH THIS PAGE" in
Workspaces as found in the toolbar of the Enterprise version ?
o How can i add the toolbar (or the functions of the toolbar) of
the Enterprise version which give the
+ "WATCH THIS PAGE" function
+ and EXPORT AS ... as a normal user
o May i modify the template ?
* There is not tags in Workspaces, is there a way to activate them as in
Enterpise version ?
o Whereas i have "xwiki.tags=1" in xwiki.cfg ...
* Comments in blog or wiki are not visible through the RSS
notifications, it is possible ?
* I didn't have found tools for importing another wiki. It is possible
for example from Confluence (i know, you know ... :-) ) :
o
http://confluence.atlassian.com/display/CONFEXT/Universal+Wiki+Converter
o Possible with XWIKI ?
* I18N seem's to be : one language for all spaces
o When as admin user, i select from administration Global
Preferences
+ MULTI LINGUAL=YES
+ Languages = fr,en
+ Default Language = fr
o All spaces fall into EN language ...
o Can we have 2 workspaces in two differents languages ?
Thanks,
Stephane.
--
View this message in context: http://n2.nabble.com/General-questions-about-XWIKI-WORKSPACES-tp1581324p158…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Greetings-
I am need to upgrade an installation of XWiki from 1.2.2 to the latest (currently 1.6.1) and I am trying to put together an attack plan. Should I attempt an upgrade all the way to 1.6.1 in one fell swoop or should I upgrade to 1.3.2 -> 1.4.1 ...etc. Do I need to upgrade the XAR for every release or just once?
I am using hsqldb as my database, but after getting everything upgraded correctly, I will be moving the database to MySQL.
I have searched the archives but I haven't found anything more recent and also dealing with wide range of upgrading I need to do.
Regards
_________________________________________________________________
Get more done, have more fun, and stay more connected with Windows Mobile®.
http://clk.atdmt.com/MRT/go/119642556/direct/01/
I tried changing newdoc.getAttachments() to
newdoc.newDocument(context).getAttachmentList().
I've stripped down the class to remove dependance on getting values
out of the context; i.e I've provided string literals for sender, cc,
etc. I've also changed the rule to DocChangeRule(this), and removed
the test for the change coming from a space's Blog so that any
document save event would trigger email.
Still no joy.
The only clue in the log is when calling the notify method from a
velocity script:
[WARNING] Cannot retrieve method notify from object of class
BlogMailNotificationGroovyClass due to security restrictions.
Dan
Here's the revised class:
/* 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 = DocChangeRule(this);
context.getWiki().getNotificationManager().addGeneralRule(rule);
}
public void notify(XWikiNotificationRule rule, XWikiDocument
newdoc, \
XWikiDocument olddoc, int event, XWikiContext
context)
{
def ms = xwiki.getPlugin("mailsender");
def nb = ms.sendHtmlMessage("XWiki.Admin", \
"dsvoboda(a)structbio.pitt.edu", \
"dsvoboda(a)structbio.pitt.edu", \
"dsvoboda(a)structbio.pitt.edu", \
"subject", \
newdoc.getRenderedContent(), \
newdoc.getContent(), \
newdoc.newDocument(context).getAttachmentList());
}
}
/* *# */
> Ok, I have another idea. Did you try sending the mail without
> attachments ?
>
> This because what you pass the plugin API are XWikiAttachments
> (http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xw…
> ),
> while it expects "com.xpn.xwiki.api.Attachment" (see the plugin API
> here
> http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin).
> If you want to have the proper wrapped attachments to pass the plugin,
> you should use "newdoc.newDocument(context).getAttachmentList()"
>
> Hope this helps,
> Jerome.
>
> Daniel Svoboda wrote:
>> Thanks for the replies.
>>
>> I had already found that bug. If I take the conditional completely
>> out
>> of the class, it still doesn't send an email.
>>
>> Dan
>>
>>> It is probably due to the following :
>>>
>>> "if(newdoc.getSpace().substring(lastFour) == "Blog") {"
>>>
>>> in Java, if you have the following :
>>>
>>> String st1 = "Blog";
>>> String st2 = new String("Blog");
>>>
>>> then st1 == st2 will always return false, as the objects are not the
>>> same. What you want is to compare their values, using
>>> st1.equals(st2),
>>> which will return true.
>>> You can read here to find out more
>>> http://www.unix.com.ua/orelly/java/langref/ch04_09.htm (especially
>>> this
>>> sentence : "Because the == operator determines if two objects are
>>> the
>>> same object, it is not appropriate for comparisons that need to
>>> determine if two objects have the same contents. For example, if you
>>> need to know whether two String objects contain the same sequences
>>> of
>>> characters, the == operator is inappropriate. You should use the
>>> equals() method")
>>>
>>> Anyway, their is even simpler for you. What you want to do is
>>> check if
>>> the space name finishes by "Blog". For this the appropriate method
>>> is
>>> String#endsWith
>>> (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#endsWith(java…
>>> )
>>> )
>>> As in :
>>>
>>> "if(newdoc.getSpace().endsWith("Blog")) {"
>>>
>>> Hope this helps and fixes your issue,
>>>
>>> Regards,
>>> Jerome
>>>
>>> Daniel Svoboda wrote:
>>>> 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
Since 1.6 creating headings in the old WYSIWYG-Editor creats html-Headings
Heading 1 -> <h1>Text</h1>
Heading 2 -> <h2>Text</h2>
....
The result is that some functions (e.g. Toc macro) don't work anymore.
Is it planned to fix that? or is there no more development for the old
WYSIWYG?
The new looks great but has not the functionality of the old one (yet?)
Thanks
Helmut
--
View this message in context: http://n2.nabble.com/Headings-in-old-WYSIWYG-and-some-more-questions-tp1575…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi,
I'm using JBoss (4.2.1), XWiki XE 1.7 Milestone 1.
Which parameters are to be set or which files have to be modified/moved to
prevent the following DEBUG and ERROR messages?
No matter whether xwiki.cfg file has
xwiki.cache.cachefactory.hint=jbosscache and
xwiki.cache.cachefactory.local.hint=jbosscache/local as comment or not,
there is a DEBUG message on console saying
"Failed to load configuration file xwiki.store.pagecache".
There's a second DEBUG message saying "Failed to load configuration file
default".
I realized this after deletion of log4j-1.2.13.jar in lib folder.
The real problem seems to be that there is an error later with lucene:
ERROR [com.xpn.xwiki.plugin.lucene.IndexUpdater] error indexing document
xwiki:XWiki.420127.default.objects
com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while
reading document XWiki.420127
(The number is a XWiki "username".)
Logging is very high. It's showing a lot of debug and error messages
relating caching.
Thanks,
Rudolf
Each stack traces are there a lot of times. Stack Details:
1) as first
2008-11-13 00:00:00,015 ERROR [org.quartz.core.QuartzSchedulerThread]
Runtime error occured in main trigger firing loop.
java.lang.NullPointerException
at
org.apache.commons.logging.LogFactory.getCachedFactory(LogFactory.java:979)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:435)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
at org.quartz.core.JobRunShell.<init>(JobRunShell.java:80)
at
org.quartz.impl.StdJobRunShellFactory.borrowJobRunShell(StdJobRunShellFactory.java:86)
at
org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:357)
2) a bit later
2008-11-13 05:10:00,888 INFO
[org.xwiki.cache.jbosscache.internal.JBossCacheCacheFactory] Start JBoss
cache initialisation
2008-11-13 05:10:00,904 DEBUG
[org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration] Failed to
load configuration file xwiki.groovy.content
org.xwiki.cache.jbosscache.internal.PropertiesLoadingCacheException: Can't
find any configuration file forxwiki.groovy.content
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration.loadConfig(JBossCacheCacheConfiguration.java:245)
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration.load(JBossCacheCacheConfiguration.java:115)
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration.<init>(JBossCacheCacheConfiguration.java:99)
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheFactory.newCache(JBossCacheCacheFactory.java:78)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.initCache(XWikiGroovyRenderer.java:133)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.initCache(XWikiGroovyRenderer.java:121)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.prepareCache(XWikiGroovyRenderer.java:152)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.parseGroovyFromString(XWikiGroovyRenderer.java:333)
at com.xpn.xwiki.XWiki.parseGroovyFromString(XWiki.java:5698)
at com.xpn.xwiki.api.XWiki.parseGroovyFromPage(XWiki.java:2169)
at gjdk.com.xpn.xwiki.api.XWiki_GroovyReflector.invoke(Unknown Source)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:363)
at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:146)
at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
at Script1.run(Script1.groovy:8)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:485)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:460)
at com.xpn.xwiki.plugin.scheduler.GroovyJob.execute(GroovyJob.java:83)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
2008-11-13 05:10:00,904 DEBUG
[org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration] Failed to
load configuration file default-local
org.xwiki.cache.jbosscache.internal.PropertiesLoadingCacheException: Can't
find any configuration file fordefault-local
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration.loadConfig(JBossCacheCacheConfiguration.java:245)
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration.getDefaultConfig(JBossCacheCacheConfiguration.java:216)
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration.load(JBossCacheCacheConfiguration.java:118)
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheConfiguration.<init>(JBossCacheCacheConfiguration.java:99)
at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheFactory.newCache(JBossCacheCacheFactory.java:78)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.initCache(XWikiGroovyRenderer.java:133)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.initCache(XWikiGroovyRenderer.java:121)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.prepareCache(XWikiGroovyRenderer.java:152)
at
com.xpn.xwiki.render.groovy.XWikiGroovyRenderer.parseGroovyFromString(XWikiGroovyRenderer.java:333)
at com.xpn.xwiki.XWiki.parseGroovyFromString(XWiki.java:5698)
at com.xpn.xwiki.api.XWiki.parseGroovyFromPage(XWiki.java:2169)
at gjdk.com.xpn.xwiki.api.XWiki_GroovyReflector.invoke(Unknown Source)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:363)
at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:146)
at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
at Script1.run(Script1.groovy:8)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:485)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:460)
at com.xpn.xwiki.plugin.scheduler.GroovyJob.execute(GroovyJob.java:83)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
2008-11-13 05:10:00,919 INFO [org.jboss.cache.factories.ComponentRegistry]
JBoss Cache version: JBossCache 'Poblano' 2.2.0.GA
2008-11-13 05:10:00,919 INFO
[org.xwiki.cache.jbosscache.internal.JBossCacheCacheFactory] End JBoss cache
initialisation
3) at least each hour
2008-11-13 05:13:05,559 ERROR [com.xpn.xwiki.plugin.lucene.IndexUpdater]
error indexing document xwiki:XWiki.420127.default.objects
com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while
reading document XWiki.420127
Wrapped Exception: Entry.next=null, data[removeIndex]=XWiki.545365=<?xml
version="1.0" encoding="UTF-8"?>
<class>
<name>XWiki.545365</name>
<customClass></customClass>
<customMapping></customMapping>
<defaultViewSheet></defaultViewSheet>
<defaultEditSheet></defaultEditSheet>
<defaultWeb></defaultWeb>
<nameField></nameField>
<validationScript></validationScript>
</class>
previous=XWiki.420762=<?xml version="1.0" encoding="UTF-8"?>
<class>
<name>XWiki.420762</name>
<customClass></customClass>
<customMapping></customMapping>
<defaultViewSheet></defaultViewSheet>
<defaultEditSheet></defaultEditSheet>
<defaultWeb></defaultWeb>
<nameField></nameField>
<validationScript></validationScript>
</class>
key=XWiki.420127 value=<?xml version="1.0" encoding="UTF-8"?>
<class>
<name>XWiki.420127</name>
<customClass></customClass>
<customMapping></customMapping>
<defaultViewSheet></defaultViewSheet>
<defaultEditSheet></defaultEditSheet>
<defaultWeb></defaultWeb>
<nameField></nameField>
<validationScript></validationScript>
</class>
size=20 maxSize=20 Please check that your keys are immutable, and that you
have used synchronization properly. If so, then please report this to
commons-dev(a)jakarta.apache.org as a bug.
at
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:744)
at
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:209)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1323)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1363)
at
com.xpn.xwiki.plugin.lucene.IndexUpdater.runMainLoop(IndexUpdater.java:217)
at com.xpn.xwiki.plugin.lucene.IndexUpdater.run(IndexUpdater.java:117)
at java.lang.Thread.run(Thread.java:619)
--
View this message in context: http://n2.nabble.com/JBossCacheCacheConfiguration-Failed-to-load-configurat…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi,
I have done an upgrade (WAR and XAR) today from XE 1.6.1 to 1.7.3 with lots
of issues with LDAP.
1. Get a lot of the following errors even when users are just browsing
without loggin
[https://myserver/xwiki/bin/view/Main/?xpage=xpart&vm=commentsinline.vm]
[TP-Processor1] DEBUG LDAP.XWikiLDAPAuthServiceImpl - LDAP authentication
failed: login null
2. User mapping to Group member ship has issue. (this is more serious)
It used to map OK but currently, after a new user first login, it added the
user in this format "XWiki.XWiki.<USERID>" into the group multiple times.
When user loggedin and browse, it add even more multiple entries. So a user
login for the first time and browse 2 pages, could end up having 10 idential
entries in the group.
Normally it added in the format "XWiki.<USERID>" not "XWiki.XWiki.<USERID>".
3. After a user loggin, browsing, I saw lots of these errors
[TP-Processor8] ERROR LDAP.XWikiLDAPAuthServiceImpl - Failed to add a user
[XWiki.USERID] to a group [XWiki.MYGROUP]
com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving
document XWiki.MYGROUP
Wrapped Exception: Batch update returned unexpected row count from update
[1]; actual row count: 0; expected: 1
at
com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:590)
at
com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:135)
at
com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:128)
at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1270)
and
[TP-Processor2] DEBUG LDAP.XWikiLDAPAuthServiceImpl - Local LDAP
authentication failed.
java.lang.NullPointerException
at
com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.ldapAuthenticateInContext(XWikiLDAPAuthServiceImpl.java:369)
at
com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.ldapAuthenticate(XWikiLDAPAuthServiceImpl.java:197)
at
com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.authenticate(XWikiLDAPAuthServiceImpl.java:148)
at
com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.authenticate(MyFormAuthenticator.java:239)
Any thoughts please?
I do need to upgrade in order to fix the upload image with space in the
filename issue.
Appreciated, and Thanks!
--
View this message in context: http://n2.nabble.com/LDAP-issue-after-upgrade-from-XE-1.6.1-to-1.7.3-tp1573…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I found something else that was incorrect, but correcting it didn't
help:
newdoc.getRenderedContent() needs to be
newdoc.getRenderedContent(context)
Dan
> I tried changing newdoc.getAttachments() to
> newdoc.newDocument(context).getAttachmentList().
>
> I've stripped down the class to remove dependance on getting values
> out of the context; i.e I've provided string literals for sender,
> cc, etc. I've also changed the rule to DocChangeRule(this), and
> removed the test for the change coming from a space's Blog so that
> any document save event would trigger email.
>
> Still no joy.
>
> The only clue in the log is when calling the notify method from a
> velocity script:
>
> [WARNING] Cannot retrieve method notify from object of class
> BlogMailNotificationGroovyClass due to security restrictions.
>
> Dan
>
> Here's the revised class:
>
> /* 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 = DocChangeRule(this);
>
> context.getWiki().getNotificationManager().addGeneralRule(rule);
> }
>
> public void notify(XWikiNotificationRule rule, XWikiDocument
> newdoc, \
> XWikiDocument olddoc, int event, XWikiContext
> context)
> {
>
> def ms = xwiki.getPlugin("mailsender");
> def nb = ms.sendHtmlMessage("XWiki.Admin", \
> "dsvoboda(a)structbio.pitt.edu", \
> "dsvoboda(a)structbio.pitt.edu", \
> "dsvoboda(a)structbio.pitt.edu", \
> "subject", \
> newdoc.getRenderedContent(), \
> newdoc.getContent(), \
>
> newdoc.newDocument(context).getAttachmentList());
> }
> }
>
> /* *# */
>
>
>
>> Ok, I have another idea. Did you try sending the mail without
>> attachments ?
>>
>> This because what you pass the plugin API are XWikiAttachments
>> (http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xw…
>> ),
>> while it expects "com.xpn.xwiki.api.Attachment" (see the plugin API
>> here
>> http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin).
>> If you want to have the proper wrapped attachments to pass the
>> plugin,
>> you should use "newdoc.newDocument(context).getAttachmentList()"
>>
>> Hope this helps,
>> Jerome.
>>
>> Daniel Svoboda wrote:
>>> Thanks for the replies.
>>>
>>> I had already found that bug. If I take the conditional completely
>>> out
>>> of the class, it still doesn't send an email.
>>>
>>> Dan
>>>
>>>> It is probably due to the following :
>>>>
>>>> "if(newdoc.getSpace().substring(lastFour) == "Blog") {"
>>>>
>>>> in Java, if you have the following :
>>>>
>>>> String st1 = "Blog";
>>>> String st2 = new String("Blog");
>>>>
>>>> then st1 == st2 will always return false, as the objects are not
>>>> the
>>>> same. What you want is to compare their values, using
>>>> st1.equals(st2),
>>>> which will return true.
>>>> You can read here to find out more
>>>> http://www.unix.com.ua/orelly/java/langref/ch04_09.htm (especially
>>>> this
>>>> sentence : "Because the == operator determines if two objects are
>>>> the
>>>> same object, it is not appropriate for comparisons that need to
>>>> determine if two objects have the same contents. For example, if
>>>> you
>>>> need to know whether two String objects contain the same
>>>> sequences of
>>>> characters, the == operator is inappropriate. You should use the
>>>> equals() method")
>>>>
>>>> Anyway, their is even simpler for you. What you want to do is
>>>> check if
>>>> the space name finishes by "Blog". For this the appropriate
>>>> method is
>>>> String#endsWith
>>>> (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#endsWith(java…
>>>> )
>>>> )
>>>> As in :
>>>>
>>>> "if(newdoc.getSpace().endsWith("Blog")) {"
>>>>
>>>> Hope this helps and fixes your issue,
>>>>
>>>> Regards,
>>>> Jerome
>>>>
>>>> Daniel Svoboda wrote:
>>>>> 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
Hi,
I've updated from 1.5.2 to 1.6.1. After this, I found all groups beeing
empty - so no users were there anymore.
As result I started mapping LDAP groups to XWiki groups to let XWiki
populate the memberships again - I was planning this anyway.
For some reason XWiki is not able to get the groups members and I cannot
understand why. Also it is not putting my user in the XWiki.AllGroup -
still my groups do not have any member.
This are the logs:
DEBUG LDAP.XWikiLDAPAuthServiceImpl - Updating existing user with LDAP
attribues located at cn=a12345,ou=associates,ou=users,o=wlgore
DEBUG ldap.XWikiLDAPConfig - Ready to create user from LDAP
with fields
last_name=sn,first_name=givenName,fullname=fullName,email=mail,ldap_dn=dn
DEBUG ldap.XWikiLDAPConfig - Groupmapping found:
XWiki.XWikiAdminGroup
cn=Admin,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore
DEBUG ldap.XWikiLDAPConfig - Groupmapping found:
XWiki.MSOEGroup
cn=MSOE,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore
DEBUG ldap.XWikiLDAPConfig - Groupmapping found:
XWiki.MedicalFabricsAdmGroup
cn=MedFabAdmin,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore
DEBUG ldap.XWikiLDAPConfig - Groupmapping found:
XWiki.MedicalFabricsGroup
cn=MedFabUser,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore
DEBUG LDAP.XWikiLDAPAuthServiceImpl - Updating group membership for the
user: tzwitano
DEBUG LDAP.XWikiLDAPAuthServiceImpl - The user belongs to following
XWiki groups:
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.XWikiAllGroup
DEBUG LDAP.XWikiLDAPAuthServiceImpl - All defined XWiki groups:
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.MSOEGroup
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.MedicalFabricsAdmGroup
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.MedicalFabricsGroup
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.TrillrAdmin
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.TrillrUser
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.XWikiAdminGroup
DEBUG LDAP.XWikiLDAPAuthServiceImpl - XWiki.XWikiAllGroup
DEBUG ldap.XWikiLDAPUtils - Found group
[cn=MSOE,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore]
members :{}
DEBUG ldap.XWikiLDAPUtils - Found group
[cn=Admin,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore]
members :{}
DEBUG ldap.XWikiLDAPUtils - Found group
[cn=MedFabAdmin,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore]
members :{}
DEBUG ldap.XWikiLDAPUtils - Found group
[cn=MedFabUser,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore]
members :{}
This is my config:
#-# new LDAP authentication service
xwiki.authentication.authclass=com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl
#-# Turn LDAP authentication on - otherwise only XWiki authentication
#-# 0: disable
#-# 1: enable
xwiki.authentication.ldap=1
#-# Force to check password after LDAP connection
#-# 0: disable
#-# 1: enable
xwiki.authentication.ldap.validate_password=0
#-# only members of the following group will be verified in the LDAP
# otherwise only users that are found after searching starting from the
base_DN
#xwiki.authentication.ldap.user_group=o=wlgore
#-# base DN for searches
#xwiki.authentication.ldap.base_DN=o=wlgore
#-# Specifies the LDAP attribute containing the identifier to be used as
the XWiki name (default=cn)
xwiki.authentication.ldap.UID_attr=uid
#-# [SINCE 1.5M1, XWikiLDAPAuthServiceImpl]
#-# Specifies the LDAP attribute containing the password to be used "when
xwiki.authentication.ldap.validate_password" is set to 1
# xwiki.authentication.ldap.password_field=userPassword
#-# [SINCE 1.5M1, XWikiLDAPAuthServiceImpl]
#-# The potential LDAP groups classes. Separated by commas.
xwiki.authentication.ldap.group_classes=group,groupOfNames,groupOfUniqueNames,dynamicGroup,dynamicGroupAux,groupWiseDistributionList,Top
#xwiki.authentication.ldap.group_classes=groupOfNames,Top,groupOfNames
#-# [SINCE 1.5M1, XWikiLDAPAuthServiceImpl]
#-# The potential names of the LDAP groups fields containings the members.
Separated by commas.
xwiki.authentication.ldap.group_memberfields=member,equivalentToMe
#-# retrieve the following fields from LDAP and store them in the XWiki
user object (xwiki-attribute=ldap-attribute)
#-# ldap_dn=dn -- dn is set by class, caches dn in XWiki.user object for
faster access
xwiki.authentication.ldap.fields_mapping=last_name=sn,first_name=givenName,fullname=fullName,email=mail,ldap_dn=dn
#-# [SINCE 1.3M2, XWikiLDAPAuthServiceImpl]
#-# on every login update the mapped attributes from LDAP to XWiki
otherwise this happens only once when the XWiki account is created.
xwiki.authentication.ldap.update_user=1
#-# [SINCE 1.3M2, XWikiLDAPAuthServiceImpl]
#-# mapps XWiki groups to LDAP groups, separator is "|"
xwiki.authentication.ldap.group_mapping=XWiki.XWikiAdminGroup=cn=Admin,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore|\
XWiki.MSOEGroup=cn=MSOE,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore|\
XWiki.MedicalFabricsAdmGroup=cn=MedFabAdmin,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore|\
XWiki.MedicalFabricsGroup=cn=MedFabUser,ou=XWiki,ou=Corp,ou=Links,ou=extranet_access,ou=groups,o=wlgore
#-# [SINCE 1.3M2, XWikiLDAPAuthServiceImpl]
#-# time in s after which the list of members in a group is refreshed from
LDAP (default=3600*6)
xwiki.authentication.ldap.groupcache_expiration=60
#-# [SINCE 1.3M2, XWikiLDAPAuthServiceImpl]
#-# - create : synchronize group membership only when the user is first
created
#-# - always: synchronize on every login
xwiki.authentication.ldap.mode_group_sync=always
#-# [SINCE 1.3M2, XWikiLDAPAuthServiceImpl]
#-# if ldap authentication fails for any reason, try XWiki DB
authentication with the same credentials
xwiki.authentication.ldap.trylocal=1
Thanks!
Thomas
Thanks for the replies.
I had already found that bug. If I take the conditional completely out
of the class, it still doesn't send an email.
Dan
> It is probably due to the following :
>
> "if(newdoc.getSpace().substring(lastFour) == "Blog") {"
>
> in Java, if you have the following :
>
> String st1 = "Blog";
> String st2 = new String("Blog");
>
> then st1 == st2 will always return false, as the objects are not the
> same. What you want is to compare their values, using st1.equals(st2),
> which will return true.
> You can read here to find out more
> http://www.unix.com.ua/orelly/java/langref/ch04_09.htm (especially
> this
> sentence : "Because the == operator determines if two objects are the
> same object, it is not appropriate for comparisons that need to
> determine if two objects have the same contents. For example, if you
> need to know whether two String objects contain the same sequences of
> characters, the == operator is inappropriate. You should use the
> equals() method")
>
> Anyway, their is even simpler for you. What you want to do is check if
> the space name finishes by "Blog". For this the appropriate method is
> String#endsWith
> (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#endsWith(java…
> )
> As in :
>
> "if(newdoc.getSpace().endsWith("Blog")) {"
>
> Hope this helps and fixes your issue,
>
> Regards,
> Jerome
>
> Daniel Svoboda wrote:
>> 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
>>
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