[xwiki-users] Question on DBList and the use of different wikis

2015-03-17 Thread Peter Huisman

Hi,

I am looking for a solution for the following situation.

I have 2 wiki's. The fist one (ref: MD) contains "Master Data". The 
second one (ref: UD) contains "User Data". I have Classes in UD that use 
data from the MD. The way to connect them is using DBList. I am however 
not able to compose a HQL query that enables me to select a different 
Wiki to run the query on. I know it is possible to select the Wiki in 
Velocity but until now, that didn't help me. In the Github code (the 
getDBList method in the DBListClass.java) a comment is included just 
before a statement:


// The DBlist may come from an other wiki
StringwikiName =getReference().extractReference(EntityType.WIKI).getName();

This might indicate that selecting a wiki might be an option when 
getting a DBList.


Anybody knows how to solve this problem (without replicating the data 
from MD in UD ;-))? Any additional suggestions are welcome.


Thanks,

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


[xwiki-users] Livetable results for guest users

2015-04-20 Thread Peter Huisman

Hi,

I have a Wiki which sole purpose is provide documentation for another 
Wiki based on vairous classes used to define this documentation. The 
wiki should be publicly accessible. I'm using Livetables to show the 
results.


So far so good. I do not have any problems controlling the environment 
for guest users in accessing the data. I ran into a problem however: I 
added a column "sequencenumber" (just a "Number") in a class, to control 
the sequence of objects for a certain parent. This column is displayed 
in the livetable as a sortable column. This works great when I'm 
signed-in as Admin, but when I'm accessing the livetable as guest, it 
doesn't work as I expected. The data is shown when I'm selecting any 
other (non-number) column as a sort key, but when I select the 
sequencenumber column to sort the data, nothing (no single row) is 
displayed. Selecting another key to sort the data brings the rows back 
on the screen.


I've tried changing the visibility of the livetable macro's but that 
didn't bring me anything. Is there anyone who had the same experience 
and (obviously) can help me solve this (without changing the 
sequencenumber to String type)? :-)


Thanks,

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


Re: [xwiki-users] users Digest, Vol 93, Issue 41

2015-04-21 Thread Peter Huisman

Hi Marius,

I am using 6.4.3 and the unmodified LiveTableResults macro. I haven't 
tried this for a simple user since this is a (sub-)wiki that is 
accessible only for Admin and guest (non-registered) users. I will try 
to check this out later today.


Thanks,
Peter



users-requ...@xwiki.org schreef op 20-4-2015 om 14:00:

Send users mailing list submissions to
users@xwiki.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.xwiki.org/mailman/listinfo/users
or, via email, send a message with subject or body 'help' to
users-requ...@xwiki.org

You can reach the person managing the list at
users-ow...@xwiki.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of users digest..."


Today's Topics:

1. Livetable results for guest users (Peter Huisman)
2. Re: Livetable results for guest users (Marius Dumitru Florea)
3. create new xclass property (TOTOUM NEMKAM, Eva)
4. Re: create new xclass property (Marius Dumitru Florea)
5. Help me again ;) (Maciej Fokt)
6. Re: Help me again ;) (ricardo.julio.rodriguez.fernan...@sergas.es)


___
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


[xwiki-users] DBList and Custom Display

2015-04-22 Thread Peter Huisman

Hi guys,

I have a class containing a property type DBList. The Query is something 
like this:


SELECT idVarProp.value, CONCAT(codeVarProp.value, ' - ', 
naamVarProp.value, ' (', codeProdProp.value, ' - ', naamProdProp.value, 
')')

FROM  etc. etc.

This works fine if I use "displayView"; the CONCAT value is displayed on 
screen. I now want to use a custom displayer to access this CONCAT part. 
I guess I should have access to some kind of Map value, but I do not 
know how to get to it.


Any ideas or is this not possible at all?

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


[xwiki-users] DocumentSavingEvent

2015-07-10 Thread Peter Huisman
Hi,

I was wondering if there is a way to stop the document from being saved using 
this event listener (or any similar event listener for that matter)?

With kind regards,

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


[xwiki-users] DocumentCreatingEvent

2015-07-10 Thread Peter Huisman
Hi,

I was wondering if there is a way to stop the document from being saved using 
this event listener (or any similar event listener for that matter)?

With kind regards,

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


Re: [xwiki-users] DocumentSavingEvent

2015-07-10 Thread Peter Huisman
Thanks Thomas,

Sorry about the double question. It was intended to be only one :-) I am 
however able to cancel the SAVE by canceling the 
ActionExecutingEvent(SaveAction.ACTION_NAME) which is triggered by the Save. 
This however displays an empty page when I send an event.cancel().

It would be a solution if I could somehow display the previous page or some 
kind of error message. I’m not that much of an expert in Java / xWiki that I 
understand if and how this could be accomplished. Any suggestions?

Br,

Peter
> Op 10 jul. 2015, om 12:00 heeft users-requ...@xwiki.org het volgende 
> geschreven:
> 
> Send users mailing list submissions to
>   users@xwiki.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://lists.xwiki.org/mailman/listinfo/users
> or, via email, send a message with subject or body 'help' to
>   users-requ...@xwiki.org
> 
> You can reach the person managing the list at
>   users-ow...@xwiki.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of users digest..."
> Today's Topics:
> 
>   1. DocumentSavingEvent (Peter Huisman)
>   2. DocumentCreatingEvent (Peter Huisman)
>   3. Re: DocumentSavingEvent (Thomas Mortagne)
>   4. Re: DocumentCreatingEvent (Thomas Mortagne)
> 
> Van: Peter Huisman 
> Onderwerp: [xwiki-users] DocumentSavingEvent
> Datum: 10 juli 2015 11:05:14 CEST
> Aan: users@xwiki.org
> Antwoord aan: XWiki Users 
> 
> 
> Hi,
> 
> I was wondering if there is a way to stop the document from being saved using 
> this event listener (or any similar event listener for that matter)?
> 
> With kind regards,
> 
> Peter
> 
> 
> 
> Van: Peter Huisman 
> Onderwerp: [xwiki-users] DocumentCreatingEvent
> Datum: 10 juli 2015 11:06:59 CEST
> Aan: users@xwiki.org
> Antwoord aan: XWiki Users 
> 
> 
> Hi,
> 
> I was wondering if there is a way to stop the document from being saved using 
> this event listener (or any similar event listener for that matter)?
> 
> With kind regards,
> 
> Peter
> 
> 
> 
> Van: Thomas Mortagne 
> Onderwerp: Antw.: [xwiki-users] DocumentSavingEvent
> Datum: 10 juli 2015 11:08:49 CEST
> Aan: XWiki Users 
> Antwoord aan: XWiki Users 
> 
> 
> Nop you can't cancel saving right now, but you can use
> DocumentSavingEvent to revert any change you don't like in the
> document before the save.
> 
> 
> On Fri, Jul 10, 2015 at 11:05 AM, Peter Huisman  wrote:
>> Hi,
>> 
>> I was wondering if there is a way to stop the document from being saved 
>> using this event listener (or any similar event listener for that matter)?
>> 
>> With kind regards,
>> 
>> Peter
>> ___
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
> 
> 
> 
> -- 
> Thomas Mortagne
> 
> 
> 
> 
> Van: Thomas Mortagne 
> Onderwerp: Antw.: [xwiki-users] DocumentCreatingEvent
> Datum: 10 juli 2015 11:09:30 CEST
> Aan: XWiki Users 
> Antwoord aan: XWiki Users 
> 
> 
> Same answer than for DocumentSavingEvent mail.
> 
> On Fri, Jul 10, 2015 at 11:06 AM, Peter Huisman  wrote:
>> Hi,
>> 
>> I was wondering if there is a way to stop the document from being saved 
>> using this event listener (or any similar event listener for that matter)?
>> 
>> With kind regards,
>> 
>> Peter
>> ___
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
> 
> 
> 
> -- 
> Thomas Mortagne
> 
> 
> 
> ___
> 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


