On Wed, Jul 23, 2014 at 6:22 AM, Aaron Hardy at AC
<ashtarcommunicati...@gmail.com> wrote:
> When you create a custom class, you also create a "sheet" (which is
> basically just another page with display code) for that class which
> specifies how an object of that class will be displayed when the object is
> attached to a page. You're prompted to do this when creating a custom
> class. If the sheet is "bound" to the class it will mean that a page
> containing an object of that class will automatically display the objects
> using the sheet. Whether to do this or not is an option when you're
> creating a custom class. If the sheet isn't bound, you would need to
> manually include code on a page to display any attached objects - useful
> when you have multiple object types attached to a page.
> Here's part of the documentation that discussions this more thoroughly:
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Sheet+Module#HClasssheets
>
> I also found it useful to walk through the process of creating a custom
> class and sheet through the FAQ and TODO Tutorials in the XWiki Dev Guide -
> some of it is a bit dated interface-wise, but all the same basic concepts
> still apply.
>
> If you're using built-in classes rather than a custom class, you probably
> need to figure out where the sheet is for that class, whether it's bound or
> not, and adjust accordingly.
>
> For any class, looking at the Class page will give you a lot of info, like
> where the Sheet is and whether it's bound, e.g.:
> /bin/XWiki/MycustomClass
> or wherever the relevant Class page is.
>
> You also might want to look at this previous thread on this list - that's
> me, asking a similar question to yours a couple years ago. It has some good
> advice:
> http://xwiki.475771.n2.nabble.com/RESTful-API-to-create-a-new-object-of-custom-class-td6965384.html
>
> Based on your original question, it sounds like what you want to do is:

> a) Figure out what class object is being attached to working pages in your
> Application (i.e. not using REST) that triggers the bound "Sheet" and hence
> results in the object being displayed on the page

Yes, See 
http://extensions.xwiki.org/xwiki/bin/view/Extension/App+Within+Minutes+Application#HApplicationStructure

Read the "Before 6.2-milestone-1" section though. You most probably
have the application code and data in the same space.

>  - for example use the
> object editor on a page that has the grid you want and figure out where
> those controls are coming from.

You can also edit in object mode an existing application entry to see
the object it has.

> b) Create a new page via REST

Yes.

> c) Create a new object of the same class as step a on the new page - if the
> sheet is bound to the class, that should automatically make that page
> display the object correctly (by getting the display code from the sheet).

Yes.

> If it's not bound, you'd have to modify the page to include the sheet (or
> other display code) manually.

The sheet is bound. No need for  this.

>
> Again, I don't know much about doing this via App Within Minutes or whether
> what I've said is applicable to your situation

It is. AWM just automates what you normally do with the class/object
editor. It creates the class, the sheet and the template, and then
helps you create new instances (application entries) using the class
template under the hood. Nothing fancy really. This
http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorial may be
useful to compare the manual approach with the automated (AWM)
approach.

Hope this helps,
Marius

