[Idea] XClass Preferences

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Idea] XClass Preferences

Marius Dumitru Florea
Hi devs,

I have an XWiki application that has a template provider which allows the
users to create application entries anywhere on the wiki using the Create
Page menu. I would like to control entirely how application entries are
displayed to the user. I can do this partially from my sheet but:

* I can't control the panels. I would like to display panels that are
specific to my application whenever a user is viewing an application entry,
no matter where the application entry is located.
* I can't control the color theme or the icon theme. I would like to use a
custom color theme and icon theme without affecting the other pages from
the wiki.
* I can't control the layout (the skin). I can hide the extra tabs from the
sheet but I can't hide a panel column or control the panel column width.

One solution to fix my problem is to introduce XClass Preferences, same as
we have page and wiki preferences. XClass preferences would have priority
over page and wiki preferences, inheriting from them. We can implement it
using either a naming convention, <ClassName>Preferences, or using some
xobject on the XClass, similar to the ClassSheetBinding xobject.

Do you see any problem with solution? I can think of one: access rights.
Does it make sense to have access rights specific to an XClass? E.g. "only
this group can edit instances of this XClass".

Do you think it is worth implementing? Another solution would be to allow
the sheet to overwrite some of the preferences, but the problem is that the
sheet is executed after the page HTML has started to be written to the
response.

Thanks,
Marius
Reply | Threaded
Open this post in threaded view
|

Re: [Idea] XClass Preferences

Thomas Mortagne
Administrator
On Tue, Nov 29, 2016 at 9:47 AM, Marius Dumitru Florea
<[hidden email]> wrote:

> Hi devs,
>
> I have an XWiki application that has a template provider which allows the
> users to create application entries anywhere on the wiki using the Create
> Page menu. I would like to control entirely how application entries are
> displayed to the user. I can do this partially from my sheet but:
>
> * I can't control the panels. I would like to display panels that are
> specific to my application whenever a user is viewing an application entry,
> no matter where the application entry is located.
> * I can't control the color theme or the icon theme. I would like to use a
> custom color theme and icon theme without affecting the other pages from
> the wiki.
> * I can't control the layout (the skin). I can hide the extra tabs from the
> sheet but I can't hide a panel column or control the panel column width.
>
> One solution to fix my problem is to introduce XClass Preferences, same as
> we have page and wiki preferences. XClass preferences would have priority

> over page and wiki preferences, inheriting from them. We can implement it

I guess technically you mean space and wiki preferences.

> using either a naming convention, <ClassName>Preferences, or using some
> xobject on the XClass, similar to the ClassSheetBinding xobject.

What kind of object ? XWikiPreferences or a special kind ?

>
> Do you see any problem with solution? I can think of one: access rights.
> Does it make sense to have access rights specific to an XClass? E.g. "only
> this group can edit instances of this XClass".
>
> Do you think it is worth implementing? Another solution would be to allow
> the sheet to overwrite some of the preferences, but the problem is that the
> sheet is executed after the page HTML has started to be written to the
> response.
>
> Thanks,
> Marius



--
Thomas Mortagne
Reply | Threaded
Open this post in threaded view
|

Re: [Idea] XClass Preferences

Marius Dumitru Florea
On Tue, Nov 29, 2016 at 11:02 AM, Thomas Mortagne <[hidden email]
> wrote:

> On Tue, Nov 29, 2016 at 9:47 AM, Marius Dumitru Florea
> <[hidden email]> wrote:
> > Hi devs,
> >
> > I have an XWiki application that has a template provider which allows the
> > users to create application entries anywhere on the wiki using the Create
> > Page menu. I would like to control entirely how application entries are
> > displayed to the user. I can do this partially from my sheet but:
> >
> > * I can't control the panels. I would like to display panels that are
> > specific to my application whenever a user is viewing an application
> entry,
> > no matter where the application entry is located.
> > * I can't control the color theme or the icon theme. I would like to use
> a
> > custom color theme and icon theme without affecting the other pages from
> > the wiki.
> > * I can't control the layout (the skin). I can hide the extra tabs from
> the
> > sheet but I can't hide a panel column or control the panel column width.
> >
> > One solution to fix my problem is to introduce XClass Preferences, same
> as
> > we have page and wiki preferences. XClass preferences would have priority
>
> > over page and wiki preferences, inheriting from them. We can implement it
>
>

