Re: [xwiki-users] database related issue while upgrading to the brand new 7.0 release

2015-04-06 Thread Thomas Mortagne
On Mon, Apr 6, 2015 at 11:16 AM, Manuel Smeria man...@xwiki.com wrote:
 Hello all,

 I've just tested an upgrade from XWiki 6.4.3 to 7.0 on MySQL using the JDBC
 driver v5.1.35 and I didn't have any problem.

 Both the upgrade process and starting the XWiki server afterwards worked as
 expected.

 The only thing I did notice was this line:

 2015-04-06 12:11:07,687 [main] WARN  ltInstalledExtensionRepository -
 Invalid extension
 [org.xwiki.platform:xwiki-platform-search-lucene-ui-6.4.3] on namespace
 [wiki:xwiki] (InvalidExtensionException: No compatible extension is
 installed for dependency
 [org.xwiki.platform:xwiki-platform-search-lucene-api-6.4.3])

Lucene module is not part of the WAR anymore so it's just talling you
that you have Lucene UI which is not valid anymore.


 which is always displayed when starting the server.

 Thanks,
 Manuel

 On Fri, Apr 3, 2015 at 2:03 AM, ricardo.julio.rodriguez.fernan...@sergas.es
 wrote:


 
 De: Vincent Massol [vmas...@gmail.com] en nombre de vinc...@massol.net [
 vinc...@massol.net]
 Enviado: jueves, 02 de abril de 2015 13:09
 Para: XWiki Users
 CC: Rodriguez Fernandez, Ricardo Julio
 Asunto: Re: [xwiki-users] database related issue while upgrading to the
 brand new 7.0 release



 On 2 Apr 2015 at 12:57:48, ricardo.julio.rodriguez.fernan...@sergas.es (
 ricardo.julio.rodriguez.fernan...@sergas.es(mailto:
 ricardo.julio.rodriguez.fernan...@sergas.es)) wrote:

  The 5.1.28 release of MySQL connector did the trick!

 hmm so you’re saying that versions 5.0.8 and 5.1.35 don’t work but
 version 5.1.28 works?

 Yes, this is at least what is happening here. The upgrade process seems to
 have been correctly completed. Here the log records I can see in when I
 shutdown and restart Tomcat with 5.1.28 on place...


 http://atriumkm.idisantiago.es/bin/download/ICT/XWikiUpgradeIssues/tomcatErrorLog.UpgradingTo70.connector.5.1.28.txt

 memory leak is a word combination that affrighting me!

 Please, let me know if and how I could be of any futher help!

 Cheers,

 Ricardo


 That’s strange. Would be great if someone could try and confirm this so
 that we can put it on the XWiki MySQL document page...

 Thanks
 -Vincent

  I've downloaded it from...
 
  http://mvnrepository.com/artifact/mysql/mysql-connector-java
 
  I'll keep enjoying XWiki! Thanks for your help,
 
  Ricardo
 
  --
  Ricardo Rodríguez
  Research Management and Promotion Technician
  Technical Secretariat
  Health Research Institute of Santiago de Compostela (IDIS)
  http://www.idisantiago.es
 
  
  De: Vincent Massol [vmas...@gmail.com] en nombre de vinc...@massol.net [
 vinc...@massol.net]
  Enviado: jueves, 02 de abril de 2015 10:56
  Para: XWiki Users
  CC: Rodriguez Fernandez, Ricardo Julio
  Asunto: Re: [xwiki-users] database related issue while upgrading to the
 brand new 7.0 release
 
  FTR I’ve just tested an upgrade from XWiki 5.4 to 7.0 on Oracle
 11.2.0.2.0 with ojdbc6.jar and it worked fine! :)
 
  This seems to mean that DBCP 2.1 only requires JDBC 4.0 (and not 4.1)
 since ojdbc6 doesn’t support JDBC 4.1 according to:
 
 http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#01_03
 
  Thanks
  -Vincent
 
 
  On 2 Apr 2015 at 10:22:05, vinc...@massol.net (vinc...@massol.net
 (mailto:vinc...@massol.net)) wrote:
 
   Hi Ricardo,
  
   We realized, after the release of XWiki 7.0 that due to our upgrade of
 DBCP to version 2.1 we’ve introduced a new requirement: JDBC 4 (I’m not
 sure if we require JDBC 4.0 or 4.1 actually, still trying to find out).
   See
 http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki70#HIssuesspecifictoXWiki7.0
   (
 http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki70#HIssuesspecifictoXWiki7.0
 )
  
   (
 http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki70#HIssuesspecifictoXWiki7.0
 )
   That said it seems that MySQL JDBC drivers 5.0.x are supposed to be
 JDBC4 compliant and version 5.1.x certainly are too.
  
   Thomas has just tested XWiki 7.0 on MySQL with version 5.1.28 and it
 was working fine for him.
  
   The error you get is strange. ATM I don’t understand it. We’re going
 to do more tests on various DBs to see whether we need to rollback the DBCP
 upgrade or not.
  
   Stay tuned.
  
   Sorry about the problem
  
   Thanks
   -Vincent
  
   On 2 Apr 2015 at 09:39:45, ricardo.julio.rodriguez.fernan...@sergas.es
 (ricardo.julio.rodriguez.fernan...@sergas.es(mailto:
 ricardo.julio.rodriguez.fernan...@sergas.es)) wrote:
  
