You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Youngho Cho <yo...@nannet.co.kr> on 2001/08/01 02:35:09 UTC

Re: [patch] DBSecurityService.java

Hi Jason,

I didn't understand what you said.

Am I some missing?

My purpose is I would like to use getAttribute/setAttribute of the SecurityObject with saving DB.

Please let me know what was wrong in my code.

thanks.

youngho

----- Original Message ----- 
From: Jason van Zyl <jv...@apache.org>
To: <tu...@jakarta.apache.org>
Sent: Tuesday, July 31, 2001 9:59 PM
Subject: Re: [patch] DBSecurityService.java


> On 7/31/01 2:06 AM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
> 
> > Hi,
> > 
> > Here is a Patch for DBSecurityService.java.
> > 2.x also should be fixed.
> 
> Please send an explanation with your patches, regardless of
> how simple the patch is.
> 
>  
> > Thanks.
> > 
> > youngho
> > 
> > Index: DBSecurityService.java
> > ===================================================================
> > RCS file: 
> > /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/security/
> > impl/db/DBSecurityService.java,v
> > retrieving revision 1.4
> > diff -u -r1.4 DBSecurityService.java
> > --- DBSecurityService.java 2001/07/17 23:01:07 1.4
> > +++ DBSecurityService.java 2001/07/31 05:58:36
> > @@ -650,6 +650,7 @@
> >            {
> >                Criteria criteria = TurbineGroupPeer.buildCriteria(group);
> >                TurbineGroupPeer.doUpdate(criteria);
> > +                return;
> >            }
> >        }
> >        catch(Exception e)
> > @@ -678,6 +679,7 @@
> >            {
> >                Criteria criteria = TurbineRolePeer.buildCriteria(role);
> >                TurbineRolePeer.doUpdate(criteria);
> > +                return;
> >            }
> >        }
> >        catch(Exception e)
> > @@ -707,6 +709,7 @@
> >            {
> >                Criteria criteria =
> > TurbinePermissionPeer.buildCriteria(permission);
> >                TurbinePermissionPeer.doUpdate(criteria);
> > +                return;
> >            }
> >        }
> >        catch(Exception e)
> 
> -- 
> 
> jvz.
> 
> Jason van Zyl
> 
> http://tambora.zenplex.org
> http://jakarta.apache.org/turbine
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/alexandria
> http://jakarta.apache.org/commons
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

Re: [patch] DBSecurityService.java