> I guess technically you mean space and wiki preferences.
>

Yes.


>
> > using either a naming convention, <ClassName>Preferences, or using some
> > xobject on the XClass, similar to the ClassSheetBinding xobject.
>
>

> What kind of object ? XWikiPreferences or a special kind ?
>

The XClass Preferences page would have a XWikiPreferences object, just like
page (space) and wiki preferences pages. In the paragraph above I was
actually indicating how the XClass Preferences page can be determined:
either using a naming convention or using configuration (similar to the way
the XClass sheet is configured).


>
> >
> > Do you see any problem with solution? I can think of one: access rights.
> > Does it make sense to have access rights specific to an XClass? E.g.
> "only
> > this group can edit instances of this XClass".
> >
> > Do you think it is worth implementing? Another solution would be to allow
> > the sheet to overwrite some of the preferences, but the problem is that
> the
> > sheet is executed after the page HTML has started to be written to the
> > response.
> >
> > Thanks,
> > Marius
>
>
>
> --
> Thomas Mortagne
>
Reply | Threaded
Open this post in threaded view
|

Re: [Idea] XClass Preferences

Thomas Mortagne
Administrator
On Tue, Nov 29, 2016 at 10:27 AM, Marius Dumitru Florea
<[hidden email]> wrote:

> On Tue, Nov 29, 2016 at 11:02 AM, Thomas Mortagne <[hidden email]
>> wrote:
>
>> On Tue, Nov 29, 2016 at 9:47 AM, Marius Dumitru Florea
>> <[hidden email]> wrote:
>> > Hi devs,
>> >
>> > I have an XWiki application that has a template provider which allows the
>> > users to create application entries anywhere on the wiki using the Create
>> > Page menu. I would like to control entirely how application entries are
>> > displayed to the user. I can do this partially from my sheet but:
>> >
>> > * I can't control the panels. I would like to display panels that are
>> > specific to my application whenever a user is viewing an application
>> entry,
>> > no matter where the application entry is located.
>> > * I can't control the color theme or the icon theme. I would like to use
>> a
>> > custom color theme and icon theme without affecting the other pages from
>> > the wiki.
>> > * I can't control the layout (the skin). I can hide the extra tabs from
>> the
>> > sheet but I can't hide a panel column or control the panel column width.
>> >
>> > One solution to fix my problem is to introduce XClass Preferences, same
>> as
>> > we have page and wiki preferences. XClass preferences would have priority
>>
>> > over page and wiki preferences, inheriting from them. We can implement it
>>
>>
>
>> I guess technically you mean space and wiki preferences.
>>
>
> Yes.
>
>
>>
>> > using either a naming convention, <ClassName>Preferences, or using some
>> > xobject on the XClass, similar to the ClassSheetBinding xobject.
>>
>>
>
>> What kind of object ? XWikiPreferences or a special kind ?
>>
>
> The XClass Preferences page would have a XWikiPreferences object, just like
> page (space) and wiki preferences pages. In the paragraph above I was
> actually indicating how the XClass Preferences page can be determined:
> either using a naming convention or using configuration (similar to the way
> the XClass sheet is configured).

Just wanted to be sure you wanted to use the same class and not
introduce a new one.

Sounds good to me. Don't really have any issue in mind.

>
>
>>
>> >
>> > Do you see any problem with solution? I can think of one: access rights.
>> > Does it make sense to have access rights specific to an XClass? E.g.
>> "only
>> > this group can edit instances of this XClass".
>> >
>> > Do you think it is worth implementing? Another solution would be to allow
>> > the sheet to overwrite some of the preferences, but the problem is that
>> the
>> > sheet is executed after the page HTML has started to be written to the
>> > response.
>> >
>> > Thanks,
>> > Marius
>>
>>
>>
>> --
>> Thomas Mortagne
>>



--
Thomas Mortagne
Reply | Threaded
Open this post in threaded view
|

Re: [Idea] XClass Preferences

