Refs #1 - Created a java spring web application, with basic architecture. Includes latest stable spring libraries, postgresql jdbc driver and fmgVen.
Refs #1 - Created a java spring web application, with basic architecture. Includes latest stable spring libraries, postgresql jdbc driver and fmgVen.
Refs #2 - Added latest fmgVen lib, dataSource definition at dao.xml (no liquibase yet). Implemented basic fetching content from db.

Property file must be defined to the JVM by -Dfmgcms.home=fmgCMSHomeDir parameter (prop file is looked up at fmgCMSHomeDir/conf/fmgCMS.properties).
Refs #1 - added liquibase support, which handles database updates and rollbacks automatically. !LiquibaseUtil is used to build and rollback db changes while testing. !LiquibaseWrapper fixes liquibase spring support class which does not work in Turkish locale.
Fixes #3 - Created domain object hierarchy. Added to liquibase db-changelog. Updated service and added test. Removed previous "Content" domain object. Instead the domain object hierarchy is like;

 * Attribute: type-attribute-value triplet for arbitrary content/data storage, for all dynamic fragments in pages/templates.
 * Template: each template, can have template wide attributes
 * Page: each page with an accessible path, has attributes for content fragments
 * !PageAttribute: many to many relationship btw page and attributes.
 * !TemplateAttribute: many to many relationship btw template and attributes.

This hierarchy is flexible enough that pages can have multiple dynamic content, also templates can template wide contents. Content concept is replaced with attribute, I think this leads to a clearer mind. Using these objects, the user can add multiple attributes to pages, and specify those attributes in html templates.

By the way, since spring 2.5 removed setWrappedInstance, fmgVen cannot not properly map one-to-many relationships, this should be fixed.
Fixes #3 - Created domain object hierarchy. Added to liquibase db-changelog. Updated service and added test. Removed previous "Content" domain object. Instead the domain object hierarchy is like;

 * Attribute: type-attribute-value triplet for arbitrary content/data storage, for all dynamic fragments in pages/templates.
 * Template: each template, can have template wide attributes
 * Page: each page with an accessible path, has attributes for content fragments
 * !PageAttribute: many to many relationship btw page and attributes.
 * !TemplateAttribute: many to many relationship btw template and attributes.

This hierarchy is flexible enough that pages can have multiple dynamic content, also templates can template wide contents. Content concept is replaced with attribute, I think this leads to a clearer mind. Using these objects, the user can add multiple attributes to pages, and specify those attributes in html templates.

By the way, since spring 2.5 removed setWrappedInstance, fmgVen cannot not properly map one-to-many relationships, this should be fixed.
Fixes #4, Refs #2 - Used freemarker for templating, in templateService, created tests, fixed encoding problems. Created a contentController which will handle all static and dynamic content, redirected everything to this spring controller. It checks if the requested resource is static, and pipes from templating service. The static resources are the ones which are referenced from template. 

Mostly working, should be tested more, and exceptions should be added to services.
Refs #2 - Handling static resources is improved, with last modified headers (static content caching). Started admin pages, listing available pages and attributes.
Refs #2 - Fixed jsp forwarding infinite loop, since we map /* to dispatcher servlet in web.xml jsps are catched by controllers (happened in jetty). Fixed by forwarding to named dispacher (jsp). Meanwhile added private jsp filter, so that public jsps cannot be accessed by end users.
Refs #5 - Admin pages, update page attribute is done. Accessing static content of admin pages become problem, content controller handled js files. To fix this, added !DefaultServletController which will get the jsp and default named dispatchers and forward the jsp/static content to them.

Will use jackson for json - java mapping, and utilize spring mvc 3 annotations.
Refs #5 

 * Updated controllers according to Spring MVC 3 @requestmapping annotation, the request mapping is defined by simpleurlmapping, which can configure orders whereas @requestmapping cannot configure orders. The current config is a mix of simpleurlmapping and @requestmapping. The method names will decide like CCNHM. Default servlet is required because we manually map /*
 * Updated to liquibase 2.0 with new generic !LiquibaseUtil also can generate changelogs (copied from propgen project)
 * configured mapping so that somepage/edit opens the admin editing page. This required relative paths inside of editPage.jsp (and scripts.js) to be converted to absolute paths, using pageContext.request.contextPath
Refs #5 - almost finished, can create pages (/path/edit), change path and template of a page, add/remove attributes to page and templates. With !AttributeEnum required attributes for templates and pages are stored in the db for each template. While editing a page/template missing attributes are detected, listed in a select box, and can be added.

Separated editing page and template, somehow ven won't list the attributes of the template of a page (lists only one), and editing page and template attributes in different pages seems a better choice.

Did not add remove page code, since attributes become orphan when the pages are removed, instead user can change the path of the page and remove/update attributes according to existing/new template.

There are still some issues, but current state can be deployed, I think. (With an authentication mechanism)
Refs #5 - added basic authentication mechanism to try it live on the web.
Refs #5 - Did not work in jetty, because !SimpleUrlHandlerMapping does not sort mapping keys, the most suitable mapping is decided according to the longest match, so the static content will be matched by other controllers. 

SUHM uses hashmap to store mappings, which does not sort them according to priority. Instead, the solution is to define another SUHM and give it an order property, and define higher priority mappings in there. 

So at the end, we first check if the url is static, and forward to default servlet. On the contrary, in the default spring annotation tradition, spring first checks the @request mappings and forwards to default servlet if there is no match. I think my solution is better :)

Also removed pageContext prefixes from jsps, for simplicity and clarity. Instead /[path]/edit redirects to /admin/editPage?path=[path]
Refs #5 - Fine tuning admin pages, added 'add all' link, reduced attr value textarea size.

Also I've worked on automatic deploy to jetty on commit.
Refs #5 - Because of a bug in fmgVen multiple template attributes were returning as a single attr, corrected.

Further information regarding fmgVen bug;

 * This join did not work: Page.template.templateAttributes.attribute
 * template prop of the page was always being created with new copies of templateAttributes list
 * Fixed by adding this to Ven.QueryMapper (many to one): if (fieldValue != null) list.add(fieldValue);
Refs #6 - Inline editing with Aloha Editor. Admin edit page injects aloha editor to the template while editing. Login page is added, currently demo password is used. Netbeans 7.1. Aloha has giant dependencies, so this commit is huge.
Refs #6 - While injecting aloha editor, adds div instead of span, so editable highlighting works better.

Moreover, the client reported that table editing is problematic. Tested it, while editing the table, attr content is updated with aloha specific divs. After editing tables, user should click somewhere outside editable, so that the attr should be updated with proper html (without aloha specific tags), and then update button should be clicked. Can do some workaround for this, f.ex. auto clicking outside on update, but this time user cannot edit attr content manually. 

Note that this state is alpha, we'll do much more improvements to fix issues like these.
Refs #6, #7 - Simplified domain model, removed attribute, added attr, value, author, date, version fields to pageAttribute and templateAttribute. On saving attribute, a new version is added. While viewing the latest version is retrieved (this required complex query which is added to /etc, and used modified version of fmgVen to use inner mapper and generator to inject custom join). 

Various improvements at editPage, mostly improved Aloha editor usage, getting specific changed editable, textarea to aloha update, focus on change, etc. Renamed functions to be more understandable.