Search This Blog

Sunday, January 17, 2016

What is Theme Manger in IBM Portal 8.5.


Use the Theme Manager portlet to create new themes from templates, edit existing themes, and copy, export, or delete themes with one click. You can find the Theme Manager by clicking Applications menu > Theme Development in your portal. From Theme Development, you can access two tools: Theme Manager and Theme Analyzer.

Sunday, January 10, 2016

What are the core objects of the JSR 286 API in IBM WebSphere Portal 8.5?
  1. PortletConfig class: The PortletConfig class functions similarly to ServletConfig in that it uses the following common methods to provide access to the portlet’s configuration:
    • getInitParameter(): Gets initialization parameters.
    • getPortletName(): Gets the portlet’s name
    • getResourceBundle(): Gets the resource bundle for this portlet
    • getSupportedLocales(): Gets the list of supported locales
    • ResourceBundle portletBundle = null;  
      portletBundle = getPortletConfig().getResourceBundle(request.getLocale());

       2. PortletContext class : The PortletContext class functions similarly to ServletContext in that it                      provides access to information about the portlet container.

          The following methods store and retrieve objects that are common to all users of the portlet:
    • setAttribute().
    • getAttribute().
         The getRequestDispatcher() method gets a dispatcher to call other portlet resources. 

         Example :

        
 PortletRequestDispatcher rd =getPortletContext().getRequestDispatcher("/jsps/DisplayCompany.jsp");   
 rd.include(request, response);   


        The PortletContext object defines a portlet view of the portlet container. 
        The PortletContext  also makes resources available to the portlet. 
        By using the context, a portlet can access the portlet log and obtain URL references             to resources. 
        One context is available for each portlet application per Java virtual machine (JVM).
        (A portlet application is a collection of portlets and servlets installed by way of a web             archive   file.)
        As a web application, a portlet application also has a servlet context.        The portlet context uses most of its functionality from the servlet context of the  portlet
       application.
       Attributes stored in the context are global for all users and all components in the portlet 
       application

      3.The PortletRequest class: uses the following sub-interfaces:
  • ActionRequestPassed into the processAction() method.
  • RenderRequestPassed into the doView(), doEdit() methods.
  • EventRequestPassed into the processEvent() method (for portlets subscribing to events).
  • ResourceRequest.
  • Passed into the serveResource() method (for resource serving portlets).
       4.PortletResponse class:Each portlet life-cycle phase has an implementation of the 
        PortletResponse Class:    
  • ActionResponse.
  • RenderResponse.
  • EventResponse.
  • ResourceResponse.
        5.PortletSession class:The PortletSession provides short-term access to objects on 
         behalf of the user. PortletSession has the following characteristics:

           Session data is specific to individual users. Objects that are placed in the session are available 
           for the life of the session either for a specific user-and-portlet combination or to a user across
           all portlets within a portlet application.
          Objects are stored in the session when the object must be available to a subsequent request or
          when the object is shared across multiple portlets in the same application. 
          Objects are removed when the object is no longer required.
          Sessions are invalidated when all objects in the session are no longer required.
          The PortletSession provides a way to identify a user across more than one request and to store
          transient information about that user. It is created per user client per portlet application.
         A portlet can bind an object attribute into a PortletSession by name. The PortletSession 
         interface defines two scopes for storing objects:
  • APPLICATION_SCOPE 
               All objects stored in the session by using the APPLICATION_SCOPE must be available to 
               all the portlets, servlets, and JSP that belong to the same portlet application and that handles 
               a request identified as being a part of the same session.
  •   PORTLET_SCOPE
                 Objects stored in the session using the PORTLET_SCOPE must be available to the 
                 portlet during requests for the same portlet window from which the objects where stored. 

What are famous IBM Portal Theme dynamic spots?

1)
Name: CustomTheme8Dynamic_footer 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/footer.jsp

2)
Name: CustomTheme8Dynamic_crumbTrail 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/crumbTrail.jsp?rootClass=wpthemeCrumbTrail&startLevel=2 

3)
Name: CustomTheme8Dynamic_topNav 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/navigation.jsp?rootClass=wpthemeHeaderNav&startLevel=0&primeRoot=true 