Eduard Moraru
Interesting stuff.

Will raise the complexity of XWiki overall and the number of places to
check when debugging an issue, but will also give app devs much more
customization power.

We would probably also need to look into the current limitation we have for
Nested Pages Administration (since WebPreferences requires the "admin"
right) and how this would impact this proposal.

+1 from my side.

Thanks,
Eduard

On Tue, Nov 29, 2016 at 11:39 AM, Thomas Mortagne <[hidden email]
> wrote:

> On Tue, Nov 29, 2016 at 10:27 AM, Marius Dumitru Florea
> <[hidden email]> wrote:
> > On Tue, Nov 29, 2016 at 11:02 AM, Thomas Mortagne <
> [hidden email]
> >> wrote:
> >
> >> On Tue, Nov 29, 2016 at 9:47 AM, Marius Dumitru Florea
> >> <[hidden email]> wrote:
> >> > Hi devs,
> >> >
> >> > I have an XWiki application that has a template provider which allows
> the
> >> > users to create application entries anywhere on the wiki using the
> Create
> >> > Page menu. I would like to control entirely how application entries
> are
> >> > displayed to the user. I can do this partially from my sheet but:
> >> >
> >> > * I can't control the panels. I would like to display panels that are
> >> > specific to my application whenever a user is viewing an application
> >> entry,
> >> > no matter where the application entry is located.
> >> > * I can't control the color theme or the icon theme. I would like to
> use
> >> a
> >> > custom color theme and icon theme without affecting the other pages
> from
> >> > the wiki.
> >> > * I can't control the layout (the skin). I can hide the extra tabs
> from
> >> the
> >> > sheet but I can't hide a panel column or control the panel column
> width.
> >> >
> >> > One solution to fix my problem is to introduce XClass Preferences,
> same
> >> as
> >> > we have page and wiki preferences. XClass preferences would have
> priority
> >>
> >> > over page and wiki preferences, inheriting from them. We can
> implement it
> >>
> >>
> >
> >> I guess technically you mean space and wiki preferences.
> >>
> >
> > Yes.
> >
> >
> >>
> >> > using either a naming convention, <ClassName>Preferences, or using
> some
> >> > xobject on the XClass, similar to the ClassSheetBinding xobject.
> >>
> >>
> >
> >> What kind of object ? XWikiPreferences or a special kind ?
> >>
> >
> > The XClass Preferences page would have a XWikiPreferences object, just
> like
> > page (space) and wiki preferences pages. In the paragraph above I was
> > actually indicating how the XClass Preferences page can be determined:
> > either using a naming convention or using configuration (similar to the
> way
> > the XClass sheet is configured).
>
> Just wanted to be sure you wanted to use the same class and not
> introduce a new one.
>
> Sounds good to me. Don't really have any issue in mind.
>
> >
> >
> >>
> >> >
> >> > Do you see any problem with solution? I can think of one: access
> rights.
> >> > Does it make sense to have access rights specific to an XClass? E.g.
> >> "only
> >> > this group can edit instances of this XClass".
> >> >
> >> > Do you think it is worth implementing? Another solution would be to
> allow
> >> > the sheet to overwrite some of the preferences, but the problem is
> that
> >> the
> >> > sheet is executed after the page HTML has started to be written to the
> >> > response.
> >> >
> >> > Thanks,
> >> > Marius
> >>
> >>
> >>
> >> --
> >> Thomas Mortagne
> >>
>
>
>
> --
> Thomas Mortagne
>
Reply | Threaded
Open this post in threaded view
|

Re: [Idea] XClass Preferences

Ecaterina Moraru (Valica)
+1 interesting, although nice to have

Using it we would be able also to have some panels that provide future
actions if the application is not valid, or we could use it to add some
custom rights in the same XClassPreferences page.

Thanks,
Caty

On Tue, Nov 29, 2016 at 12:36 PM, Eduard Moraru <[hidden email]>
wrote:

> Interesting stuff.
>
> Will raise the complexity of XWiki overall and the number of places to
> check when debugging an issue, but will also give app devs much more
> customization power.
>
> We would probably also need to look into the current limitation we have for
> Nested Pages Administration (since WebPreferences requires the "admin"
> right) and how this would impact this proposal.
>
> +1 from my side.
>
> Thanks,
> Eduard
>
> On Tue, Nov 29, 2016 at 11:39 AM, Thomas Mortagne <
> [hidden email]
> > wrote:
>
> > On Tue, Nov 29, 2016 at 10:27 AM, Marius Dumitru Florea
> > <[hidden email]> wrote:
> > > On Tue, Nov 29, 2016 at 11:02 AM, Thomas Mortagne <
> > [hidden email]
> > >> wrote:
> > >
> > >> On Tue, Nov 29, 2016 at 9:47 AM, Marius Dumitru Florea
> > >> <[hidden email]> wrote:
> > >> > Hi devs,
> > >> >
> > >> > I have an XWiki application that has a template provider which
> allows
> > the
> > >> > users to create application entries anywhere on the wiki using the
> > Create
> > >> > Page menu. I would like to control entirely how application entries
> > are
> > >> > displayed to the user. I can do this partially from my sheet but:
> > >> >
> > >> > * I can't control the panels. I would like to display panels that
> are
> > >> > specific to my application whenever a user is viewing an application
> > >> entry,
> > >> > no matter where the application entry is located.
> > >> > * I can't control the color theme or the icon theme. I would like to
> > use
> > >> a
> > >> > custom color theme and icon theme without affecting the other pages
> > from
> > >> > the wiki.
> > >> > * I can't control the layout (the skin). I can hide the extra tabs
> > from
> > >> the
> > >> > sheet but I can't hide a panel column or control the panel column
> > width.
> > >> >
> > >> > One solution to fix my problem is to introduce XClass Preferences,
> > same
> > >> as
> > >> > we have page and wiki preferences. XClass preferences would have
> > priority
> > >>
> > >> > over page and wiki preferences, inheriting from them. We can
> > implement it
> > >>
> > >>
> > >
> > >> I guess technically you mean space and wiki preferences.
> > >>
> > >
> > > Yes.
> > >
> > >
> > >>
> > >> > using either a naming convention, <ClassName>Preferences, or using
> > some
> > >> > xobject on the XClass, similar to the ClassSheetBinding xobject.
> > >>
> > >>
> > >
> > >> What kind of object ? XWikiPreferences or a special kind ?
> > >>
> > >
> > > The XClass Preferences page would have a XWikiPreferences object, just
> > like
> > > page (space) and wiki preferences pages. In the paragraph above I was
> > > actually indicating how the XClass Preferences page can be determined:
> > > either using a naming convention or using configuration (similar to the
> > way
> > > the XClass sheet is configured).
> >
> > Just wanted to be sure you wanted to use the same class and not
> > introduce a new one.
> >
> > Sounds good to me. Don't really have any issue in mind.
> >
> > >
> > >
> > >>
> > >> >
> > >> > Do you see any problem with solution? I can think of one: access
> > rights.
> > >> > Does it make sense to have access rights specific to an XClass? E.g.
> > >> "only
> > >> > this group can edit instances of this XClass".
> > >> >
> > >> > Do you think it is worth implementing? Another solution would be to
> > allow
> > >> > the sheet to overwrite some of the preferences, but the problem is
> > that
> > >> the
> > >> > sheet is executed after the page HTML has started to be written to
> the
> > >> > response.
> > >> >
> > >> > Thanks,
> > >> > Marius
> > >>
> > >>
> > >>
> > >> --
> > >> Thomas Mortagne
> > >>
> >
> >
> >
> > --
> > Thomas Mortagne
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [Idea] XClass Preferences

Anca Luca
In reply to this post by Marius Dumitru Florea
Hello all,



On Tue, Nov 29, 2016 at 9:47 AM, Marius Dumitru Florea <
[hidden email]> wrote:

> Hi devs,
>
> I have an XWiki application that has a template provider which allows the
> users to create application entries anywhere on the wiki using the Create
> Page menu. I would like to control entirely how application entries are
> displayed to the user. I can do this partially from my sheet but:
>
> * I can't control the panels. I would like to display panels that are
> specific to my application whenever a user is viewing an application entry,
> no matter where the application entry is located.
>