Posted by John McNally <jm...@collab.net>.
There is nothing wrong Youngho's patch as it does fix a bug and follows
what appears to be the original intent of the code.  But I thought I'd
bring to Daniel's attention a method where the normal return is in the
middle of a method and an exception is thrown if execution proceeds to
the end of the method. :-)  

    public void savePermission( Permission permission )
        throws DataBackendException, UnknownEntityException
    {
        boolean permissionExists = false;
        try
        {
            permissionExists = checkExists(permission);
            if(permissionExists)
            {
                Criteria criteria = TurbinePermissionPeer
                   .buildCriteria(permission);
                TurbinePermissionPeer.doUpdate(criteria);
                return;
            }
        }
        catch(Exception e)
        {
            throw new DataBackendException("savePermission(Permission)
failed", e);
        }
        throw new UnknownEntityException("Unknown permission '" +
permission + "'");
    }


Jason van Zyl wrote:
> 
> On 7/31/01 8:35 PM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
> 
> > Hi Jason,
> >
> > I didn't understand what you said.
> >
> > Am I some missing?
> >
> > My purpose is I would like to use getAttribute/setAttribute of the
> > SecurityObject with saving DB.
> 
> That's all I wanted was an explanation :-)
> 
> > Please let me know what was wrong in my code.
> 
> Nothing is wrong with the code, but a description is always
> helpful when you send a patch.
> 
> > thanks.
> >
> > youngho
> >
> > ----- Original Message -----
> > From: Jason van Zyl <jv...@apache.org>
> > To: <tu...@jakarta.apache.org>
> > Sent: Tuesday, July 31, 2001 9:59 PM
> > Subject: Re: [patch] DBSecurityService.java
> >
> >
> >> On 7/31/01 2:06 AM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
> >>
> >>> Hi,
> >>>
> >>> Here is a Patch for DBSecurityService.java.
> >>> 2.x also should be fixed.
> >>
> >> Please send an explanation with your patches, regardless of
> >> how simple the patch is.
> >>
> >>
> >>> Thanks.
> >>>
> >>> youngho
> >>>
> >>> Index: DBSecurityService.java
> >>> ===================================================================
> >>> RCS file:
> >>> /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/securit
> >>> y/
> >>> impl/db/DBSecurityService.java,v
> >>> retrieving revision 1.4
> >>> diff -u -r1.4 DBSecurityService.java
> >>> --- DBSecurityService.java 2001/07/17 23:01:07 1.4
> >>> +++ DBSecurityService.java 2001/07/31 05:58:36
> >>> @@ -650,6 +650,7 @@
> >>>            {
> >>>                Criteria criteria = TurbineGroupPeer.buildCriteria(group);
> >>>                TurbineGroupPeer.doUpdate(criteria);
> >>> +                return;
> >>>            }
> >>>        }
> >>>        catch(Exception e)
> >>> @@ -678,6 +679,7 @@
> >>>            {
> >>>                Criteria criteria = TurbineRolePeer.buildCriteria(role);
> >>>                TurbineRolePeer.doUpdate(criteria);
> >>> +                return;
> >>>            }
> >>>        }
> >>>        catch(Exception e)
> >>> @@ -707,6 +709,7 @@
> >>>            {
> >>>                Criteria criteria =
> >>> TurbinePermissionPeer.buildCriteria(permission);
> >>>                TurbinePermissionPeer.doUpdate(criteria);
> >>> +                return;
> >>>            }
> >>>        }
> >>>        catch(Exception e)
> >>
> >> --
> >>
> >> jvz.
> >>
> >> Jason van Zyl
> >>
> >> http://tambora.zenplex.org
> >> http://jakarta.apache.org/turbine
> >> http://jakarta.apache.org/velocity
> >> http://jakarta.apache.org/alexandria
> >> http://jakarta.apache.org/commons
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> 
> --
> 
> jvz.
> 
> Jason van Zyl
> 
> http://tambora.zenplex.org
> http://jakarta.apache.org/turbine
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/alexandria
> http://jakarta.apache.org/commons
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [patch] DBSecurityService.java

Posted by John McNally <jm...@collab.net>.
There is a method in BasePeer

Youngho Cho wrote:
> 
> Hi,
> 
> I think I order to save SecurityObject's attirbutes into the DB,
> It should be supported Map ( at least HashMap , Hashtable ) to bytearray convertion  in somewhare
> ( for examples in ObjectUtils )
> 
> thought ?
> 
> thanks
> 
> youngho
> 
> ----- Original Message -----
> From: Jason van Zyl <jv...@apache.org>
> To: <tu...@jakarta.apache.org>
> Sent: Wednesday, August 01, 2001 9:41 AM
> Subject: Re: [patch] DBSecurityService.java
> 
> > On 7/31/01 8:35 PM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
> >
> > > Hi Jason,
> > >
> > > I didn't understand what you said.
> > >
> > > Am I some missing?
> > >
> > > My purpose is I would like to use getAttribute/setAttribute of the
> > > SecurityObject with saving DB.
> >
> > That's all I wanted was an explanation :-)
> >
> > > Please let me know what was wrong in my code.
> >
> > Nothing is wrong with the code, but a description is always
> > helpful when you send a patch.
> >
> > > thanks.
> > >
> > > youngho
> > >
> > > ----- Original Message -----
> > > From: Jason van Zyl <jv...@apache.org>
> > > To: <tu...@jakarta.apache.org>
> > > Sent: Tuesday, July 31, 2001 9:59 PM
> > > Subject: Re: [patch] DBSecurityService.java
> > >
> > >
> > >> On 7/31/01 2:06 AM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> Here is a Patch for DBSecurityService.java.
> > >>> 2.x also should be fixed.
> > >>
> > >> Please send an explanation with your patches, regardless of
> > >> how simple the patch is.
> > >>
> > >>
> > >>> Thanks.
> > >>>
> > >>> youngho
> > >>>
> > >>> Index: DBSecurityService.java
> > >>> ===================================================================
> > >>> RCS file:
> > >>> /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/securit
> > >>> y/
> > >>> impl/db/DBSecurityService.java,v
> > >>> retrieving revision 1.4
> > >>> diff -u -r1.4 DBSecurityService.java
> > >>> --- DBSecurityService.java 2001/07/17 23:01:07 1.4
> > >>> +++ DBSecurityService.java 2001/07/31 05:58:36
> > >>> @@ -650,6 +650,7 @@
> > >>>            {
> > >>>                Criteria criteria = TurbineGroupPeer.buildCriteria(group);
> > >>>                TurbineGroupPeer.doUpdate(criteria);
> > >>> +                return;
> > >>>            }
> > >>>        }
> > >>>        catch(Exception e)
> > >>> @@ -678,6 +679,7 @@
> > >>>            {
> > >>>                Criteria criteria = TurbineRolePeer.buildCriteria(role);
> > >>>                TurbineRolePeer.doUpdate(criteria);
> > >>> +                return;
> > >>>            }
> > >>>        }
> > >>>        catch(Exception e)
> > >>> @@ -707,6 +709,7 @@
> > >>>            {
> > >>>                Criteria criteria =
> > >>> TurbinePermissionPeer.buildCriteria(permission);
> > >>>                TurbinePermissionPeer.doUpdate(criteria);
> > >>> +                return;
> > >>>            }
> > >>>        }
> > >>>        catch(Exception e)
> > >>
> > >> --
> > >>
> > >> jvz.
> > >>
> > >> Jason van Zyl
> > >>
> > >> http://tambora.zenplex.org
> > >> http://jakarta.apache.org/turbine
> > >> http://jakarta.apache.org/velocity
> > >> http://jakarta.apache.org/alexandria
> > >> http://jakarta.apache.org/commons
> > >>
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> > >> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> >
> > --
> >
> > jvz.
> >
> > Jason van Zyl
> >
> > http://tambora.zenplex.org
> > http://jakarta.apache.org/turbine
> > http://jakarta.apache.org/velocity
> > http://jakarta.apache.org/alexandria
> > http://jakarta.apache.org/commons
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [patch] DBSecurityService.java

