Wednesday, 30 August 2017

Liferay integration with solr 



Configure solr with Tomcat 7 


Step -1 
-  Download Solr from apache website. Here we are using solr 4.*.*.(solr-4.3.1.tgz)

-  Download tomcat from apache website(apache-tomcat-7.0.75.zip).

-  Create a  folder called "solr".

-  Unzip both files on solr folder.(  tar -xvf yourfile.tar)

-  Copy solr<version>.war from <extracted_solr>\dist 
    to <extracted_tomcat>\webapps and rename solr<version>.war to solr.war.

-  Copy all jars in <extracted_solr>\example\lib\ext  to <extracted_tomcat>\lib.
      Change the port to 8006

         <Server port="8005" shutdown="SHUTDOWN">
             Change ajp port to 8008
         <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
-  Change the port to 8983  in server.xml file of tomcat . (in different instance no need for this step)

-  Start the tomcat.
-  Check New folder names solr would be available in webapps.

-  Shutdown the tomcat.

-  Modify web.xml located at <extracted_tomcat>\webapps\solr\WEB-INF
         Uncomment below entry and update the path for solr\home.

      <env-entry>  <env-entry-name>solr/home</env-entry-name>   <env-entry-value>    <extracted_solr>C:/Solr/solr-4.3.1/example/solr</env-entry-value> <env-entry-type>java.lang.String</env-entry-type></env-entry>

- Start the tomcat and access the below URL.
      http://[IP ADDRESS]:[PORT]/solr or  http://localhost:[PORT]/solr

Step-2:

Setup solr-web plugins in liferay :

*  Download the solr web from liferay market place (Liferay Solr 4 Search Engine.lpkg) .
*  Copy the solr-web war file to deploy folder of liferay-server
*  After solr-web  plugin is deployed in Liferay, stop Liferay Tomcat server.
-  Go to <Liferay>/tomcat-7.0.27/webapps/solr-web/WEB-INF/conf directory.
-  Copy and replace schema.xml file to <extracted_solr>example/solr/collection1/conf directory on         solr server.

* Go to < liferay>/tomcat-7.0.42/webapps/solr4-web/WEB-INF/classes/ 
    Edit solr.properties file to update  with property server.http.url
    And value should be< solr-ip>:8983/solr


* Edit the solrconfig.xml file and update the values as below 
     <extracted_solr>example/solr/collection1/conf directory on Solr Server.
        <autoCommit> 
             <maxTime>10000</maxTime> 
            <openSearcher>true</openSearcher> 
     </autoCommit>

*  Creare the log4j.properties file in C:\Solr\apache-tomcat-7.0.75\lib and add the below properties

    #  Logging level
       log4j.rootLogger=INFO, file, CONSOLE

       log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender

   #log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
     log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x \u2013 %m%n

   #- size rotation with log cleanup.
    log4j.appender.file=org.apache.log4j.RollingFileAppender
    log4j.appender.file.MaxFileSize=4MB
    log4j.appender.file.MaxBackupIndex=9

   #- File to log to and log format
    log4j.appender.file.File=C:\\Solr\\apache-tomcat-7.0.75\\logs\\solr.log
    log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %C; %m\n

    log4j.logger.org.apache.zookeeper=WARN

- After above changes are done, first start the Solr Tomcat Server after start Liferay Tomcat server.
- When Liferay Server starts successfully, follow below steps,
     -> Login with admin user
     -> Go to the Control Panel > Server > Server Administration.
     -> Click on Execute Button beside Reindex all search indexes.

Tuesday, 21 February 2017

Update Document and Media MetaData Field values : 
=========================================


I want to store documents in specific User own document type.

Goto Content -> Document and Media -> click Manage -> Click Add Document Types

Name : SSC Document

Add the 3 MetaData fields for SSC Document like Expire Date ,Date and Language.

