reffec.com

Adding Vel ci y se vices in .NET Generation barcode 3/9 in .NET Adding Vel ci y se vices

Adding Vel ci y se vices using visual .net toinclude barcode 3 of 9 on asp.net web,windows application ISBN - 13 In order to get the j Visual Studio .NET barcode 39 ournal article and asset ID through a group ID and an article ID, we need to add Velocity services. First, let"s prepare ExtVelocityToolUtil as follows: 1.

Create a package named com.ext.portal.

service in the /ext/ext-impl/ src folder; create an interface ExtVelocityToolService, and add service interface methods.. public JournalArticle getJournalArticle(String groupId, String articleId); public String getAssetId(String groupId, String articleId);. 2. Create a package n USS Code 39 for .NET amed com.

ext.portal.service.

impl in the /ext/extimpl/src folder; create a class ExtVelocityToolServiceImpl, and then add service methods implementation as follows:. public String getAsse tId(String groupId, String articleId) { String assetId = ""; [ 258 ]. This material is copy .NET Code 39 right and is licensed for the sole use by Richard Ostheimer on 20th June 2009 2205 hilda ave., , missoula, , 59801.

7 try{ JournalArticl e journalArticle = JournalArticleLocal ServiceUtil.getArticle(new Long(groupId), articleId); TagsAsset asset = TagsAssetLocalServiceUtil. getAsset(JournalArticle.

class.getName(), journalArticle.getResourcePrimKey()); assetId = String.

valueOf(asset.getAssetId()); } catch (Exception e){ return assetId; } return assetId; } public JournalArticle getJournalArticle(String groupId, String articleId) { JournalArticle journalArticle = null; try{ journalArticle = JournalArticleLocalServiceUtil.getArticle(new Long(groupId).

longValue(), articleId); } catch (Exception e){ return journalArticle; } return journalArticle; } public String getAssetId(String groupId, String articleId) { String assetId = ""; try{ JournalArticle journalArticle = JournalArticleLocalServiceUtil .getArticle(new Long(groupId).longValue(), articleId); TagsAsset asset = TagsAssetLocalServiceUtil.

getAsset (JournalArticle.class.getName(), journalArticle.

getResourcePrimKey()); assetId = String.valueOf(asset.getAssetId()); } catch (Exception e){ return assetId; } return assetId; }.

3. Create a package n barcode 3/9 for .NET amed com.

ext.portal.util in the /ext/ext-impl/src folder.

Next create a ExtVelocityToolUtil class and consume the above service and method as follows:. public String getAsse tId(String groupId, String articleId){ return _extVelocityToolService.getAssetId(groupId, articleId); } public JournalArticle getJournalArticle(String groupId, String articleId){. [ 259 ]. This material is copy right and is licensed for the sole use by Richard Ostheimer on 20th June 2009 2205 hilda ave., , missoula, , 59801. Customizing CMS and W VS .NET barcode 3/9 CM return _extVelocityToolService.getJournalArticle (groupId,articleId); } public static ExtVelocityToolService getExtVelocityToolService(){ return _extVelocityToolService; } public void setExtVelocityToolService(ExtVelocityToolService extVelocityToolService){ _extVelocityToolService = extVelocityToolService; } private static ExtVelocityToolService _extVelocityToolService;.

As shown in the code above, ExtVelocityToolUtil specifies the methods getJournalArticle (getting journal article through group ID and article ID) and getAssetId (getting asset ID through group ID and article ID). Accordingly, we need to wire them all together. To do that, add the following lines after the line <beans> in the /ext/ext-impl/src/META-INF/ext-spring.

xml file:. <bean id="com.ext. 3 of 9 barcode for .

NET portal.service.ExtVelocityToolService" class="com.

ext.portal.service.

impl.ExtVelocityToolServiceImpl" /> <bean id="com.ext.

portal.util.ExtVelocityToolUtil" class="com.

ext.portal.util.