Hi all!
   
We have successfuly updated our XWiki 6.x installation along the
 whole 6 cycle, but I'm in troubles with the new 7.0 release. I think that
 with only the first four lines of the error stack
   
XWiki initialization failed !
   
Exception thrown during job execution
class java.lang.AbstractMethodError: null
at
 

Re: [xwiki-users] database related issue while upgrading to the brand new 7.0 release

2015-04-06 Thread Manuel Smeria
Hello all,

I've just tested an upgrade from XWiki 6.4.3 to 7.0 on MySQL using the JDBC
driver v5.1.35 and I didn't have any problem.

Both the upgrade process and starting the XWiki server afterwards worked as
expected.

The only thing I did notice was this line:

2015-04-06 12:11:07,687 [main] WARN  ltInstalledExtensionRepository -
Invalid extension
[org.xwiki.platform:xwiki-platform-search-lucene-ui-6.4.3] on namespace
[wiki:xwiki] (InvalidExtensionException: No compatible extension is
installed for dependency
[org.xwiki.platform:xwiki-platform-search-lucene-api-6.4.3])

which is always displayed when starting the server.

Thanks,
Manuel

On Fri, Apr 3, 2015 at 2:03 AM, ricardo.julio.rodriguez.fernan...@sergas.es
 wrote:


 
 De: Vincent Massol [vmas...@gmail.com] en nombre de vinc...@massol.net [
 vinc...@massol.net]
 Enviado: jueves, 02 de abril de 2015 13:09
 Para: XWiki Users
 CC: Rodriguez Fernandez, Ricardo Julio
 Asunto: Re: [xwiki-users] database related issue while upgrading to the
 brand new 7.0 release



 On 2 Apr 2015 at 12:57:48, ricardo.julio.rodriguez.fernan...@sergas.es (
 ricardo.julio.rodriguez.fernan...@sergas.es(mailto:
 ricardo.julio.rodriguez.fernan...@sergas.es)) wrote:

  The 5.1.28 release of MySQL connector did the trick!

 hmm so you’re saying that versions 5.0.8 and 5.1.35 don’t work but
 version 5.1.28 works?

 Yes, this is at least what is happening here. The upgrade process seems to
 have been correctly completed. Here the log records I can see in when I
 shutdown and restart Tomcat with 5.1.28 on place...


 http://atriumkm.idisantiago.es/bin/download/ICT/XWikiUpgradeIssues/tomcatErrorLog.UpgradingTo70.connector.5.1.28.txt

 memory leak is a word combination that affrighting me!

 Please, let me know if and how I could be of any futher help!

 Cheers,

 Ricardo


 That’s strange. Would be great if someone could try and confirm this so
 that we can put it on the XWiki MySQL document page...

 Thanks
 -Vincent

  I've downloaded it from...
 
  http://mvnrepository.com/artifact/mysql/mysql-connector-java
 
  I'll keep enjoying XWiki! Thanks for your help,
 
  Ricardo
 
  --
  Ricardo Rodríguez
  Research Management and Promotion Technician
  Technical Secretariat
  Health Research Institute of Santiago de Compostela (IDIS)
  http://www.idisantiago.es
 
  
  De: Vincent Massol [vmas...@gmail.com] en nombre de vinc...@massol.net [
 vinc...@massol.net]
  Enviado: jueves, 02 de abril de 2015 10:56
  Para: XWiki Users
  CC: Rodriguez Fernandez, Ricardo Julio
  Asunto: Re: [xwiki-users] database related issue while upgrading to the
 brand new 7.0 release
 
  FTR I’ve just tested an upgrade from XWiki 5.4 to 7.0 on Oracle
 11.2.0.2.0 with ojdbc6.jar and it worked fine! :)
 
  This seems to mean that DBCP 2.1 only requires JDBC 4.0 (and not 4.1)
 since ojdbc6 doesn’t support JDBC 4.1 according to:
 
 http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#01_03
 
  Thanks
  -Vincent
 
 
  On 2 Apr 2015 at 10:22:05, vinc...@massol.net (vinc...@massol.net
 (mailto:vinc...@massol.net)) wrote:
 
   Hi Ricardo,
  
   We realized, after the release of XWiki 7.0 that due to our upgrade of
 DBCP to version 2.1 we’ve introduced a new requirement: JDBC 4 (I’m not
 sure if we require JDBC 4.0 or 4.1 actually, still trying to find out).
   See
 http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki70#HIssuesspecifictoXWiki7.0
   (
 http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki70#HIssuesspecifictoXWiki7.0
 )
  
   (
 http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki70#HIssuesspecifictoXWiki7.0
 )
   That said it seems that MySQL JDBC drivers 5.0.x are supposed to be
 JDBC4 compliant and version 5.1.x certainly are too.
  
   Thomas has just tested XWiki 7.0 on MySQL with version 5.1.28 and it
 was working fine for him.
  
   The error you get is strange. ATM I don’t understand it. We’re going
 to do more tests on various DBs to see whether we need to rollback the DBCP
 upgrade or not.
  
   Stay tuned.
  
   Sorry about the problem
  
   Thanks
   -Vincent
  
   On 2 Apr 2015 at 09:39:45, ricardo.julio.rodriguez.fernan...@sergas.es
 (ricardo.julio.rodriguez.fernan...@sergas.es(mailto:
 ricardo.julio.rodriguez.fernan...@sergas.es)) wrote:
  