[xwiki-users] Generating a DocumentReference

2015-08-05 Thread Peter Huisman
Hi,

I am looking for a way to create a document reference without the “hassle” of 
worrying about the WikiName. In a listener, I get a document name which I use 
for input in a query. The result is a list of documentNames in the format 
[space.docname]. I need to transform this into a DocumentReference. I can do 
this without using the wiki, but this gives me “wiki” as the default Wiki. I 
gate get the wiki from (e.g.) the context, but this means I have to do - as far 
as I know - one of the two following creations:

1 - documentReferenceResolver ( wikiName + “:” + docFullName)

Where docFullName is in the format [space.docname]

2 - new DocumentReference ( wikiName, spaceName, docName)

In this case, I will have to split the fullName string in order to get access 
to the spaceName and the docName. If I use a query that delivers me only the 
pageName, I have the problem of not being able to resolve the spaceName.

I am fairly sure I miss something essential here. Could someone help me out? 
I’m also fine with any answer that gives me a XWikiDocument :-)

With kind regards,

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


[xwiki-users] Recursion during deleteEvent

2015-08-06 Thread Peter Huisman
Hi,

I am looking for a solution to “automatically” delete children for a XWiki page 
using the DeleteEvent listener. Is there a way to prevent recursion when 
deleting such a child XWiki page from a Java lib?

Thanks for your feedback,

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


[xwiki-users] Antw.: Recursion during deleteEvent

2015-08-09 Thread Peter Huisman
Hi Eduard,

Thanks. I figured that one out. Fortunately, I have been able to use the 
recursion in the DeleteListener to my advantage without having to set any kind 
of context variable. It works like a charm!

Thanks again for the effort.

With kind regards,

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


[xwiki-users] Sold search from JAVA

2015-08-10 Thread Peter Huisman
Hi,

I have been looking into the Solr search to identify which wiki links ([>>doc:] 
in TEXTAREA’s within Objects on a page) are being used for a certain document. 
I want to use this from my Java packages. I have not been able to identify an 
(easy?) way of incorporating Solr search into this. If I’m not mistaken, it 
even discouraged to use. It works like a charm in velocity but that’s not where 
I want to use it.

Now, I’m not an expert in Java so maybe I do not have the right knowledge to 
understand how this works but can you please enlighten me a bit on this topic?

With kind regards,

Peter


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


[xwiki-users] Solr search from JAVA

2015-08-11 Thread Peter Huisman
Hi Vincent, Eduard,

Thanks for the answers. They look ridiculously simple since it’s absolutely in 
line with the XWQL and HQL format - something that I could have guessed. Very 
very helpful. Sorry to bother you but it’s a great help!

With kind regards,

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


[xwiki-users] Question on copying Objects

2015-08-21 Thread Peter Huisman
Hi,

I have a question when copying an object from a page onto another page 
according to (abbreviated) method below.

BaseObject sourceResultaatObject = getObject(sourceResultaattype, 
RESULTAATTYPECLASSREFERENCE);
// gets a BaseObject from a page based on the two DocumentReferences for the 
source and the class (custom method)
BaseObject destinationResultaatObject = 
sourceResultaatObject.duplicate();
List sourceResultaattypeLeidtTotBesluittype = 
sourceResultaatObject.getListValue(LEIDTTOTBESLUITTYPE)
// contents = [“BST_ER5MLpodilPv6”,"BST_622yQb1ktyvV6"];
..
destinationResultaatObject.setDBStringListValue(LEIDTTOTBESLUITTYPE, 
sourceResultaattypeLeidtTotBesluittype);
..
XWikiDocument XWikiDoc = createPage(destinationResultaattype);
// destinationResultaattype is a newly created DocumentReference
XWikiDoc.addXObject(destinationResultaatObject);
savePage(XWikiDoc);
// a custom method to save the XWikiPage.
sourceResultaatObject = getObject(sourceResultaattype, 
RESULTAATTYPECLASSREFERENCE);
logger.trace(sourceResultaatObject.toXMLString());

End result I expect to be:

SourceObject: property LEIDTTOTBESLUITTYPE = 
[“BST_ER5MLpodilPv6”,"BST_622yQb1ktyvV6"];
DestinationObject: property LEIDTTOTBESLUITTYPE = 
[“BST_ER5MLpodilPv6”,"BST_622yQb1ktyvV6"];

When I display the old Object immediately after the savePage (toXMLString), the 
result is, that the DBList field is also showing both items. However: When I 
display the page showing the object (using a sheet), the data is gone and the 
DBList is empty. And it looks like it takes a few seconds for this to show up 
this way.

The only solution I have come up with is to fill the List using a for 
loop. In that case, it is working fine.

Maybe I’m missing an essential Java item here but it looks like, when I am 
assigning the DBList values to the List variable, it does not copy the 
data but creates an object link. When assigning it to the new object DBList  
the old link is removed. What I do not understand is, that it takes some time 
before Wiki (or is it?) realizes that it has to remove the DBList values from 
the sourceObject.

Can anyone explain what is happening here? It would be much appreciated.

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


[xwiki-users] Query in Java

2015-09-10 Thread Peter Huisman
Hi,

I’m looking for the return type for the following Query type in Java:

select doc.space, doc.name from XWikiDocument doc, BaseObject obj…

I know it should be some kind of List> since this is what works in 
Velocity but I can’t do a typecast from List to List.

Can anyone help me on this?

Br,

Peter

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


[xwiki-users] Eventlistener

2015-09-11 Thread Peter Huisman
Hi,

After deleting a document, XWiki first shows a confirmation page and after that 
displays the deleted document(s). I was wondering if I’m able to redirect the 
user to a different page after the confirmation he has to give on the delete 
action. I have noticed some remaks on the topic such as the JIRA issue 
XWIKI-9906 but I;m not sure if there have been any changes on this.

I don’t mind solving the issue myself and I would expect to be able to use the 
DocumentDeleted event listener. I do not have enough detailed knowledge on the 
topic to be able to sort this out entirely by myself so that leaves the 
following questions:

1 - Any news on the JIRA issue in any XWIKI version?
2 - Is it possible to use the DocumentDeleted listener for this purpose?
3 - If yes, does anyone have any suggestion on the approach?
4 - if no, is there any other way to solve this?

Thanks in advance for the feedback,

Br,

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


[xwiki-users] XAR

2015-09-17 Thread Peter Huisman
Hi,

Is there a way to generate XAR’s using XWiki’s scheduling function? I’m not 
looking for a DB based backup but merely for a backup of spaces / pages.

With kind regards,

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


Re: [xwiki-users] XAR

2015-09-18 Thread Peter Huisman
Hi Eduard,

Thanks for the explanation and the links.

I am not looking for the Java way since we already have a XML exporter in place 
that is exporting the information in our environment (which is heavily object 
based) in a way that can be used by third parties. This is the way we are 
looking for a more final solution. We were looking for an easy and quick 
(intermediate) solution to bridge the gap so to speak.

The strange thing is, that I use google to search extensively for things before 
i ask for info in this group. I was somewhat surprised to see the link (no 7) 
which is exactly what I needed! I thank you again for the help and I’m sorry 
that I have not been able to find it myself.

Br,

Peter

