Discussion:
[Jxplorer-users] Customized form - select from list of groups
Richard Mixon
12 years ago
Permalink
Hi,

First, JXplorer is pretty impressive. Great job and thank you!

I've read the FAQ and the Administrator Guide on creating custom HTML
forms. There is an example of how to create an HTML "<select" - but it has
a static list of options. Is there a recommended way to use data from the
directory to populate a HTML select?

I'm specifically wanting to choose/adjust roles for a user ( or users with
a particular role).

thank you - Richard
Chris Betts
12 years ago
Permalink
Hi Richard,

The HTML forms handling is a pretty ancient (2002?) part of the code
base, and hasn't been touched in years :-). At the time it was written the
java html text handling was fairly primitive, so many (most!) of the things
you can do in modern web browsers you won't be able to do in the html form.
In addition, a quick review of the code shows that the (then) Sun html
editor kit was a fairly fragile piece of work, so I wouldn't necessarily
recommend trying to be too tricky with it.

That said, there seems to be some support in the code for what you're
trying to do: if you feel like spelunking the
class com.ca.directory.jxplorer.viewer.HTMLTemplateDisplay allows for tags
such as:
<p><dxtemplate:get-all-attributes style="list"/></p>
<p><dxtemplate:get-attribute name="cn" style="list"/></p>

... however the method formattedListWithModifiers() supports a list or
table display.

So... if you want to use what's there now, the best you could do would be
provide a list of allowable values as text *next* to a text field.

If you're feeling brave and don't mind doing some testing, I could try to
extend the twelve year old code that handles this stuff and shoot you a dev
image to play with?

- Chris






-----
*Dr Christopher Betts*
Australian Cloud Identity
http://cloudidentity.com.au
m: 0408 533 456
...
Richard Mixon
12 years ago
Permalink
Chris,

Thanks for the response - so at least I had not missed anything in the
documentation.

I was looking to see if JXplorer would server as an admin interface to our
directory- at least until we get the planned web UI in place.

If you think this could be more generally useful, I would be more than
happy to do a bit of testing when yo have something ready.

Thank you - Richard
...
--
Richard Mixon
Custom Computer Creations, L.L.C.
mobile: (480) 577-6834 office: (480) 614-3442
email: ***@CustCo.biz <mailto:***@CustCo.biz>
Microsoft Partner ID: 1263725
The messages and documents transmitted with this notice contain
confidential information belonging to the sender. If you are not the
intended recipient of this information, you are hereby notified that any
disclosure, copying, distribution or use of the information is strictly
prohibited. If you have received this transmission in error, please notify
the sender immediately.
Chris Betts
12 years ago
Permalink
Hi Richard,

I've just spent an idle half hour (that I should have spent on
something else!) adding this functionality... however having done so, I'm
not sure it will actually do what you want. The problem is that the editor
will only look at attributes of the particular entry; so unless you've got
your user roles listed on each user entry, I'm not sure it will be useful
for you? If your roles are defined on a separate entry, there's no way for
the existing system to access them :-(.

However it was fun putting it in, and if you'd like to give it a shot
here's an updated jxplorer.jar file (simply rename your existing
jars/jxplorer.jar file to jxplorer.jar.bak and drop this one in), and you
should be able to add syntax similar to this to your template file:

<select name="description">
<dxtemplate:get-attribute name="groupmindFavourites"
style="options"/>
</select>

In this example the selection fields are built from the values in the
'groupmindFavourites' attribute (each particular option has both name and
value set to be the same), and the selected result is submitted to update
the 'description' attribute.

Let me know how it goes!

- Chris




-----
*Dr Christopher Betts*
Australian Cloud Identity
http://cloudidentity.com.au
m: 0408 533 456
...
Loading...