Hi all!
   
We have successfuly updated our XWiki 6.x installation along the
 whole 6 cycle, but I'm in troubles with the new 7.0 release. I think that
 with only the first four lines of the error stack
   
XWiki initialization failed !
   
Exception thrown during job execution
class java.lang.AbstractMethodError: null
at
 org.apache.commons.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:914)
at
 org.apache.commons.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:914)
...
   
Here you could find all catalina.out logged me after a Tomcat
 

Re: [xwiki-users] XWiki utility for stripping HTML

2015-04-06 Thread Marius Dumitru Florea
This http://extensions.xwiki.org/xwiki/bin/view/Extension/Html+to+plain+text
may be useful too.

Hope this helps,
Marius

On Tue, Jan 20, 2015 at 1:32 AM, beldaz bryn.jeffr...@sydney.edu.au wrote:
 Yes, escaping is what I'm after. Looks like StringExcapeUtils is already
 included in the XWiki install so I'll use that inside my Groovy scripts.

 Many thanks.



 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/XWiki-utility-for-stripping-HTML-tp7593665p7593712.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] A way to add some tags on saved page with class (resolved)

2015-04-06 Thread Pascal BASTIEN
Here my working well :-) code to add a tag from a property ( database list) of 
my Class attached on my doc :
          ## Début section pour checker les tags
          ## Si champ x_CssTag alors rajout du tag et/ou suppression des 
