Win a copy of Event Streams in Action this week in the Java in General forum!

Dalia Sultana

Ranch Hand
+ Follow
since Jul 16, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dalia Sultana

Having said that, I am thinking we can look for a consecutive approval & unapproval pair by a particular user and consider it void.
7 years ago
No, I only have history about approval and unapproval. Basically when an approved entity is changed, it's put in an unapproved state.
7 years ago
Hi All,

I have to prevent a user from approving a change that she made. I have a way to get the history for the users who changed the item. For a simple case I can just check who was the last person that modified the item and prevent her from approving it. However, for cases such as below, what's the best way to implent it?

User 1 saves, User 2 approves and then unapproves, User 1 now should not be able to approve
User 1 saves, User 2 approves and then unapproves, User 3 approves and then unapproves, User 1 now should not be able to approve

Thanks!
7 years ago
Does removing a method break serialization? I ran into a class that implements Serializable. It doesn't declare a version uid. It seems like the application is throwing an InvalidClassException after removing a method, although the method is unused. I am wondering if this is the reason why I am getting the error or something else might have triggered it.
10 years ago
Thanks, This could almost work, but I haven't given you the entire picture, apologies for that. We have something like this currently.



an instance of this class is created and used like this in different places:



Here is the code for a PermissionedButton



This works nicely for almost all cases. But the problem arises when there are more than one modify permission controlling different parts of a dialog.

I need to be able to say
PerrmissionedButton testButton = new PermissionedButton(complexPermission);
then the button will just get enabled as long as the user has any of the permissions. This is fine as a ComplexPermission class can have a function that returns an ArrayList of all the activities that was used in the object creation.

But the problem is when I want to say
PerrmissionedButton testButton = new PermissionedButton("PRODUCTS_MODIFY_ID_ONLY");

How does the user class know that it has to pass PRODUCTS_MODIFY_ID_ONLY? I guess I can just specify all these permissions as emums and they will just have to look it up.

Thanks again!

Please suggest anything that you think might make things simpler for other developers. I am just aiming for a clear design! How does permissioning things work in a standard software? So simple yet so tedious!


[ May 14, 2008: Message edited by: Dalia Sultana ]
[ May 14, 2008: Message edited by: Dalia Sultana ]
11 years ago
Well, I need to instantiate many objects like this, like

ComplexPermission cp1 = new ComplexPermissionImpl("view_users", new String[]{ "modify_user_address","modify_user_name", "modify_user_account"});


ComplexPermission cp2 = new ComplexPermissionImpl("view_product", new String[]{ "modify_product_description","modify_product_price", "modify_product_id"}); etc.

The String[] could contain many strings , not just 2 or 3.

These objects are used in many places in the application. So they are instantiated at start up and used every where. I was trying to avoid instantiating them in every place that they are used. The user class needs to validate if a given action is allowed through a call like cp1.isModifiable("modify_user_address"). There have been occasions where using strings like that was introducing bugs (i.e. for spelling error etc) which wouldn't get caught until much later. So this is an attempt to close that hole. The user class shouldn't need to know the name of the permissions, they can just say cp1.getModifyProductDescriptionPermission() and then just use that to validate. Please suggest, if there is another way to achieve this.
11 years ago
Hi All,
I don't know if it is the right forum for my question, but..

I have a class like the following. I want to be able to give back the user the strings that was passed in in the string array when the object was constructed. For example say somewhere in the code I have


after constructing the object, I want the user class to have access to a methods like getModify_a(), getModify_b(), getModify_c() etc, as the user class has no idea about the stings that was passed in inside the array. These objects are static and constructed in a different class at start up.
Is this doable? or does anyone have a suggestion as to what can I do this to implement something like this?

Following is the class that I have currently.





[ May 13, 2008: Message edited by: Dalia Sultana ]

[ May 13, 2008: Message edited by: Dalia Sultana ]
[ May 13, 2008: Message edited by: Dalia Sultana ]
11 years ago
I have a jlabel as a rendering component for a JTable, it shows some text and an icon. I want the text to appear on the right side and the icon on the left. If I call setHorizontalAlignment on the label, everything goes to the right. Any ideas?
11 years ago
Hi All,

I have a Swing JFrame, which loads on a menu click. The screen is not too simple, but not too complicated either. It has 2 toolbars, a menubar, a JPanel(consisting of a JTable and a filter panel) and a right click context menu for the table. The very first time the screen is loaded, it takes forever fo it to come up. However, it's not as slow the cnsecutive times. I've put it through JProfiler and found out that the majority time is consumed by class loader. Any ideas, how to improve the performence here?

Also, is there a free good profiler that I can use with Eclipse 3.3?

Thanks!
11 years ago
Great idea

I am talking about the effect they have on the third screenshot where Rebecca Laszlo is selected. Though it really looks a lot sleeker in reality.
11 years ago

Originally posted by Maneesh Godbole:


Use the "" option. It has an image tag.



I am not sure if it a different image tag or not. The insereted code looks the same. But i'll give it a try. Here it goes...

11 years ago
perhaps I didn't do it right. How should I add a snapshot. I only added an image using the images button on the "Post A Reply" page.
11 years ago
I will take a look at the blog, meanwhile, this is what i am talking about...

11 years ago
more like a gradient actually.
11 years ago
Hi,

I am trying to create a glossy effect on some table rows like the one seen in office communicator when one selects a contact. I am not sure how to approach it though.

Please help.
11 years ago