You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by pp...@apache.org on 2010/05/18 22:58:14 UTC

svn commit: r945882 - /openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java

Author: ppoddar
Date: Tue May 18 20:58:14 2010
New Revision: 945882

URL: http://svn.apache.org/viewvc?rev=945882&view=rev
Log:
Add missing loader

Added:
    openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java   (with props)

Added: openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java?rev=945882&view=auto
==============================================================================
--- openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java (added)
+++ openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java Tue May 18 20:58:14 2010
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2010 Pinaki Poddar
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+*/
+package openbook.server;
+
+import java.util.Map;
+
+import openbook.util.PropertyHelper;
+
+/**
+ * Cleans and loads a new OpenBooks database.
+ * 
+ * @author Pinaki Poddar
+ *
+ */
+public class DataLoader {
+    
+    /**
+     * Load data.
+     * 
+     * @param args 0-th argument is the name of persistence unit
+     *             1-st argument is the path to the data file
+     *             
+     * @throws Exception
+     */
+    public static void main(String[] args) throws Exception {
+        String unit = args.length > 0 ? args[0] : OpenBookService.DEFAULT_UNIT_NAME;
+        Map<String,Object> params = args.length > 1 ? PropertyHelper.load(args[1]) : null;
+        OpenBookService service = ServiceFactory.getService(unit);
+        service.clean();
+        service.initialize(params);
+    }
+}

Propchange: openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native



Re: Copyright usage in OpenBooks

Posted by Kevin Sutter <kw...@gmail.com>.
Sounds even better, Mike.  I had forgotten about this discussion with
Craig...  Thanks.

Kevin

On Wed, May 19, 2010 at 8:52 PM, Michael Dick <mi...@apache.org> wrote:

> +1.
>
> I'd actually go a step further and remove the author tags as well. Per
> Craig's comment here <http://markmail.org/message/7rut2end2vsw5me7>
> @author
> tags do not foster community.
>
> -mike
>
> On Wed, May 19, 2010 at 4:07 PM, Donald Woods <dw...@apache.org> wrote:
>
> > http://apache.org/legal/src-headers.html#header-existingcopyright
> >
> > "1. If the source file is submitted with a copyright notice included in
> > it, the copyright owner (or owner's agent) must either:
> >    1. remove such notices, or
> >    2. move them to the NOTICE file associated with each applicable
> > project release, or
> >    3. provide written permission for the ASF to make such removal or
> > relocation of the notices."
> >
> >
> > We always follow 1.2 above when accepting new code donations from
> > outside the ASF (third-party) via a Software Grant Agreement (SGA) into
> > the Incubator or into an existing PMC.
> >
> > For OpenBooks, the 1.2 option should only be used if this is coming in
> > via SGA or a CCLA via donation from a third-party.
> > If the code was only developed by Pinaki as an ASF committer, then we
> > should follow 1.1 and use the normal @author tag instead.
> >
> >
> > -Donald
> >
> >
> >
> > On 5/19/10 11:12 AM, Pinaki Poddar wrote:
> > >
> > > Actually, all the files on OpenBooks currently has copyright header on
> my
> > > name, not only the new files. It is legacy reason.
> > >
> > >
> > >
> > >
> > >
> > > -----
> > > Pinaki
> >
>

Re: Copyright usage in OpenBooks

Posted by Michael Dick <mi...@apache.org>.
+1.

I'd actually go a step further and remove the author tags as well. Per
Craig's comment here <http://markmail.org/message/7rut2end2vsw5me7> @author
tags do not foster community.

-mike

On Wed, May 19, 2010 at 4:07 PM, Donald Woods <dw...@apache.org> wrote:

> http://apache.org/legal/src-headers.html#header-existingcopyright
>
> "1. If the source file is submitted with a copyright notice included in
> it, the copyright owner (or owner's agent) must either:
>    1. remove such notices, or
>    2. move them to the NOTICE file associated with each applicable
> project release, or
>    3. provide written permission for the ASF to make such removal or
> relocation of the notices."
>
>
> We always follow 1.2 above when accepting new code donations from
> outside the ASF (third-party) via a Software Grant Agreement (SGA) into
> the Incubator or into an existing PMC.
>
> For OpenBooks, the 1.2 option should only be used if this is coming in
> via SGA or a CCLA via donation from a third-party.
> If the code was only developed by Pinaki as an ASF committer, then we
> should follow 1.1 and use the normal @author tag instead.
>
>
> -Donald
>
>
>
> On 5/19/10 11:12 AM, Pinaki Poddar wrote:
> >
> > Actually, all the files on OpenBooks currently has copyright header on my
> > name, not only the new files. It is legacy reason.
> >
> >
> >
> >
> >
> > -----
> > Pinaki
>

Re: Copyright usage in OpenBooks

Posted by Donald Woods <dw...@apache.org>.
http://apache.org/legal/src-headers.html#header-existingcopyright

"1. If the source file is submitted with a copyright notice included in
it, the copyright owner (or owner's agent) must either:
    1. remove such notices, or
    2. move them to the NOTICE file associated with each applicable
project release, or
    3. provide written permission for the ASF to make such removal or
relocation of the notices."


We always follow 1.2 above when accepting new code donations from
outside the ASF (third-party) via a Software Grant Agreement (SGA) into
the Incubator or into an existing PMC.

For OpenBooks, the 1.2 option should only be used if this is coming in
via SGA or a CCLA via donation from a third-party.
If the code was only developed by Pinaki as an ASF committer, then we
should follow 1.1 and use the normal @author tag instead.


-Donald



On 5/19/10 11:12 AM, Pinaki Poddar wrote:
> 
> Actually, all the files on OpenBooks currently has copyright header on my
> name, not only the new files. It is legacy reason.
> 
> 
>  
> 
> 
> -----
> Pinaki 

Re: Copyright usage in OpenBooks

Posted by Pinaki Poddar <pp...@apache.org>.
Actually, all the files on OpenBooks currently has copyright header on my
name, not only the new files. It is legacy reason.


 


-----
Pinaki 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Copyright-usage-in-OpenBooks-tp5072126p5075411.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Copyright usage in OpenBooks

Posted by Donald Woods <dw...@apache.org>.
Pinaki, is there a reason you're adding copyright statements to new
files you add?  The usual ASF way is that copyrights are stripped from
the source and moved to the NOTICE file during contribution.  Also, it
seems weird to have an ASF committer asking for copyright privileges,
when we usually just use an @author tag or a <developer> entry in the
pom.xml when someone wants attribution for contributions.....


-Donald


On 5/18/10 4:58 PM, ppoddar@apache.org wrote:
> Author: ppoddar
> Date: Tue May 18 20:58:14 2010
> New Revision: 945882
> 
> URL: http://svn.apache.org/viewvc?rev=945882&view=rev
> Log:
> Add missing loader
> 
> Added:
>     openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java   (with props)
> 
> Added: openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java
> URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java?rev=945882&view=auto
> ==============================================================================
> --- openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java (added)
> +++ openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java Tue May 18 20:58:14 2010
> @@ -0,0 +1,45 @@
> +/*
> + * Copyright 2010 Pinaki Poddar
> + *
> + *  Licensed under the Apache License, Version 2.0 (the "License");
> + *  you may not use this file except in compliance with the License.
> + *  You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + *  Unless required by applicable law or agreed to in writing, software
> + *  distributed under the License is distributed on an "AS IS" BASIS,
> + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + *  See the License for the specific language governing permissions and
> + *  limitations under the License.
> +*/
> +package openbook.server;
> +
> +import java.util.Map;
> +
> +import openbook.util.PropertyHelper;
> +
> +/**
> + * Cleans and loads a new OpenBooks database.
> + * 
> + * @author Pinaki Poddar
> + *
> + */
> +public class DataLoader {
> +    
> +    /**
> +     * Load data.
> +     * 
> +     * @param args 0-th argument is the name of persistence unit
> +     *             1-st argument is the path to the data file
> +     *             
> +     * @throws Exception
> +     */
> +    public static void main(String[] args) throws Exception {
> +        String unit = args.length > 0 ? args[0] : OpenBookService.DEFAULT_UNIT_NAME;
> +        Map<String,Object> params = args.length > 1 ? PropertyHelper.load(args[1]) : null;
> +        OpenBookService service = ServiceFactory.getService(unit);
> +        service.clean();
> +        service.initialize(params);
> +    }
> +}
> 
> Propchange: openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/DataLoader.java
> ------------------------------------------------------------------------------
>     svn:eol-style = native
> 
> 
>