[xwiki-devs] [VOTE] XMLRPC API Extension
Dear all, since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following: /* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest) /* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion) Besides their usefulness there is also a rationale: these are actually a need for the Concerto project and it would be great to have them already available in 1.7.
From the implementation point of view, these methods have almost no impact on the current code base and they are purely an extension (i.e., no pre-existing critical code has been touched)
Here it is my +1 -Fabio
Hi Fabio, On Dec 5, 2008, at 8:54 PM, Fabio Mancinelli wrote:
Dear all,
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
/*
what is "start"? what is "fromLatest"? Can't we have a searchDocument() API as in the XWiki class for doing queries?
These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion)
Besides their usefulness there is also a rationale: these are actually a need for the Concerto project and it would be great to have them already available in 1.7.
From the implementation point of view, these methods have almost no impact on the current code base and they are purely an extension (i.e., no pre-existing critical code has been touched)
Here it is my +1
Can you explain what happens if checkVersion is true? Thanks -Vincent
Vincent Massol wrote:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
/*
what is "start"? what is "fromLatest"?
Start is the start offset when dealing with big result sets. So instead of bulk-transferring 10000 results, for example, I can transfer all of them, 50 results at a time (numberOfResults) by varying the start offset. fromLatest is basically the order. If it's true then the order is descending (recent modifications are transfered first). Maybe another name would be better.
Can't we have a searchDocument() API as in the XWiki class for doing queries?
This function, if I am not wrong, should do something more wrt searchDocument, i.e., returning all the modifications dates for all page revisions and not only for the latest versions.
Can you explain what happens if checkVersion is true?
If checkVersion is true then before storing the page, the version of the page to be stored page is checked against the latest version of the page on the xwiki. What can happen is the following: 1) getPage("x") -> (x, 1.4, content) 2) somebody updates via web "x" so that now the version in the wiki is 1.5 3) storePage((x, 1.4, content), true) This fails because the current version of x is different from that when x was retrieved (somebody has modified the page in the meanwhile). Of course this mechanism can be implemented client side (this is what is done in XEclipse, for example) by calling a getPage just before a storePage. But by putting it on the server we can guarantee a better "atomicity" for preventing the replacement of the content that could have been changed during the network transfer. -Fabio
Fabio Mancinelli wrote:
Dear all,
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
/* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion)
Besides their usefulness there is also a rationale: these are actually a need for the Concerto project and it would be great to have them already available in 1.7.
From the implementation point of view, these methods have almost no impact on the current code base and they are purely an extension (i.e., no pre-existing critical code has been touched)
Here it is my +1
+1 -- Sergiu Dumitriu http://purl.org/net/sergiu/
+0 Fabio Mancinelli wrote:
Dear all,
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
/* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion)
Besides their usefulness there is also a rationale: these are actually a need for the Concerto project and it would be great to have them already available in 1.7.
From the implementation point of view, these methods have almost no impact on the current code base and they are purely an extension (i.e., no pre-existing critical code has been touched)
Here it is my +1
-Fabio
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
+1 Fabio Mancinelli wrote:
Dear all,
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
/* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion)
Besides their usefulness there is also a rationale: these are actually a need for the Concerto project and it would be great to have them already available in 1.7.
From the implementation point of view, these methods have almost no impact on the current code base and they are purely an extension (i.e., no pre-existing critical code has been touched)
Here it is my +1
-Fabio
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
+1 On Fri, Dec 5, 2008 at 8:54 PM, Fabio Mancinelli <[email protected]> wrote:
Dear all,
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
/* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion)
Besides their usefulness there is also a rationale: these are actually a need for the Concerto project and it would be great to have them already available in 1.7.
From the implementation point of view, these methods have almost no impact on the current code base and they are purely an extension (i.e., no pre-existing critical code has been touched)
Here it is my +1
-Fabio
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi Fabio. Fabio Mancinelli wrote:
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
should (null, 0, 0, true) return all?
/* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion)
What the usecases for storePage(page, false) ?
Besides their usefulness there is also a rationale: these are actually a need for the Concerto project and it would be great to have them already available in 1.7.
From the implementation point of view, these methods have almost no impact on the current code base and they are purely an extension (i.e., no pre-existing critical code has been touched)
Here it is my +1
-- Artem Melentyev
Artem Melentyev wrote:
Hi Fabio.
Fabio Mancinelli wrote:
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
should (null, 0, 0, true) return all?
Curently null values are not usable in XMLRPC so the previous one would be (new Date(0), 0, 0, true). And yes, it returns all. Basically I directly feed numberOfResults and start parameters to setLimit() and setOffset() methods of the Query object.
/* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion)
What the usecases for storePage(page, false) ?
You mean that storePage(page) should have the storePage(page, true) behaviour by default, and storePage(page, false) is nonsense? Actually storePage(page, false) which is equivalent to the current storePage(page) is the default behavior that replaces the current content. -Fabio
Ok. +1 Fabio Mancinelli wrote:
Artem Melentyev wrote:
Hi Fabio.
Fabio Mancinelli wrote:
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API. These methods are the following:
/* Returns a list of all the changed pages starting from a given date */ public List<XWikiPageHistorySummary> getModifiedPagesHistory( Date date, Integer numberOfResults, Integer start, Boolean fromLatest) should (null, 0, 0, true) return all?
Curently null values are not usable in XMLRPC so the previous one would be (new Date(0), 0, 0, true).
And yes, it returns all. Basically I directly feed numberOfResults and start parameters to setLimit() and setOffset() methods of the Query object.
/* These are basically equivalent to original store functions, but if checkVersion is true then a check of the current page version is done before storing the page/object. This check handles the case in which a page has been modified by somebody else after the last getPage or getObject */ public XWikiPage storePage(XWikiPage page, Boolean checkVersion) public XWikiObject storeObject(XWikiObject object, Boolean checkVersion) What the usecases for storePage(page, false) ?
You mean that storePage(page) should have the storePage(page, true) behaviour by default, and storePage(page, false) is nonsense?
Actually storePage(page, false) which is equivalent to the current storePage(page) is the default behavior that replaces the current content.
-- Artem Melentyev
Fabio Mancinelli wrote:
Dear all,
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API.
Since there is already a large consensus about this topic, I would like to commit changes tonight or at most tomorrow morning (shorter delay wrt the usual 72h for a vote), in order to have more time to address possible issues. If you are fine with this, I am ready to go. -Fabio
On Dec 7, 2008, at 6:13 PM, Fabio Mancinelli wrote:
Fabio Mancinelli wrote:
Dear all,
since the 1.7 release has been delayed I would like to propose to add 3 methods to the XMLRPC API.
Since there is already a large consensus about this topic, I would like to commit changes tonight or at most tomorrow morning (shorter delay wrt the usual 72h for a vote), in order to have more time to address possible issues.
If you are fine with this, I am ready to go.
I haven't had the time to think more about it so go ahead for me. Thanks -Vincent
participants (7)
-
Artem Melentyev -
Eduard Moraru -
Fabio Mancinelli -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol