cc'ing back in the gatein-dev list, you should usually use
'reply-all' (or reply-to-list) so that the list gets added. It's usually
best to discuss things on the list so that the whole group can comment.
On Thu, 2012-04-12 at 15:41 -0300, Gabriel Cardoso wrote:
Hi Matt.
Would that work? Just adding the words OR and AND before the specs?
Thanks
No, not exactly (but its my fault its confusing and I should have
specified two separate lists from the original mockups). Can you change
the mock up to add two separate lists for contains and must not contain?
Really what is comes down to is:
Contains:
foo
or bar
or ...
Must Not Contain:
abc
or xyz
or ...
So if we have a match for anything in the contains list, and we don't
have a match for anything in the 'does-not-contains' list, then the
condition for user agent strings is true. Its the same thing as a white
list and a black list.
For example, using the above configuration
User-Agent: fasdfl asdf asdf asdf foo asdf asdf a dsf
-> is true because it contains foo _and_ does not contain abc and xyz
User-Agent: fasdfl asdf asdf asdf foo abc asdf asdf a dsf
-> is false, even though it contains foo, because it contains abc it
fails
User-Agent: fasdfl asdf asdf asdf asdf asdf a dsf
-> is false, there is no match on a contains
User-Agent: fasdfl asdf abc asdf asdf asdf asdf a dsf
-> is false, it contains abc which is in the does-not-contain list (and
it also doesn't contain anything in the contains list)
If you want to do something like direct for every User-Agent except if
it contains abc, then you would add '*' to contains (regex to match
everything) and add 'abc' to does-not-contain.
The does-not-contain list can be empty.
For the situation when you create a new condition, the contains list and
the doesn-not-contain list should probably both be empty (since the
contains list is empty, the default will be to never redirect until the
admin configures something here).
For device properties, if the list is empty then it means we are not
checking any device properties, and the device property check will
return true. When creating a new condition, this list should be empty.
It would be nice if for an empty list we have an entry in the table
saying something like 'No Device Properties specified. Device Properties
are not being checked'.
If we have one or more device properties specified, then _all_ of these
properties must be met (ie its now using AND).
So it all works something like this (note: this is for higher level
logic, the implementation doesn't exactly follow these steps).
1) we check if the User-Agent string has a match in the list of
'contains'. If true continue, if not don't do the redirect
2) we check if the User-Agent string has a match in the list of 'does
not contain'. If we have a match, then don't do the redirect. Otherwise
continue
3) we check if there is a match for all the device properties. If we
have a match, now we can do the redirect, otherwise don't do the
redirect.
Hopefully this makes it more clear.
On Apr 12, 2012, at 3:09 PM, Matt Wringe wrote:
>
> JBoss Community
> Gatein Mobile Detection And Redirection: Administration UI
> new comment by Matt Wringe View all comments on this document
> After a offline discussion, the following changes were determined:
>
>
> - no more concept of device type
>
> - prepopulate a new portal with a couple of default redirects which contain default
conditions for some specific devices (phone, tablet, etc..)
>
>
> screen 1:
>
> - remove the icon and change 'Device' to something like 'Redirect'
which will display the redirect name.
>
> - add a 'copy' option to clone a new redirect based on a exiting redirect.
Copy and Delete will appear under a separate menu where the current 'delete' icon
is currently located
>
>
> screen 2:
>
> - removed
>
> - when creating a new redirect, screen 3 will be displayed.
>
>
> screen 3:
>
> - no icon beside the redirect name.
>
> - when creating a new redirect: generic redirect name ('redirect-1' or
something similar) but its an editable value, so it change be changed. The redirect site
will have to be set to the first site name in the drop down [does this make sense? or
should it be empty/null by default?]. Redirect will be enabled by default when creating a
new redirect [right? since they obviously want to use the redirect, otherwise why would
they create one?] [Note this part as not discussed, just adding my thoughts here]
>
> - make the 'redirect to' more prominent (larger font size, etc. Its too
small and out of the way right now when its an important option)
>
>
> screen 4:
>
> TODO: make clearer in screen 4 the behaviour when multiple conditions are
specified.
>
> Current behaviour for user-agent string: Condition is true if the user agent
contains any of the strings specified in 'contains' and no string specified in
'does not contain'
>
> [multiple user-agent conditions act as OR]
>
> Current behabiour for device properties: If ALL the device conditions are met
>
> [multiple device properties act as AND]
>
>
> The idea behind this is that you would probably want to list multiple different
contains for a user agent string (ie for a list of browser types, so OR) but you would
probably want to use AND for device properties (ie if width is less than X and device
pixel density is above y). But this gets a bit confusing. I would rather not have to
support more complex rules if possible.
>