Posted by Youngho Cho <yo...@nannet.co.kr>.
Hi,

I think I order to save SecurityObject's attirbutes into the DB,
It should be supported Map ( at least HashMap , Hashtable ) to bytearray convertion  in somewhare
( for examples in ObjectUtils )

thought ?

thanks

youngho

----- Original Message ----- 
From: Jason van Zyl <jv...@apache.org>
To: <tu...@jakarta.apache.org>
Sent: Wednesday, August 01, 2001 9:41 AM
Subject: Re: [patch] DBSecurityService.java


> On 7/31/01 8:35 PM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
> 
> > Hi Jason,
> > 
> > I didn't understand what you said.
> > 
> > Am I some missing?
> > 
> > My purpose is I would like to use getAttribute/setAttribute of the
> > SecurityObject with saving DB.
> 
> That's all I wanted was an explanation :-)
>  
> > Please let me know what was wrong in my code.
> 
> Nothing is wrong with the code, but a description is always
> helpful when you send a patch.
>  
> > thanks.
> > 
> > youngho
> > 
> > ----- Original Message -----
> > From: Jason van Zyl <jv...@apache.org>
> > To: <tu...@jakarta.apache.org>
> > Sent: Tuesday, July 31, 2001 9:59 PM
> > Subject: Re: [patch] DBSecurityService.java
> > 
> > 
> >> On 7/31/01 2:06 AM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
> >> 
> >>> Hi,
> >>> 
> >>> Here is a Patch for DBSecurityService.java.
> >>> 2.x also should be fixed.
> >> 
> >> Please send an explanation with your patches, regardless of
> >> how simple the patch is.
> >> 
> >>  
> >>> Thanks.
> >>> 
> >>> youngho
> >>> 
> >>> Index: DBSecurityService.java
> >>> ===================================================================
> >>> RCS file: 
> >>> /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/securit
> >>> y/
> >>> impl/db/DBSecurityService.java,v
> >>> retrieving revision 1.4
> >>> diff -u -r1.4 DBSecurityService.java
> >>> --- DBSecurityService.java 2001/07/17 23:01:07 1.4
> >>> +++ DBSecurityService.java 2001/07/31 05:58:36
> >>> @@ -650,6 +650,7 @@
> >>>            {
> >>>                Criteria criteria = TurbineGroupPeer.buildCriteria(group);
> >>>                TurbineGroupPeer.doUpdate(criteria);
> >>> +                return;
> >>>            }
> >>>        }
> >>>        catch(Exception e)
> >>> @@ -678,6 +679,7 @@
> >>>            {
> >>>                Criteria criteria = TurbineRolePeer.buildCriteria(role);
> >>>                TurbineRolePeer.doUpdate(criteria);
> >>> +                return;
> >>>            }
> >>>        }
> >>>        catch(Exception e)
> >>> @@ -707,6 +709,7 @@
> >>>            {
> >>>                Criteria criteria =
> >>> TurbinePermissionPeer.buildCriteria(permission);
> >>>                TurbinePermissionPeer.doUpdate(criteria);
> >>> +                return;
> >>>            }
> >>>        }
> >>>        catch(Exception e)
> >> 
> >> -- 
> >> 
> >> jvz.
> >> 
> >> Jason van Zyl
> >> 
> >> http://tambora.zenplex.org
> >> http://jakarta.apache.org/turbine
> >> http://jakarta.apache.org/velocity
> >> http://jakarta.apache.org/alexandria
> >> http://jakarta.apache.org/commons
> >> 
> >> 
> >> 
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> 
> -- 
> 
> jvz.
> 
> Jason van Zyl
> 
> http://tambora.zenplex.org
> http://jakarta.apache.org/turbine
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/alexandria
> http://jakarta.apache.org/commons
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

