[xwiki-users] safari compatibility of tinymce
Hi, I'm using platform version 1.5.2, and when I navigate to a page that uses the wysiwyg editor in the Safari browser, I get a popup that says: Editing tools in this location are not supported by the Safari browser. Please use the Firefox browser to take advantage of these features. The tinymce site says that it's compatible with Safari. Is this a version problem? If so, can someone give me a procedure for using a new version of tinymce? Is it simply downloading and replacing the tiny_mce directory? Dan ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] another tinymce question
I want to make additional tinymce editor features available; e.g. embedded media. Is this a tinymce version issue, or is some supporting xwiki code required to make it work? Dan ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] groovy notification
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(), [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] , \ 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: [EMAIL PROTECTED] [EMAIL PROTECTED] 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
Re: [xwiki-users] groovy notification
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.lang.String) ) 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(), [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] , \ 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: [EMAIL PROTECTED] [EMAIL PROTECTED] 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
[xwiki-users] preventing registration on workspaces under xem
Hi, I'm using workspaces 1.2M1 as a virtual xwiki under xem 1.3. I have configured the XWikiServerClass object under XWikiServerServername to have the visibility property set to 'Private'. When I look at XWikiPreferences in the virtual xwiki, there are XWikiGlobalRights objects configured Deny, Groups:,Levels:Register,Users:XWikiGuest, and Deny, Groups:XWikiAllGroup, Levels: edit, register, Users: The registration form still appears on the login page, and upon filling in the fields and submitting, registration is successful. I need to not allow registration by anyone except Admin. Thanks, Dan Svoboda ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users