[xwiki-users] xmlrpc question
Hello, When I use the XMLRPC interface from Python I can store a lot of pages, attachments and even convert syntaxes. But how can I find if some attachment already exists in the wiki to make a link to that attachment and not upload the same attachment over and over again? kind regards, -- Kind regards, ONVZ Healthinsurance Jeroen Baten Consultant IT Staff dept. De Molen 66 Postbus 392 3990 GD Houten Tel: +31 30 639 65 08 Fax: +31 30 639 63 25 Deze e-Mail en de inhoud daarvan is vertrouwelijk. Indien dit bericht niet voor u bestemd is, verzoeken wij u vriendelijk deze e-mail direct aan ons te retourneren en daarna te verwijderen. Openbaarmaking, vermenigvuldiging, verstrekking en/of gebruik door derden van dit e-mail bericht en/of informatie is niet toegestaan. De verzender sluit elke aansprakelijkheid uit in verband met het niet juist, onvolledig of niet tijdig overkomen van de informatie in deze e-mail. Deze e-mail is gecontroleerd op virussen.
Hi, On 3/16/2010 9:38 AM, Jeroen Baten wrote:
Hello,
When I use the XMLRPC interface from Python I can store a lot of pages, attachments and even convert syntaxes.
But how can I find if some attachment already exists in the wiki to make a link to that attachment and not upload the same attachment over and over again?
Add attachment doesn't have the optional check version as storePage has. I think the only way to do that right now is to get the list of attachments of a page before you start the upload. For that you can use the Attachment[] getAttachments(..) method. The Attachment map contains an 'url' key. You can check the xml-rpc api & model at: - http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-xmlrpc/xwiki-xm... For a more complete model and documented api please check: - http://svn.xwiki.org/svnroot/xwiki/xoffice/trunk/xword/Connectivity/Clients/... We have some missing elements in our xml-rpc documentation on xwiki.org, is this something you could contribute? Thanks, Florin Ciubotaru
kind regards,
Yes, but what if you want to link to an existing attachment on another page and you don't know the title of that other page. So: 1-ask system list of all attachments with pages where there exist 2-link to attachment on other page. Willing to contribute when I know what to write :-) any thoughts on why getPageHistory exists in java class but doesn't work in python? Or is xwiki intelligent enough to prevent calls to yet undocumented classes? :-) kind regards, On Tue, 2010-03-16 at 11:10 +0200, Florin Ciubotaru wrote:
Hi,
On 3/16/2010 9:38 AM, Jeroen Baten wrote:
Hello,
When I use the XMLRPC interface from Python I can store a lot of pages, attachments and even convert syntaxes.
But how can I find if some attachment already exists in the wiki to make a link to that attachment and not upload the same attachment over and over again?
Add attachment doesn't have the optional check version as storePage has. I think the only way to do that right now is to get the list of attachments of a page before you start the upload. For that you can use the Attachment[] getAttachments(..) method. The Attachment map contains an 'url' key.
You can check the xml-rpc api & model at: - http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-xmlrpc/xwiki-xm... For a more complete model and documented api please check: - http://svn.xwiki.org/svnroot/xwiki/xoffice/trunk/xword/Connectivity/Clients/...
We have some missing elements in our xml-rpc documentation on xwiki.org, is this something you could contribute?
Thanks, Florin Ciubotaru
kind regards,
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Kind regards, ONVZ Healthinsurance Jeroen Baten Consultant IT Staff dept. De Molen 66 Postbus 392 3990 GD Houten Tel: +31 30 639 65 08 Fax: +31 30 639 63 25 Deze e-Mail en de inhoud daarvan is vertrouwelijk. Indien dit bericht niet voor u bestemd is, verzoeken wij u vriendelijk deze e-mail direct aan ons te retourneren en daarna te verwijderen. Openbaarmaking, vermenigvuldiging, verstrekking en/of gebruik door derden van dit e-mail bericht en/of informatie is niet toegestaan. De verzender sluit elke aansprakelijkheid uit in verband met het niet juist, onvolledig of niet tijdig overkomen van de informatie in deze e-mail. Deze e-mail is gecontroleerd op virussen.
Jeroen, On 3/16/2010 11:34 AM, Jeroen Baten wrote:
Yes, but what if you want to link to an existing attachment on another page and you don't know the title of that other page.
So: 1-ask system list of all attachments with pages where there exist
You mean searching all pages containing attachments or a certain attachment? You could try the search method, though I'm not sure it supports all hql queries. The xml result will be quite big on a large wiki. If not, there's always the force brute way: getSpaces -> getPages -> getAttachments
2-link to attachment on other page.
I'm not sure I understand your use case. The url is still the same if you don't want to translate it into a xwiki syntax url.
Willing to contribute when I know what to write :-)
any thoughts on why getPageHistory exists in java class but doesn't work in python? Or is xwiki intelligent enough to prevent calls to yet undocumented classes? :-)
Not sure why the call fails. We need more details on this. Florin Ciubotaru
kind regards,
On Tue, 2010-03-16 at 11:10 +0200, Florin Ciubotaru wrote:
Hi,
On 3/16/2010 9:38 AM, Jeroen Baten wrote:
Hello,
When I use the XMLRPC interface from Python I can store a lot of pages, attachments and even convert syntaxes.
But how can I find if some attachment already exists in the wiki to make a link to that attachment and not upload the same attachment over and over again?
Add attachment doesn't have the optional check version as storePage has. I think the only way to do that right now is to get the list of attachments of a page before you start the upload. For that you can use the Attachment[] getAttachments(..) method. The Attachment map contains an 'url' key.
You can check the xml-rpc api& model at: - http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-xmlrpc/xwiki-xm... For a more complete model and documented api please check: - http://svn.xwiki.org/svnroot/xwiki/xoffice/trunk/xword/Connectivity/Clients/...
We have some missing elements in our xml-rpc documentation on xwiki.org, is this something you could contribute?
Thanks, Florin Ciubotaru
kind regards,
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Tue, 2010-03-16 at 12:13 +0200, Florin Ciubotaru wrote:
Jeroen,
On 3/16/2010 11:34 AM, Jeroen Baten wrote: You mean searching all pages containing attachments or a certain attachment? You could try the search method, though I'm not sure it supports all hql queries. The xml result will be quite big on a large wiki. If not, there's always the force brute way: getSpaces -> getPages -> getAttachments
:-)
any thoughts on why getPageHistory exists in java class but doesn't work in python? Or is xwiki intelligent enough to prevent calls to yet undocumented classes? :-)
Not sure why the call fails. We need more details on this.
see: XE-618 in jira for the details: http://jira.xwiki.org/jira/browse/XE-618 kind regards, -- Kind regards, ONVZ Healthinsurance Jeroen Baten Consultant IT Staff dept. De Molen 66 Postbus 392 3990 GD Houten Tel: +31 30 639 65 08 Fax: +31 30 639 63 25 Deze e-Mail en de inhoud daarvan is vertrouwelijk. Indien dit bericht niet voor u bestemd is, verzoeken wij u vriendelijk deze e-mail direct aan ons te retourneren en daarna te verwijderen. Openbaarmaking, vermenigvuldiging, verstrekking en/of gebruik door derden van dit e-mail bericht en/of informatie is niet toegestaan. De verzender sluit elke aansprakelijkheid uit in verband met het niet juist, onvolledig of niet tijdig overkomen van de informatie in deze e-mail. Deze e-mail is gecontroleerd op virussen.
participants (2)
-
Florin Ciubotaru -
Jeroen Baten