> Hi Peter,
> 
> Of course, though you might want to think a bit on the approach.
> 
> 1) If you want to do it in XWiki using the scheduler plugin, you have to
> write some groovy script [1] in the scheduled task that you create in order
> to use the filter module [2] (or the old packager module [3], whichever you
> choose) in order to export the pages you are interested in and save the
> result (on the filesystem or as an attachment in a page).
> 
> As inspiration, you could check out the source code (in java) of the export
> action [4] which is exactly what is going on when you are exporting a page
> from the UI.
> 
> 2) A simpler choice, IMO, would be to schedule a cron [5] task on a linux
> machine (possible the same one running the XWiki instance) and have that
> task simply download (using something like cURL [6]) the result of a
> manually crafter export URL (as detailed in our documentation [7])
> containing the list of pages to export.
> 
> Hope this helps,
> Eduard
> 
> --
> [1] http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting
> [2] http://extensions.xwiki.org/xwiki/bin/view/Extension/Filter+Module
> [3]
> https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/plugin/packaging/PackageAPI.java
> [4]
> https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/ExportAction.java#L244
> [5] https://en.wikipedia.org/wiki/Cron
> [6] https://en.wikipedia.org/wiki/CURL
> [7] http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport
> 
> 
> On Thu, Sep 17, 2015 at 3:49 PM, Peter Huisman  wrote:
> 
>> Hi,
>> 
>> Is there a way to generate XAR’s using XWiki’s scheduling function? I’m
>> not looking for a DB based backup but merely for a backup of spaces / pages.
>> 
>> With kind regards,
>> 
>> Peter
>> ___
>> 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


[xwiki-users] Antw.: XAR

2015-09-24 Thread Peter Huisman
//github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/plugin/packaging/PackageAPI.java>
>> [4]
>> 
> https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/ExportAction.java#L244
>> [5] https://en.wikipedia.org/wiki/Cron
>> [6] https://en.wikipedia.org/wiki/CURL
>> [7] http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport
>> 
>> 
>> On Thu, Sep 17, 2015 at 3:49 PM, Peter Huisman 
> wrote:
>> 
>>> Hi,
>>> 
>>> Is there a way to generate XAR’s using XWiki’s scheduling function? I’m
>>> not looking for a DB based backup but merely for a backup of spaces /
> pages.
>>> 
>>> With kind regards,
>>> 
>>> Peter
>>> ___
>>> 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
> 
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Antw.: Antw.: XAR

2015-09-24 Thread Peter Huisman
That’s the point: As far as I can tell, everything seems to be in order. What 
really puzzles me is that - as per the first example - there is no version 
history present. The only available version is 1.2. Is the export function 
looking for versions earlier than the current function or is it just looking 
for “page version objects”?

If I use the default Admin Export function, I do see all available versions for 
the documents. Importing the page also gives me a full list of all available 
versions which I can also revert. After this, it also show up with no errors in 
it.

