Planet Hippo
Ard Schrijvers (Hippo) — Relevance scoring your search results with the HST QueryJuly 28, 2010 Typically, customers like it when a title matches some query, that this item gets scored higher than a match for the query only in the documents body. Now, without going into the subtle details of Lucene scoring, by default all text in a Hippo Document is indexed with equal weight (assumi Read more... |
Jasha Joachimsthal (Hippo) — Reusing content with Hippo CMSJuly 27, 2010 It may sound very simple, but it's something we have to keep telling: in Hippo CMS you're managing content, not webpages. Even for a simple site as mine, a document can appear in multiple forms. There's the detail page of a blog post which you may see now. You may have seen the title, date, introduction and tags in the overview or the faceted navigation. It's also very well possible that you read this blog post in Google Reader and you have never seen my website at. Now that's already 3 different ways of showing content of the same document. To be honest, the RSS feed may be a default feature for most systems now, but you can do more with the content. One of the projects I have worked on recently was for a company with several rental locations spread over the country. For each rental location it maintains a document in the CMS with the address data including GPS coordinates. If a rental location is temporarily closed, there's a special field for it in the document. In the front end there are multiple views on that document. The most obvious is a webpage with the full details of the rental location like the address (and a link to a Google Map), directions, opening hours and optionally the message that the location is temporarily closed. To get to this view, there's a search box on the homepage with autocomplete for all the locations. This autocomplete list is created dynamically by a query over all rental location documents, the editors don't have to maintain a separate list. If a visitor of the site ignores the autocomplete list and only enters the city name, he or she will get a list of all rental locations in that city plus a Google Map showing the locations. The pointers on this Google Map are generated on the fly based on the search term the visitor entered. On the homepage the visitor can click on a link to see which rental locations are temporarily closes. This is to inform customers who use the rental product frequently, that their location is temporarily closed but will be available again. The list, which is hopefully empty, is a result of a query on all rental locations with the special field enabled for "temporarily closed". Now this is only the content reuse within the site itself. We have also created an HST component that produces a list of all rental locations in KML format. This XML output can be used to import into Google Maps to display a map of all rental locations on an external site. There are also plans to create mobile phone applications to find a rental location near you or a dynamically generated PDF that lists all the rental locations. All these views are using the same datasource: the documents that represent the rental locations. Every view is generated at request which means that updates are immediately visible. Are you still maintaining a webpage? |
Tjeerd D. Brenninkmeijer (Hippo) — Performance does matter..July 21, 2010 Google will be using site speed in web search ranking. A quick website is no longer just a nice-to-have as Google is using a new signal in their search ranking algorithms: site speed. Site Read more... |
Jasha Joachimsthal (Hippo) — Show Tweets with HST and Twitter4JJuly 20, 2010 As you may have noticed, my five latest Tweets show up on my site. In this blog I'll explain how you can easily add such a block to your HST site. For the Twitter component I've used Twitter4J to retrieve my latest tweets. The first step is to add its dependency to your CMS pom: <dependency> <groupId>org.twitter4j</groupId> <artifactId>twitter4j-core</artifactId> <version>[2.1,)</version> </dependency> Then create your TwitterComponent that extends org.hippoecm.hst.component.support.bean.BaseHstComponent. In your TwitterComponent add a doBeforeRender method that will fetch your latest updates. The quick (and a bit dirty) way is to authenticate using a Twitter username and password. Twitter4J also supports using oAuth which you may prefer over storing your Twitter credentials. First get a Twitter instance with your credentials (wil be deprecated see update at the end of this article): Twitter twitter = new TwitterFactory().getInstance([username], [password]); Then get your Tweets and ReTweets. Twitter does not return a combined list of Tweets and ReTweets because of backwards compatibility so you'll have to combine them yourself. You probably want to show the newest first so you'll have to use a descending sort order based on the ID of the Status. try {
List<Status> statuses = twitter.getUserTimeline();
List<Status> retweets = twitter.getRetweetedByMe();
statuses.addAll(retweets);
Set<Status> allStatuses = new TreeSet<Status>(Collections.reverseOrder());
allStatuses.addAll(statuses);
allStatuses.addAll(retweets);
if (!allStatuses.isEmpty()) {
request.setAttribute("statuses", allStatuses);
}
} catch (TwitterException e) {
log.warn("Error getting Twitter status updates", e);
}
To display the 5 newest (Re)Tweets, use this in your JSP (don't forget to add the taglibs): <ul>
<c:forEach items="${statuses}" var="status" begin="0" end="4">
<li>
<c:choose>
<c:when test="${status.retweet}">
RT ${status.retweetedStatus.user.screenName}: ${status.retweetedStatus.text}<br />
Retweeted at
<a href="http://twitter.com/${status.retweetedStatus.user.screenName}/status/${status.retweetedStatus.id}" rel="external">
<fmt:formatDate value="${status.createdAt}" pattern="d MMM H:mm"/></a>
</c:when>
<c:otherwise>
${status.text}<br />
<a href="http://twitter.com/${status.user.screenName}/status/${status.id}" rel="external">
<fmt:formatDate value="${status.createdAt}" pattern="d MMM H:mm"/></a>
</c:otherwise>
</c:choose>
</li>
</c:forEach>
</ul>
Note: Twitter4J does not have a caching mechanism yet. Twitter allows you to do 150 API calls per hour (excluding posting updates). If you exceed that limit, it will return a 400 (bad request) instead of your latest (Re)Tweets.
Update about authentication (22-07-2010)I totally overlooked the warning by Twitter that the basic authentication is going to be shut down from August 16 in favour of oAuth. If you need a quick & dirty way to generate your Autorization secrets, register your application (choose for Application Type client) and read this blog to generate your AccesToken. Then you can get a Twitter instance with: AccessToken accessToken = new AccessToken([token],[tokenSecret]); Twitter twitter= new TwitterFactory().getOAuthAuthorizedInstance([consumerKey], [consumerSecret], accessToken); |
Rolf van der Steen (Hippo) — Usability test: Insert / Modify ImageJuly 08, 2010 A call to Hippo CMS7 authors, editors and admins! Please join in on the next usability test. This test is about inserting and editing images while editing a document. Please use the following URL to start the test: http://usabilla.com/rate/5077836124c35 Please don't hesitate to join in and speak up. Your opinion is much appreciated! Note on Usabilla (the tool I'm using for these tests): Participating is anonymous; It is not possible for me to see who has participated. If you like to get in touch personally, please state your email in a note in the test. |
Recent Posts
- Ard Schrijvers (Hippo) (feed)
- Arje Cahn (Hippo) (feed)
- Arthur Bogaart (Hippo) (feed)
- David Taylor (Hippo) (feed)
- Dennis Dam (Hippo) (feed)
- Jasha Joachimsthal (Hippo) (feed)
- Jeroen Reijn (Hippo) (feed)
- Jeroen Verberg (Hippo) (feed)
- Lars Peters (Hippo) (feed)
- Mathijs Brand (Hippo) (feed)
- Niels van Kampenhout (Hippo) (feed)
- Rolf van der Steen (Hippo) (feed)
- Tjeerd D. Brenninkmeijer (Hippo) (feed)
- Vijay Kiran (Hippo) (feed)
- Woonsan Ko (Hippo) (feed)
