[xwiki-users] Generate Url to delete attached object..
I have the following code stolen directly from the Blog Categories app: $doc.getURL( Add New Topic Is there an "objectdelete" action for getURL. This is probably in the code but I don't have the sources and it's not in the API docs. Thanks! .:. Kevin -- View this message in context: http://n2.nabble.com/Generate-Url-to-delete-attached-object..-tp2163415p2163... Sent from the XWiki- Users mailing list archive at Nabble.com.
Ooops, I found it. It's "objectremove" now all I need to do is find out which index the object to remove is. -- View this message in context: http://n2.nabble.com/Generate-Url-to-delete-attached-object..-tp2163415p2163... Sent from the XWiki- Users mailing list archive at Nabble.com.
Kevin_C wrote:
Ooops, I found it. It's "objectremove" now all I need to do is find out which index the object to remove is.
$doc.getURL('objectremove', "classname=${obj.getxWikiClass().getName()}&classid=${obj.number}") -- Sergiu Dumitriu http://purl.org/net/sergiu/
OK, that got me closer but for some reason the generated Url is fubarred: My code: [delete>$doc.getURL('objectremove', 'classname=${doc.fullName}&classid=${topic.number}&xredirect=${redirurl}')] Generated Url: http://localhost:9090/xwiki/bin/edit/FranchiseTax/%2Fxwiki%2Fbin%2Fobjectrem... It's adding: /xwiki/bin/edit/FranchiseTax/ onto the front of the Url for some reason. The current page I'm viewing is: http://localhost:9090/xwiki/bin/view/FranchiseTax/TopicsClass and I've modified the display of the objects such that the displayed table contains a delete link as well as the property values. What am I doing wrong? Thanks! .:. Kevin -- View this message in context: http://n2.nabble.com/Generate-Url-to-delete-attached-object..-tp2163415p2164... Sent from the XWiki- Users mailing list archive at Nabble.com.
Seems like maybe it is a bug with creating links using square brackets as the following works as expected: {table} Topic | T.A.C. Rule | #foreach($topic in $topics) #set($delUrl = $doc.getURL("objectremove", "classname=${doc.fullName}&classid=${topic.number}&xredirect=${redirurl}")) $topic.topic | $topic.tacrule | $delUrl delete #end {table} Or am I just doing something wrong? -- View this message in context: http://n2.nabble.com/Generate-Url-to-delete-attached-object..-tp2163415p2164... Sent from the XWiki- Users mailing list archive at Nabble.com.
Kevin_C wrote:
OK, that got me closer but for some reason the generated Url is fubarred:
My code: [delete>$doc.getURL('objectremove', 'classname=${doc.fullName}&classid=${topic.number}&xredirect=${redirurl}')]
Generated Url: http://localhost:9090/xwiki/bin/edit/FranchiseTax/%2Fxwiki%2Fbin%2Fobjectrem...
The square brackets syntax only accepts document names, and it is supposed to generate URLs. You already have the URL, so there's no need to put it in brackets. For this you should just use an HTML link: <a href="$doc.getURL(...)">delete</a>
It's adding: /xwiki/bin/edit/FranchiseTax/ onto the front of the Url for some reason. The current page I'm viewing is: http://localhost:9090/xwiki/bin/view/FranchiseTax/TopicsClass
and I've modified the display of the objects such that the displayed table contains a delete link as well as the property values. What am I doing wrong?
Thanks! .:. Kevin
-- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (2)
-
Kevin_C -
Sergiu Dumitriu