<root available-locales="en_US" default-locale="en_US">
<dynamic-element dataType="string" indexType="keyword" localizable="true" multiple="false" name="select" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width="">
<dynamic-element name="option3863" type="option" value="English">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[English]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option5214" type="option" value="French">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[French]]>
</entry>
</meta-data>
</dynamic-element>
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Select Language]]>
</entry>
<entry name="predefinedValue">
<![CDATA[[""]]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element dataType="date" fieldNamespace="ddm" indexType="keyword" localizable="true" name="expiryDate" readOnly="false" repeatable="false" required="false" showLabel="true" type="ddm-date" width="small">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Expiry Date]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element dataType="string" indexType="keyword" localizable="true" multiple="false" name="role" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width="">
<dynamic-element name="option4347" type="option" value="Sales Document Approver">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Sales Document Approver]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option4348" type="option" value="Parts Document Approver">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Parts Document Approver]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option4349" type="option" value="Service Document Approver">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Service Document Approver]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option4350" type="option" value="Marketing Document Approver">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Marketing Document Approver]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option4351" type="option" value="Management Document Approver">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Management Document Approver]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option4352" type="option" value="Accounting Document Approver">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Accounting Document Approver]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option3746" type="option" value="Portal Admin Document Approver">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Portal Admin Document Approver]]>
</entry>
</meta-data>
</dynamic-element>
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Approved By]]>
</entry>
<entry name="predefinedValue">
<![CDATA[[""]]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
</root>


While adding the documents in Document and Media.

Goto Content -> Document and Media -> Click Add section and Select SSC Document

Add the document and give to fields values like Expire Date ,Date and Language

Save the document.

Update the ExpiryDate MetaData field value programatically:

Step 1 : 

get the SSC Document structure id value
DDMStructure agcoStructure = null;
DLFileEntry dlFileEntry = null;
List<DDMStructure> ddmStructure = DDMStructureLocalServiceUtil.getDDMStructures(0,DDMStructureLocalServiceUtil.getDDMStructuresCount());

for (DDMStructure structure : ddmStructure) {
if (structure.getName(Locale.getDefault()).equalsIgnoreCase(DocumentUpdaterConstants.AGCO_DOCUMENT_TYPE)) {
agcoStructure = structure;
break;
}
}

Step 2 :

Get the dlfileentry Id

ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = themeDisplay.getCompanyId();
String fileEntryUUId = "d5254c81-8924-4d24-bd5e-c6f3fdce1113";
dlFileEntry = DLFileEntryLocalServiceUtil.getDLFileEntryByUuidAndCompanyId(fileEntryUUId, companyId);

long fileEntryTypeId = dlFileEntry.getFileEntryTypeId();
long version = dlFileEntry.getFileVersion().getFileVersionId();
long dlfileEntryId = dlFileEntry.getFileEntryId();

String expirationDate = "6/28/2016";

Step 3 :

Convert string to date and Make sure every date value will be store in string value so,convert date to Serializable
Serializable date = null;
SimpleDateFormat simpleDateFomat = new SimpleDateFormat("MM/dd/yyyy");
Date convertedExpirationDate = null;
convertedExpirationDate = simpleDateFomat.parse(expirationDate);
date = String.valueOf(convertedExpirationDate.getTime());

Step 4:

Get the MetaData filed value
Field fieldExpiryDate = new Field("expiryDate", date);  // expiryDate field value identify in DDMConent table

Step5 : 

Create the object of field class

Fields fields = new Fields();
fields.put(fieldExpiryDate);

Step 6 :

Create the map object generic classes of fields and pass the Structure key
Map<String, Fields> fieldsMapFinal = new HashMap<String, Fields>();
fieldsMapFinal.put(agcoStructure.getStructureKey(),fields);
DLFileEntryMetadataLocalServiceUtil.updateFileEntryMetadata(fileEntryTypeId,dlfileEntryId, version, fieldsMapFinal,serviceContextDLFile);

update success

Step 7:

When ever we can modify or update the Document new version will be created
In the above case new version couldn't create, follow below it will be update new version

ServiceContext serviceContext = new ServiceContext();
String sourceFileName = dlFileEntry.getTitle();
serviceContext.setAttribute("fileEntryTypeId", fileEntryTypeId);
FileEntry fileEntry = DLAppServiceUtil.getFileEntry(themeDisplay.getSiteGroupId(), dlFileEntry.getFolderId(),dlFileEntry.getTitle());
InputStream is = DLFileEntryLocalServiceUtil.getFileAsStream(themeDisplay.getUserId(), dlfileEntryId,fileEntry.getVersion(), false);
File file = DLFileEntryLocalServiceUtil.getFile(themeDisplay.getUserId(), dlfileEntryId,fileEntry.getVersion(), false);
DLAppServiceUtil.updateFileEntry(dlfileEntryId, sourceFileName,MimeTypesUtil.getContentType(dlFileEntry.getTitle()),dlFileEntry.getTitle(),
dlFileEntry.getDescription().concat(StringPool.SPACE),StringPool.BLANK, Boolean.FALSE, is, file.length(),serviceContext);

Wednesday, 16 November 2016

Working with (Three Level) Kaleo Workflow Liferay6.2 :



I have to implement based on roles type of three level workflow.

1) Create three users

 Users and Organisation -> Select add users

                          User 1 :   workflow1@liferay.com

                          User 2 :   Workflow2@liferay.com

                          User 3 :   Workflow3@liferay.com