ExtVelocityToolUtil"> <property name="extVelocityToolService" ref="com.ext.portal.

service.ExtVelocityToolService" /> </bean> <bean id="com.ext.

portal.util.ExtVelocityToolUtil.

velocity" class="org.springframework.aop.

framework.ProxyFactoryBean" parent="baseVelocityUtil"> <property name="target" ref="com.ext.

portal.service.ExtVelocityToolService" /> </bean>.

As shown in the code above, the XML file specifies beans ExtVelocityToolService, ExtVelocityToolUtil, and ExtVelocityToolUtil.velocity..

B ilding s s c e and empla e We have successfully added Velocity services. Now let"s create touts structure and template. Accordingly, create three articles with the Article Tout type and the names Our Mission, Our Process, and Who-We-Are, respectively.

Then find articles IDs for these journal articles; for example, 13201, 13206, and 13211. Note that in runtime, these articles IDs would be different. Further, let"s create a structure TOUT as follows: 1.

In the Journal portlet, click on the Structure tab. 2. Click on the Add Structure button and provide input for ID, name, and description as TOUT.

. [ 260 ]. This material is copy right and is licensed for the sole use by Richard Ostheimer on 20th June 2009 2205 hilda ave., , missoula, , 59801. 7 . 3. Click on the Launc h Editor button, add the following lines, and save it:. <root> <dyna .net framework Code-39 mic-element name="Article_Touts" type="multi-list"> <dynamic-element name="13201" type="Our-Mission"> </dynamic-element> <dynamic-element name="13206" type="Our-Process"> </dynamic-element> <dynamic-element name="13211" type="Who-We-Are"> </dynamic-element> </dynamic-element> </root>. The code above specif ies a multiple list with journal articles: Our Mission, Our Process, and Who-We-Are. By the way, this is a static solution specifying a multiple list in a structure. That is, if you want to change this multiple list, you have to manually update these journal articles IDs and titles in the structure.

A dynamic solution is also available if you specify this multiple list as Template Node. For more details about dynamic solution, for example polls, refer to the next section..

#set ($extVelocityToo .NET Code 39 lUtil = $utilLocator.findUtil("com.

ext.portal. util.

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

render-url.indexOf(" "))) #set ($touts = $Article_Touts.options) <table width="100%" cellpadding="0" cellspacing="0"> #foreach ($tout in $touts) #set ($ja = $extVelocityToolUtil.

getJournalArticle($groupId, $tout)) #set ($assetId =$extVelocityToolUtil.getAssetId($groupId, $tout)) #set ($path = $currentURL + " p_p_id=extJournalContent&p_p_ lifecycle=0&_extJournalContent_assetId=" + $assetId) <tr> <td style="width:120px; height: 100%; padding: 0px 0px; vertical-align:top;"> <a href="$path"> <img src="/image/image_gallery img_id=$ja.getSmallImageId()"/> </a> </td> <td style="width: 250px; height: 100%; padding: 0px 0px; vertical-align:top;"> <a href="$path"> <div style="font-size: 12pt; font-weight: bold; "> $ja.

getTitle() </div> </a> <div style="font-size: 10pt; font-weight: normal; "> $ja.getDescription() </div> </td> </tr> [ 261 ]. This material is copy right and is licensed for the sole use by Richard Ostheimer on 20th June 2009 2205 hilda ave., , missoula, , 59801. Customizing CMS and W barcode 39 for .NET CM <tr> <td style="border-bottom: 0.05em dotted #ADADAF; padding-top: 2px; height: 10px; " colspan="2"> </td> </tr> <tr> <td style="height: 10px; " colspan="2"></td> </tr> #end </table>.

As shown in the code above, the TOUT template consumes Velocity services: extVelocityToolUtil getJournalArticle, and getAssetId. It also provides a simple look and feel. Of course, you can update the look and feel any time.

.
Copyright © reffec.com . All rights reserved.