> 
> Looks like the history of those object is not in a great shape. Are
> you able to view the history of those documents in error and access
> each version ?
> 
> On Thu, Sep 24, 2015 at 10:14 AM, Peter Huisman  wrote:
>> Hi Eduard,
>> 
>> We have proceeded as per your advice and created a cron with the URL as 
>> explained on 
>> http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport 
>> <http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport>. It 
>> however generates a lot of (in my eyes) unexpected errors in the Log file 
>> (resulting in a Log file size of over 500Mb). When we do an export using the 
>> Admin panel, we do not encounter this problem.
>> 
>> [example 1]
>> the Page (in Bold) has only 1 version (version 1.2) present (and no minor 
>> versions). There are no additional errors for this document.
>> [example 2]
>> This page (also Bold) actually has a version history. The document’s current 
>> version is 14.1 with 2 intermediate (lower) versions before 11.1 and quite a 
>> few below that. Apparently, the export indicates that there is an error in 
>> 11.1 but I’m unable to determine the error in the objects. The higher 
>> versions do not generate an error and I expect that he quits after the error.
>> 
>> Note: Our pages only contain Custom Objects and Comment objects. There’s no 
>> actual content on the page.
>> Note: I can not find any version information in the XAR. It seems that only 
>> a single version is included in the Export.
>> 
>> Can someone explain why this is happening or guide me towards a solution and 
>> (more important :-)) how to correct this?
>> 
>> With kind regards,
>> 
>> Peter
>> 
>> [example 1]
>> 2015-09-23 03:10:40,084 
>> [http://wiki.dkf.wiki/xwiki/bin/export/Space/Page?format=xar&pages=vr360brabant:%25.%25&name=vr360brabant&history=true&backup=true&author=XWiki.Admin
>>  
>> <http://wiki.dkf.wiki/xwiki/bin/export/Space/Page?format=xar&pages=vr360brabant:%25.%25&name=vr360brabant&history=true&backup=true&author=XWiki.Admin>]
>>  ERROR kiDocumentLocaleEventGenerator - Document 
>> [vr360brabant:ZTCVR50348655.EIGSW_jq4Q8bdPCP7zE] has malformed history
>> com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate 
>> execute
>>at 
>> com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1305)
>>  ~[xwiki-platform-legacy-oldcore-6.4.5.jar:na]
>>at 
>> com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:1338)
>>  ~[xwiki-platform-legacy-oldcore-6.4.5.jar:na]
>>at 
>> com.xpn.xwiki.store.XWikiHibernateVersioningStore.loadRCSNodeContent(XWikiHibernateVersioningStore.java:291)
>>  ~[xwiki-platform-legacy-oldcore-6.4.5.jar:na]
>>at 
>> com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo.getContent(XWikiRCSNodeInfo.java:194) 
>> ~[xwiki-platform-legacy-oldcore-6.4.5.jar:na]
>>at 
>> com.xpn.xwiki.doc.rcs.XWikiRCSArchive.(XWikiRCSArchive.java:79) 
>> ~[xwiki-platform-legacy-oldcore-6.4.5.jar:na]
>>at 
>> com.xpn.xwiki.doc.XWikiDocumentArchive.getArchive(XWikiDocumentArchive.java:199)
>>  ~[xwiki-platform-legacy-oldcore-6.4.5.jar:na]
>>at 
>> org.xwiki.filter.instance.internal.input.XWikiDocumentLocaleEventGenerator.write(XWikiDocumentLocaleEventGenerator.java:90)
>>  [xwiki-platform-filter-instance-oldcore-6.4.5.jar:na]
>>at 
>> org.xwiki.filter.instance.internal.input.XWikiDocumentLocaleEventGenerator.write(XWikiDocumentLocaleEventGenerator.java:55)
>>  [xwiki-platform-filter-instance-oldcore-6.4.5.jar:na]
>>at 
>> org.xwiki.filter.instance.internal.input.AbstractBeanEntityEventGenerator.write(AbstractBeanEntityEventGenerator.java:114)
>>  [xwiki-platform-filter-instance-api-6.4.5.jar:na]
>>at 
>> org.xwiki.filter.instance.input.AbstractEntityEventGenerator.write(AbstractEntityEven

[xwiki-users] Antw.: Antw.: Antw.: XAR

2015-09-24 Thread Peter Huisman
I did some testing on this document and it’s history:

LocalDocumentReference docLDR = new 
LocalDocumentReference(spaceName, pageName);
DocumentReference docRef = new 
DocumentReference(docLDR, new WikiReference(this.CONTEXT.getWikiId()));
XWikiDocument a = new XWikiDocument(docRef);
XWikiVersioningStoreInterface b = 
a.getVersioningStore(this.CONTEXT);
Version[] c = b.getXWikiDocVersions(a, this.CONTEXT);
XWikiDocumentArchive e = b.getXWikiDocumentArchive(a, 
this.CONTEXT);
for(Version version : c) {
XWikiDocument f = e.loadDocument(version, 
this.CONTEXT);
BaseObject g = f.getXObject(new 
DocumentReference(this.wiki.getName(), "DutoCode", "AfgeleidPrincipeClass"));
}

This gives me all of the document versions that are available and there are no 
error showing the Object data (I’ve removed all the logging statements). So no 
documents are empty.

Any suggestion on where to look for?

> 
>> From what I understand from the error it looks like some version(s) of
> the document have identifiers but no content.
> 
> On Thu, Sep 24, 2015 at 11:01 AM, Thomas Mortagne
> mailto:thomas.morta...@xwiki.com>> wrote:
>> Actually it's a little more that than, it ask for a String version of
>> the history which is more what happen when a document is deleted.
>> 
>> On Thu, Sep 24, 2015 at 10:59 AM, Thomas Mortagne
>> mailto:thomas.morta...@xwiki.com>> wrote:
>>> According to the trace it just ask for document version handler,
>>> nothing more. And that supposed to happen exactly the same way when
>>> you look at the document versions.
>>> 
>>> 
>>> On Thu, Sep 24, 2015 at 10:57 AM, Peter Huisman >> <mailto:p.huis...@ximm.nl>> wrote:
>>>> That’s the point: As far as I can tell, everything seems to be in order. 
>>>> What really puzzles me is that - as per the first example - there is no 
>>>> version history present. The only available version is 1.2. Is the export 
>>>> function looking for versions earlier than the current function or is it 
>>>> just looking for “page version objects”?
>>>> 
>>>> If I use the default Admin Export function, I do see all available 
>>>> versions for the documents. Importing the page also gives me a full list 
>>>> of all available versions which I can also revert. After this, it also 
>>>> show up with no errors in it.
>>>> 
>>>>> 
>>>>> Looks like the history of those object is not in a great shape. Are
>>>>> you able to view the history of those documents in error and access
>>>>> each version ?
>>>>> 
>>>>> On Thu, Sep 24, 2015 at 10:14 AM, Peter Huisman >>>> <mailto:p.huis...@ximm.nl>> wrote:
>>>>>> Hi Eduard,
>>>>>> 
>>>>>> We have proceeded as per your advice and created a cron with the URL as 
>>>>>> explained on 
>>>>>> http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport 
>>>>>> <http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport> 
>>>>>> <http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport 
>>>>>> <http://platform.xwiki.org/xwiki/bin/view/Features/Exports#HXARExport>>. 
>>>>>> It however generates a lot of (in my eyes) unexpected errors in the Log 
>>>>>> file (resulting in a Log file size of over 500Mb). When we do an export 
>>>>>> using the Admin panel, we do not encounter this problem.
>>>>>> 
>>>>>> [example 1]
>>>>>> the Page (in Bold) has only 1 version (version 1.2) present (and no 
>>>>>> minor versions). There are no additional errors for this document.
>>>>>> [example 2]
>>>>>> This page (also Bold) actually has a version history. The document’s 
>>>>>> current version is 14.1 with 2 intermediate (lower) versions before 11.1 
>>>>>> and quite a few below that. Apparently, the export indicates that there 
>>>>>> is an error in 11.1 but I’m unable to determine the error in the 
>>>>>> objects. The higher versions do not generate an error and I expect that 
>>>>>> he quits after the error.
>>>>>> 
>>>>>> Note: Our pages only con

[xwiki-users] Antw.: Antw.: Antw.: Antw.: XAR

2015-09-24 Thread Peter Huisman
After I load the XWikiDocumentArchive, I can call the getArchive ((I used 
String h = e.getArchive(this.CONTEXT);). This gives me the complete archive of 
the versions. And I guess you are right about the content. Where any previous 
or later version is fully XML compliant, the 11.1 version shows the following 
content (I have replaced large text area’s with [a lot of text]:


11.1
log
@@
text
@d14 1
a14 1
1442743679000
d16 1
a16 1
11.1
d336 1
a336 1
Er zijn vertaaltabellen voor relevante combinaties van zowel 
gebruikte en in gebruik zijnde metainformatiestandaarden als van de daarbij 
horende waardenlijsten.
d378 1
a378 1
[a lot of text]
d380 1
a380 1
[a lot of text]
d382 3
a384 1
1. de metainformatiestandaard bevat zelf een waardetabel.
d386 1
a386 1
1. de metainformatiestandaard verwijst naar een classificatieschema.
d389 1
a389 1
1. de metainformatiestandaard verwijst naar een meer algemene registratie in de 
vorm van een database met gestandaardiseerde gegevens.
d396 1
a396 1
[a lot of text]
d398 1
a398 1
[a lot of text]
d400 1
a400 1
Meer concreet levert dit de volgende voorbeelden van toepassingen op:
d403 1
a403 2
[a lot of text]
d405 1
a405 1
[a lot of text]

@


I am unable to make any sense of this - especially because since the listing of 
the object properties in the snippet below give me following data:

Versie = 11.1 
   identificatieString : AP_P9doA5GQpspPj
   prefix : AP
   nummer : 55
   afgeleidPrincipe : Er zijn vertaaltabellen voor relevante combinaties van 
zowel gebruikte en in gebruik zijnde metainformatiestandaarden als van de 
daarbij horende waardenlijsten.
   isAfgeleideVanBasisprincipe : []
   toelichting : [a lot of text]
   overweging : Dit nieuwe principe is bedoeld als vervanging van AP 23, 36 en 
54.
   voorbeelden : 
   standaarden : In ieder geval alle landelijke mclassificatieschema's en 
metainformatiestandaarden.
   bronverwijzingen : 
   acties : 
   actiehouder : XWiki.AdrieSpruit
   scoreBegrijpelijk : 0
   scoreCorrect : 0
   scoreWenselijk : 0
   scoreUitvoerbaar : 
   heeftStatus : ST_6JgwAwqZungbE


What I can get out of this is: 
- A lot of  items are not present.
- the XML item in the  part () is the only property that 
has indeed changed compared to the previous version (10.1). Some information is 
missing compared to the same item in the  block.
- the XML item in the  part (< afgeleidPrincipe> is according to what 
it should be.
- the XML item in the  part () could well be alright - I 
actually don’t know :-)
- I can make the 11.1 version the current version and it shows up as expected 
(version 15.1)
- Comparing the 11.1 with the 15.1 version shows that they are the same (except 
for the user)

Can you help me understand how this can be the case? And of course what I can 
do to correct this situation?

I’m sorry about the somewhat complex way of explaining but I hope you can help 
me out here.

Br,

Peter


> 
> According to the error what is falling is the method
> XWikiDocumentArchive#getArchive when trying to load version 11.1. Did
> you tried executing it ? Is this version listed in your code ?
> 
> On Thu, Sep 24, 2015 at 1:14 PM, Peter Huisman  <mailto:p.huis...@ximm.nl>> wrote:
>> I did some testing on this document and it’s history:
>> 
>>LocalDocumentReference docLDR = new 
>> LocalDocumentReference(spaceName, pageName);
>>DocumentReference docRef = new 
>> DocumentReference(docLDR, new WikiReference(this.CONTEXT.getWikiId()));
>>XWikiDocument a = new XWikiDocument(docRef);
>>XWikiVersioningStoreInterface b = 
>> a.getVersioningStore(this.CONTEXT);
>>Version[] c = b.getXWikiDocVersions(a, this.CONTEXT);
>>XWikiDocumentArchive e = b.getXWikiDocumentArchive(a, 
>> this.CONTEXT);
>>for(Version version : c) {
>>XWikiDocument f = e.loadDocument(version, 
>> this.CONTEXT);
>>BaseObject g = f.getXObject(new 
>> DocumentReference(this.wiki.getName(), "DutoCode", "AfgeleidPrincipeClass"));
>>}
>> 
>> This gives me all of the document versions that are available and there are 
>> no error showing the Object data (I’ve removed all the logging statements). 
>> So no documents are empty.
>> 
>> Any suggestion on where to look for?
>> 
>>> 
>>>> From what I understand from the error it looks like some version(s) of
>>> the document have identifiers but no content.
>>> 
>>> On Thu, Sep 24, 2015 at 11:01 AM, Thomas Mortagne
>>> mailto:thomas.morta...@xwiki.com> 
>>> <mailto:thomas.morta...@xwiki.com <mailto:th

Re: [xwiki-users] Antw.: Antw.: Antw.: Antw.: XAR

2015-09-25 Thread Peter Huisman
Hi Eduard,

Apparently, the use of the following call is not working:

http:///xwiki/bin/export/Space/Page&format=xar&pages=ws360vthwest:%25.%25&name=ws360vthwest&history=true&backup=true&author=XWiki.Admin
 
/xwiki/bin/export/Space/Page&format=xar&pages=ws360vthwest:%.%&name=ws360vthwest&history=true&backup=true&author=XWiki.Admin>

Apparently, the export is able to find the pages, but not the history.
The one that works without any problem is:

http:///xwiki/wiki/dutotest/export/Main/WebHome?format=xar&name=export&pages=%25.%25&history=true
 
/xwiki/wiki/dutotest/export/Main/WebHome?format=xar&name=export&pages=%.%&history=true>

The difference between both calls is, that the first one is using the Main 
wiki, where the second one is using the Wiki that needs to be exported.

Did I misread the documentation on this? I’m happy that we have at least solved 
the problem. I’m sorry to have used up some your time for this but thanks for 
helping me get some understanding on the topic.

Br,

Peter
> 
>> 
>> You could maybe try to delete the version 11.1 and try exporting again.
>> 

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


[xwiki-users] rendering

2015-10-07 Thread Peter Huisman
Hi,

I am using a conversion from XWiki syntax to XHTML which is working like a 
charm. The challenge I have however is the following:

I am running a (test velocity) script from the Sandbox space. I am converting 
documents in a different space (let’s say ).These documents contain objects 
with textarea’s where the references are in the form of [[text>>doc:filename]] 
since it refers to documents in the  space. The conversion of XWiki links 
is “going down the drain” since the converter is using the Sandbox space to 
resolve the reference to the page and generates a create reference to the file.

Is there an easy way to set the (default) space (in either Java or Velocity) 
without having to run the script from the actual space (in this case, the  
space)?

Br,

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


[xwiki-users] rendering

2015-10-07 Thread Peter Huisman
Hi,

I am using a conversion from XWiki syntax to XHTML which is working like a 
charm. The challenge I have however is the following:

I am running a (test velocity) script from the Sandbox space. I am converting 
documents in a different space (let’s say ).These documents contain objects 
with textarea’s where the references are in the form of [[text>>doc:filename]] 
since it refers to documents in the  space. The conversion of XWiki links 
is “going down the drain” since the converter is using the Sandbox space to 
resolve the reference to the page and generates a create reference to the file.

Is there an easy way to set the (default) space (in either Java or Velocity) 
without having to run the script from the actual space (in this case, the  
space)?

Br,

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


[xwiki-users] Antw.: rendering

2015-10-09 Thread Peter Huisman
Hi,

That is what I expected. I am however calling a java service for this where I’m 
going through a list of documents and doing the conversion. I expect that I 
have to set the document in the context from within the service?

Thanks for the answers,

Peter

On 8 Oct 2015 at 16:23:51, Eduard Moraru (enygma2...@gmail.com 
<mailto:enygma2...@gmail.com>(mailto:enygma2...@gmail.com 
<mailto:enygma2...@gmail.com>)) wrote:

> Hi,
> 
> You did not mention how you are doing the "conversion". Are you using the
> rendering script service?
> 
> Anyway, one thing I can think of is to set the context document before
> starting the conversion process. Here is a snippet that would exemplify
> this:
> 
> {{velocity}}
> $xcontext.doc
> $xcontext.setDoc($xwiki.getDocument('Sandbox.WebHome').document)
> $xcontext.doc
> {{/velocity}}
> 
> Note that it requires Programming Right (on the author user) to be able to
> be executable.

BTW Edy, we have a {{context}} macro for doing this :)

See
http://extensions.xwiki.org/xwiki/bin/view/Extension/Context+Macro 
<http://extensions.xwiki.org/xwiki/bin/view/Extension/Context+Macro>

Thanks
-Vincent

> Hope this helps,
> Eduard
> 
> 
> On Wed, Oct 7, 2015 at 12:38 PM, Peter Huisman wrote:
> 
>> Hi,
>> 
>> I am using a conversion from XWiki syntax to XHTML which is working like a
>> charm. The challenge I have however is the following:
>> 
>> I am running a (test velocity) script from the Sandbox space. I am
>> converting documents in a different space (let’s say ).These documents
>> contain objects with textarea’s where the references are in the form of
>> [[text>>doc:filename]] since it refers to documents in the  space. The
>> conversion of XWiki links is “going down the drain” since the converter is
>> using the Sandbox space to resolve the reference to the page and generates
>> a create reference to the file.
>> 
>> Is there an easy way to set the (default) space (in either Java or
>> Velocity) without having to run the script from the actual space (in this
>> case, the  space)?
>> 
>> Br,
>> 
>> Peter
>> ___
>> users mailing list
>> users@xwiki.org <mailto:users@xwiki.org>
>> http://lists.xwiki.org/mailman/listinfo/users 
>> <http://lists.xwiki.org/mailman/listinfo/users>
>> 
> ___
> users mailing list
> users@xwiki.org <mailto:users@xwiki.org>
> http://lists.xwiki.org/mailman/listinfo/users 
> <http://lists.xwiki.org/mailman/listinfo/users>

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


[xwiki-users] Job's and queues

2015-10-10 Thread Peter Huisman
Hi guys,

I am looking for an example on how to create / use a queue for my custom jobs 
and how to add jobs in the queue (preferably an example in Java). I can’t find 
an example I can use - except for the job Executor description in the 
Extensions area. Can anyone supply me with an example?

With kind regards,

Peter


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


[xwiki-users] Question on Jobs and context

2015-11-13 Thread Peter Huisman
Hi,

Im getting my head around job building. One question I have: If I start a job, 
the context of the job is not the context I need. The script I run is in a 
subWiki but the context of the job is in the main Wiki. What is the best way to 
change the context in the job to match the wiki that I am using to start the 
job?

With kind regards,

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


Re: [xwiki-users] Question on Jobs and context

2015-11-14 Thread Peter Huisman
Hi Thomas,

Thanks for that. Maybe a very silly question but how do I get a job to run in a 
specific Wiki?

Br,

Peter

Van: Thomas Mortagne mailto:thomas.morta...@xwiki.com>>
Onderwerp: Antw.: [xwiki-users] Question on Jobs and context
Datum: 13 november 2015 14:52:51 CET
Aan: XWiki Users mailto:users@xwiki.org>>
Antwoord aan: XWiki Users mailto:users@xwiki.org>>


Right now there is no standard for it. Usually jobs that need to run
in a specific wiki or with specific user for example are provided with
this wiki/user as a job request parameter.

On Fri, Nov 13, 2015 at 2:51 PM, Peter Huisman mailto:p.huis...@ximm.nl>> wrote:
> Hi,
> 
> Im getting my head around job building. One question I have: If I start a 
> job, the context of the job is not the context I need. The script I run is in 
> a subWiki but the context of the job is in the main Wiki. What is the best 
> way to change the context in the job to match the wiki that I am using to 
> start the job?
> 
> With kind regards,
> 
> Peter
> ___
> users mailing list
> users@xwiki.org <mailto:users@xwiki.org>
> http://lists.xwiki.org/mailman/listinfo/users 
> <http://lists.xwiki.org/mailman/listinfo/users>



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


Re: [xwiki-users] Question on Jobs and context (Peter Huisman)

2015-11-16 Thread Peter Huisman
Hi Thomas,

I figured something like this. I have however been trying to pass various 
parameters to the request but this has not resulted in any succes: Passing the 
entire context (either ExecutionContext or XWikiContext) did’t work and neither 
did setting the WikiId or the database. Can you help me on this with an example 
on what (and how) to set?

Br,

Peter

Van: Thomas Mortagne mailto:thomas.morta...@xwiki.com>>
Onderwerp: Antw.: [xwiki-users] Question on Jobs and context
Datum: 14 november 2015 14:13:17 CET
Aan: XWiki Users mailto:users@xwiki.org>>
Antwoord aan: XWiki Users mailto:users@xwiki.org>>


You can change the context with in the XWikiContext. See
http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents#HTheXWikicontext
 

for how to access it from a component.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Antw.: Question on Jobs and context (Peter Huisman)

2015-11-17 Thread Peter Huisman
Hi Thomas,

I managed to do what I wanted. Apparently I mixed up some of the environments. 
I used the DocumentClass to get a document after I set did the setWiki() but 
that didn’t work. Once I switched to the XWikiDocument, it worked like a charm. 
I will most likely have to do some rework to have access to my components from 
a job :-)

Thanks for the help by answering my questions.

Br,

Peter

Van: Thomas Mortagne mailto:thomas.morta...@xwiki.com>>
Onderwerp: Antw.: [xwiki-users] Question on Jobs and context (Peter Huisman)
Datum: 16 november 2015 18:27:13 CET
Aan: XWiki Users mailto:users@xwiki.org>>
Antwoord aan: XWiki Users mailto:users@xwiki.org>>


You should never use the same ExecutionContext or XWikiContext in
different threads since they are really not designed for this and you
will have weird random issue at best.

You can find a example of a component getting the current XWikiContext
and setting the current wiki id on
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/src/main/java/org/xwiki/mail/internal/DatabaseMailStatusStore.java#L73
 
<https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/src/main/java/org/xwiki/mail/internal/DatabaseMailStatusStore.java#L73>.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Type in the code

2015-11-18 Thread Peter Huisman
I guess there is a type in the code: in  org 
.xwiki
 
.job
 
.internal
 
.AbstractJob
 
.progressManager , the 
stepPropress (with a P) is defined where it should be stepProgress - or is 
there a reason for this?

Br,

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


[xwiki-users] Error saving mail status

2015-11-19 Thread Peter Huisman
Hi guys,

I have an error when trying to send an email from inside a job.

The error I get is :

2015-11-19 11:09:16,507 ERROR o.x.m.i.DatabaseMailListener   - Failed to save 
mail status [messageId = [04e467fb-0982-475b-9e8d-e3b1cc58c3a1], batchId = 
[9e5aa5f2-2372-40c9-b4c0-f6c5b7579560], state = [ready], date = [Thu Nov 19 
11:09:16 CET 2015], recipients = [p.huis...@ximml.nl], wiki = [testwiki]] to 
the database 
org.xwiki.mail.MailStoreException: Failed to save mail status [messageId = 
[04e467fb-0982-475b-9e8d-e3b1cc58c3a1], batchId = 
[9e5aa5f2-2372-40c9-b4c0-f6c5b7579560], state = [ready], date = [Thu Nov 19 
11:09:16 CET 2015], recipients = [p.huis...@ximm.nl], wiki = [testwiki]] to the 
database.
at 
org.xwiki.mail.internal.DatabaseMailStatusStore.save(DatabaseMailStatusStore.java:88)
 ~[xwiki-platform-mail-send-storage-6.4.4.jar:na]
at 
org.xwiki.mail.internal.DatabaseMailListener.saveStatus(DatabaseMailListener.java:151)
 [xwiki-platform-mail-send-storage-6.4.4.jar:na]
at 
org.xwiki.mail.internal.DatabaseMailListener.onPrepare(DatabaseMailListener.java:82)
 [xwiki-platform-mail-send-storage-6.4.4.jar:na]
at 
org.xwiki.mail.internal.thread.PrepareMailRunnable.prepareSingleMail(PrepareMailRunnable.java:162)
 [xwiki-platform-mail-send-default-6.4.4.jar:na]
at 
org.xwiki.mail.internal.thread.PrepareMailRunnable.prepareMail(PrepareMailRunnable.java:133)
 [xwiki-platform-mail-send-default-6.4.4.jar:na]
at 
org.xwiki.mail.internal.thread.PrepareMailRunnable.run(PrepareMailRunnable.java:94)
 [xwiki-platform-mail-send-default-6.4.4.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
Caused by: org.xwiki.mail.MailStoreException: Failed to delete mail status 
(message id [04e467fb-0982-475b-9e8d-e3b1cc58c3a1]) from the database.
at 
org.xwiki.mail.internal.DatabaseMailStatusStore.delete(DatabaseMailStatusStore.java:194)
 ~[xwiki-platform-mail-send-storage-6.4.4.jar:na]
at 
org.xwiki.mail.internal.DatabaseMailStatusStore.save(DatabaseMailStatusStore.java:76)
 ~[xwiki-platform-mail-send-storage-6.4.4.jar:na]
... 6 common frames omitted
Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while 
hibernate execute
at 
com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1305)
 ~[xwiki-platform-legacy-oldcore-6.4.4.jar:na]
at 
com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1413)
 ~[xwiki-platform-legacy-oldcore-6.4.4.jar:na]