2) Create two Regulars Roles

                         Role 1 :  approver1
                         Role 2 :  approver2
                         Role 2 :  approver3

3)  Assign the roles to users
             
                          User 1 have assign the role appover1
                          User 2 have assign the role approver2
                          User 3 have assign the role approver3

4)  Below code add to one XML file(ThreeLevel-Defination.xml)

<?xml version="1.0"?>

<workflow-definition
    xmlns="urn:liferay.com:liferay-workflow_6.2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.2.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_2_0.xsd"
>

    <name>Three Level Approval</name>
    <description>Workflow assets must be approved first Level.</description>
    <version>1</version>
    <state>
        <name>created</name>
        <metadata><![CDATA[{"transitions":{"Market Review":{"bendpoints":[]},"marketing-review":{"bendpoints":[],"xy":[-60,2]}},"xy":[60,50]}]]></metadata>
        <initial>true</initial>
        <transitions>
            <transition>
                <name>Market Review</name>
                <target>marketing-review</target>
                <default>true</default>
            </transition>
            <transition>
                <name>marketing-review</name>
                <target>marketing-review</target>
            </transition>
            <transition>
                <name>marketing-review</name>
                <target>marketing-review</target>
            </transition>
        </transitions>
    </state>
    <task>
        <name>update</name>
        <metadata><![CDATA[{"transitions":{"resubmit":{"bendpoints":[[431,224]]},"Resubmit":{"bendpoints":[[80,1910]],"xy":[140,-530]}},"xy":[510,350]}]]></metadata>
        <actions>
            <notification>
                <name>Creator Modification Notification</name>
                <template>Your asset was rejected by a reviewer, please modify and resubmit.</template>
                <template-language>velocity</template-language>
                <notification-type>email</notification-type>
             
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <user />
        </assignments>
        <transitions>
            <transition>
                <name>resubmit</name>
                <target>marketing-review</target>
            </transition>
        </transitions>
    </task>
    <task>
        <name>marketing-review</name>
        <metadata><![CDATA[{"transitions":{"Marketing Approved":{"bendpoints":[]},"Marketing Denied":{"bendpoints":[]}},"xy":[230,50]}]]></metadata>
        <actions>
            <notification>
                <name>Market Content Review Notification</name>
                <template>You have a new asset waiting for your review in the workflow.</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <roles>
                <role>
                    <role-type>regular</role-type>
                    <name>approver1</name>
                </role>
            </roles>
        </assignments>
        <transitions>
            <transition>
                <name>Marketing Approved</name>
                <target>legal-review</target>
                <default>true</default>
            </transition>
            <transition>
                <name>Marketing Denied</name>
                <target>update</target>
                <default>false</default>
            </transition>
        </transitions>
    </task>
    <task>
        <name>legal-review</name>
        <metadata><![CDATA[{"transitions":{"Legal Denied":{"bendpoints":[]},"Legal Approved":{"bendpoints":[]},"Legal Approval":{"bendpoints":[]}},"xy":[650,60]}]]></metadata>
        <actions>
            <notification>
                <name>Legal Content Review Notification</name>
                <template>You have a new asset waiting for your review in the workflow.</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <roles>
                <role>
                    <role-type>regular</role-type>
                    <name>approver2</name>
                </role>
            </roles>
        </assignments>
        <transitions>
            <transition>
                <name>Legal Denied</name>
                <target>update</target>
                <default>false</default>
            </transition>
            <transition>
                <name>Legal Approved</name>
                <target>thirdlevel</target>
            </transition>
            <transition>
                <name>Legal Approved</name>
                <target>third-level</target>
            </transition>
        </transitions>
    </task>
    <state>
        <name>approved</name>
        <metadata><![CDATA[{"xy":[1190,130]}]]></metadata>
        <actions>
            <action>
                <name>approve</name>
                <script>
                    <![CDATA[
                        import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
                        import com.liferay.portal.kernel.workflow.WorkflowConstants;

                        WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.toStatus("approved"), workflowContext);
                    ]]>
                </script>
                <script-language>groovy</script-language>
                <execution-type>onEntry</execution-type>
            </action>
        </actions>
    </state>
    <task>
        <name>third-level</name>
        <metadata><![CDATA[{"transitions":{"third Denied":{"bendpoints":[]},"approved":{"bendpoints":[]},"Legal Approved":{"bendpoints":[]},"Third Denied":{"bendpoints":[]}},"xy":[900,70]}]]></metadata>
        <actions>
            <notification>
                <name>Thirdl Content Review Notification</name>
                <template>/* specify task notification template */</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <roles>
                <role>
                    <role-type>regular</role-type>
                    <name>approver3</name>
                    <auto-create>true</auto-create>
                </role>
            </roles>
        </assignments>
        <transitions>
            <transition>
                <name>approved</name>
                <target>approved</target>
            </transition>
            <transition>
                <name>Third Denied</name>
                <target>update</target>
            </transition>
        </transitions>
    </task>
 
