Hi Marius,
It looks like i'm getting it, step by step
Thanks, this really was helpful
If I have time I will try to document this more in depth and share with the community
Gerritjan
Op 24 mei 2012, om 16:26 heeft Marius Dumitru Florea het volgende geschreven:
Hi Gerritjan,
You should start by reading
http://extensions.xwiki.org/xwiki/bin/view/Extension/App+Within+Minutes+App…
.
On Thu, May 24, 2012 at 3:37 PM, Gerritjan Koekkoek
<gerritjankoekkoek(a)gmail.com> wrote:
Hi,
I've create a app with the App within Minutes;
The following class model is used:
- Name (name: String)
- E-mail (email: String)
- Subject (subject: String)
- Status (status: String)
- Question (question: TextArea)
- Answer (answer: TextArea)
- Published to Public (generalize: Static List)
So now when user click on 'Add' he/she is requested with document name and
then he/she can fill in the record
Now I would like to modify the behaviour?
1) Click on Add should not ask for new document name but for 'subject',
this should also show on the record prefilled
(I would like to generate a document name base on UserName + Subject)
This can be done by using a custom sheet for the home page of your
application. First you need to understand class and document sheets:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Sheet+Module .
Next you can bind a (custom) document sheet to the WebHome page of
your application space. This custom sheet can be for instance a copy
of AppWithinMinutes.LiveTableViewSheet which you customize for your
needs.
2) Some fields should be defaulted by code
- name should be username, field should be
hidden
- E-mail should be fetched from user record (XWiki.<username>.email)
- Subject (as stated under 1)
These three can be done by customizing the sheet used to
create/edit/view application entries. Note that for now you have to
take care to uncheck "Update class sheet" next time you edit the
application since otherwise your changes to the sheet will be
overwritten (you can rollback of course).
- Status should be defaulted to
'created'
- Published to Public should be defaulted to 'no'
These two can both be done on the 2nd step of AppWithinMinutes (where
the model is defined). Any value you put/select in the fields is
considered default values and is saved in the model template which is
later used to create new application entries.
Hope this helps,
Marius
How would you advise me to do this, i have modest
velocity knowledge, but
no groovy, it looks like the code behind the 'add'-button is 'groovy'
Gerritjan
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users