{"id":2033,"date":"2017-11-08T08:48:26","date_gmt":"2017-11-08T08:48:26","guid":{"rendered":"http:\/\/www.enprowess.com\/blogs\/?p=2033"},"modified":"2022-02-08T12:06:17","modified_gmt":"2022-02-08T12:06:17","slug":"felix-gogo-shell-custom-command-liferay-7","status":"publish","type":"post","link":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/","title":{"rendered":"Felix GoGo Shell Custom Command with Liferay 7"},"content":{"rendered":"<p>Since its inception Liferay has maintained a reputation of using latest technologies to help build robust portal products and the legacy continues with Liferay 7 also. Liferay 7 has acquired many new concepts like development of single page application (SPA) , Arquillian extension for functional as well as integration testing of product, adapting OSGI framework etc.<\/p>\n<p>&nbsp;<\/p>\n<p>As part of osgi adoption, Liferay supports Apache Felix, a project to implement osgi framework and service platform developed under Apache license, however Liferay supports variety of osgi containers like equinox and knopflerfish.<\/p>\n<p>&nbsp;<\/p>\n<p>Apache Felix consist of many sub projects of which GoGo is a command line shell that allows to manage lifecycle of osgi bundle. It follows RFC147 standard and command syntax of it is based on Tiny Shell Language (TSL).<\/p>\n<p>&nbsp;<\/p>\n<p>This can be useful, when apart from managing bundle lifecycle, a custom gogo command can be implemented to automate specific processes like bulk installation of bundles, bulk activation\/deactivation of bundles etc.<\/p>\n<p>&nbsp;<\/p>\n<p>Following below sequence of steps a custom GoGo command can be created.<\/p>\n<p>&gt; Create a Liferay Module Project with project template type as \u201capi\u201d.<\/p>\n<p>&gt; Set dependencies in build file as below<\/p>\n<p>For Gradle set build.gradle as<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-2036\" src=\"http:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_1.png\" alt=\"\" width=\"80%\" height=\"100\" \/> <\/p>\n<p>For maven set pom.xml as<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-medium wp-image-2037\" src=\"http:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_2.png\" alt=\"\" width=\"80%\" height=\"250\" \/> <\/p>\n<p>&gt; Once dependencies are set build your module to add dependency jars to classpath.<\/p>\n<p>&gt; Now update a Component(that was created while creating module project) as below.<\/p>\n<p>&nbsp;<\/p>\n<p>Note: Liferay IDE also provides sample GOGO command template that can be used as a reference.To Generate it Right click your Module Project &gt; New &gt; Liferay Component Class &gt; provide package name, class name and select component class template as GoGo Command &gt; finish.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-medium wp-image-2038\" src=\"http:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_3.png\" alt=\"\" width=\"80%\" height=\"300\" \/> <\/p>\n<p>&gt; Here osgi.command.scope property is set to \u201cblade\u201d since it just need to print number of blogs in portal.<\/p>\n<p>&gt; Deploy your module.<\/p>\n<p>&gt; Connect to gogo shell.<\/p>\n<p>&nbsp;<\/p>\n<p>Note : Below is a reference link to connect gogo shell. :\u00a0<a href=\"https:\/\/dev.liferay.com\/develop\/reference\/-\/knowledge_base\/7-0\/using-the-felix-gogo-shell\">connecting felix gogo shell<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&gt; Give command blogscount, which\u00a0displays number of blogs count<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-medium wp-image-2039\" src=\"http:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_4.png\" alt=\"\" width=\"80%\" height=\"150\" \/><\/p>\n<p>Similarly this can be useful to execute our own programs with a custom command.<\/p>\n<p>&nbsp;<\/p>\n<p>For more information Apache Felix GoGo, please refer <a href=\"https:\/\/www.packtpub.com\/books\/content\/apache-felix-gogo.\">https:\/\/www.packtpub.com\/books\/content\/apache-felix-gogo.<\/a><\/p>\n<p>For more information on custom GoGo command, please refer <a href=\"http:\/\/enroute.osgi.org\/appnotes\/gogo-cmd.html\">http:\/\/enroute.osgi.org\/appnotes\/gogo-cmd.html<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>By,<\/p>\n<p>Ripal Thakkar<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since its inception Liferay has maintained a reputation of using latest technologies to help build robust portal products and the legacy continues with Liferay 7 also. Liferay 7 has acquired many new concepts like development of single page application (SPA) , Arquillian extension for functional as well as integration testing of product, adapting OSGI framework&hellip; <a class=\"more-link\" href=\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/\">Continue reading <span class=\"screen-reader-text\">Felix GoGo Shell Custom Command with Liferay 7<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2043,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18,1],"tags":[74,21,75,76,77,30,78,31],"class_list":["post-2033","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-liferay","category-liferay-dxp","category-other","tag-apache-felix","tag-enprowess","tag-gogo-command","tag-gogo-custom-command","tag-gogo-shell","tag-liferay-7","tag-liferay-blogs","tag-liferay-dxp","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Felix GoGo Shell Custom Command with Liferay 7 - EnProwess<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess\" \/>\n<meta property=\"og:description\" content=\"Since its inception Liferay has maintained a reputation of using latest technologies to help build robust portal products and the legacy continues with Liferay 7 also. Liferay 7 has acquired many new concepts like development of single page application (SPA) , Arquillian extension for functional as well as integration testing of product, adapting OSGI framework&hellip; Continue reading Felix GoGo Shell Custom Command with Liferay 7\" \/>\n<meta property=\"og:url\" content=\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/\" \/>\n<meta property=\"og:site_name\" content=\"EnProwess\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-08T08:48:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-08T12:06:17+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dev_admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#website\",\"url\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/\",\"name\":\"EnProwess\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#webpage\",\"url\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/\",\"name\":\"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess\",\"isPartOf\":{\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage\"},\"datePublished\":\"2017-11-08T08:48:26+00:00\",\"dateModified\":\"2022-02-08T12:06:17+00:00\",\"author\":{\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#\/schema\/person\/0bf4f9fb6538f60f497377ecceb54f55\"},\"breadcrumb\":{\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Felix GoGo Shell Custom Command with Liferay 7\"}]},{\"@type\":\"Person\",\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#\/schema\/person\/0bf4f9fb6538f60f497377ecceb54f55\",\"name\":\"dev_admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-content\/uploads\/2021\/05\/p3.png\",\"contentUrl\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-content\/uploads\/2021\/05\/p3.png\",\"caption\":\"dev_admin\"},\"sameAs\":[\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\"],\"url\":\"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/author\/dev_admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/","og_locale":"en_US","og_type":"article","og_title":"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess","og_description":"Since its inception Liferay has maintained a reputation of using latest technologies to help build robust portal products and the legacy continues with Liferay 7 also. Liferay 7 has acquired many new concepts like development of single page application (SPA) , Arquillian extension for functional as well as integration testing of product, adapting OSGI framework&hellip; Continue reading Felix GoGo Shell Custom Command with Liferay 7","og_url":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/","og_site_name":"EnProwess","article_published_time":"2017-11-08T08:48:26+00:00","article_modified_time":"2022-02-08T12:06:17+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dev_admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#website","url":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/","name":"EnProwess","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage","inLanguage":"en-US","url":"","contentUrl":""},{"@type":"WebPage","@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#webpage","url":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/","name":"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess","isPartOf":{"@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage"},"datePublished":"2017-11-08T08:48:26+00:00","dateModified":"2022-02-08T12:06:17+00:00","author":{"@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#\/schema\/person\/0bf4f9fb6538f60f497377ecceb54f55"},"breadcrumb":{"@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/"},{"@type":"ListItem","position":2,"name":"Felix GoGo Shell Custom Command with Liferay 7"}]},{"@type":"Person","@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#\/schema\/person\/0bf4f9fb6538f60f497377ecceb54f55","name":"dev_admin","image":{"@type":"ImageObject","@id":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/#personlogo","inLanguage":"en-US","url":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-content\/uploads\/2021\/05\/p3.png","contentUrl":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-content\/uploads\/2021\/05\/p3.png","caption":"dev_admin"},"sameAs":["http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com"],"url":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/author\/dev_admin\/"}]}},"_links":{"self":[{"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/posts\/2033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/comments?post=2033"}],"version-history":[{"count":1,"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/posts\/2033\/revisions"}],"predecessor-version":[{"id":2392,"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/posts\/2033\/revisions\/2392"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/"}],"wp:attachment":[{"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/media?parent=2033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/categories?post=2033"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ws-srv-php72.in.webmyne.com\/enprowess.com\/wp-json\/wp\/v2\/tags?post=2033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}