You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Angel Vera <gu...@yahoo.com> on 2007/11/06 21:31:14 UTC

Re: migration from blojsom

Hi Dave,

I move this discussion into the development as the context of it is quite technical, and I am planning to contribute the migration tool, if you guys accept it. :)

I am almost done with my migration utility. I made it extensible so that other people can provide their own classes to read data from a blog and get the data into jRoller. I am pretty happy because we might be the first Blog to provide a extensible framework to migrate data into a blog :D.

I manage to get it running inside of eclipse, but now that I am trying to separate it out from the eclipse environment and  I am running into problem that hopefully you can help me.

I used the groovy sample http://tinyurl.com/2l2no4 as a based but I went with Java which is my strength. I found that before calling:

Weblogger roller = WebloggerFactory.getWeblogger();

I need to call:
        WebloggerStartup.prepare();
        WebloggerFactory.bootstrap();

And with that I need to add a whole bunch of jar dependecies, so I am doing this.. I am staring to wonder if:

1) I am doing it the right way
2) Do i really need to add all this guicer jars and jpa stuff..?
3) After resolving several problems related to properties, or classes missing, I am now running into:
Caused by: java.lang.RuntimeException: couldn't access theme dir [${webapp.context}]
    at org.apache.roller.weblogger.business.themes.ThemeManagerImpl.<init>(ThemeManagerImpl.java:88)
    ... 34 more


Dave <sn...@gmail.com> wrote: On 11/5/07, Angel Vera  wrote:
> I was thinking on creating a java tool that would connect to the blojsom database and insert the data into the roller database. Unfortunately, I don't understand  (yet) what is the minimum required data for the table "weblogentry" so that it will not break jRoller. My idea is to migrate the entries only (without categories), disallow comments on those entries, but have the correct posting date and time.

Instead of creating the Roller data via SQL, I recommend you use the
"Roller API" which is made up of a set of Java classes "POJOs" and
some Java interfaces "Managers."

You can find a set of examples that illustrate how to call the Roller
API from Groovy here: http://tinyurl.com/2l2no4. If you don't want to
mess with Groovy, the Java code will be pretty similar.

- Dave


Re: migration from blojsom

Posted by Angel Vera <gu...@yahoo.com>.
My formating got lost.. so here is a new message with the proper formating..

  Hi Dave, 

I am not lost.. just caught with holiday approaching. Things have been quite busy at work and in the house..so I haven't had tiem to reply to your email.

  > I did not test, but I did take a look at the code and I did notice a
> couple of things. First, you use the name JRoller but this code
> doesn't really have anything to do with JRoller.com, it's for Roller.
> That's not a big deal.

  I will test over the holidays, I just need to prepare a computer for my testing, I don't want to test on my main server. I thought JRoller and Roller where the same thing.. I can change the name of the class and packages, no problem.

I just tried checking out the code using eclipse, but I need a username. i tried using anonymous, but it wouldn't let me. Can I get a username to extract the code..? and should we talk about checkins as well?

  > Second, I noticed some category names that look hard-coded, like
> "Hobbies" and "Tech Talk" -- are those your categories or standard
> ones from Blojsom?
  
 Those are my categories, the idea is to have people provide their own code.. so yes this is specific for people who understand java. 

There is just so many different version of blogs and so many different way you can get the them working (derby, oracle, Tomcat, GlassFish) that I thought providing one solution (ie: from blojsom using derby to roller using derby) is just too specific. So instead of providing one solution I created a framework that people can extend. You do bring in a good point, and I think that we can further expand the BlojsomMigrator to a more generic way for people who can use this one single migration scenario, but don't want to compile the code. We can probably build on creating other IMigratorReader in the future as well.

> Third, you did not include any copyright messages or license headers.
> Would you like to release those code under the Apache license, just
> like Roller itself? Would you like the code to be "Copyright 2007
> Angel Vera"? I'll add the appropriate LICENSE and NOTICE files and
> headers for that.

  Adding copyrights.. that didn't even cross my mind. yes. I have read and I agree to the terms of the Apache License and NOTICE. Please do add that to the files.

  > Fourth and final, how generic is this code? How hard would it be to
> support migrations from other blog servers with this code base?

  Very generic, that was the main purposes. Other JAVA programmer need to extend IMigrationReader and they are on their way to create a new Migrator. IMigrationReader is the class that understands how to read the other other blog servers(blojsom, pebble, etc), and creates the IEntry and IComment (extended) classes that can be inserted into Roller. The internal code will takes this IEntry and IComment and create the proper roller correponding entries and comments.

  ------------------------------------------------------------------------------------------
  Dave wrote:
Angel,

