reffec.com

W a "s appening in .NET Generating 3 of 9 barcode in .NET W a "s appening

12. using barcode printer for .net framework control to generate, create code 3/9 image in .net framework applications. About QR Code As you can see, search barcode 3/9 for .NET results share a simple format. That is, search results with the same formats are against Document Library, Image Gallery, Blogs, Bookmarks, Directory, Message Boards, Wikis, and Web Content.

How do you add the OpenSearch capability on custom portlets In this section, we"re going to answer these questions related to search and OpenSearch.. W a "s appening In fact, Liferay porta barcode 39 for .NET l supports OpenSearch standard (or called federated search). That is, it returns search results from multiple content sources including Liferay portlets and external integrated applications.

The OpenSearch interface has been specified in com.liferay.portal.

kernel.search.OpenSearch under the /portal/portal-kernel/src/ folder with the following code:.

public interface OpenS earch { public boolean isEnabled(); public String search(HttpServletRequest request, String url) throws SearchException; public String search( HttpServletRequest request, String keywords, int startPage, int itemsPerPage, String format) throws SearchException; }. The code above shows a Code 39 Extended for .NET n interface OpenSearch. It specifies the isEnabled method to either enable or disable the OpenSearch capability first.

Then it specifies two search methods with different parameters. Thus, we can use the search method either by the URL parameter or by the parameters keywords, startPage, itemsPage, and format based on different requirements. OpenSearch is a collection of simple formats for the sharing of search results, which is suitable for syndication and aggregation, and a way for web sites and search engines to publish search results in a standard and accessible format.

Refer to http://www.opensearch.org for more information.

. [ 481 ]. Using Common API As you can see, the ab stract class com.liferay.portal.

search. BaseOpenSearchImpl in the /portal/portal-impl/src/ folder implements the com.liferay.

portal.kernel.search.

OpenSearch interface. The com.liferay.

portlet.directory.util.

DirectoryOpenSearchImpl class goes further to extend com.liferay.portal.

search.BaseOpenSearchImpl. For this reason, the Search portlet includes the search results from the Directory portlet.

The com.liferay.portal.

search.HitsOpenSearchImpl abstract class extends the com.liferay.

portal.search.BaseOpenSearchImpl abstract class.

It adds the getHits, getSearchPath, and getTitle methods and, moreover, it overrides the search method. In addition, a set of classes extend the com.liferay.

portal.search.HitsOpenSearchImpl abstract class some of which are com.

liferay.portlet.wiki.

util.WikiOpenSearchImpl, com.liferay.

portlet. blogs.util.

BlogsOpenSearchImpl, com.liferay.portlet.

journal.util. JournalOpenSearchImpl, and so on.

Note that HitsOpenSearchImpl is different from BaseOpenSearchImpl as it extends BaseOpenSearchImpl and adds search hits (for example, start locations, search time, length, scores, and so on). You can refer to com.liferay.

portal.kernel.search.

Hits in the /portal/portal-kernel/ src folder. Further, the OpenSearch implementation must be registered via the open-searchclass tag in liferay-portlet.xml under the /portal/portal-web/docroot/ WEB-INF folder.

The open-search-class value must be a class that implements com.liferay.portal.

kernel.search.OpenSearch and is called to get search results in the OpenSearch standard.

The following code shows the OpenSearch registration of the Web Content portlet:. <portlet> <po .NET 3 of 9 rtlet-name>15</portlet-name> <icon>/html/icons/default.png</icon> <struts-path>journal</struts-path> <configuration-action-class> com.

liferay.portlet.journal.

action.ConfigurationActionImpl </configuration-action-class> <indexer-class> com.liferay.

portlet.journal.util.

Indexer </indexer-class> <open-search-class> com.liferay.portlet.

journal.util.JournalOpenSearchImpl </open-search-class> s<! ignore details --> </portlet>.

The code above describ es the open-search-class tag with the com.liferay. portlet.

