B ilding a icle empla e f e m s p p la j nal a icles in .NET Integrated barcode 39 in .NET B ilding a icle empla e f e m s p p la j nal a icles

How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
B ilding a icle empla e f e m s p p la j nal a icles using vs .net todraw bar code 39 on web,windows application .NET Framework 2.0 We have added view c barcode 3/9 for .NET ounter on journal articles. We have already built VM service for the most popular articles too.

Now let"s build an article template for them.. Se ing p e defa l a icle ype l l As mentioned earlier .net framework 3 of 9 barcode , there is a set of types of journal articles, for example, announcements, blogs, general, news, press-release, updates, article-tout, article-content, and so on. In real case, only some of these types will require view counter, for example article-content.

Let"s configure the default article type for mostly popular articles. We can add the following line at the end of portal-ext. properties.

. ext.most_popular_articles.article_type=article-content The code above shows that the default article type for most_popular_articles is article-content. [ 290 ]. This material is cop .net framework Code 39 Full ASCII yright and is licensed for the sole use by Richard Ostheimer on 20th June 2009 2205 hilda ave., , missoula, , 59801.

8 . Se ing p e a icle empla e Let"s create a templ ate named MOST_POPULAR_ARTICLES via the portlet Web Content with the following content:. #set ($extVelocityTo Code 3 of 9 for .NET olUtil = $utilLocator.findUtil ("com.


ExtVelocityToolUtil")) #set ($currentURL = $request.render-url.substring(0, $request.

renderurl.indexOf(" "))) #set ($results = $extVelocityToolUtil.getMostPopularArticles( $companyId, $groupId, $propsUtil.

get( "ext.most_popular_articles.article_type"), 10)) <div style="border: 1px solid #cccccc; padding: 4px; text-align: left; "> <div><h5>Most Popular Content </h5></div> #foreach ($result in $results) <div> <a href="$currentURL p_p_id=extJournalContent&p_p_lifecycle=0 &_extJournalContent_assetId=$result.

getAssetId() "> <strong>$result.Title</strong> </a> $result.viewCount views </div> #end </div>.

The code above shows how to use the extVelocityToolUtil. getMostPopularArticles method to get the most popular articles via companyId, groupId, article_type and the number of articles (10). Then it shows the most popular articles with title and view count.

. P ing all a icle empla es ge e Finally, we need to update the ARTICLE_CONTENT template via the portlet Web Content in order to merge the POLL, RELATED_CONTENT, and MOST_POPULAR_ARTICLES templates. Thus, we will have one integrated view for polls, related articles, and the most popular articles. To do so, add the following line after the line #parse ("$journalTemplatesPath/RELATED_Content") in the ARTICLE_CONTENT template:.

#parse ("$journalTem Code-39 for .NET platesPath/MOST_POPULAR_ARTICLES"). Cool! You have built dynamic articles with polls, related content, and the most popular articles successfully. If you created an article with the Article Content type and tags, the polls, related content, and most popular articles (TOP 10) will come out altogether..

[ 291 ]. This material is cop yright and is licensed for the sole use by Richard Ostheimer on 20th June 2009 2205 hilda ave., , missoula, , 59801. Building a Personalized Community Having a andle n view c n e f asse s Assets could be jour 3 of 9 for .NET nal articles, Wiki articles, blog entries, Message Boards threads, Image Gallery images, Document Library documents, bookmark entries, and so on. Although the function of view counter for these assets is provided in the TagsAssetModel model at the com.


model package in the folder /portal/portal-service/src, Message Boards threads and bookmark entries still use their own models. At the same time, Image Gallery images and Document Library documents do not use the TagsAssetModel model for view counter yet. Therefore, it would be nice to look at view counter for these assets in detail.

. Using j nal a icle kens We have added the vi VS .NET 3 of 9 ew counter feature in JSP file successfully. Here we have one more option: adding the views counter through the journal articles token.

You can just add a @view_counter@ token to either the content of journal article or the output of article template used. This token is automatically translated to the logic of view counter increment. To find out the logic, locate the Java file ViewCounterTransformerListener.

java at the com.liferay.portlet.

journal. util package in the folder /portal/portal-impl/src and open it. Check out the following lines:.

protected String rep lace(String s) { Map<String, String> tokens = getTokens(); String articleResourcePK = tokens.get("article_resource_pk"); String counterToken = StringPool.AT + "view_counter" + StringPool.

AT; StringBuilder sb = new StringBuilder(); sb.append("<script type=\"text/javascript\">"); sb.append("Liferay.


incrementViewCounter"); sb.append("({className:""); sb.append("com.


model.JournalArticle", "); sb.append("classPK:"); sb.

append(articleResourcePK); sb.append("});"); sb.append("</script>"); s = StringUtil.

replace(s, counterToken, sb.toString()); return s; }. The code above shows visual .net ANSI/AIM Code 39 the same logic as that of the journal article JSP file that was mentioned earlier. Because it is AJAX-based, even if the page is cached somewhere in a proxy, you will get the correct number of views counted.

. [ 292 ]. This material is cop Visual Studio .NET Code 39 Full ASCII yright and is licensed for the sole use by Richard Ostheimer on 20th June 2009 2205 hilda ave., , missoula, , 59801.

Copyright © . All rights reserved.