I added your Migrator code to the Roller Support project
(http://roller.dev.java.net), which is where we host plugins, add-ons
that are not included in the Apache Roller release.

I did some work to make the code build via a simple Ant script. I
setup a directory structure for it and added a build script which
packages it for distribution. Please check it out and make sure it
still works for you.

1) Checkout the code for Roller Support project
See the instructions here for checking out the code for the Roller
support project
https://roller.dev.java.net/source/browse/roller/

2) Change dirs to the migrator directory
cd roller_support/tools/migrator

3) Build the migrator
ant build

4) Test it out. First, cd to dist/migrator edit the migrator script
and roller-custom.properties file and run.

I did not test, but I did take a look at the code and I did notice a
couple of things. First, you use the name JRoller but this code
doesn't really have anything to do with JRoller.com, it's for Roller.
That's not a big deal.

Second, I noticed some category names that look hard-coded, like
"Hobbies" and "Tech Talk" -- are those your categories or standard
ones from Blojsom?

Third, you did not include any copyright messages or license headers.
Would you like to release those code under the Apache license, just
like Roller itself? Would you like the code to be "Copyright 2007
Angel Vera"? I'll add the appropriate LICENSE and NOTICE files and
headers for that.

Fourth and final, how generic is this code? How hard would it be to
support migrations from other blog servers with this code base?

Once you check it out and we fix any problems I may have introduced,
I'll make the binaries available in the file download area of Roller
Support.

Thanks for the contribution!

- Dave



On Nov 13, 2007 6:57 AM, Angel Vera wrote:
> Yeah.. I know, I know... I forgot to attached the code...:)
> http://www.larinaandangel.gunfus.com/blog-help/roller-migrator.jar
>
> Angel
>
>
>
> Dave wrote: On Nov 8, 2007 10:50 PM, Angel Vera wrote:
> > Now let's move on to other things, would you guys be
> > interested in such migration tool? Or should I just
> > host it on my webpage..?
>
> I would definitely like to take a look at the code, so if you're
> willing please post it (or a pointer to it) here.
>
> It might be a good candidate for the Roller Support project, which we
> use for add-ons that can be downloaded separately from Roller.
>
> - Dave
>
>




Re: migration from blojsom

Posted by Angel Vera <gu...@yahoo.com>.
Hi Dave, 
   
  I am not lost.. just caught with holiday approaching. Things have been quite busy at work and in the house..so I haven't had tiem to reply to your email.
   
    I did not test, but I did take a look at the code and I did notice a
couple of things. First, you use the name JRoller but this code
doesn't really have anything to do with JRoller.com, it's for Roller.
That's not a big deal.
  I will test over the holidays, I just need to prepare a computer for my testing, I don't want to test on my main server. I thought JRoller and Roller where the same thing.. I can change the name of the class and packages, no problem.
   
  I just tried checking out the code using eclipse, but I need a username. i tried using anonymous, but it wouldn't let me. Can I get a username to extract the code..? and should we talk about checkins as well?
    Second, I noticed some category names that look hard-coded, like
"Hobbies" and "Tech Talk" -- are those your categories or standard
ones from Blojsom?
  Those are my categories, the idea is to have people provide their own code.. so yes this is specific for people who understand java. 
   
  There is just so many different version of blogs and so many different way you can get the them working (derby, oracle, Tomcat, GlassFish) that I thought providing one solution (ie: from blojsom using derby to roller using derby) is just too specific. So instead of providing one solution I created a framework that people can extend. You do bring in a good point, and I think that we can further expand the BlojsomMigrator to a more generic way for people who can use this one single migration scenario, but don't want to compile the code. We can probably build on creating other IMigratorReader in the future as well.
   
    Third, you did not include any copyright messages or license headers.
Would you like to release those code under the Apache license, just
like Roller itself? Would you like the code to be "Copyright 2007
Angel Vera"? I'll add the appropriate LICENSE and NOTICE files and
headers for that.
  Adding copyrights.. that didn't even cross my mind. yes. I have read and I agree to the terms of the Apache License and NOTICE. Please do add that to the files.
   
    Fourth and final, how generic is this code? How hard would it be to
support migrations from other blog servers with this code base?
  Very generic, that was the main purposes. Other JAVA programmer need to extend IMigrationReader and they are on their way to create a new Migrator. IMigrationReader is the class that understands how to read the other other blog servers(blojsom, pebble, etc), and creates the IEntry and IComment (extended) classes that can be inserted into Roller. The internal code will takes this IEntry and IComment and create the proper roller correponding entries and comments.
   
  Dave <sn...@gmail.com> wrote:
  Angel,