at 
org.xwiki.mail.internal.DatabaseMailStatusStore.delete(DatabaseMailStatusStore.java:182)
 ~[xwiki-platform-mail-send-storage-6.4.4.jar:na]
... 7 common frames omitted
Caused by: org.hibernate.QueryParameterException: could not locate named 
parameter [id]
at 
org.hibernate.engine.query.ParameterMetadata.getNamedParameterDescriptor(ParameterMetadata.java:101)
 ~[hibernate-core-3.6.9.Final.jar:3.6.9.Final]
at 
org.hibernate.engine.query.ParameterMetadata.getNamedParameterExpectedType(ParameterMetadata.java:107)
 ~[hibernate-core-3.6.9.Final.jar:3.6.9.Final]
at 
org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:460) 
~[hibernate-core-3.6.9.Final.jar:3.6.9.Final]
at 
org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:430) 
~[hibernate-core-3.6.9.Final.jar:3.6.9.Final]
at 
org.xwiki.mail.internal.DatabaseMailStatusStore$4.doInHibernate(DatabaseMailStatusStore.java:189)
 ~[xwiki-platform-mail-send-storage-6.4.4.jar:na]
at 
com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1299)
 ~[xwiki-platform-legacy-oldcore-6.4.4.jar:na]
... 9 common frames omitted

