When I was trying to figure out how to cleanly configure the registration page, I wrote a
piece of code to handle
it. The code is at XWiki.ConfigurableClass and it displays configuration for applications
which contain objects of
the same class. Documentation is here:
http://code.xwiki.org/xwiki/bin/view/Applications/AdministrationApplication…
In adding this I made a few assumptions which may not be the direction which the community
wants to go.
#1
I added a document called XWiki.RegistrationHelp to the default XE package which explains
how to configure the registration page.
In the Registration section of the administration interface, I made the labels for the
input fields into links to the relevant sections of the help page (I like links :) )
Vincent has suggested that instead of links we were to use popups or tooltips because they
would not allow the user to leave the administration interface.
The currently existing links could have click handlers added to show a popup and block the
click so that they still work for users without Javascript.
The other and more major issue in my mind is that I can't think of a way to show only
information for the item clicked on while keeping the help page a single unit which can be
read (and edited) easily.
Another option would be to remove the help page and links but I found myself reading code
to figure out what some of the parameters meant so I don't think that is a realistic
option.
I am in favor of continuing with the method which I started because I feel that popups are
an attack on my browser and I see no way to keep tooltips centralized for reading
beginning to end and for easily updating when things change.
#2
When I added configuration for the registration page, I did not want to add it to
XWikiPreferences. This is not only because I want to keep my code modular but I want to
put myself in the position of an application developer so I can see the API from their
point of view.
This has lead to configuration for XWiki.Registration residing in
XWiki.RegistrationConfig. It has been pointed out to me that this will make upgrading more
difficult and I agree but I don't think adding properties to XWikiPreferences class
for each and every application is reasonable and since third party developers cannot do
that I see this as a deficiency in our API.
The options I can see are to add a "Document Type" which defines a particular
document as a configuration document which should never be upgraded but I think this is
wrong because even configuration needs to be upgraded, it is the values which need to
remain. Also I am not a fan of separating configuration to a document different than the
code because the code needs to handle the case where the configuration is unavailable and
I think code making static references to a document name is an antipattern.
My proposal is to create another class just like ConfigurableClass except it will be
UpgradableClass. A document may have an object of UpgradableClass and that object can
either
A. Point to another object in the same class which should have it's values loaded in
on upgrade or
B. Add some code which should be run on upgrade.
It is important to understand that the document can be changed but the upgradable objects
will load the values from the old object and set them in the new object.
#3
Because the configuration for the registration page is seperate, it cannot be saved along
with XWikiPreferences in a single save operation and because there is configuration for
the registration page in XWikiPreferences and in RegistrationConfig, they are both
specified to be displayed in the "Registration" section of the administration
interface. XWiki.ConfigurableClass handles this situation by creating two forms with two
save buttons and a heading in the middle saying "Configure
XWiki.RegistrationConfig" It would be easy to override this with another message and
it would be possible to make a single button for users who have Javascript enabled but it
introduces the question do we want third party applications to anonymously add parameters
to a section of the administration interface.
I suppose the best answer would be to separate all of the parameters having to do with
registration from XWikiPreferences (and stop referring to them in the core).
I can think of no better solutions to this at the moment.
#4
(No hasty changes here, just a proposal)
The administration application uses the "admin" struts action which calls the
AdminAction class. From my looking at AdminAction class I think it can be removed entirely
and struts can be redirected to the InlineClass (Unproven claim).
This brings up a point about permissions: admin permission must be had in order to use the
admin action but only edit access to XWikiPreferences is required to do the things offered
by the administration action.
see:
https://localhost:8443/xwikiTrunk/bin/edit/XWiki/XWikiPreferences?editor=ob…
In fact admin action is not even necessary to use the Administration Application
see:
https://localhost:8443/xwikiTrunk/bin/inline/XWiki/XWikiPreferences?xpage=a…
I think the myth that admin access is necessary to do the administrative functions is
dangerous for administrators who may leave security holes as a result.
My proposal is that we try removing AdminAction to sandbox and redirect /admin/ in struts
to InlineAction.
I also think we ought to redefine admin access perhaps as the combination of view, edit,
and delete which cannot be denied at a lower level (so a space admin can delete a page
even if it denies them access.)
I have made XWiki.ConfigurableClass with the idea that it should be able to do all of the
functions of the administration application (meaning XWikiPreferences would have a
ConfigurableClass object for each section in the administration application).
I am always happy to hear when somebody wants to use ConfigurableClass but I don't
think porting XWikiPreferences over is a good idea until ConfigurationClass has had some
time in the field and we are sure that we don't want to change any of it's
behavior.
Sorry for the long email, I had a lot to discuss and didn't want to spam the list with
4 emails about the administration application.
Caleb