</workflow-definition>




5)  Add the two level workflow into Workflow section

    Select Workflow - > Defination -> Add defination

6)  Add the worflow to outofbox assets(Webcontent,Wiki,Messageboards,Blogs etc.)

7) Test it



Working with (Two Level) Kaleo Workflow Liferay6.2 :



1) Create two users

 Users and Organisation -> Select add users

                          User 1 :   workflow1@liferay.com

                          User 2 :   Workflow2@liferay.com

2) Create two Regulars Roles

                         Role 1 :  approver1
                         Role 2 :  approver2

3)  Assign the roles to users
               
                          User 1 have assign the role appover1
                          User 2 have assign the role approver2

4)  Below code add to one XML file(TwoLevel-Defination.xml)

<?xml version="1.0"?>

<workflow-definition
    xmlns="urn:liferay.com:liferay-workflow_6.2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.2.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_2_0.xsd"
>
    <name>Legal and Marketing Approval</name>
    <description>Workflow assets must be approved first by Marketing and then by Legal.</description>
    <version>1</version>
    <state>
        <name>created</name>
        <metadata>
            <![CDATA[{"transitions":{"Market Review":{"xy":[-46,-12]}},"xy":[62,51]}]]>
        </metadata>
        <initial>true</initial>
        <transitions>
            <transition>
                <name>Market Review</name>
                <target>marketing-review</target>
                <default>true</default>
            </transition>
        </transitions>
    </state>
    <task>
        <name>update</name>
        <metadata>
            <![CDATA[{"transitions":{"Resubmit":{"bendpoints":[[427,40]],"xy":[-27,11]}},"xy":[530,36]}]]>
        </metadata>
        <actions>
            <notification>
                <name>Creator Modification Notification</name>
                <template>Your asset was rejected by a reviewer, please modify and resubmit.</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <notification-type>user-notification</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <user />
        </assignments>
        <transitions>
            <transition>
                <name>Resubmit</name>
                <target>marketing-review</target>
                <default>true</default>
            </transition>
        </transitions>
    </task>
    <task>
        <name>marketing-review</name>
        <metadata>
            <![CDATA[{"transitions":{"Marketing Approved":{"xy":[-1,-29]},"Marketing Denied":{"xy":[-34,-1]}},"xy":[260,36]}]]>
        </metadata>
        <actions>
            <notification>
                <name>Market Content Review Notification</name>
                <template>You have a new asset waiting for your review in the workflow.</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <notification-type>user-notification</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <roles>
                <role>
                    <role-type>regular</role-type>
                    <name>approver1</name>
                </role>
            </roles>
        </assignments>
        <transitions>
            <transition>
                <name>Marketing Approved</name>
                <target>legal-review</target>
                <default>true</default>
            </transition>
            <transition>
                <name>Marketing Denied</name>
                <target>update</target>
                <default>false</default>
            </transition>
        </transitions>
    </task>
    <task>
        <name>legal-review</name>
        <metadata>
            <![CDATA[{"xy":[260,270]}]]>
        </metadata>
        <actions>
            <notification>
                <name>Legal Content Review Notification</name>
                <template>You have a new asset waiting for your review in the workflow.</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <notification-type>user-notification</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <roles>
                <role>
                    <role-type>regular</role-type>
                    <name>approver2</name>
                </role>
            </roles>
        </assignments>
        <transitions>
            <transition>
                <name>Legal Approval</name>
                <target>approved</target>
                <default>true</default>
            </transition>
            <transition>
                <name>Legal Denied</name>
                <target>update</target>
                <default>false</default>
            </transition>
        </transitions>
    </task>
    <state>
        <name>approved</name>
        <metadata>
            <![CDATA[
                {"xy":[540,285]}
            ]]>
        </metadata>
        <actions>
            <action>
                <name>approve</name>
                <script>
                    <![CDATA[
                        import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
                        import com.liferay.portal.kernel.workflow.WorkflowConstants;

                        WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.toStatus("approved"), workflowContext);
                    ]]>
                </script>
                <script-language>groovy</script-language>
                <execution-type>onEntry</execution-type>
            </action>
        </actions>
    </state>
