[xwiki-users] Skip name dialog in App Within Minutes
Hello all, I have a question about these case: http://lists.xwiki.org/pipermail/users/2014-July/028689.html i would love to implement exactly the same our wiki ( we are using some forms where employees put in simple data like wo they called over the day). I created an app with app within minutes, everything is working fine, but i would also like to skip the name dialog in App Within Minutes and replace it with an auto generated random number, so the user should be directly in the edit URL. I think the best advise came from Ludovic, but my scripting knowledge is not as good to understand the advise from him directly, so can someone give me a little further explanation of how to script my own Burton using the document api and than redirection the user to the edit URL. I would be very grateful for an advice what helps me to accomplish these goal. Thanks Felix
Hi, Ludovic`s suggestion, as far as I understand it, was to create your own button/link on the application`s homepage that takes the user to a constructed URL what uses the entry name that you want. /xwiki/bin/edit/<appName>/Data/<entryName>?template=test.Code.testTemplate&parent=test.WebHome&editor=inline You can generate such an URL with velocity using: $xwiki.getDocument("<appName>.Data.<entryName>", "edit", "template=test.Code.testTemplate&parent=test.WebHome&editor=inline") You would do this modification in the applcation's homepage, which is located in "<appName>.Data.WebHome". Hope this helps, Eduard On Tue, Mar 15, 2016 at 8:27 PM, Wiki Service-Team <[email protected]> wrote:
Hello all,
I have a question about these case: http://lists.xwiki.org/pipermail/users/2014-July/028689.html
i would love to implement exactly the same our wiki ( we are using some forms where employees put in simple data like wo they called over the day). I created an app with app within minutes, everything is working fine, but i would also like to skip the name dialog in App Within Minutes and replace it with an auto generated random number, so the user should be directly in the edit URL.
I think the best advise came from Ludovic, but my scripting knowledge is not as good to understand the advise from him directly, so can someone give me a little further explanation of how to script my own Burton using the document api and than redirection the user to the edit URL.
I would be very grateful for an advice what helps me to accomplish these goal.
Thanks Felix
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi Eduard Thank you very much for your suggestion, this makes the situation a little more transparent, But i can“t edit the action buttons in the WebHome Page in my app, because the "real WebHome" just includes following: {{include reference="Qualitycall.Data.WebHome" /}} So i modified the string to fit in my template and put a #set before because otherwise i see just the velocity script as text in the "Qualitycall.Data.WebHome" Page of my app. But now i get an velocity error. Here is the full code of the WebHome Page of my app ------------------------------- {{velocity}} #set ($columnsProperties = { 'Distributor': {"type":"number","size":10}, 'vpid': {"type":"number","size":10}, 'Zahlungsart': {"type":"text","size":10}, 'Vertragsnummer': {"type":"number","size":10}, 'Betreff': {"type":"text","size":10}, 'Bemerkung': {"type":"text","filterable":false,"sortable":false,"html":true}, 'doc.author': {"type":"text","size":10,"link":"author"}, 'doc.creationDate': {"type":"text","size":10} }) #set ($options = { 'className': 'Qualitycall.Code.QualitycallClass', 'translationPrefix': 'qualitycall.livetable.', 'tagCloud': true, 'rowCount': 15, 'maxPages': 10, 'selectedColumn': 'Distributor', 'defaultOrder': 'asc' }) #set ($columns = ['Distributor', 'vpid', 'Zahlungsart', 'Vertragsnummer', 'Betreff', 'Bemerkung', 'doc.author', 'doc.creationDate']) #livetable('qualitycall' $columns $columnsProperties $options) #set ($xwiki.getDocument("Qualitycall.Data.1", "edit", "template=Qualitycall.Code.QualitycallTemplate&parent=Qualitycall.WebHome&editor=inline") {{/velocity}} ------------------------------- Am 17.03.2016 um 13:18 schrieb Eduard Moraru:
$xwiki.getDocument("<appName>.Data.<entryName>", "edit", "template=test.Code.testTemplate&parent=test.WebHome&editor=inline")
Hey i found this tutorial: https://www.xwiki.org/xwiki/bin/view/FAQ/How+can+I+create+a+new+page+based+o... so this Situation is very similar to mine except that i want the name auto generated name of the document which is created then. Here is an Module for exactly this: http://extensions.xwiki.org/xwiki/bin/view/Extension/Unique+Identification+N... but i cant figure out how to change the code, so that the new created page is not based on the value of docName rather than it is based on $uin.getNextAvailableUIN() ---- #if("$!request.docName" != '') ## Request for creating a new instance #set($targetDocReference = $services.model.createDocumentReference('', $!{request.spaceName}, $!{request.docName})) $response.sendRedirect($xwiki.getURL($targetDocReference, 'inline', "template=${escapetool.url($request.template)}&parent=${escapetool.url($request.parent)}")) ## Stop processing, since we already sent a redirect. #stop #end = Add a new question = {{html}} <form action="" id="newdoc" method="post"> <div> <input type="hidden" name="parent" value="${doc.fullName}"/> <input type="hidden" name="template" value="FAQ.FAQTemplate"/> <input type="hidden" name="sheet" value="1"/> <input type="hidden" name="spaceName" value="FAQ"/> Document: <input type="text" name="docName" value="Enter your question here" class="withTip" size="50"/> <span class="buttonwrapper"><input type="submit" value="Create this FAQ" class="button"/></span> </div> </form> {{/html}} ---- If someone gives me a little further information i would be very grateful. Thanks Felix Am 17.03.2016 um 13:18 schrieb Eduard Moraru:
Hi,
Ludovic`s suggestion, as far as I understand it, was to create your own button/link on the application`s homepage that takes the user to a constructed URL what uses the entry name that you want.
/xwiki/bin/edit/<appName>/Data/<entryName>?template=test.Code.testTemplate&parent=test.WebHome&editor=inline
You can generate such an URL with velocity using:
$xwiki.getDocument("<appName>.Data.<entryName>", "edit", "template=test.Code.testTemplate&parent=test.WebHome&editor=inline")
You would do this modification in the applcation's homepage, which is located in "<appName>.Data.WebHome".
Hope this helps, Eduard
On Tue, Mar 15, 2016 at 8:27 PM, Wiki Service-Team <[email protected]> wrote:
Hello all,
I have a question about these case: http://lists.xwiki.org/pipermail/users/2014-July/028689.html
i would love to implement exactly the same our wiki ( we are using some forms where employees put in simple data like wo they called over the day). I created an app with app within minutes, everything is working fine, but i would also like to skip the name dialog in App Within Minutes and replace it with an auto generated random number, so the user should be directly in the edit URL.
I think the best advise came from Ludovic, but my scripting knowledge is not as good to understand the advise from him directly, so can someone give me a little further explanation of how to script my own Burton using the document api and than redirection the user to the edit URL.
I would be very grateful for an advice what helps me to accomplish these goal.
Thanks Felix
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Eduard Moraru -
Wiki Service-Team