Pages

Showing posts with label custom components. Show all posts
Showing posts with label custom components. Show all posts

Tuesday, March 8, 2016

How to change intradoc port of UCM server for Vertical clustering ?

How to change intradoc port  of UCM server for Vertical clustering ?


Currently  two different nodes of same cluster can't be run in same machine . 

Using custom filter intradoc port can be changed. for each node . This can be used for horizontal clustering .


Steps to do


to understand the basics of UCM filter and steps followed

2. It should run only during the startup :
Method to create filter for : createSystemProviders

3. Verify the server name and set the value :

if (param.equals("createSystemProviders"))
{
traceVerbose("Inside the filter");


String ServerName=SharedObjects.getEnvironmentValue("IDC_Id");



traceVerbose("ServerName is "+ ServerName );

if (ServerName.equals("UCM_server2"))


{
traceVerbose("Changing intradoc port ");
SharedObjects.putEnvironmentValue("IntradocServerPort",SharedObjects.getEnvironmentValue("UCM_Server2IntradocServerPort"));

traceVerbose("Intradoc is "+ SharedObjects.getEnvironmentValue("IntradocServerPort"));

}


   }



4. Add new port in config.cfg as 

UCM_Server2IntradocServerPort

Wednesday, January 6, 2016

Method to print entire ResultSet in Custom component


   intradoc.data.ResultSet




private void traceResultSet (final intradoc.data.ResultSet rs)


            {

                               
                                    int rowCount = 0;
                                    int columsize = rs.getNumFields();


                                       for(rs.first(); rs.isRowPresent(); rs.next())

                                          {

                                                for (int j=0;j< columsize ; j++)

                                                  {
                                                     String   key = rs.getFieldName(j);
                                                     String   value = rs.getStringValueByName(key);
                                                     traceVerbose (key + "  " + value);

                                                  }
                                         
                                          rowCount++;
                                          traceVerbose ("Going to Next Row ---");          
                                  
                                          }


            } // end of traceResultSet


















private static void trace(final String message)

              {
                
                  Report.trace("MyCustomComponent", message, null);
              }       


 private static void traceVerbose(final String message)

                  {
               
                if (Report.m_verbose)
                         {
                        trace(message);
                         }
                   }  // end of TraceVerbose

Monday, December 21, 2015

How to overwrite a template in UCM page for customization ?






Purpose : How to overwrite a template in UCM page for customization .


Example : In this example we overwrite “Active Workflows” page . Which can 


be located at

Content Management → Active Workflows

IdcService : IdcService=GET_ACTIVE_WORKFLOWS

URL : http://IP:PORT/cs/idcplg?IdcService=GET_ACTIVE_WORKFLOWS




Detailed Steps :

1. Find out which template is used :


Template Class : Workflow
Template FilePath : Path of htm file used
Template Name : WORKFLOW_LIST
Template Type : WorkFlowListPage



2. Go to file system , which mention in Template FilePath .

3. Edit the workflow_list.htm
Add below line before <$include std_page_end$> :

Example
<br style="line-height:15px">

Added Manually in the file

<$include std_page_end$>

</body>
</html>



4. Re load the same page again in WCC . It should show the whatever added in the htm file




















This will make sure that , we are editing the correct template file . But this can't be done in proudction because every patch update will overwrite htm . So we have to create a custom component to overwrite htm file . That will save the htm file from “patching”

5. Going to create new custom component .

Start ComponentWizard from file system

6 . Add →

Name : OverWriteWorkFlowList











































7. Click Ok

8. Click on “Add” in Component page , Select “Template”

9.Next -->(Use default options)---> Next

10. On Add Intradoc Template page

Name : WORKFLOW_LIST
Select “Copy From” –> Browse → workflow_list.htm
Class : Workflow
Type : WorkFlowListPage

FileName: NewWorkFlowList.htm ( You can give any Name )
Description : Provide anything

Check Step1 for how to get those 4 details :



















































11. Finish , it will show message which provides the status

12. Go to Build → Build Settings

Wait for default values to load , then click ok

13. Go to Build – > Build

Wait for default values to load , then click ok

14. Go to Options → Enable


Since htm files are dynamic , we can edit “on the go” 









 









































Before restarting the WCC server , compare with above screen shot


15. Restart the WCC server


16. Go to File system ,where custom component are created .

Usually it will be : <domain>/ucm/cs/custom/OverWriteWorkFlowList

Go to templates/ Directory :

Same step can be done from ComponentWizard applet ,by click on Launch editor ( if you select the default editor )


17. Remove the lines added manually before (Step 4) and Add new Line

Like Added from CUSTOM component

18. Reload the page

19. It will show new date updated on Step 17

Key of Custom Component creation is

Any update in hda file , Restart is required
Any update in htm file , Restart is NOT required