Home » Eclipse Projects » Riena » Create Application model depending on login information
| | |
Re: Create Application model depending on login information [message #24053 is a reply to message #24021] |
Wed, 01 April 2009 08:57   |
Frank Schepp Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Hi Carsten,
you are right class UIFilterRuleNavigationHiddenMarker is internal and
so should be used only with caution, because this code may undergo
changes. May be you file a bugzilla request which describes your problem
and mentions that class UIFilterRuleNavigationHiddenMarker is internal.
The gray "placeholder" seems to be a refresh problem. Can you file
bugzilla request for that? Is it a submodule your are hiding?
Regards, Frank
Carsten Spieker wrote:
> Hi Frank,
>
> thanks for your reply!
>
> I tried the way you explained via the UIFilter. Unfortunately I have two
> problems with this solution:
>
> 1) The class UIFilterRuleNavigationHiddenMarker seems to be internal.
> 2) The UI shows a bad looking gray "placeholder" where the now hidden
> navigation node was displayed before until I "click" somewhere in the UI
> (maybe this is only a refresh problem?)
>
> Greetz,
> Carsten
>
>
> "Frank Schepp" <Frank.Schepp@compeople.de> schrieb im Newsbeitrag
> news:gqqqia$un0$1@build.eclipse.org...
>> Hi Carsten,
>>
>> you are right in case you use the splash login view (its different for the
>> login dialog view). The splash login view is brought up when the workbench
>> is created and that is after createModel() was called. I think you can use
>> the riena ui filters (see http://wiki.eclipse.org/Riena_UI_filters) to
>> manipulate the displayed model nodes based on permissions. Override the
>> createView() method of your application class (subclass of SwtApplication)
>> like this:
>>
>> @Override
>> public Object createView(IApplicationContext context, IApplicationNode
>> pNode) {
>> Collection<IUIFilterRule> rules = new ArrayList<IUIFilterRule>(1);
>>
>> // hidden marker for all children of application node
>> IUIFilterRule filterRule = new UIFilterRuleNavigationHiddenMarker("/" +
>> pNode.getNodeId().getTypeId() + "/*") {
>> @Override
>> public boolean matches(Object... args) {
>> return super.matches(args) && !getPermission(args);
>> }
>>
>> private boolean getPermission(Object... args) {
>> boolean permission = true;
>> if (args[0] instanceof INavigationNode<?>) {
>> permission = // get permission for node (args[0])
>> }
>>
>> return permission;
>> }
>> };
>> rules.add(filterRule);
>> IUIFilter filter = new UIFilter(rules);
>> pNode.addFilter(filter);
>>
>> return super.createView(context, pNode);
>> }
>>
>> Also there is an API method setVisible() in INavigationNode to set the
>> visibility of a node.
>>
>> Regards, Frank
>>
>> Carsten Spieker wrote:
>>> Hi,
>>>
>>> I want to create my application model depending on the current users
>>> permissions.
>>>
>>> The problem is that IApplicationNode.createModel() is called before login
>>> has been performed.
>>>
>>> Is there any possibility to manipulate the displayed model nodes after
>>> login? Or is there any out of the box solution for this?
>>>
>>> Thanks and greetz,
>>> Carsten
>
>
|
|
|
Re: Create Application model depending on login information [message #24153 is a reply to message #24053] |
Wed, 01 April 2009 09:46  |
Carsten Spieker Messages: 197 Registered: July 2009 |
Senior Member |
|
|
Hi Frank,
I opened Bug report 270735 for this.
Greetz,
Carsten
"Frank Schepp" <Frank.Schepp@compeople.de> schrieb im Newsbeitrag
news:gqvavi$9fi$1@build.eclipse.org...
> Hi Carsten,
>
> you are right class UIFilterRuleNavigationHiddenMarker is internal and so
> should be used only with caution, because this code may undergo changes.
> May be you file a bugzilla request which describes your problem and
> mentions that class UIFilterRuleNavigationHiddenMarker is internal. The
> gray "placeholder" seems to be a refresh problem. Can you file bugzilla
> request for that? Is it a submodule your are hiding?
>
> Regards, Frank
>
> Carsten Spieker wrote:
>> Hi Frank,
>>
>> thanks for your reply!
>>
>> I tried the way you explained via the UIFilter. Unfortunately I have two
>> problems with this solution:
>>
>> 1) The class UIFilterRuleNavigationHiddenMarker seems to be internal.
>> 2) The UI shows a bad looking gray "placeholder" where the now hidden
>> navigation node was displayed before until I "click" somewhere in the UI
>> (maybe this is only a refresh problem?)
>>
>> Greetz,
>> Carsten
>>
>>
>> "Frank Schepp" <Frank.Schepp@compeople.de> schrieb im Newsbeitrag
>> news:gqqqia$un0$1@build.eclipse.org...
>>> Hi Carsten,
>>>
>>> you are right in case you use the splash login view (its different for
>>> the login dialog view). The splash login view is brought up when the
>>> workbench is created and that is after createModel() was called. I think
>>> you can use the riena ui filters (see
>>> http://wiki.eclipse.org/Riena_UI_filters) to manipulate the displayed
>>> model nodes based on permissions. Override the createView() method of
>>> your application class (subclass of SwtApplication) like this:
>>>
>>> @Override
>>> public Object createView(IApplicationContext context, IApplicationNode
>>> pNode) {
>>> Collection<IUIFilterRule> rules = new ArrayList<IUIFilterRule>(1);
>>>
>>> // hidden marker for all children of application node
>>> IUIFilterRule filterRule = new UIFilterRuleNavigationHiddenMarker("/"
>>> + pNode.getNodeId().getTypeId() + "/*") {
>>> @Override
>>> public boolean matches(Object... args) {
>>> return super.matches(args) && !getPermission(args);
>>> }
>>>
>>> private boolean getPermission(Object... args) {
>>> boolean permission = true;
>>> if (args[0] instanceof INavigationNode<?>) {
>>> permission = // get permission for node (args[0])
>>> }
>>>
>>> return permission;
>>> }
>>> };
>>> rules.add(filterRule);
>>> IUIFilter filter = new UIFilter(rules);
>>> pNode.addFilter(filter);
>>>
>>> return super.createView(context, pNode);
>>> }
>>>
>>> Also there is an API method setVisible() in INavigationNode to set the
>>> visibility of a node.
>>>
>>> Regards, Frank
>>>
>>> Carsten Spieker wrote:
>>>> Hi,
>>>>
>>>> I want to create my application model depending on the current users
>>>> permissions.
>>>>
>>>> The problem is that IApplicationNode.createModel() is called before
>>>> login has been performed.
>>>>
>>>> Is there any possibility to manipulate the displayed model nodes after
>>>> login? Or is there any out of the box solution for this?
>>>>
>>>> Thanks and greetz,
>>>> Carsten
>>
|
|
| | |
Re: Create Application model depending on login information [message #581655 is a reply to message #24021] |
Wed, 01 April 2009 08:57  |
Frank Schepp Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Hi Carsten,
you are right class UIFilterRuleNavigationHiddenMarker is internal and
so should be used only with caution, because this code may undergo
changes. May be you file a bugzilla request which describes your problem
and mentions that class UIFilterRuleNavigationHiddenMarker is internal.
The gray "placeholder" seems to be a refresh problem. Can you file
bugzilla request for that? Is it a submodule your are hiding?
Regards, Frank
Carsten Spieker wrote:
> Hi Frank,
>
> thanks for your reply!
>
> I tried the way you explained via the UIFilter. Unfortunately I have two
> problems with this solution:
>
> 1) The class UIFilterRuleNavigationHiddenMarker seems to be internal.
> 2) The UI shows a bad looking gray "placeholder" where the now hidden
> navigation node was displayed before until I "click" somewhere in the UI
> (maybe this is only a refresh problem?)
>
> Greetz,
> Carsten
>
>
> "Frank Schepp" <Frank.Schepp@compeople.de> schrieb im Newsbeitrag
> news:gqqqia$un0$1@build.eclipse.org...
>> Hi Carsten,
>>
>> you are right in case you use the splash login view (its different for the
>> login dialog view). The splash login view is brought up when the workbench
>> is created and that is after createModel() was called. I think you can use
>> the riena ui filters (see http://wiki.eclipse.org/Riena_UI_filters) to
>> manipulate the displayed model nodes based on permissions. Override the
>> createView() method of your application class (subclass of SwtApplication)
>> like this:
>>
>> @Override
>> public Object createView(IApplicationContext context, IApplicationNode
>> pNode) {
>> Collection<IUIFilterRule> rules = new ArrayList<IUIFilterRule>(1);
>>
>> // hidden marker for all children of application node
>> IUIFilterRule filterRule = new UIFilterRuleNavigationHiddenMarker("/" +
>> pNode.getNodeId().getTypeId() + "/*") {
>> @Override
>> public boolean matches(Object... args) {
>> return super.matches(args) && !getPermission(args);
>> }
>>
>> private boolean getPermission(Object... args) {
>> boolean permission = true;
>> if (args[0] instanceof INavigationNode<?>) {
>> permission = // get permission for node (args[0])
>> }
>>
>> return permission;
>> }
>> };
>> rules.add(filterRule);
>> IUIFilter filter = new UIFilter(rules);
>> pNode.addFilter(filter);
>>
>> return super.createView(context, pNode);
>> }
>>
>> Also there is an API method setVisible() in INavigationNode to set the
>> visibility of a node.
>>
>> Regards, Frank
>>
>> Carsten Spieker wrote:
>>> Hi,
>>>
>>> I want to create my application model depending on the current users
>>> permissions.
>>>
>>> The problem is that IApplicationNode.createModel() is called before login
>>> has been performed.
>>>
>>> Is there any possibility to manipulate the displayed model nodes after
>>> login? Or is there any out of the box solution for this?
>>>
>>> Thanks and greetz,
>>> Carsten
>
>
|
|
|
Re: Create Application model depending on login information [message #581668 is a reply to message #24053] |
Wed, 01 April 2009 09:46  |
Carsten Spieker Messages: 197 Registered: July 2009 |
Senior Member |
|
|
Hi Frank,
I opened Bug report 270735 for this.
Greetz,
Carsten
"Frank Schepp" <Frank.Schepp@compeople.de> schrieb im Newsbeitrag
news:gqvavi$9fi$1@build.eclipse.org...
> Hi Carsten,
>
> you are right class UIFilterRuleNavigationHiddenMarker is internal and so
> should be used only with caution, because this code may undergo changes.
> May be you file a bugzilla request which describes your problem and
> mentions that class UIFilterRuleNavigationHiddenMarker is internal. The
> gray "placeholder" seems to be a refresh problem. Can you file bugzilla
> request for that? Is it a submodule your are hiding?
>
> Regards, Frank
>
> Carsten Spieker wrote:
>> Hi Frank,
>>
>> thanks for your reply!
>>
>> I tried the way you explained via the UIFilter. Unfortunately I have two
>> problems with this solution:
>>
>> 1) The class UIFilterRuleNavigationHiddenMarker seems to be internal.
>> 2) The UI shows a bad looking gray "placeholder" where the now hidden
>> navigation node was displayed before until I "click" somewhere in the UI
>> (maybe this is only a refresh problem?)
>>
>> Greetz,
>> Carsten
>>
>>
>> "Frank Schepp" <Frank.Schepp@compeople.de> schrieb im Newsbeitrag
>> news:gqqqia$un0$1@build.eclipse.org...
>>> Hi Carsten,
>>>
>>> you are right in case you use the splash login view (its different for
>>> the login dialog view). The splash login view is brought up when the
>>> workbench is created and that is after createModel() was called. I think
>>> you can use the riena ui filters (see
>>> http://wiki.eclipse.org/Riena_UI_filters) to manipulate the displayed
>>> model nodes based on permissions. Override the createView() method of
>>> your application class (subclass of SwtApplication) like this:
>>>
>>> @Override
>>> public Object createView(IApplicationContext context, IApplicationNode
>>> pNode) {
>>> Collection<IUIFilterRule> rules = new ArrayList<IUIFilterRule>(1);
>>>
>>> // hidden marker for all children of application node
>>> IUIFilterRule filterRule = new UIFilterRuleNavigationHiddenMarker("/"
>>> + pNode.getNodeId().getTypeId() + "/*") {
>>> @Override
>>> public boolean matches(Object... args) {
>>> return super.matches(args) && !getPermission(args);
>>> }
>>>
>>> private boolean getPermission(Object... args) {
>>> boolean permission = true;
>>> if (args[0] instanceof INavigationNode<?>) {
>>> permission = // get permission for node (args[0])
>>> }
>>>
>>> return permission;
>>> }
>>> };
>>> rules.add(filterRule);
>>> IUIFilter filter = new UIFilter(rules);
>>> pNode.addFilter(filter);
>>>
>>> return super.createView(context, pNode);
>>> }
>>>
>>> Also there is an API method setVisible() in INavigationNode to set the
>>> visibility of a node.
>>>
>>> Regards, Frank
>>>
>>> Carsten Spieker wrote:
>>>> Hi,
>>>>
>>>> I want to create my application model depending on the current users
>>>> permissions.
>>>>
>>>> The problem is that IApplicationNode.createModel() is called before
>>>> login has been performed.
>>>>
>>>> Is there any possibility to manipulate the displayed model nodes after
>>>> login? Or is there any out of the box solution for this?
>>>>
>>>> Thanks and greetz,
>>>> Carsten
>>
|
|
|
Goto Forum:
Current Time: Mon Oct 02 22:37:34 GMT 2023
Powered by FUDForum. Page generated in 0.02666 seconds
|