The code I use is base on the example on 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Mail+Sender+API#HCompatibilitywiththeMailSenderPlugin
 

 :

I Inject the following:
@Inject
MailSenderConfiguration mailConfiguration;

@Inject
@Named("text/html")
MimeBodyPartFactory htmlPartFactory;

@Inject
@Named("database")
private Provider mailListenerProvider;

@Inject 
MailSender mailSender;

The calls are:
[…]
MailListener maillistener = this.mailListenerProvider.get();
Session session = 
Session.getInstance(this.mailConfiguration.getAllProperties());
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress("p.huis...@ximm.nl"));
message.addRecipient(RecipientType.TO, new 
InternetAddress("p.huis...@ximm.nl"));
message.setSubject("XML Export");
Multipart multipart = new MimeMultipart("mixed");
Map parameters = new HashMap<>();
parameters.put("alternative", "text");
multipart.addBodyPart(this.htmlPartFactory.create(resultaat, parameters));
message.setContent(multipart);
MailResult result = this.mailSender.sendAsynchronously(Arrays.asList(message), 
session, maillistener);
[

[xwiki-users] import of a XAR and versions

2016-01-04 Thread Peter Huisman
Hi,

I have a question regarding the import of a XAR. 

When we do an import of a XAR (exported with the History), we have noticed that 
- when the document NOT contains an attachment - the version history of the 
document is identical to the original (obviously as expected). However, when 
the document contains an attachment, it look like a new version of the document 
is created with the comment being identical to the last available comment. We 
have experimented with file an DB store (since we have multiple servers in use 
with different setups) but that does not solve this issue.

1 - Is this the expected result?
2 - Is there a way to work around this (in our case) unwanted result?

Thanks in advance for looking at this.

Br,

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


Re: [xwiki-users] import of a XAR and versions

2016-01-04 Thread Peter Huisman
For us it is very important to have it available in the next 6 release since it 
is a big part of our backup and portability part. I would really appreciate it 
if this could be done :-)