I added your Migrator code to the Roller Support project
(http://roller.dev.java.net), which is where we host plugins, add-ons
that are not included in the Apache Roller release.

I did some work to make the code build via a simple Ant script. I
setup a directory structure for it and added a build script which
packages it for distribution. Please check it out and make sure it
still works for you.

1) Checkout the code for Roller Support project
See the instructions here for checking out the code for the Roller
support project
https://roller.dev.java.net/source/browse/roller/

2) Change dirs to the migrator directory
cd roller_support/tools/migrator

3) Build the migrator
ant build

4) Test it out. First, cd to dist/migrator edit the migrator script
and roller-custom.properties file and run.

I did not test, but I did take a look at the code and I did notice a
couple of things. First, you use the name JRoller but this code
doesn't really have anything to do with JRoller.com, it's for Roller.
That's not a big deal.

Second, I noticed some category names that look hard-coded, like
"Hobbies" and "Tech Talk" -- are those your categories or standard
ones from Blojsom?

Third, you did not include any copyright messages or license headers.
Would you like to release those code under the Apache license, just
like Roller itself? Would you like the code to be "Copyright 2007
Angel Vera"? I'll add the appropriate LICENSE and NOTICE files and
headers for that.

Fourth and final, how generic is this code? How hard would it be to
support migrations from other blog servers with this code base?

Once you check it out and we fix any problems I may have introduced,
I'll make the binaries available in the file download area of Roller
Support.

Thanks for the contribution!

- Dave



On Nov 13, 2007 6:57 AM, Angel Vera wrote:
> Yeah.. I know, I know... I forgot to attached the code...:)
> http://www.larinaandangel.gunfus.com/blog-help/roller-migrator.jar
>
> Angel
>
>
>
> Dave wrote: On Nov 8, 2007 10:50 PM, Angel Vera wrote:
> > Now let's move on to other things, would you guys be
> > interested in such migration tool? Or should I just
> > host it on my webpage..?
>
> I would definitely like to take a look at the code, so if you're
> willing please post it (or a pointer to it) here.
>
> It might be a good candidate for the Roller Support project, which we
> use for add-ons that can be downloaded separately from Roller.
>
> - Dave
>
>


Re: migration from blojsom

Posted by Dave <sn...@gmail.com>.
Angel,

I added your Migrator code to the Roller Support project
(http://roller.dev.java.net), which is where we host plugins, add-ons
that are not included in the Apache Roller release.

I did some work to make the code build via a simple Ant script. I
setup a directory structure for it and added a build script which
packages it for distribution. Please check it out and make sure it
still works for you.

1) Checkout the code for Roller Support project
See the instructions here for checking out the code for the Roller
support project
   https://roller.dev.java.net/source/browse/roller/

2) Change dirs to the migrator directory
   cd roller_support/tools/migrator

3) Build the migrator
   ant build

4) Test it out. First, cd to dist/migrator edit the migrator script
and roller-custom.properties file and run.

I did not test, but I did take a look at the code and I did notice a
couple of things. First, you use the name JRoller but this code
doesn't really have anything to do with JRoller.com, it's for Roller.
That's not a big deal.

Second, I noticed some category names that look hard-coded, like
"Hobbies" and "Tech Talk" -- are those your categories or standard
ones from Blojsom?

Third, you did not include any copyright messages or license headers.
Would you like to release those code under the Apache license, just
like Roller itself? Would you like the code to be "Copyright 2007
Angel Vera"? I'll add the appropriate LICENSE and NOTICE files and
headers for that.

Fourth and final, how generic is this code? How hard would it be to
support migrations from other blog servers with this code base?

Once you check it out and we fix any problems I may have introduced,
I'll make the binaries available in the file download area of Roller
Support.

Thanks for the contribution!

- Dave



On Nov 13, 2007 6:57 AM, Angel Vera <gu...@yahoo.com> wrote:
> Yeah.. I know, I know... I forgot to attached the code...:)
> http://www.larinaandangel.gunfus.com/blog-help/roller-migrator.jar
>
> Angel
>
>
>
> Dave <sn...@gmail.com> wrote: On Nov 8, 2007 10:50 PM, Angel Vera  wrote:
> > Now let's move on to other things, would you guys be
> > interested in such migration tool? Or should I just
> > host it on my webpage..?
>
> I would definitely like to take a look at the code, so if you're
> willing please post it (or a pointer to it) here.
>
> It might be a good candidate for the Roller Support project, which we
> use for add-ons that can be downloaded separately from Roller.
>
> - Dave
>
>

Re: migration from blojsom

Posted by Angel Vera <gu...@yahoo.com>.
Dave, 

I have packaged the code in a jar format. I have included the source and the eclipse metadata files, so if you eclipse you can easily import it. 

I am still trying to work out the details on how to run it using a bat file and a shell script. So this means, that as of today you will still need to add all of the dependent jars manually. 