</workflow-definition>




5)  Add the two level workflow into Workflow section

    Select Workflow - > Defination -> Add defination

6)  Add the worflow to outofbox assets(Webcontent,Wiki,Messageboards,Blogs etc.)

7) Test it




Wednesday, 26 October 2016

Programatically Add the Site and Page in Liferay:


1) Create Custom Portlet

2) Create Custom Class add the code in Controller Class

@Override
    public void doView(RenderRequest renderRequest,
            RenderResponse renderResponse) throws IOException, PortletException {
        // TODO Auto-generated method stub
        ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
        ServiceContext serviceContext = new ServiceContext();
        serviceContext.setAddCommunityPermissions(true);
        serviceContext.setAddGuestPermissions(true);
        Group group=null;
        Layout layout = null;
        try{
            group=GroupLocalServiceUtil.getGroup(themeDisplay.getCompanyId(), "Hello");
            if(group.getName().equalsIgnoreCase("Hello")){
                System.out.println("Group already exists");
            }else{
                group = GroupServiceUtil.addGroup("Hello", "", GroupConstants.TYPE_SITE_PRIVATE, "", true, true, serviceContext);
                layout = LayoutLocalServiceUtil.addLayout(themeDisplay.getUserId(),group.getGroupId(), true, 0, "ShowCase", "", "", LayoutConstants.TYPE_PORTLET, false, "/showcase2/3", serviceContext);
                LayoutLocalServiceUtil.updateLayout(layout);
            }
           
           
           
        }
        catch(Exception e){
            e.printStackTrace();
        }
       
        super.doView(renderRequest, renderResponse);
       
    }





 

 

Embedded the WebContent in Theme:



Add the below code in portal_norma.vm file

<div class="journalContent">
        #set($groupId = $themeDisplay.getScopeGroupId())
        #set($languageId = $request.theme-display.language-id)
        #set($journalArticleLocal=$serviceLocator.findService('com.liferay.portlet.journal.service.JournalArticleLocalService'))
        #set($journalContentUtil =$utilLocator.findUtil('com.liferay.portlet.journalcontent.util.JournalContent'))
        #set($journalArticle = $journalArticleLocal.getArticle($groupId,"WELCOME"))
        #set($latestArticle= $journalArticleLocal.getLatestArticle($groupId,$journalArticle.getArticleId()))
        #set($journalArticleDisplay=$journalContentUtil.getDisplay($groupId, $latestArticle.getArticleId(),"",$themeDisplay.getLanguageId(),$themeDisplay))
        $journalArticleDisplay.getContent()
        $themeDisplay.getLanguageId()

</div>



Monday, 24 October 2016

Embedding a Portlet in Theme :

 Add the below code in Portal-Normal.vm


<div class="lang-bar">
                        $velocityPortletPreferences.setValue("portlet-setup-show-borders", "false")
                        #set($sampleLanguageTranslatorPortletId = "languagetranslator_WAR_sampleportlet")
                        $theme.runtime($sampleLanguageTranslatorPortletId ,"", $velocityPortletPreferences.toString())
                        $velocityPortletPreferences.reset()
                    </div>
languagetranslator_WAR_sampleportlet =  portletId value get it from Database Portlet table

select * from Portlet.

 Form Entries API Controller Class ============ render(){ String dataIs = getData(); //make your changes try { long formIns...