4)
Name: CustomTheme8Dynamic_primaryNav 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/navigation.jsp?rootClass=wpthemePrimaryNav%20wpthemeLeft&startLevel=1 

5)
Name: CustomTheme8Dynamic_secondaryNav 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/navigation.jsp?rootClass=wpthemeSecondaryNav&startLevel=2&levelsDisplayed=2 

6)
Name: CustomTheme8Dynamic_commonActions 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/commonActions.jsp

7) Name: HukoomiTheme80_pageModeToggle 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/pageModeToggle.jsp,wp_toolbar 

8)
Name: HukoomiTheme80_head 
Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/head.jsp 

9)
Name: Custom80theme_status 

Value: res:/CustomTheme8Dynamic/themes/html/dynamicSpots/status.jsp, wp_status_bar

Friday, January 8, 2016

How migrate IBM Portal Page 6.1 to IBM Portal 8.x ? 


Firstly you need to download migration tool 'ppm.jar' from greenhouse then do following :
  1. Run java -jar ppm.jar -setup
  2. Export page trees from your Portal Server and copy them to a folder where the tool is located.
  3. Run java -jar ppm.jar -analyze <input path>
  4. Develop your v8 or v85 Theme and Layouts. Use the analysis from the PPM tool to determine which layouts need to be created and prioritize them.
  5. Deploy your custom theme to your server.
  6. Update the PPM Tool Configuration to match your custom them and layouts.
  7. Run java -jar ppm.jar -migrate <input path>
  8. Delete the original pages on the Portal Server.  Remember the exported original pages should be saved and can be re-imported if necessary.
  9. Import the migrated pages into the Portal Server.


Sunday, December 6, 2015

What are Core Objects of the JSR 286 API in IBM WebSphere Portal 8.5? 
  • PortletConfig class.
  • PortletContext class.
  • PortletRequest class.
  • PortletResponse class.
  • PortletSession class.

Monday, October 12, 2015

How Link from static resource to dynamic resource in IBM Portal theme ? 


<a rel="dynamic-content" href="dyn-cs:/newDynamicContent"></a>


How Link from static resource to dynamic resource in IBM Portal theme ? 

Including a theme JSP directly:
<a rel="dynamic-content" 
     href="res:/CustomThemeContext/themes/html/MyTheme/dynamicContent.jsp"></a>


Monday, August 10, 2015


How setting different data sources for menu component in IBM Lotus WCM 8.5?

1.Edit Site Area.
2.Go to 'Menu Criteria'
3.Select 'Location'.
4.Go to Further options for Location.
5.You will find three different sources:
           a.  Specify in the Web Content Viewer portlet configuration: The site area will configure in Portal Page.
           b. Current Content.
           c.  Query String: if you want to pass parameter to menu component.

Sunday, August 2, 2015

How can migrate Standard Portal Pages into the Static Portal Page format in IBM Portal 8.



https://greenhouse.lotus.com/plugins/plugincatalog.nsf/assetDetails.xsp?action=editDocument&documentId=5190EB71148A2EC485257B2400510466

Monday, July 13, 2015

Why change in static resources in WebDav does not reflecting directly to theme in IBM Portal?

There exist two dirrent URL you can use to communicate with WebDav, following URL  is used to reflect directly :

http://localhost:10030/wps/mycontenthandler/dav/fs-type1/.../

But following URL is used for viewing without reflecting directly : 

http://localhost:10039/wps/mycontenthandler/dav/skinlist/

Monday, May 4, 2015

How to import and export IBM WCM Library ?

https://www.ibm.com/support/knowledgecenter/SS3JLV_8.0.0/wcm/wcm_config_wcmlibrary_export.html

Wednesday, December 17, 2014

How retrieve portal users using IBM PUMA Built-in service ?

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.naming.NamingException;

import com.ibm.portal.um.Group;
import com.ibm.portal.um.PagingIterator;
import com.ibm.portal.um.PumaController;
import com.ibm.portal.um.PumaHome;
import com.ibm.portal.um.PumaLocator;
import com.ibm.portal.um.PumaProfile;
import com.ibm.portal.um.User;
import com.ibm.portal.um.exceptions.PumaAttributeException;
import com.ibm.portal.um.exceptions.PumaException;
import com.ibm.portal.um.exceptions.PumaMissingAccessRightsException;
import com.ibm.portal.um.exceptions.PumaModelException;
import com.ibm.portal.um.exceptions.PumaSystemException;