Br,

Peter
> Op 4 jan. 2016, om 11:20 heeft vinc...@massol.net het volgende geschreven:
> 
> Hi Peter,
> 
> No it’s not been fixed in 6.4.x. Maybe Thomas has decided not to backport it 
> since it could a bit dangerous? Thomas?
> 
> Thanks
> -Vincent
> 
> On 4 Jan 2016 at 11:02:58, Peter Huisman 
> (p.huis...@ximm.nl(mailto:p.huis...@ximm.nl)) wrote:
> 
>> Hi Vincent,  
>> 
>> Thanks for the prompt response and great to hear that it is already fixed! I 
>> am wondering (since I can’t find it easily) if you also have fixed in the 
>> latest 6.x series since we are not ready to move to 8.  
>> 
>> Br,  
>> 
>> Peter
>>> Op 4 jan. 2016, om 10:59 heeft 
>>> vinc...@massol.net(mailto:vinc...@massol.net) het volgende geschreven:  
>>> Hi Peter,  
>>> On 4 Jan 2016 at 10:55:49, Peter Huisman 
>>> (p.huis...@ximm.nl(mailto:p.huis...@ximm.nl)(mailto:p.huis...@ximm.nl)) 
>>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I have a question regarding the import of a XAR.
>>>> 
>>>> When we do an import of a XAR (exported with the History), we have noticed 
>>>> that - when the document NOT contains an attachment - the version history 
>>>> of the document is identical to the original (obviously as expected). 
>>>> However, when the document contains an attachment, it look like a new 
>>>> version of the document is created with the comment being identical to the 
>>>> last available comment. We have experimented with file an DB store (since 
>>>> we have multiple servers in use with different setups) but that does not 
>>>> solve this issue.
>>>> 
>>>> 1 - Is this the expected result?
>>>> 2 - Is there a way to work around this (in our case) unwanted result?
>>>> 
>>>> Thanks in advance for looking at this.  
>>> 
>>> I think you’ve experienced http://jira.xwiki.org/browse/XWIKI-9960 which 
>>> we’ve just fixed.  
>>> 
>>> Thanks  
>>> -Vincent
>>> 
>>>> Br,
>>>> 
>>>> Peter  
> 

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


Re: [xwiki-users] import of a XAR and versions

2016-01-04 Thread Peter Huisman
I get that and respect that :-) It’s of course up to you if that’s possible.

Br,

Peter
> Op 4 jan. 2016, om 11:25 heeft vinc...@massol.net het volgende geschreven:
> 
> 
> On 4 Jan 2016 at 11:22:29, Peter Huisman 
> (p.huis...@ximm.nl(mailto:p.huis...@ximm.nl)) wrote:
> 
>> For us it is very important to have it available in the next 6 release since 
>> it is a big part of our backup and portability part. I would really 
>> appreciate it if this could be done :-)
> 
> Note that this issue has been there since XWiki 5.2.4 so it’s not really new 
> ;)
> 
> Also note that independently of whether we merge it in the 6.4.x branch, you 
> can always do it for your own version by checking the “Commit” tab in JIRA 
> and applying the patch to your branch. Of course I understand that it’s 
> simpler for you if we do it but we need Thomas’s opinion on this (I wouldn’t 
> want to risk stability of the 6.4.x branch for such an old issue that is not 
> critical).
> 
> Thanks
> -Vincent
> 
>> Br,
>> 
>> Peter
>>> Op 4 jan. 2016, om 11:20 heeft vinc...@massol.net het volgende geschreven:
>>> 
>>> Hi Peter,
>>> 
>>> No it’s not been fixed in 6.4.x. Maybe Thomas has decided not to backport 
>>> it since it could a bit dangerous? Thomas?
>>> 
>>> Thanks
>>> -Vincent
>>> 
>>> On 4 Jan 2016 at 11:02:58, Peter Huisman 
>>> (p.huis...@ximm.nl(mailto:p.huis...@ximm.nl)) wrote:
>>> 
>>>> Hi Vincent,
>>>> 
>>>> Thanks for the prompt response and great to hear that it is already fixed! 
>>>> I am wondering (since I can’t find it easily) if you also have fixed in 
>>>> the latest 6.x series since we are not ready to move to 8.
>>>> 
>>>> Br,
>>>> 
>>>> Peter
>>>>> Op 4 jan. 2016, om 10:59 heeft 
>>>>> vinc...@massol.net(mailto:vinc...@massol.net) het volgende geschreven:
>>>>> Hi Peter,
>>>>> On 4 Jan 2016 at 10:55:49, Peter Huisman 
>>>>> (p.huis...@ximm.nl(mailto:p.huis...@ximm.nl)(mailto:p.huis...@ximm.nl)) 
>>>>> wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I have a question regarding the import of a XAR.
>>>>>> 
>>>>>> When we do an import of a XAR (exported with the History), we have 
>>>>>> noticed that - when the document NOT contains an attachment - the 
>>>>>> version history of the document is identical to the original (obviously 
>>>>>> as expected). However, when the document contains an attachment, it look 
>>>>>> like a new version of the document is created with the comment being 
>>>>>> identical to the last available comment. We have experimented with file 
>>>>>> an DB store (since we have multiple servers in use with different 
>>>>>> setups) but that does not solve this issue.
>>>>>> 
>>>>>> 1 - Is this the expected result?
>>>>>> 2 - Is there a way to work around this (in our case) unwanted result?
>>>>>> 
>>>>>> Thanks in advance for looking at this.
>>>>> 
>>>>> I think you’ve experienced http://jira.xwiki.org/browse/XWIKI-9960 which 
>>>>> we’ve just fixed.
>>>>> 
>>>>> Thanks
>>>>> -Vincent
>>>>> 
>>>>>> Br,
>>>>>> 
>>>>>> Peter
>>> 
>> 
> 

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


[xwiki-users] Prevent editing in editmode

2016-01-28 Thread Peter Huisman
Hi,

I have an object on a page. Once in edit mode, I want certain properties of the 
object not to be editable. This in itself is not an issue since I can display 
the value using $object.getValue(‘propertyname’). I have however a custom 
displayer in place for this property which is activated using 
$doc.display($propertyname.getName()). Is it possible to use this displayer in 
edit mode?

With kind regards,

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


[xwiki-users] Diff Module

2016-02-05 Thread Peter Huisman
Hi,

