Friday, June 17, 2016

Portal v7.0 not starting - Previous initialization was not successful

The problem is that now all of a sudden, the wps application starts before the wps_scheduler application, and that is what is causing the problem. To fix it, check the following:

1. Start the WebSphere_Portal server if it is not already started.
2. Try and access the WAS admin console:

http://<portal hostname>:10042/ibm/console

3. Navigate to Applications -> WebSphere Enterprise Applications
4. Pick the 'wps' application and go to 'Startup Behavior'. Check the
Startup Order. The default value is 10. If you have to change this,
do so now.
5. Go back to 'wps' and click Manage Modules.
6. Click 'WebSphere Portal Server'. It's starting weight should be
10000. If you have to change this, do so now.
7. Back in Manage Modules, click 'WebSphere Portal Server WSRP
Facade'. It's starting weight should be 10000. If you have to change
this, do so now.
8. Back in Manage Modules, click 'WebSphere Portal XmlAccess Facade'.
It's starting weight should also be 10000. Again if you have to change
this, do so now.
9. Now back to the list of applications, pick 'wps_scheduler' and go
to 'Startup Behavior'. It's startup order should also be 10. If you
have to change this, do so now.
10. From wps_scheduler, go to Manage Modules.
11. Click 'WPS Task Scheduler'. It's starting weight should be 5000.
If you have to change this, do so now.
12. Save all changes and restart Portal.

Also verify if <portalserver_dir>\wps.propeties file exists and it has required permission. If required rename that to a different file and created a new wps.properties and copied the contents of it and restarted.

If nothing works then try to backup and redeploy wps.ear: http://www-10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=IBM+WebSphere+Portal+8+Product+Documentation#action=openDocument&res_title=Redeploying_the_portal_EAR_file_wp8&content=pdcontent&sa=true

Font Loading issue when installing font in browser is disable

http://ajax.googleapis.com/ajax/libs/webfont/1.5.3/webfont.js
https://github.com/typekit/webfontloader/issues/160
http://www.techrepublic.com/blog/web-designer/how-to-use-the-google-webfont-loader/
http://stackoverflow.com/questions/7973421/detect-if-font-download-in-ie-is-enabledd

Create a url to change language on Portal

You can use following code to change the language on Portal.
<portal-navigation:url command="ChangeLanguage">
  <portal-navigation:urlParam name="locale" value="<language>"/>
</portal-navigation:url>
 
There was a problem with this when navigational state is cleared. 
This happens if  bookmarks to friendly URLs are used for navigation or 
the navigational state is cleared intentionally.
 
You can this technique to store language value in cookie temporarily and 
It sets the locale information, if no locale information can be 
found in the navigational state.
 
Configure cookie support language using this 
url: http://www-01.ibm.com/support/docview.wss?uid=swg1PM17679
 

Content decompress (Base64 + Zlib)

I wanted to decompress data getting send to GSA (google search appliance) to verify the actual content. Google Search Appliance uses Base64 encode and Zlib compress technique which improves performance, because less data is sent across the network.

Here is link on GSA Content Compression: https://www.google.com/support/enterprise/static/gsa/docs/admin/72/gsa_doc_set/feedsguide/feedsguide.html#1074587

There is api provides by Java that can be used to  compress and decompress data using the java.util.zip package. - http://www.oracle.com/technetwork/articles/java/compress-1565076.html

To decode base64 string you can use class org.apache.commons.codec.binary.Base64 provided by apache commons library.

code snippet that follows:  
String string = "SmF2YWNvZGVnZWVrcw==";
// Get bytes from string
byte[] byteArray = Base64.decodeBase64(string.getBytes());
// Print the decoded array
System.out.println(Arrays.toString(byteArray));


To decompress zlib content you can use Java Byte Array Using Inflater
code snippet that follows: 
public static byte[] decompress(byte[] data) throws IOException, DataFormatException {
    Inflater inflater = new Inflater();  
    inflater.setInput(data); 
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length); 
    byte[] buffer = new byte[1024]; 
    while (!inflater.finished()) { 
        int count = inflater.inflate(buffer); 
        outputStream.write(buffer, 0, count); 
    } 
    outputStream.close(); 
    byte[] output = outputStream.toByteArray(); 
    LOG.debug("Original: " + data.length); 
    LOG.debug("Compressed: " + output.length); 
    return output; 
}  

Here is the reference link: https://dzone.com/articles/how-compress-and-uncompress


Download complete source code: https://app.box.com/s/w2wyffurcwdpeetouk56kg2tmg40wjtl

Monday, June 13, 2016

How to set Ephox Edit Live editor as default WCM editor?

Below are the simple steps to changes the WCM editor from default rich text to Ephox edit Live. First of all you have to download Ephox edit live from https://greenhouse.lotus.com/ and install the same application on to your portal server if not already installed.
  • Login to WAS Console.
  • Navigate to Applications->Application Types -> WebSphere enterprise applications.
  • Click on Install and select the .ear file you downloaded and click Next. Keep the default options keep going to next pages.
  • Make sure you select websphere_portal as the server not server1 while installing the .ear and finish the installation and save the configuration.
  • Start the application if its not already started.
  • Login to portal as administrator and navigate to WCM Authoring portlet -> Preferences > Configure.
  • Expand the Rich Text Options section , select Custom Editor in the drop down and enter the following in the text box "/wps/ephox/;jsp/html/EditLiveJavaEditor.jsp"and click OK.
  • Now navigate to WCM Authoring portlet -> Preferences > Edit Shared Settings.
  • Expand the RichTextOptions section , select Custom Editor in the drop down and enter the following in the text box "/wps/ephox/;jsp/html/EditLiveJavaEditor.jsp"and click OK.
  • Now go to any content item that uses rich text and you can see its using ephox edit live edit instead of IBM's default RTE.
  •  You can easily toggle between the design view and code view in the bottom left corner.
 Ephox edit Live is a Java Editor and Java Runtime is required on wcm author's machine to be able to use this applet in a browser.

Ephox has also released a javascript based rich text editor that you can apply on WebSphere Portal 8.5.0.0 with CF06 or higher.
Here is some more info on this: https://greenhouse.lotus.com/plugins/plugincatalog.nsf/assetDetails.xsp?action=editDocument&documentId=86189C1DAC5B1D3B85257E4500199F1B

About Rich Text editor options on WCM: https://www.ibm.com/support/knowledgecenter/SS3JLV_8.0.0/wcm/wcm_config_authoringportlet_richtext.html