public class IBMPumaUtility {
 
 private static IBMPumaUtility pumaUtility;
 private PumaHome pumaHome;
 
 private IBMPumaUtility() throws NamingException {
  javax.naming.Context ctx = new javax.naming.InitialContext();
  pumaHome = (PumaHome) ctx.lookup(PumaHome.JNDI_NAME);
 }

 public static IBMPumaUtility getInstance() throws NamingException {
  if(pumaUtility == null) {
   pumaUtility = new IBMPumaUtility();
  } 
  return pumaUtility;
 }

 public User getCurrentUser() throws PumaException {
  //To retrieve current User
  PumaProfile profile = pumaHome.getProfile();
  return profile.getCurrentUser();
 }
 
 public List<User> getUsersByAttribute(String attributeName, String attributeValue)
  throws PumaSystemException, PumaAttributeException, PumaMissingAccessRightsException {
  //To find Users by attribute
  //(eg. attrName = "cn" and attrValue="Manish")
  PumaLocator locator = pumaHome.getLocator();
  return locator.findUsersByAttribute(attributeName, attributeValue);
 }
 
 public List<User> findUsersByQuery(String query) 
  throws PumaSystemException, PumaAttributeException, PumaMissingAccessRightsException {
  //If you need to search by mutilple attributes, search users by query
  PumaLocator locator = pumaHome.getLocator();
  //String query = "((cn != 'Manish') and (givenName != 'wpsadmin'))";
  return locator.findUsersByQuery(query);
 }
 
 public Map<String, Object> getUserAttributes(User user)
  throws PumaAttributeException, PumaSystemException, PumaModelException, PumaMissingAccessRightsException {
  List<String> returnAttributes = new ArrayList<String>();
  returnAttributes.add("cn");
  returnAttributes.add("mail");
  PumaProfile profile = pumaHome.getProfile();
  Map<String, Object> values = profile.getAttributes(user, returnAttributes);
  return values;
 }
 
 public List<Group> findGroupsByAttribute(String attributeName, String attributeValue) 
  throws PumaSystemException, PumaAttributeException, PumaMissingAccessRightsException {
  //Just like findUsers you can find Groups by attribute
  PumaLocator locator = pumaHome.getLocator();  
  List<Group> groups = locator.findGroupsByAttribute(attributeName, attributeValue);
  return groups;
 }

 public PagingIterator<User> paginationFindUsersByQuery(String query, int resultsPerPage)
  throws PumaSystemException, PumaAttributeException, PumaMissingAccessRightsException {
  //PumaLocator provides method to either return a List of PagingIterator
  //int resultsPerPage = 10;  
  PumaLocator locator = pumaHome.getLocator();
  Map<String, Integer> pProperties = new HashMap<String, Integer>();
  pProperties.put(PumaLocator.RESULTS_PER_PAGE, resultsPerPage);
  PagingIterator<User> pIterator = locator.findUsersByQuery(query, pProperties);
  return pIterator;
 }
 
 public void updateUserAttribute(User user, String attribute, String value)
  throws PumaAttributeException, PumaSystemException, PumaModelException, PumaMissingAccessRightsException {
  PumaController pController = pumaHome.getController();  
  //Use PumaController to set or remove User attribute
  Map<String, Object> attributes = new HashMap<String, Object>();
  attributes.put(attribute, value);
  pController.setAttributes(user, attributes);   
 }
 
 public void updateUserAttributes(User user, Map<String, Object> attributes)
 throws PumaAttributeException, PumaSystemException, PumaModelException, PumaMissingAccessRightsException {
  PumaController pController = pumaHome.getController();  
  //Use PumaController to set or remove User attribute
  pController.setAttributes(user, attributes);   
 }
 