Re: [patch] DBSecurityService.java

Posted by Jason van Zyl <jv...@apache.org>.
On 7/31/01 8:35 PM, "Youngho Cho" <yo...@nannet.co.kr> wrote:

> Hi Jason,
> 
> I didn't understand what you said.
> 
> Am I some missing?
> 
> My purpose is I would like to use getAttribute/setAttribute of the
> SecurityObject with saving DB.

That's all I wanted was an explanation :-)
 
> Please let me know what was wrong in my code.

Nothing is wrong with the code, but a description is always
helpful when you send a patch.
 
> thanks.
> 
> youngho
> 
> ----- Original Message -----
> From: Jason van Zyl <jv...@apache.org>
> To: <tu...@jakarta.apache.org>
> Sent: Tuesday, July 31, 2001 9:59 PM
> Subject: Re: [patch] DBSecurityService.java
> 
> 
>> On 7/31/01 2:06 AM, "Youngho Cho" <yo...@nannet.co.kr> wrote:
>> 
>>> Hi,
>>> 
>>> Here is a Patch for DBSecurityService.java.
>>> 2.x also should be fixed.
>> 
>> Please send an explanation with your patches, regardless of
>> how simple the patch is.
>> 
>>  
>>> Thanks.
>>> 
>>> youngho
>>> 
>>> Index: DBSecurityService.java
>>> ===================================================================
>>> RCS file: 
>>> /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/securit
>>> y/
>>> impl/db/DBSecurityService.java,v
>>> retrieving revision 1.4
>>> diff -u -r1.4 DBSecurityService.java
>>> --- DBSecurityService.java 2001/07/17 23:01:07 1.4
>>> +++ DBSecurityService.java 2001/07/31 05:58:36
>>> @@ -650,6 +650,7 @@
>>>            {
>>>                Criteria criteria = TurbineGroupPeer.buildCriteria(group);
>>>                TurbineGroupPeer.doUpdate(criteria);
>>> +                return;
>>>            }
>>>        }
>>>        catch(Exception e)
>>> @@ -678,6 +679,7 @@
>>>            {
>>>                Criteria criteria = TurbineRolePeer.buildCriteria(role);
>>>                TurbineRolePeer.doUpdate(criteria);
>>> +                return;
>>>            }
>>>        }
>>>        catch(Exception e)
>>> @@ -707,6 +709,7 @@
>>>            {
>>>                Criteria criteria =
>>> TurbinePermissionPeer.buildCriteria(permission);
>>>                TurbinePermissionPeer.doUpdate(criteria);
>>> +                return;
>>>            }
>>>        }
>>>        catch(Exception e)
>> 
>> -- 
>> 
>> jvz.
>> 
>> Jason van Zyl
>> 
>> http://tambora.zenplex.org
>> http://jakarta.apache.org/turbine
>> http://jakarta.apache.org/velocity
>> http://jakarta.apache.org/alexandria
>> http://jakarta.apache.org/commons
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org