7.08.2011

Resolving Postgres "returning auto generated keys no supported"

I discovered Jean-Pol Landrain's, "TriggerAssignedIdentityGenerator" to address the issue of the Hibernate ID Generator not supporting an Id created by the database via a BEFORE INSERT trigger.

However the TriggerAssignedIdentityGenerator design for Oracle did not work for the older JDBC PostgreSQL driver which doesn't support the return of auto-generated keys.

The probem was resolved by changes to the 'prepare' and 'executeAndExtract' methods:




protected PreparedStatement prepare(String insertSQL, SessionImplementor session) throws SQLException {

return session.getBatcher().prepareStatement(insertSQL + " RETURNING *");
}

protected Serializable executeAndExtract(PreparedStatement insert) throws SQLException {

insert.execute();
// get the new id back
ResultSet rs = insert.getResultSet();
if (rs.next()) {
return new String(rs.getString(1)); // assume that 1 is id
}

throw new SQLException("Returned no id in resultset");

}

postgres create trigger error relation does not exist 42P01

PostgreSQL 8.4: When attempting to create a simple trigger the executes a function, for a table that exists, I was getting a 42P01 error: relation "table_name" does not exist

CREATE TRIGGER genUuid
BEFORE INSERT ON table_name
FOR EACH ROW EXECUTE PROCEDURE generate_function_v1();

This was simple resolved by including the schema name along with the table as follows:

CREATE TRIGGER genUuid
BEFORE INSERT ON my_schma.table_name
FOR EACH ROW EXECUTE PROCEDURE generate_function_v1();

6.21.2011

org.hibernate.HibernateException: Unable to locate current JTA transaction

It started with a "org.hibernate.HibernateException: Could not find datasource" which was resolved by moving the hibernate-cfg.xml to the root folder (above WEB-INF). Once this was resolved my servlet returned a "Unable to locate current JTA transaction" transaction error. The postgres datasource configured via JBoss indicated status DOWN.

Error text:

org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:88)
org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:621)

occurs when getSessionFactory is attempted. Direct connection to db (w/o JBoss DS) works fine.

4.06.2011

.NET MVC DropDownList, SelectList and Selected Value

If you've tried using the Html.DropDownList in .NET MVC you know that it the selectedValue of the populating SelectList doesn't work. The frequently posted workaround, is to change the name of DropDownList to something other that the field it is supposed to be bound to.

Perfect, now the value is selected in the list as expected. BUT, the problem with this however is that is the DropDownList no longer binds to the model as needed. Since we've changed the name, updates to the database do not work. After reading numerous posts on Stackoverflow I discovered zero solutions.

Here is how I resolved it:

Assuming that your SelectList is constructed in your Controller or ViewModel like this:

CatsRepository CatsRepo = new CatsRepository();
CatsList = new SelectList(CatsRepo.FindCats(), "CatId", "Category", Content.CatId);


The HTML.DropDownList can be constructed in your control like this:


%lt;input type="hidden" name="CatId" id="CatId" value="" /%gt;
%lt;%= Html.DropDownList("CatIdList", Model.CatsList, new { @onchange = "CatId.value = this.value"})%%gt;

In Summary,

1) I renamed my "CatId" bound DropDownList to "CatIdList".
2) Then I added a hiddel field named "CatId" setting it's value to "".
3) I added a "new { @onchange = "CatId.value = this.value"}" as an htmlAttribute to my DropDownList, so when a different value is picked it updates the hidden field value accordingly.

1.19.2011

SOAPUI - Failed to import wsdl

It seems that this is a very generic error, but if you examine the SOAPUI logs you can usually find out what's causing it. The SOAPUI error log (found in the "soapUI Logs" in the eclipse soapUI perspective tabs) shows the error details.

In my case, there was a SchemaException: Error loading schema types. My WSDL referenced numerous .xsd schemas, one of which was on a secured remote site. I changed the schema reference to a local address using the 'schemaLocation=../localpath/some.xsd' attribute of the import tag and all worked fine.

How to check if JBoss WS is deployed

It seems like a simple task, but it took me a little while to determine whether or not my Web service deployed to JBossWS from Eclipse actually got deployed. Just browse to http://localhost:8080/jbossws/services, and you can see what services are active on the server.

3.19.2009

Big Fish, Little Fish: Tracking Web Startups

Gone are the days of the dotcom boom, but there are still alot of new ideas being launched. After spending some time on WebWare and KillerStartups you can see the current trends, which as of late are social networking and micro-blogging. There are all kinds of widgets and mash-ups that take advantage of the API's that the bigger fish are providing.

Web Business Models

Making money from an idea. This is something most of us would like to learn more about. Dan Zamboni over at Box UK gives a nice breakdown of Web business models. Dan's Web business model taxonomy is loosely related.

In general, Dan defines 2 top-levels "immediate" and "long-term". The immediate (short-term) level breaks down into what we see in most Web revenue models --subscription based, one-time payments or 3rd-party (sponsor/partner/advertiser) supported. At the long-term level (do you have the patience?) the general idea is to build an audience before expecting any return -- "Attract a substantial audience before monetizing".

