{"id":2033,"date":"2017-11-08T08:48:26","date_gmt":"2017-11-08T08:48:26","guid":{"rendered":"https:\/\/www.enprowess.com\/blogs\/?p=2033"},"modified":"2022-04-28T11:18:04","modified_gmt":"2022-04-28T05:48:04","slug":"felix-gogo-shell-custom-command-liferay-7","status":"publish","type":"post","link":"https:\/\/www.enprowess.com\/blogs\/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 loading=\"lazy\" class=\"aligncenter size-full wp-image-2036\" src=\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_1.png\" alt=\"Gradle set build.gradle as\" width=\"80%\" height=\"100\" \/> <\/p>\n<p>For maven set pom.xml as<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-2037\" src=\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_2.png\" alt=\" set pom.xml\" 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 loading=\"lazy\" class=\"aligncenter size-medium wp-image-2038\" src=\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_3.png\" alt=\"update a Component\" 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 loading=\"lazy\" class=\"aligncenter size-medium wp-image-2039\" src=\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/GoGo_4.png\" alt=\"Connect to gogo shell.\" 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=\"https:\/\/www.enprowess.com\/blogs\/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":[],"categories":[8,46,1],"tags":[67,7,68,70,69,18,72,19],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Felix GoGo Shell Custom Command with Liferay 7 - EnProwess Blog<\/title>\n<meta name=\"description\" content=\"So let&#039;s see How to implement a custom Gogo shell command for Liferay 7. In this blog we will explain some other custom command.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.enprowess.com\/blogs\/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 Blog\" \/>\n<meta property=\"og:description\" content=\"So let&#039;s see How to implement a custom Gogo shell command for Liferay 7. In this blog we will explain some other custom command.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/\" \/>\n<meta property=\"og:site_name\" content=\"EnProwess Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-08T08:48:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-28T05:48:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png\" \/>\n\t<meta property=\"og:image:width\" content=\"699\" \/>\n\t<meta property=\"og:image:height\" content=\"146\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"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\":\"Organization\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#organization\",\"name\":\"EnProwess\",\"url\":\"https:\/\/www.enprowess.com\/blogs\/\",\"sameAs\":[],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2021\/07\/enprowess_logo.jpg\",\"contentUrl\":\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2021\/07\/enprowess_logo.jpg\",\"width\":1057,\"height\":697,\"caption\":\"EnProwess\"},\"image\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#website\",\"url\":\"https:\/\/www.enprowess.com\/blogs\/\",\"name\":\"EnProwess Blog\",\"description\":\"Your Enterprise solution partner\",\"publisher\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.enprowess.com\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png\",\"contentUrl\":\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png\",\"width\":699,\"height\":146,\"caption\":\"Felix GoGo Shell Custom Command with Liferay 7\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#webpage\",\"url\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/\",\"name\":\"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage\"},\"datePublished\":\"2017-11-08T08:48:26+00:00\",\"dateModified\":\"2022-04-28T05:48:04+00:00\",\"description\":\"So let's see How to implement a custom Gogo shell command for Liferay 7. In this blog we will explain some other custom command.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/www.enprowess.com\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Liferay DXP\",\"item\":\"https:\/\/www.enprowess.com\/blogs\/category\/liferay-dxp\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Felix GoGo Shell Custom Command with Liferay 7\"}]},{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#\/schema\/person\/cb84840e7dba202419065ea1c9fe7f11\"},\"headline\":\"Felix GoGo Shell Custom Command with Liferay 7\",\"datePublished\":\"2017-11-08T08:48:26+00:00\",\"dateModified\":\"2022-04-28T05:48:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#webpage\"},\"wordCount\":393,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png\",\"keywords\":[\"Apache Felix\",\"enprowess\",\"GoGo Command\",\"GoGo Custom Command\",\"GoGo Shell\",\"Liferay 7\",\"Liferay Blogs\",\"Liferay DXP\"],\"articleSection\":[\"Liferay\",\"Liferay DXP\",\"Other\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#\/schema\/person\/cb84840e7dba202419065ea1c9fe7f11\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.enprowess.com\/blogs\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b43445b202a083f6e4a2f2e7d6f43d62?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b43445b202a083f6e4a2f2e7d6f43d62?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.enprowess.com\/blogs\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess Blog","description":"So let's see How to implement a custom Gogo shell command for Liferay 7. In this blog we will explain some other custom command.","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":"https:\/\/www.enprowess.com\/blogs\/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 Blog","og_description":"So let's see How to implement a custom Gogo shell command for Liferay 7. In this blog we will explain some other custom command.","og_url":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/","og_site_name":"EnProwess Blog","article_published_time":"2017-11-08T08:48:26+00:00","article_modified_time":"2022-04-28T05:48:04+00:00","og_image":[{"width":699,"height":146,"url":"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png","type":"image\/png"}],"twitter_card":"summary","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.enprowess.com\/blogs\/#organization","name":"EnProwess","url":"https:\/\/www.enprowess.com\/blogs\/","sameAs":[],"logo":{"@type":"ImageObject","@id":"https:\/\/www.enprowess.com\/blogs\/#logo","inLanguage":"en-US","url":"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2021\/07\/enprowess_logo.jpg","contentUrl":"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2021\/07\/enprowess_logo.jpg","width":1057,"height":697,"caption":"EnProwess"},"image":{"@id":"https:\/\/www.enprowess.com\/blogs\/#logo"}},{"@type":"WebSite","@id":"https:\/\/www.enprowess.com\/blogs\/#website","url":"https:\/\/www.enprowess.com\/blogs\/","name":"EnProwess Blog","description":"Your Enterprise solution partner","publisher":{"@id":"https:\/\/www.enprowess.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.enprowess.com\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage","inLanguage":"en-US","url":"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png","contentUrl":"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png","width":699,"height":146,"caption":"Felix GoGo Shell Custom Command with Liferay 7"},{"@type":"WebPage","@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#webpage","url":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/","name":"Felix GoGo Shell Custom Command with Liferay 7 - EnProwess Blog","isPartOf":{"@id":"https:\/\/www.enprowess.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage"},"datePublished":"2017-11-08T08:48:26+00:00","dateModified":"2022-04-28T05:48:04+00:00","description":"So let's see How to implement a custom Gogo shell command for Liferay 7. In this blog we will explain some other custom command.","breadcrumb":{"@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.enprowess.com\/blogs\/"},{"@type":"ListItem","position":2,"name":"Liferay DXP","item":"https:\/\/www.enprowess.com\/blogs\/category\/liferay-dxp\/"},{"@type":"ListItem","position":3,"name":"Felix GoGo Shell Custom Command with Liferay 7"}]},{"@type":"TechArticle","@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#article","isPartOf":{"@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#webpage"},"author":{"@id":"https:\/\/www.enprowess.com\/blogs\/#\/schema\/person\/cb84840e7dba202419065ea1c9fe7f11"},"headline":"Felix GoGo Shell Custom Command with Liferay 7","datePublished":"2017-11-08T08:48:26+00:00","dateModified":"2022-04-28T05:48:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#webpage"},"wordCount":393,"commentCount":0,"publisher":{"@id":"https:\/\/www.enprowess.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#primaryimage"},"thumbnailUrl":"https:\/\/www.enprowess.com\/blogs\/wp-content\/uploads\/2017\/11\/liferay-felix.png","keywords":["Apache Felix","enprowess","GoGo Command","GoGo Custom Command","GoGo Shell","Liferay 7","Liferay Blogs","Liferay DXP"],"articleSection":["Liferay","Liferay DXP","Other"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.enprowess.com\/blogs\/felix-gogo-shell-custom-command-liferay-7\/#respond"]}]},{"@type":"Person","@id":"https:\/\/www.enprowess.com\/blogs\/#\/schema\/person\/cb84840e7dba202419065ea1c9fe7f11","name":"admin","image":{"@type":"ImageObject","@id":"https:\/\/www.enprowess.com\/blogs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/b43445b202a083f6e4a2f2e7d6f43d62?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b43445b202a083f6e4a2f2e7d6f43d62?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.enprowess.com\/blogs\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/posts\/2033"}],"collection":[{"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/comments?post=2033"}],"version-history":[{"count":5,"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/posts\/2033\/revisions"}],"predecessor-version":[{"id":3202,"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/posts\/2033\/revisions\/3202"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/media\/2043"}],"wp:attachment":[{"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/media?parent=2033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/categories?post=2033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.enprowess.com\/blogs\/wp-json\/wp\/v2\/tags?post=2033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}