gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUe-dev] Automatic filters with Application Server


From: Johannes Vetter
Subject: [GNUe-dev] Automatic filters with Application Server
Date: Tue, 05 Oct 2004 10:14:15 +0200

Hello,

as you might have noticed we have changed appserver's support for
filters from the static to a more dynamic approach. automatic filtering
in appserver now should work as follows:

1.) define a class you want to act as filter using GCD's
2.) define which properties of that class a user has to enter in the
login-dialog. You can accomplish this with GLD's. All properties in the
GLD having a Search- or Info-Attribute other than None are used for
user-input (usually you would like to have only one)

now the filter is available and known to appserver. the next time a
session connects to appserver it will be asked for the specified
filter-data (as defined by gld). It takes care of the language of that
client-session of course.

3.) in all classes you want the filter to be in effect, add a
filter="..."-attribute to the GCD of the class. this will lead to an
additional reference-property in that class.


But what does all this stuff do ?

If a class has such a filter appserver will do the following for you in
the background:

1.) if a new instance of a class is created, the filter-property will be
populated with the current value of the filter (as selected in the
login-dialog of the session).

2.) on a request of a class (=select) appserver will automatically apply
an additional condition for the current filter-value to the query.
There's one exception to this rule: if the filter-property is already
mentioned in a condition it will not be added; so it's still possible to
select all instances of a class without respecting filters.


Example for such a filter:

GCD:

<module name="foo">
  <class name="company">
    <property name="code" type="string(8)"/>
    <property name="name" type="string(35)"/>
  </class>
</module>

GLD:

<module name="foo" language="en_US">
  <class name="company">
    <property name="code" pos="100" search="100" label="Company-Code"/>
    <property name="name" pos="200" label="Name of the company"/>
  </class>
</module>


Sample class (GCD)

<module name="bar">
  <class name="baz" filter="foo_company">
        ....
  </class>
</module>


The class "bar_baz" get's an additional property "foo_company" of which
is a reference to the class "foo_company". usually one will not have to
take care of the maintenance of this property.


If you would like to have cascading filters just add a filter="..."
attribute to the detail-filter.

example: 
if we would like to have fiscal-years (depending on the company) we
would add another class like the following

<module name="foo">
  <class name="year" filter="foo_company">
     <property ....

Appserver takes care of the dependancies in filters and should detect
circular refs as well. 



After all, if you won't use such filter just don't define them and you
won't be bothered by appserver. (users of the last version of appserver
might want to dismiss their gnue_company, gnue_year classes as well as
all refs to them. the current gnue.gsd is now clean and has *no*
filter-stuff in there)


ok, so have a lot of fun with appserver :)


Thanks,

Johannes

-- 
BYTEWISE Software GmbH          Tel +43 (5577) 89877-0
i.A. Johannes Vetter            Fax +43 (5577) 89877-66
A-6890 Lustenau, Enga 2         http://www.bytewise.at
-------------------------------------------------------
Wir bieten die Installation von Debian GNU/Linux auf
Servern für kleinere Netzwerke zum Pauschalpreis an.
Mehr dazu unter http://www.bytewise.at/texte/pl-debian

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]