I also want to add some readme or some sort of better explanation to how to add your own migration code, but it currently works to migrate blojsom 3.0 using derby database. 

Take a look at let me know what you think.

Dave <sn...@gmail.com> wrote: On Nov 8, 2007 10:50 PM, Angel Vera  wrote:
> Now let's move on to other things, would you guys be
> interested in such migration tool? Or should I just
> host it on my webpage..?

I would definitely like to take a look at the code, so if you're
willing please post it (or a pointer to it) here.

It might be a good candidate for the Roller Support project, which we
use for add-ons that can be downloaded separately from Roller.

- Dave


Re: migration from blojsom

Posted by Angel Vera <gu...@yahoo.com>.
Yeah.. I know, I know... I forgot to attached the code...:)

http://www.larinaandangel.gunfus.com/blog-help/roller-migrator.jar

Angel


Dave <sn...@gmail.com> wrote: On Nov 8, 2007 10:50 PM, Angel Vera  wrote:
> Now let's move on to other things, would you guys be
> interested in such migration tool? Or should I just
> host it on my webpage..?

I would definitely like to take a look at the code, so if you're
willing please post it (or a pointer to it) here.

It might be a good candidate for the Roller Support project, which we
use for add-ons that can be downloaded separately from Roller.

- Dave


Re: migration from blojsom

Posted by Dave <sn...@gmail.com>.
On Nov 8, 2007 10:50 PM, Angel Vera <gu...@yahoo.com> wrote:
> Now let's move on to other things, would you guys be
> interested in such migration tool? Or should I just
> host it on my webpage..?

I would definitely like to take a look at the code, so if you're
willing please post it (or a pointer to it) here.

It might be a good candidate for the Roller Support project, which we
use for add-ons that can be downloaded separately from Roller.

- Dave

Re: migration from blojsom

Posted by Angel Vera <gu...@yahoo.com>.
Thanks Dave. 

I will add the jars and probably create a bat and
shell script similar to the ones that there is for
groovy, just to make it easier for people to run the
migration tool.

Now let's move on to other things, would you guys be
interested in such migration tool? Or should I just
host it on my webpage..?

--- Dave <sn...@gmail.com> wrote:

> On Nov 6, 2007 3:31 PM, Angel Vera
> <gu...@yahoo.com> wrote:
> > Weblogger roller =
> WebloggerFactory.getWeblogger();
> >
> > I need to call:
> >         WebloggerStartup.prepare();
> >         WebloggerFactory.bootstrap();
> >
> > And with that I need to add a whole bunch of jar
> dependecies, so I am doing
> > this.. I am staring to wonder if:
> >
> > 1) I am doing it the right way
> 
> Yes.
> 
> 
> > 2) Do i really need to add all this guicer jars
> and jpa stuff..?
> 
> Yes. Look at the "groovy" script and you'll see that
> we include all of
> the jars in WEB-INF/lib.
> 
> 
> > 3) After resolving several problems related to
> properties, or classes
> > missing, I am now running into:
> > Caused by: java.lang.RuntimeException: couldn't
> access theme dir
> > [${webapp.context}]
> >     at
> >
>
org.apache.roller.weblogger.business.themes.ThemeManagerImpl.<init>(ThemeManagerImpl.java:88)
> >     ... 34 more
> 
> Not sure what is going on here. You might need to
> first init the
> property system like so:
>        
>
org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger().getPropertiesManager().initialize();
>
org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger().flush();
> 
> - Dave
> 


Re: migration from blojsom

Posted by Dave <sn...@gmail.com>.
On Nov 6, 2007 3:31 PM, Angel Vera <gu...@yahoo.com> wrote:
> Weblogger roller = WebloggerFactory.getWeblogger();
>
> I need to call:
>         WebloggerStartup.prepare();
>         WebloggerFactory.bootstrap();
>
> And with that I need to add a whole bunch of jar dependecies, so I am doing
> this.. I am staring to wonder if:
>
> 1) I am doing it the right way

Yes.


> 2) Do i really need to add all this guicer jars and jpa stuff..?

Yes. Look at the "groovy" script and you'll see that we include all of
the jars in WEB-INF/lib.


> 3) After resolving several problems related to properties, or classes
> missing, I am now running into:
> Caused by: java.lang.RuntimeException: couldn't access theme dir
> [${webapp.context}]
>     at
> org.apache.roller.weblogger.business.themes.ThemeManagerImpl.<init>(ThemeManagerImpl.java:88)
>     ... 34 more

Not sure what is going on here. You might need to first init the
property system like so:
        org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger().getPropertiesManager().initialize();
org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger().flush();

- Dave