Creating a Custom Portlet

  1. Click Engine > Portlets.
  2. If the portlet Custom does not appear in the Installed Portlets area, go to the Other Available Portlets area, and next to Custom, click Enable.
    The Manage Portlets page opens.
  3. Click Define Custom Portlet.
  4. In the Custom Portlet Definition page, enter the requested information.
    The Model field is used to enter the methods that your View field (HTML page or portal page) requires to render correctly.
    The following image and code examples is for the custom portlet definition of a sample portlet used to display Orchestrator users.

    Model field:
    def get_orch_users
                    begin
        users = User.find(:all , :select => "login")
     rescue Exception => e
        error "Could not fetch users in Orchestrator: #{e.inspect}"
        return []
     end
     return users 
    end
    
    View field:
    <h1>Displaying Users in Orchestrator</h1>
    <%users = @portlet.get_orch_users%>
    <ul>
    <%users.each do |u|%>
    <li><%= u.login %></li>
    <%end%>
    </ul>
  5. Click Save.
  6. Follow the procedure in Creating a Portal Page to create a portal page with your custom portlet.