anciens tags 
        #if (($xcontext.action == 'view')  
($prop.Name.endsWith(_$!{SufxTag})=='true'))
          #set ($NouveauTag=$doc.getValue($prop.Name))
          #if ($!NouveauTag!='')
            ## Array de tous les tags du document
            #set ($TagsInMyDoc=$xwiki.tag.getTagsFromDocument($doc))
            ## si tag n'est pas vide et n'est pas un tag du doc alors check des 
tags
            #if ($listtool.contains($TagsInMyDoc, $!NouveauTag)==false)
          ## Récup de toutes les valeurs de la liste
          #set($list = $class.get($prop.Name).getListValues())
  ## $list $class.getName() $prop.Name
          #foreach($ATagFromClass in $list)
            ## * value: $ATagFromClass displayed
            ##Enlève tous les tags de la liste dans la page
            ## $ATagFromClass
            ## *** $listtool.isList($TagsInMyDoc) : $ATagFromClass est dans 
la liste: $TagsInMyDoc
            ##  $listtool.contains($TagsInMyDoc, $ATagFromClass)
            ## efface les anciens tags si présents
            #if ($listtool.contains($TagsInMyDoc, $ATagFromClass)==true)
          #if ($!ATagFromClass!=$!NouveauTag)
            #set 
($discard=$xwiki.tag.removeTagFromDocument($ATagFromClass, $doc))
            ## = je supprime le tag $ATagFromClass =
          #end
            #elseif ($!ATagFromClass==$!NouveauTag)
          ## =  j'ajoute le tag $NouveauTag sur $doc =
          ## Ajoute le nouveau Tag
          #set ($discard=$xwiki.tag.addTagToDocument($NouveauTag, $doc))
            #end
          #end
          ## Fin à insérer
            #end
        ##     #set($ClassTag=$ClassName)
          #end
        #end


  De : Pascal BASTIEN pbasnews-xw...@yahoo.fr
 À : XWiki Users users@xwiki.org 
 Envoyé le : Samedi 4 avril 2015 0h11
 Objet : Re: [xwiki-users] A way to add some tags on saved page with class
   
How silly am I!
I was dealing with the problem in the wrong way.
Instead to add some tag on saving page, some piece of velocity code in my Sheet 
(in view mode) must doing the right thinks...
(I will paste the code when I finish it)

  
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Is there an escape tool to escape text in XWiki syntax?

2015-04-06 Thread Marius Dumitru Florea
There is now http://jira.xwiki.org/browse/XWIKI-11979 (7.1M1+) .

Hope this helps,
Marius