>  - there very well might be
> an easier way to accomplish what you're trying to do. And if all you're
> trying to do is replicate a "view" of a bunch of objects/documents that are
> already stored on other pages, you might only need to modify your new page
> to contain an {{include}} macro that points to the currently working page
> in your Application.
>
> Hope that helps,
>
> aaron
>
>
>
> On Tue, Jul 22, 2014 at 9:34 PM, Jason Clemons <jason.clem...@live.com>
> wrote:
>
>> Would you take a second to elaborate on that last part if you have a
>> second?  I'm not sure I understand when you say
>>
>> "Keep in mind that if your "sheet" is bound to the class, then adding an
>> object of that class to a page will cause that page to display that class's
>> sheet automatically..."
>>
>> When I create the page how do I stipulate the "sheet"?  Or how do I bind
>> it?
>>
>> > On Jul 22, 2014, at 3:39 PM, "Aaron Hardy at AC" <
>> ashtarcommunicati...@gmail.com> wrote:
>> >
>> > As far as I know, yes - you have to create the page first before adding
>> an
>> > object to it, otherwise you'll get an error.
>> >
>> > Keep in mind that if your "sheet" is bound to the class, then adding an
>> > object of that class to a page will cause that page to display that
>> class's
>> > sheet automatically...
>> >
>> >
>> > On Tue, Jul 22, 2014 at 5:31 PM, Jason Clemons <jason.clem...@live.com>
>> > wrote:
>> >
>> >> That's kinda what I'm trying to do..would I need to create the page
>> first?
>> >>
>> >> For instance, does  posting to http://yoursite.com/rest/wikis/
>> <wikiname>/spaces/<spacename>/pages/<pagename>/objects
>> >> create the page if it doesn't exist?
>> >>
>> >> Or would I
>> >>
>> >> 1.  Create the page
>> >> 2.   add the objects
>> >>
>> >> Thanks for the responses :)
>> >>
>> >>
>> >>>> On Jul 22, 2014, at 1:46 PM, "Aaron Hardy at AC" <
>> >>> ashtarcommunicati...@gmail.com> wrote:
>> >>>
>> >>> I can't help with the App Within Minutes part, as I'm not very familiar
>> >>> with it - I'm sure someone who knows more than me (ie anyone) could
>> tell
>> >>> you if you need to be creating a page or just creating an object on a
>> >> page.
>> >>>
>> >>> But, if "make the controls appear" ends up meaning that you need to add
>> >> an
>> >>> object of a certain class to a page, you just make a POST request to:
>> >>> http://yoursite.com/rest/wikis/
>> >>> <wikiname>/spaces/<spacename>/pages/<pagename>/objects
>> >>>
>> >>> containing XML similar to this:
>> >>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> >>> <object xmlns="http://www.xwiki.org";>
>> >>> <className>Space.YourClass</className>
>> >>> <property name="propertyname"><value>propertyvalue</value></property>
>> >>> </object>
>> >>>
>> >>> That should create an object on your page of the specified class - the
>> >>> response will include the XML representation of that object.
>> >>>
>> >>> Alternately, if you just need your new page to include the page with
>> the
>> >>> app code, you can create a new page and modify the contents to contain
>> >> the
>> >>> {{include}} macro...
>> >>>
>> >>> Hope that helps, at least until someone who knows what they're talking
>> >>> about comes along...
>> >>>
>> >>>
>> >>>
>> >>> On Tue, Jul 22, 2014 at 4:23 PM, Jason Clemons <jason.clem...@live.com
>> >
>> >>> wrote:
>> >>>
>> >>>> Hello all,
>> >>>>
>> >>>> I've created an "App Within Minutes" application we are using for some
>> >>>> reporting and issue tracking which is pretty much done now, but I
>> need a
>> >>>> way to create a page in the application with an API call.  I've seen
>> >> tons
>> >>>> of information on creating pages or modifying pages and I can get that
>> >> to
>> >>>> work pretty well, but when I create a page in the application space I
>> >> don't
>> >>>> know how to make the controls appear and the page doesn't show up I'm
>> >> the
>> >>>> application home page (grid).
>> >>>>
>> >>>> I'm sure I'm approaching this the wrong way as I'm creating a page
>> from
>> >>>> scratch where I'm pretty sure I should be creating an instance of the
>> >> page
>> >>>> class, but I'm not sure where to start with that.
>> >>>>
>> >>>> Does anyone have any links or tips or leads on where I would start
>> >> looking
>> >>>> for something like that?
>> >>>>
>> >>>> All help is greatly appreciated,
>> >>>>
>> >>>> Thanks in advance
>> >>>> _______________________________________________
>> >>>> users mailing list
>> >>>> users@xwiki.org
>> >>>> http://lists.xwiki.org/mailman/listinfo/users
>> >>> _______________________________________________
>> >>> users mailing list
>> >>> users@xwiki.org
>> >>> http://lists.xwiki.org/mailman/listinfo/users
>> >> _______________________________________________
>> >> users mailing list
>> >> users@xwiki.org
>> >> http://lists.xwiki.org/mailman/listinfo/users
>> > _______________________________________________
>> > users mailing list
>> > users@xwiki.org
>> > http://lists.xwiki.org/mailman/listinfo/users
>> _______________________________________________
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
>>
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to