Now to figure out which ones are the most successful. What do you think?

3.18.2009

Tripping on Egos

This isn't really a post, more like a stumple upon. Today, I was lucky enough to discover a large ego pool: http://www.monitortalent.com. How nice that these folks are there to guide us.

Why Unstructured Classification Matters?

Clay Shirky once write a great article about the importance of user defined classification. This is even more important for the socially networked "Web 3.0" CMS. Of course a CMS will let the publisher classify content by format/function (ie; content type) and topically (ie; categories,sub category,etc..) -- But the new CMS will also let me "tag" my content and generate another map it.

5.09.2007

11

Today I discovered and interesting article on 11 usability principles for CMS products. While I don't completely agree with some of the author's principles, usability is a critical consideration for Content Management Systems.

4.26.2007

Technical Considerations for Choosing a CMS

Can the CMS host multiple websites without separate installations?

Does the CMS allows for integration with additional plug-ins where required
For example, future features might include forums, mapping packages, statistics,
geographical tracking, etc.

Is there a customizable front-end styles on the CMS interface
We would like to be able to style up the interface of each separate instance of the CMS in different look & feels. Specifically we want to be able to change colours, font styles, and maybe images. Some CMS solutions allow you to edit the text straight on the website (after logging in) not via an admin site. In this case this feature is not applicable.

Is there a WYSIWYG editing interface
The user can see the page change as they are editing it, in the same look & feel (template) as the actual page. A preview button would also be ok.
Maybe even a preview website that displays latest changes rather than published items as the live site does. MS Word style formatting options appear at the top of the edit area, so that users can change the style without HTML knowledge.
Code should be cross-browser compliant (IE 6+ and Firefox 1+) and ideally accessible.

Does it allow Blog-style visitor comments
When enabled, website visitors can post comments on articles published on a website.
This technology would allow us to use the CMS as a Blogging tool.
CMS administrators can choose whether anyone can comment, only registered users (manageable via the CMS) or only team members.
Email alert goes to administrators for approval before a comment appears.

Is there staged content management (preview / live)? Can development content can be easily migrated to live. It should be easy for us to start adding content while the site is in development (on a development server) and for the same content then to be available on the live site. So some sort of extract from development which is able to be inserted on live. Some CMS's appear to assign id's to items which are referenced and this mean they are then not copyable to separate database instances where the id's may already be taken.

Is the CMS Modular / Pluggable?
All options are simple to turn on and off for different sites.
For example, advanced options like changing navigation are disabled by default, but can be switched on, if we need it.

Is there an keyword / text search in the CMS?
So that users can easily find the content they are looking for. With Keyword highlighting.

Is there automatic RSS feed generation of page content?
A tick box to decide whether an RSS feed link appears on the page or not.

What type of security model does the CMS offer? Different permissioning levels - lock content from certain users
We need at least the following levels:
* User (can edit but not publish)
* Moderator (can edit and publish)
* Administrator (can edit, publish, and change navigation, user permissions, etc)
Preferably, we would like a system where the administrators can set permissions for other users, and create custom user groups. Sections of the public website (I.e. not the admin section) can be kept behind a login.
Access can be administered from within the CMS system.

Can the navigation/menu be changed at all levels, add new pages as necessary
Ideally the CMS should be able to change the entire structure of the site.

Is there automatic updating of the Sitemap
Based on any changes to page titles or navigation.

Are there user-defined templates?
Can Administrators define new templates for pages and add new data fields to existing ones as required.

Auto-populate details based on login
Certain fields of the templates are automatically populated. Such as date and author.

3.06.2007

Another Ping Test from Google Blog

This is a test of the blog server ping system. I hope to add a Technorati Ping tag to get this updated. Post a comment if you see it worked!

10.31.2006

Overcoming Weaknesses in CMS / Portal Software

Historically, the obstacles in this space (CMS) have been cost and ease of use.

Cost

There is really no rhyme or reason to the cost of CMS software. The cost problem is that the great majority of CMS / portal vendors use competitor-based pricing which has created greyness for buyers. "Why is this CMS product $1000 and this other CMS product $50,000?". Or as I have often heard, "Your CMS app does the same thing as one that was came in at over 6 figures." Secondly, application pricing and offshore programming fees have plummeted, so vendors have tried to reclaim what was lost with increasingly higher license prices. Typically license pricing is done either per CPU or per user.

Ease-of-Use

Out-of-the-box most business users will be intimidated by the user interface offered. If you speak to existing portal users they will most likely call their portal software a nice demo, but very cumbersome to work with. Arranging and placing portlets on major sites can be a very time consuming effort. As the site structure grows, the navigation load time can increase dramatically. This is a problem web content management systems experienced years ago, but most have solved today. If you add a new menu item or rearrange the navigation you might be forced to place the portlets from scratch again. Most portal interfaces were far from designed for business users but instead IT staff. In many systems, flexiblility also means complexity. Many CMS admistration interfaces are so cryptic that they must be deciphered by a technical user in order to configure.