On Mon, Jan 19, 2015 at 9:14 AM, Thanh Hong Dai hdth...@tma.com.vn wrote:
 Currently, I'm using something like this to generate a list of pages whose
 prefix is Prefix: and link to them:



 {velocity}} (((

 #foreach ($row in $services.query.hql(select doc.name, doc.fullName from
 XWikiDocument doc where doc.space.hidden = false and doc.space not in
 ('XWiki', 'Sandbox', 'Main', 'Macros') and doc.name like
 'Prefix:%').execute())

 * **[[$row[0].replaceFirst(Prefix: *, ).replaceAll(~,
 ).replaceAll([\x20-\x7f[^a-zA-Z0-9 ~]],
 ~~$0)doc:$row[1].replaceAll(~, ~~).replaceAll([\x5b\x5d|], \\$0
 file:///\\$0 )]]**

 #end

 ))) {{/velocity}}



 I have tested with some heavy test cases like



 Prefix:
 ~~~!!!```@@@$$$%%%^^^***((()))___+++==={{{}}}[[[]]]\\\|||:::;;;'''
 ???///...,,,



 And what I have above works correctly (both showing the title and linking to
 the document). I only work on a few hard test cases, though, so I'm not sure
 if I missed anything.



 Is there a method that does all this automatically? Or is there a better
 approach to this?



 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Generating pure JSON

2015-04-06 Thread Marius Dumitru Florea
On Sat, Jan 17, 2015 at 10:43 AM, Bryn Jeffries
bryn.jeffr...@sydney.edu.au wrote:
 I'd like to be able to generate pure JSON from a wiki page, to use in other 
 pages via AJAX. To that end I created a page with the following content:
 {{velocity wiki=false}}
 $response.setContentType('application/json')

 {
 greeting : Hello,
 location: World
 }

Instead of printing the JSON directly I recommend using the $jsontool
(see 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Velocity+Module#HVelocityTools
). The advantage is that you don't have to care about escaping JSON
(property) values.

$jsontool.serialize({
  greeting : $someObject.greeting,
  location: $someOtherObject.location
})

Hope this helps,
Marius

 {{/velocity}}

 Calling this via /xwiki/bin/get/Sandbox/JsonTest I get the following code:

 pbr/#123;br/greeting : Hello,br/location: Worldbr/}/p

 I get the same via /xwiki/bin/view/AlertDB/JsonTest?xpage=plain.

 If I remove the $response.setContentType('application/json')
 https://dev.alertnessdb.net/xwiki/bin/view/AlertDB/JsonTest?xpage=plain


 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Registration of the new user fails via XWikiPreferences UI

2015-04-06 Thread Marius Dumitru Florea
On Thu, Jan 22, 2015 at 3:24 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote:

 Hi!
 XWiki 5.3 worked fine. Upgrade 5.3 - 6.3.
 http://mydomain.com/admin/XWiki/XWikiPreferences?editor=globaladminsection=Users#|t=userstablep=1l=10wiki=local
 Add User gives nothing. I fill in all required field, click on the Add user. 
 User magically does not appear in the list.
 The same via  http://mydoamin.com/register/XWiki/Register gives required 
 result - New User in the list of users appears.


 Is it a bug or I'm doing something wrong?

I cannot reproduce on a clean 7.0. Did you try cleaning your browser's
cache? Otherwise, maybe you had a bad merge during the upgrade.

Hope this helps,
Marius


 Kind regards,

 Dmitry
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Javascript RESTful

2015-04-06 Thread Marius Dumitru Florea
You overcomplicate it by specifying all those optional parameters.
This works for me:

require(['jquery'], function($) {
  $.get(XWiki.contextPath + '/rest').done(function(data) {
console.log(data);
  });
});

Hope this helps,
Marius

On Sat, Feb 21, 2015 at 1:11 PM, Matthias Wegner mic.mat.weg...@web.de wrote:
 Hello,

 i like the REST-API and have a library in Java which works perfect. Now i
 want to use the RESTful API in Javascript. But i am new to javascript and
 tried a lot, but nothing seems to work. Is there a simple example in
 javascript with the rest-api?

 I don't get what i am doing wrong, because i am not good in javascript.

 I tried

 require(['jquery'], function ($) {
   $.ajax({
  accepts: {xml: 'text/xml', text: 'text/plain'},
  url: 'http://HOST/xwiki/rest',
 type: 'GET',
  dataType: 'xml',
 contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
  converters: {'text xml': jQuery.parseXML},
  crossDomain: true,
  async: true,
  username: 'username',
  password: 'apassword',
  success: function(data){
 alert(Success: +JSON.stringify(data));
  },
 error: function(data){
 alert(Error: + JSON.stringify(data));
  }
   });
 });

 Also i tried

 var httpRequest = new XMLHttpRequest();
 httpRequest.open('PUT', 'http://HOST/xwiki/rest');
 httpRequest.setRequestHeader('Accept', 'application/xml');
 httpRequest.send( null );
 alert( JSON.stringify(httpRequest.responseText) );
 httpRequest.onreadystatechange = function(){
   if(this.readyState == 4){
if(this.status == 200){
  alert(this.responseText);
}
else{
  alert(this.statusText);
}
   }
 }

 I recognized a difference in ajax when i switched to jsonp because i tried
 on localhost. But anyway my example work when i use my server outside.

 Can you help me?

 Regards,
 Matthias



 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/Javascript-RESTful-tp7594084.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users