journal.util.JournalOpenSearchImpl value, thus implementing com.

liferay.portal.kernel.

search.OpenSearch indirectly..

[ 482 ]. 12 . Similarly, you can fin bar code 39 for .NET d the OpenSearch registration of the Wikis, Blogs, Document Library, Image Gallery, Bookmarks, and Message Boards portlets in liferay-portlet.xml.

. Adding e OpenSea c capabili y n c s m p le s How to add the OpenSea Code 3 of 9 for .NET rch capability on custom portlets In general, there are two steps to add the OpenSearch capability on custom portlets: 1. Prepare a class that implements the OpenSearch interface.

2. Register the class as the value of the open-search-class tag in liferay-portlet.xml.

Let"s take a look at the OpenSearch capability using an example: alfresco-content-portlet. Check out the alfresco-content-portlet portlet from svn://svn.liferay.

com/repos/public/plugins/trunk/portlets/ alfresco-content-portlet to $PLUGINS_SDK_HOME/portlets/alfrescocontent-portlet. As mentioned earlier, all portlets stay in the $PLUGINS_SDK_ HOME/portlets folder, and $PLUGINS_SDK_HOME is the current plugins SDK home. Refresh the $PLUGINS_SDK_HOME project and you will see the alfresco-contentportlet folder in $PLUGINS_SDK_HOME/portlets/.

You will see that a com. liferay.alfrescocontent.

util.AlfrescoOpenSearchImpl class in the. as follows:. $PLUGINS_SDK_HOME/port VS .NET USS Code 39 lets/alfresco-content-portlet/docroot/WEB-INF/ src folder implements com.liferay.

portal.kernel.search.

OpenSearch. public class AlfrescoO penSearchImpl implements OpenSearch { // ignore details public boolean isEnabled() { return ENABLED;} public String search(HttpServletRequest request, String url) throws SearchException { String xml = StringPool.BLANK; if (!ENABLED) { if (_log.isDebugEnabled()) { _log.

debug("Search is disabled"); } return xml; } if (_log.isDebugEnabled()) { _log.debug("Search with " + url); } try { xml = HttpUtil.

URLtoString(url, HOST, PORT, REALM, [ 483 ]. Using Common API USERN .net vs 2010 39 barcode AME, PASSWORD); } catch (IOException ioe) { _log.error("Unable to search with " + url, ioe); } return xml; } public String search( HttpServletRequest request, String keywords, int startPage, int itemsPerPage, String format) throws SearchException { String url = PROTOCOL + "://" + SEARCH_URL + " q=" + HttpUtil.

encodeURL(keywords) + "&p=" + startPage + "&c=" + itemsPerPage + "&guest=&format=" + format; return search(request, url); } }. The code above describ es the AlfrescoOpenSearchImpl class which implements OpenSearch. The methods which have been specified and implemented in the OpenSearch interface are isEnabled and search. Then, you need to add the AlfrescoOpenSearchImpl class as the value of the open-search-class tag in liferay-portlet.

xml under the $PLUGINS_SDK_HOME/portlets/alfrescocontent-portlet/docroot/WEB-INF folder. Eventually, you are not required to add this, as it already exists in liferay-portlet.xml as follows:.

<portlet> <po Code 3 of 9 for .NET rtlet-name>1</portlet-name> <icon>/icon.png</icon> <configuration-action-class> com.

liferay.alfrescocontent.action.

ConfigurationActionImpl </configuration-action-class> <open-search-class> com.liferay.alfrescocontent.

util.AlfrescoOpenSearchImpl </open-search-class> <layout-cacheable>true</layout-cacheable> <instanceable>true</instanceable> <render-weight>1</render-weight> <header-portlet-css>/portlet.css</header-portlet-css> <css-class-wrapper>alfresco-content-portlet</css-class-wrapper> </portlet>.

[ 484 ].
Copyright © reffec.com . All rights reserved.