How Can PortalApp.NET Overcome These Weaknesses

Cost has always been a strong point of PortalApp which delivers unbeatable versatility and value when compared to other CMS solutions. The fact the PortalApp's license cost is structured per site and not per user is an added benefit. Existing customers have often commented that the price point is so affordable that it is misleading to the product's actual potential. Formost, PortalApp is a versatile "out-of-the-box" solution that is ready to accomodate 90% of common Web requirements. This means instant deployment of a content managed Website, portal or intranet. Subsequently, PortalApp can be extensively configured and customized (both design and functionality) with minimal technical expertise. By distinguishing these 2 separate tasks the ease-of-use becomes more apparent.

10.04.2005

Is Corporate Blogging the Killer App of 2006?

Blogs have become a staple for business communication. With staff blogs on Websites being made available for public consumption, customers get insight into the people and culture of the company they may be buying into. Corporate blogs also provide customers and partners with an opportunity to provide feedback. Wether you're a business principal, partner or customer, I am interested in hearing your stories about how a business blog has changed your perspective on busuiness communication.

Primary Reasons for Starting a Corporate Blog

- Community building
- Thought leadership / idea provocation
- Communicate with customers
- Marketing / sales driving
- SEO / Improve search engine rank

Key Benefits of Corporate Blogging

- Increased credibility
- Increased sales leads
- Improved communication with audience
- Increased communication on casual / personal level


Key Risk Factors of Corporate Blogging

- Negative PR
- Cost / Man hours
- Legal Liability

,

7.25.2005

Core CMS Features

What makes a CMS a CMS? What features should a content management system have? Is a CMS a subset of other common knowledge management systems -- or does the CMS contains theses sub systems?

Core considerations for a CMS:

Content Management - Document management and related workflow

Content Creation (authoring) - Web based forms for content entry. Easy-to-use UI for editing (WYSIWYG editor)

Content Delivery - Separation of content from presentation. Publishing.

RSCM = Really Simple Content Management

While 2005 is marked as the year where RSS came of age, 2006 will mark the dawn of RSCM (Really Simple Content Management) -- a new protocol for the standardization of content management. By using an XML based structure CM vendors, content providers and publishers will improve productivity and knowledge management.

The RSCM protocol is a common language spoken by systems that handle content management data, such as news, articles, lists and other standard Website data.. A common language enables computers like the one on your desk to receive information from many different content management systems without being specially "trained" to understand the information from each.

Standards like RSCM exist in many different fields. Sometimes, the standard simply adopts one of many pre-existing languages that everyone agrees to use. For example, air traffic controllers at international airports all speak English, no matter what their native language, so pilots are guaranteed that they need learn only one language to fly anywhere in the world.

RSCM, like many XML standards, is a language that was built for a specific purpose, but the goal is the same: to have all computers that deal with content management, workflow, so that you can use the same desktop computer program with any CM that has adopted RSCM.

For software developers and for providers of CM applications, RSCM means having to write programs to use only one language, the common language of RSCM, in order to work with many different CM systems. This means lower costs, more products, more competition among vendors, and faster implementations of new systems.

7.12.2005

A CMS that Supports "Ad-hoc" Data

I am discovering that with all of the CMS products that are now available, the good majority do not support Ad-hoc data (A.K.A "metadata").

When it comes to standard "content" fields such as "Title", "Description", "Author", "Date" most CMS tools have a means to publish and search on these fields. This of course also makes sense when it comes to the standards for syndication -- RSS, ATOM, etc..

But what happens when other industry specific data needs to go into your CMS? While there are endless scenarios that can be applied -- consider the Real Estate Industry. Realtors (NAR) are now formulating the industry standard RETS (Real Estate Transaction Standard) specification. This is an XML-based protocol that will define common fields for real estate listings and transactions.

Ideally, for a CMS to assist with the support of RETS, it would require a means for CMS administrators to "add-on" some of the RETS fields:
"Bedrooms", "Bathrooms", "Acres", "Rental", "W/D", etc..

So now when a content item (page) gets created, we can apply our custom real estate data to our standard CMS data.

"Title"
"Description"
"Location"
"Bedrooms"
"Bathrooms"
etc...

PortalApp does support this "ad-hoc" data, which means it can be used to publish or index any content fields as defined by the CMS's adminstrator. This means that "content" can literally be anything from a "news article" to "real estate listing" to "classified ad" to "tech note".

For example, here is how you create an article with PortalApp:
http://www.portalapp.net/content.asp?contenttype=Article

AND, here is how you create a real estate listing with PortalApp:
http://www.portalapp.net/content.asp?contenttype=Real%20Estate

(Login using Admin, Admin if you want to try it yourself)

Let me know when you find another CMS that will allow you to create custom (ad-hoc, metadata) fields to accomodate industry specific data.

, ,