On this page (http://extensions.xwiki.org/xwiki/bin/view/Extension/Diff+Module) 
you describe a Diff module for comparing items. Is there any description for 
the DiffConfiguration which is required when called from Java?

With kind regards,

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


[xwiki-users] Question on Query

2016-02-25 Thread Peter Huisman
Hi,

I have the following question.

I have an main wiki (xwiki) and a subwiki (test)
I want to access objects from class ’space.someclassClass’ located on a page 
‘space.somepage' in the main wiki 
When in the subwiki, I have a query such as:

String query = "select name.value from XWikiDocument doc, BaseObject obj, 
StringProperty name where doc.fullName=obj.name and 
obj.className=‘space.someclassClass’ and” + 
 "obj.className<>’space.someclassTemplate’ and name.id.id=obj.id order by 
doc.title"

List results = (List) (List) 
this.queryManager.createQuery(query, Query.XWQL).setWiki(“xwiki").execute();

This gives me the name.value of the property of the object in the main wiki.

What I need however is something like:

String query = "select obj from XWikiDocument doc, BaseObject obj where 
doc.fullName=obj.name and obj.className=‘space.someclassClass’ and” + 
 "obj.className<>’space.someclassTemplate’ order by doc.title”

I expect this to return a BaseObject. When displaying this (toXMLString()), it 
is however an empty object:


space.somepage
0
space.someclassClass
3c145abe-b334-4801-a100-24c8ef2eea9f


There is no way (that I have tried) that would give me the object of class 
“xwiki:space.someclassClass” that contains the properties that I need (and get 
using the first query). 

I expect that it might have to do with the context but I’m not that familiar 
with it that I know how to do this.

Can someone please shed some light on this?

With kind regards,

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


[xwiki-users] DBList / Relational Storage

2016-03-30 Thread Peter Huisman
Hi,

I spent the last week or so figuring out very strange behavior which I could 
not explain. I’m not sure if any sort of code would be helpful so I just 
explain what the situation is:

We have a class “caseClass” containing (among others) the following DBList:

Name = product
Pretty Name = product
Custom Display = [
{{velocity}}
#set ($propertyClass = $object.getxWikiClass().get($name))
#if ($type == 'edit')
  {{html clean=false}}
$doc.displayEdit($propertyClass, $prefix, $object)
  {{/html}}
#else
   #set($listMap=$propertyClass.getMapValues())
   #foreach($fieldKey in $object.getProperty($name).value)
  #set($fieldValue=$listMap.get($fieldKey).getValue())
  [[${fieldValue}>>$services.PropertyManager.getSourceURL(${fieldKey})]]
   #end
#end
{{/velocity}}
]
DisplayType = select
Multiple Select = true
Since of box = 10
Multiselect seperators = [empty]
Join seperator = [ , ]
Sort = none
Relational Storage = true
Cache = false
Hibernate Query = [
SELECT idVarProp.value, CONCAT(codeVarProp.value, ' - ', naamVarProp.value, ' 
(', codeProdProp.value, ' - ', naamProdProp.value, ')') 
FROM BaseObject obj, StringProperty idVarProp, StringProperty codeVarProp, 
StringProperty naamVarProp, StringProperty idVarProdProp, 
BaseObject obj2, StringProperty idProdProp, StringProperty codeProdProp, 
StringProperty naamProdProp 
WHERE obj.className = 'PDCKlassen.VariantClass' AND 
obj2.className = 'PDCKlassen.ProductClass' AND 
idVarProp.id.id = obj.id AND idVarProp.id.name = 'identificatieString' AND 
codeVarProp.id.id = obj.id AND codeVarProp.id.name = 'codeVariant' AND 
naamVarProp.id.id = obj.id AND naamVarProp.id.name = 'naamVariant' AND 
idVarProdProp.id.id = obj.id AND idVarProdProp.id.name = 'product' AND 
idProdProp.id.id = obj2.id AND idProdProp.id.name = 'identificatieString' AND 
codeProdProp.id.id = obj2.id AND codeProdProp.id.name = 'productCode' AND 
naamProdProp.id.id = obj2.id AND naamProdProp.id.name = 'naam' AND 
idVarProdProp.value = idProdProp.value AND
obj.name <> 'PDCKlassen.VariantTemplate' AND obj2.name <> 
'PDCKlassen.ProductTemplate' 
ORDER BY codeProdProp.value, codeVarProp.value
]
XWiki Class name = [empty]
Id Field Name = [empty]
Value Field Name = [empty]

The functional side is, that this field can contain 0 - n occurrences. 

We have a java based listener that is used to save pages with one (and only 
one) object this class on the page with a version comment: 

xwikiContext.getWiki().saveDocument(XWikiDocument, comment, true, xwikiContext)

Situation 1: The object contains zero references (i.e. is empty)

the following is happening:

Version 1.1 - This is the initial version
After generating a listener event that saves the document (version 1.1) as 
above:
Version 1.2 - with the proper comment as passed by the save and as comment 
“first comment"
After generating another listener event that saves the same document (version 
1.2 this time) as above and as comment “second comment":
Version 1.2 - no change detected. The version comment is still “first comment”
Editing the page and pressing save button:
Version 1.3 (minor edit) of Version 2.1 (major edit)
If I go back to the first step (as described after Version 1.1), the same 
results show up.

I have checked everything up to that actual save in the XWiki class. I can see 
that the information passed to the saveDocument in the XWiki class is the 
‘right’ information.

Situation 2: The object contains one (or more) references (i.e. is not empty)

the following is happening:

Version 1.1 - This is the initial version
After generating a listener event that saves the document (version 1.1) as 
above with comment “first comment"
Version 1.2 - with the proper comment as passed by the save and as comment 
“first comment"
After generating another listener event that saves the same document (version 
1.2 this time) as above and as comment “second comment":
Version 1.3 - with the proper comment as passed by the second save and the 
comment “second comment”

Since I did not understand what is actually happening, I have dogged in the 
various aspects such as comparing object, sheets and whatnot but I could not 
detect any difference.

Until I decided to change “Relational Storage” to false. This resulted in the 
proper situation (described by Situation 2 - with an empty DBList as well as an 
non-empty DBList)

What is the effect is for the “Relational Storage” parameter?
Why is the situation as above occurring and is this the expected result or is 
this a bug or undocumented feature?

I’m sorry for the extensive explanation but it took me also a while to figure 
out what happened.

Br,

Peter




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


[xwiki-users] DBLists and Relational Storage

2016-04-03 Thread Peter Huisman
Hi,

A few short questions:

What is the storage limit when NOT using Relational Storage for each selected 
item? - I assume this is 255 but I’m not sure.
What is the storage limit when NOT using Relational Storage for all selected 
items in total? - I do not know what to make of this.

The only reference I could find is a quote in an XWiki-devs mail in 2011:

> Make sure you select the Multiple Select and Relational Storage
> checkboxes. Multiple Select allows you to select and store multiple
> values from the list, while Relational Storage makes it easier to
> integrate that property into other queries by storing each selected item
> in its own entry in the database (without it all the selected values are
> stored in one row, concatenated into a VARCHAR column), and to store
> more than a few selected values (since the column allows at most 255
> characters in total).
With kind regards,

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


[xwiki-users] DocumentDeletingEvent

2016-04-05 Thread Peter Huisman
From the XWiki source code, I see there is a difference in passing a document 
to the evenmanager:

The DocumentDeletingEvent is passing a “new 
XWikiDocument(doc.getDocumentReference())"
The DocumentUpdatedEvent (as an example) is passing the doc (the actual 
XWikiDocument) 

The difference is, that the Document passed in the DeleteEvent is a new 
XWikiDocument and not the XWikiDocument that is about to be deleted.

Is there a reason why this difference exists?

Br,

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


[xwiki-users] User registration

2016-10-04 Thread Peter Huisman
Hi,

We have migrated to xwiki 8.2.1 in a docker environment. Everything is working 
as a charm. However: When registerring a user (as an admin), I get an error. 
Investigating this only gives me results that date from 2013 but nothing 
recent. I am not sure how to proceed. The error is:


type Exception report

message Servlet execution threw an exception

description The server encountered an internal error that prevented it from 
fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115)

org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)

org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)

org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)

org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:137)
root cause

java.lang.NoClassDefFoundError: Could not initialize class 
com.xpn.xwiki.web.RegisterAction
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
java.lang.Class.newInstance(Class.java:442)

org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:172)

org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:147)

org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:281)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115)

org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)

org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)

org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)

org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:137)


Is there anyone who can show the direction to look for an answer?

Br,

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