Hello Glen,
I am confused on how to add and on what basis we have to addd position
to the new category table. Below two sql commands can be used for coping
data and deleting the root categories.
create table category (
id varchar(48) not null primary key,
name varchar(255) not null,
description varchar(255),
websiteid varchar(48) not null,
image varchar(255),
position varchar(48)
);
insert into category(id,name,description,websiteid,image) select
id,name,description,websiteid,image from weblogcategory;
delete from category where name="root";
What do you suggest for this ?
Thanks
Gaurav
On Saturday 28 December 2013 06:56 AM, Glen Mazza wrote:
Take your time, this is a messy change as it affects many areas of the
code. But Roller will be architecturally much more solid and simpler
once this change is done. I have your ROL-1616 and ROL-1982 on my
plate for this weekend.
Glen
On 12/27/2013 02:40 PM, Gaurav wrote:
Hello Glen,
I have deleted the path and all related methods, but its seems to me
that the path methods like (getWeblogCategoryByPath) and many other
path and parent related methods, are scattered over the whole roller.
There are many occurrence of these methods and I have to sort out
each piece of code as now there is no path so, mostly we check for
categoryPath != null in if conditions, so these are no longer needed.
Also, I as thinking after testing and completing this we can delete
the WeblogCategory and replace with Category method, as it will be
clean. I also figured out why my tests are failing as during creating
of weblogentry it did not find the categories, as that class was
using old WeblogCategory table and using that class methods. I think
I will definitely will figure out everything at the end and will
successfully test with the unit tests.
I am now in the editor part so can display the categories on front
end, I am now all over the 1-2-3-4 steps you mentioned. As soon as I
will able to display the categories (small issues left) at the
backend, I will again go through my changes. Also, at this time I can
only create patch for new table and migration script, as all other
classes code are interrelated so can't submit now. I will test every
single thing related to categories, then I will submit my patches.
Although I have learned a lot new things, just spent last two full
days on this sorting out things, many times ending up nowhere from
where I started. But I am confident that I will definitely complete
this task. Just I am worrying that I must be taking too much time.
If there is something, you can advice me I would happy to follow that
also.
Thanks
Gaurav
On Friday 27 December 2013 05:09 AM, Glen Mazza wrote:
If it helps, you can provide interim patches, so long as it doesn't
break the current code base. You may want to create a patch just
creating the new database table (which will be ignored by the
current code) and sql insert-select scripts to move from the current
table to the new one, then one converting the code to using the new
table without sorting, then (finally) one that implements sorting of
the categories.
Glen
On 12/26/2013 08:12 AM, Gaurav wrote:
Hello Glen,
I have created and updated all necessary files in JPA and for
database, I tried compiling the code it gave me errors in test
cases. As I am not sure that what I am wrong in this. Although I
tried compiling without running test cases, it worked fine. I
tested it with tomcat and new table category is created and initial
category (General, Finance and Technology) are created with the
position 1,2,3. Still there are many thing I have to clean up and
sort out and will test it again.
Thanks
Gaurav
On Thursday 26 December 2013 03:31 PM, Gaurav wrote:
Ok, got your point. I will check on other Roller parts also if
parent name and path aren't be using in any other part of Roller.
I will go into the RSS and Atom feeds later on, and see what
changes it need. As, till now I have changed many files and
created some, so will first test this part then go into that feeds
part.
Thanks
Gaurav
On Thursday 26 December 2013 03:23 PM, Glen Mazza wrote:
Sounds good, but may require more work to make sure all is good
with the RSS and Atom feeds as a result (which I believe rely on
path). Where path is used to check for equivalence, I guess name
(and blog/website ID, if necessary) alone will do now. We may
need to check (if we aren't already) that no two categories have
the same name, where prior we were checking that no two paths are
the same (i.e., allowing category paths USStates/Georgia and
Countries/Georgia but now needing to disallow two categories
named "Georgia".)
Regards,
Glen
On 12/26/2013 12:47 AM, Gaurav wrote:
Hello Glen,
I am thinking of removing the path coloumn also, as it does not
make sense now as there will no subcategories and all will have
same path (like /categoryname). WDYT ?
Thanks
Gaurav
On Wednesday 25 December 2013 04:05 PM, Glen Mazza wrote:
Yes, the root category can be nuked.
Glen
On 12/25/2013 05:28 AM, Gaurav wrote:
Hello Glen,
I want to know as now all the categories will be top level, so
the root category which is created by default on addWeblog
isn't needed. So, I can remove that code also ? I am in half
completed with the 1-2 steps will soon submit some patched in
jira issue. You can look on to them whenever you will get time
from other projects.
Merry Christmas :)
Thanks
Gaurav
On Tuesday 24 December 2013 10:57 AM, Gaurav wrote:
Glen,
Thanks a lot for replying soon on this, I understand your
commitments. As this will give me more time on working on
this issue. I will give my 100% on this, as I also want to
get into more and more open source projects. For Now I am
focusing on Roller for starting my contributions in open source.
Thanks
Gaurav
On Tuesday 24 December 2013 10:51 AM, Glen Mazza wrote:
No, not a rush (unfortunately I can't help much right now
either, as my other project JSPWiki has a new release going
out.) But please be patient with us on your recent
submitted patches -- we haven't forgotten you and are happy
with your efforts on this project so far, we just have
full-time jobs and, even after that, other obligations --
for open source work, we usually have to beg, borrow and
steal time to work on them.
Glen
On 12/24/2013 12:05 AM, Gaurav wrote:
Hello Glen,
I am going through this having some issues, although not
major till now. I have still working on 1-2 steps, might be
I am slow as get less time. (Wish we also have holidays of
this festive season in India :P) Just want to know isn't
there any hurry for completing this asap ? Although, I am
sure will definitely complete this as I have understood the
structure of Roller completely. Just I have to go through
the JPA more and read about this.
Thanks
Gaurav
On Saturday 21 December 2013 04:59 PM, Glen Mazza wrote:
Looking good. Anything you're missing will become apparent
to you as you work along. The Roller installation guide
and here
(http://www.jroller.com/gmazza/entry/apache_derby_setup)
can show you how to test also with Derby if you'd like.
(It is usually simpler than MySQL, and another benefit of
working on Roller is that you become
multiple-database-lingual very quickly.)
Glen
On 12/21/2013 06:16 AM, Gaurav wrote:
Hello Glen,
Thanks for helping in this and I with this much deep
information, I can start working in it. I have started
working on this Issue and have followed your steps.
1. Created a new table in createdb.vm and in migration
scripts also. I have for mow stared working on MySQL.
2. In JPAWeblogEntryManagerImpl class, I have commented
updatePathTree and getRootWeblogCategory methods
3. I have created a new file for now Category.orm.xml and
enterd details of new table. A new class Category in
weblogger/pojos.
I have created new files for now and will work on this
and add new position coloum and code regarding this.
Other than UI and template Layer, I think I have covered
all files on which I have to work on the Database and JPA
layers ? Please tell me if I am wrong anywhere or
following wrong workflow.
Thanks
Gaurav
On Saturday 21 December 2013 04:59 AM, Glen Mazza wrote:
Hi Gaurav, we use Velocity for our database scripts --
you see a createdb.vm plus migration scripts (5.0 to
5.1) -- we'll want our change in both places (IIRC), new
users have the createdb run and Roller upgraders with
their current DB's have the 5.0 to 5.1 migration script
run.
We have multiple issues here and I'd like to get this
done right (I plan on helping out where you'd like).
Namely, we've moved from a hierarchical category
structure (categories having subcategories having their
own subcatorgories etc.) to a flat single-level
structure (all categories are top level) -- that was
done a week or so back. Problem is, the database tables
are still assuming hierarchical (they will work with
flat structures but are overkill--we don't need a parent
ID column anymore.) Also, the JPA objects are designed
for hierarchical but can simplified a bit more to flat
structure. Incidentally, "sequenceNum" is ambiguous
about what it means, I would say "position" or
"ordering" (INT null, null for migrators who don't yet
have a position defined) is clearer.
I think the simplest way to handle this--for both new
installers and upgraders--is:
1.) Database: To create a new table, say "category"
designed precisely as we need, and have the migration
scripts select from the old weblogcategory and insert
into the new category table. (We then ignore the
weblogcategory table.) We'll need to test the scripts
with at least two databases (2 of probably MySQL, Derby
and/or PostgreSQL) and guess for the others--if we're
wrong the user community can supply a patch fixing it.
2.) JPA: The JPA persistence object (the old
WeblogCategory) will need simplifying/restructuring as
it's now flat-level. Indeed, I think things will get a
*lot* simpler here, as it may just be the parent Weblog
holding a list of some sort of Category objects--that's it.
3.) UI Layer: The category.jsp (or whatever it's called)
and its Struts action class will now need to use the new
Category object (and table) instead of WeblogCategory.
The UI page will need two changes: (1) all new
categories will be placed (and saved) at the bottom of
the category list (and as result, appear last
(right-most) in the category list, and, later (2)
probably have up and down buttons in the table allowing
users to easily reorder the categories as they like.
(Strictly speaking, 1 alone is all that's needed for
ordering, as you can remove/name/delete/recreate
categories to eventually get them in the position you'd
like, but (2) of course is much nicer.)
4.) Template layer (haven't looked into this): The
templates (probably just a macro or two) will need
updating to ensure that they output the category names
per the new position order.
It's a lot of work, but one advantage is that I'd like
to do the same thing with bookmarks/blogrolls (team
discussion pending...), switch from a hierarchical to
flat-level for those too. If we can do this for
categories, the logic/UI design, etc., will carry over
100% to bookmarks.
I was planning on eventually getting to this myself, so
am available to work with you on whatever parts you'd
like. I think going in order 1-2-3-4 and having separate
commits may be the cleanest way of doing this. What's
nice about using a brand new table and JPA object is
that the old objects can still work in the code while
we're creating the new, we just don't activate the new
until the very end.
WDYT? (Also, other team members on the above ideas...?)
Or are there other Roller tasks you'd like to sink your
teeth into instead? I can look at this otherwise, but
this looks like a very good exercise for someone wanting
to get more involved in Roller, as it covers all the
layers of the webapp.
Regards,
Glen
On 12/20/2013 10:43 AM, Gaurav wrote:
Hello,
I have started working on ROL-1981, as discussed in
previous discussion threads I will add new column
sequenceNum in weblogcategory table. Then we can assign
sequenceNum to each category according to websideid. If
anyone have some ideas regarding this, please help me.
Also, need some help on how to go with this issue, and
how to add new coloum, I found .sql file, do I need to
add there new column. Also, Is this possible that that
when I restart the roller it will add new column to
database ?
Thanks for Any ideas/help.
[1] - https://issues.apache.org/jira/browse/ROL-1981