 public void removeUserAttribute(User user, String attribute)
  throws PumaAttributeException, PumaSystemException, PumaModelException, PumaMissingAccessRightsException {
  List<String> keys = new ArrayList<String>();
  //keys.add("mail");
  keys.add(attribute);
  
  PumaController pController = pumaHome.getController();
  pController.removeAttributes(user, keys);   
 }

 public void removeUserAttributes(User user, List<String> attributes)
  throws PumaAttributeException, PumaSystemException, PumaModelException, PumaMissingAccessRightsException {
  PumaController pController = pumaHome.getController();
  pController.removeAttributes(user, attributes);   
 }

}


Friday, November 14, 2014

How to Redirect to specific portal page after login in IBM Portal 8 ? 


1. open commonActions.jsp   .

2. Change contentNode="wps.content.root to your specific portal page unique name.

Friday, November 7, 2014

What is the difference between an Edit Shared Setting and a Configure in IBM WCM?


Edit Shared Setting
Configure
Apply setting for this portlet only
Apply setting for all portlets under this node.

Sunday, October 5, 2014

How to make IBM Portal Theme 8.0 Responsive?

http://www.ibm.com/developerworks/library/mo-responsive-design-1/

Monday, August 4, 2014

How to create new custom IBM Portal 8.0 Theme Layout ?




1  1)     open  layout-templates folder .

    2)   Create a copy of any template and paste in the same location.

   3)   Make necessary changes to layout.json file by adding below piece of code for custom layout  creation in portal (Registering new layout by adding an entry to the items array in the following format 

Tuesday, July 22, 2014

How to access IBM WCM library using JAVA API?







sad<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@ taglib uri="/WEB-INF/tld/portal-internal.tld" prefix="wps-internal"%>
<%@ taglib uri="/WEB-INF/tld/resolver-v6.tld" prefix="portal-resolver"%> <%@ taglib uri="/WEB-INF/tld/people.tld" prefix="pa"%> <%@ taglib uri="/WEB-INF/tld/menu.tld" prefix="menu"%>
<%@ taglib uri="/WEB-INF/tld/engine.tld" prefix="wps"%>
<%@ page session="true" contentType="text/html" import="java.util.*,java.lang.*,com.ibm.portal.um.*,com.ibm.workplace.wcm.api.*"%> <%@ taglib uri="/WEB-INF/tld/portal.tld" prefix="portal"%>
<%@ page import="java.util.*,javax.servlet.jsp.JspWriter,java.io.*"%>
<%@ page import="com.ibm.workplace.wcm.api.*"%> <%@ page import="com.ibm.workplace.wcm.api.exceptions.*"%> <%@page import="java.util.*"%> <%@page import="java.io.*"%> <%@page import="java.net.*"%> <%@page import="java.text.*"%> <%@ page
<c:set var="prefLanguage" value="ar" />
import="java.text.*,java.util.*,java.lang.*,java.util.logging.*,com.ibm.workplace.wcm.api.*,com.ibm.portal.um.*"%> <wps:if locale="en"> <c:set var="prefLanguage" value="en" /> </wps:if> <wps:if locale="ar"> </wps:if> <% try { DocumentId docId = null; DocumentIdIterator itemsIterator = null;
.getDocumentLibrary("Web Content");
Workspace myworkspace = WCM_API.getRepository() .getSystemWorkspace(); if (myworkspace == null) { out.println("Unable to get a valid workspace.<br/>"); } else { out.println("Found workspace<br/>"); } myworkspace.login(); //Set the workspace to the correct library. DocumentLibrary MyLibrary = myworkspace
out.print("<br/><br/>Document id: " + docId.getId());
if (MyLibrary == null) { out.println("Library is null<br/>"); } else { out.println("<br/>My lib is not null"); myworkspace.setCurrentDocumentLibrary(MyLibrary); } itemsIterator = myworkspace.findByName( DocumentTypes.AuthoringTemplate, "Article"); docId = (DocumentId) itemsIterator.next();
itemsIterator = myworkspace.findByName(DocumentTypes.Content, "Sample Article"); docId = (DocumentId) itemsIterator.next(); out.print("<br/><br/>Document id: " + docId.toString()); myworkspace.logout(); } catch (Exception e) { out.println("Exception " + e.getMessage()); e.printStackTrace();
}