Note that this was possible, until http://jira.xwiki.org/browse/XWIKI-8269
was implemented (you'd set a variable in the sheet of the page, containing
a list of panels, just like we do for docextra tabs). I would have liked
that feature to stay as well.
I see usecases for it, but I also remember we had problems with an
application arriving on the wiki and imposing its panels, the Blog app. At
some point, the Blog app was setting both panel sets, left and right, and
we had an issue with that because we had setup the applications panel
navigation for the whole wiki as a panel in the left panels, and the fact
that the Blog app was overwriting it was a problem.

* I can't control the color theme or the icon theme. I would like to use a
> custom color theme and icon theme without affecting the other pages from
> the wiki.
>

I'm not sure I like that much the idea of changing the colors of the whole
UI whenever the type of page changes in the wiki, although I see a usecase.
I am wondering if a little color adjustment could not be handled through an
SSX, pulled by the proper sheet at the proper moment.


> * I can't control the layout (the skin). I can hide the extra tabs from the
> sheet but I can't hide a panel column or control the panel column width.
>

The examples you gave are still related to panels. I would be curious what
other elements of the skin could be customizable by an application.


>
> One solution to fix my problem is to introduce XClass Preferences, same as
> we have page and wiki preferences. XClass preferences would have priority
> over page and wiki preferences, inheriting from them. We can implement it
> using either a naming convention, <ClassName>Preferences, or using some
> xobject on the XClass, similar to the ClassSheetBinding xobject.
>
> Do you see any problem with solution? I can think of one: access rights.
> Does it make sense to have access rights specific to an XClass? E.g. "only
> this group can edit instances of this XClass".
>

Of course it does, but the other case makes sense as well (having the
rights be controlled classically, by the place where the page is rather
than by its type).


>
> Do you think it is worth implementing? Another solution would be to allow
> the sheet to overwrite some of the preferences, but the problem is that the
> sheet is executed after the page HTML has started to be written to the
> response.
>

What I don't like too much about these ideas is that we would basically be
adding a mechanism that would allow a page type to influence the whole UI /
wiki. Note that this is how currently the languages work (seeing a page in
french also changes the languague of the whole UI to french), and we're not
that convinced it's a good thing (I've heard it seen as a feature almost as
many times as I've heard it seen as a bug).

So, to me, it is good to have developement tools that would allow to
customize these, and we need to be able to control these as a developer,
but I think that an extra mechanism would add extra complexity (as Edi
said) and still not be as generic enough as the development solutions we
currently have (e.g. you wouldn't be able to remove the extra tabs
conditionally, say, depending on the current user role).

So I would be more for giving more control to the sheet (if we could
improve some vms evaluation in the skin, for example), but keeping these
customizable in the sheet rather than with an additional preference
mechanism.

I am still thinking, I see the pros and cons for this as well...


Thanks,
Anca


>
> Thanks,
> Marius
>
Reply | Threaded
Open this post in threaded view
|

Re: [Idea] XClass Preferences

Denis Gervalle-2
Hi Marius,
I have a very similar opinion to Anca and Edy. I am afraid by the
complexity this could add, not necessarily in the implementation, but in
the usage of it, in particular for us developer. I am not sure the use case
is fully true, and my feeling is that the sheet mechanism could be improved
in a way that allow a more interesting customisation. Changing the whole UI
when the page is of a given type/from a given app looks to me too invasive,
what you probably need is adapting the UI based on both your application,
and the location in the wiki. If you really want a full customisation, why
not better locating your page, in particular now that we have nested
documents, and use the current preferences. So, I am close to -1 on this
currently, but I am not close to further discussion and would like them to
include alternatives related to the usage of the sheet mechanism.
Regards,
--
Denis Gervalle
SOFTEC sa - CEO
On Wed, Nov 30, 2016 at 10:14, [hidden email]
<[hidden email]> wrote:
Hi Marius,
I have a very similar opinion to Anca and Edy. I am afraid by the
complexity this could add, not necessarily in the implementation, but in
the usage of it, in particular for us developer. I am not sure the use case
is fully true, and my feeling is that the sheet mechanism could be improved
in a way that allow a more interesting customisation. Changing the whole UI
when the page is of a given type/from a given app looks to me too invasive,
what you probably need is adapting the UI based on both your application,
and the location in the wiki. If you really want a full customisation, why
not better locating your page, in particular now that we have nested
documents, and use the current preferences. So, I am close to -1 on this
currently, but I am not close to further discussion and would like them to
include alternatives related to the usage of the sheet mechanism.
Regards,
--
Denis Gervalle
SOFTEC sa - CEO
On Tue, Nov 29, 2016 at 14:57, Anca Luca <[hidden email]> wrote:
Hello all,



On Tue, Nov 29, 2016 at 9:47 AM, Marius Dumitru Florea <
[hidden email]> wrote:

 > Hi devs,
 >
 > I have an XWiki application that has a template provider which allows
the
 > users to create application entries anywhere on the wiki using the
Create
 > Page menu. I would like to control entirely how application entries are
 > displayed to the user. I can do this partially from my sheet but:
 >
 > * I can't control the panels. I would like to display panels that are
 > specific to my application whenever a user is viewing an application
entry,
 > no matter where the application entry is located.
 >

Note that this was possible, until http://jira.xwiki.org/browse/XWIKI-8269
was implemented (you'd set a variable in the sheet of the page, containing
a list of panels, just like we do for docextra tabs). I would have liked
that feature to stay as well.
I see usecases for it, but I also remember we had problems with an
application arriving on the wiki and imposing its panels, the Blog app. At
some point, the Blog app was setting both panel sets, left and right, and
we had an issue with that because we had setup the applications panel
navigation for the whole wiki as a panel in the left panels, and the fact
that the Blog app was overwriting it was a problem.

* I can't control the color theme or the icon theme. I would like to use a
 > custom color theme and icon theme without affecting the other pages from
 > the wiki.
 >

I'm not sure I like that much the idea of changing the colors of the whole
UI whenever the type of page changes in the wiki, although I see a usecase.
I am wondering if a little color adjustment could not be handled through an
SSX, pulled by the proper sheet at the proper moment.


 > * I can't control the layout (the skin). I can hide the extra tabs from
the
 > sheet but I can't hide a panel column or control the panel column width.
 >

The examples you gave are still related to panels. I would be curious what
other elements of the skin could be customizable by an application.


 >
 > One solution to fix my problem is to introduce XClass Preferences, same
as
 > we have page and wiki preferences. XClass preferences would have
priority
 > over page and wiki preferences, inheriting from them. We can implement
it
 > using either a naming convention, <ClassName>Preferences, or using some
 > xobject on the XClass, similar to the ClassSheetBinding xobject.
 >
 > Do you see any problem with solution? I can think of one: access rights.
 > Does it make sense to have access rights specific to an XClass? E.g.
"only
 > this group can edit instances of this XClass".
 >

Of course it does, but the other case makes sense as well (having the
rights be controlled classically, by the place where the page is rather
than by its type).


 >
 > Do you think it is worth implementing? Another solution would be to
allow
 > the sheet to overwrite some of the preferences, but the problem is that
the
 > sheet is executed after the page HTML has started to be written to the
 > response.
 >

What I don't like too much about these ideas is that we would basically be
adding a mechanism that would allow a page type to influence the whole UI /
wiki. Note that this is how currently the languages work (seeing a page in
french also changes the languague of the whole UI to french), and we're not
that convinced it's a good thing (I've heard it seen as a feature almost as
many times as I've heard it seen as a bug).

So, to me, it is good to have developement tools that would allow to
customize these, and we need to be able to control these as a developer,
but I think that an extra mechanism would add extra complexity (as Edi
said) and still not be as generic enough as the development solutions we
currently have (e.g. you wouldn't be able to remove the extra tabs
conditionally, say, depending on the current user role).

So I would be more for giving more control to the sheet (if we could
improve some vms evaluation in the skin, for example), but keeping these
customizable in the sheet rather than with an additional preference
mechanism.

I am still thinking, I see the pros and cons for this as well...


Thanks,
Anca


 >
 > Thanks,
 > Marius
 >