How to get current page id from within a portlet in WebSphere Portal

Here’s how to get current Page Id from within a portlet in WebSphere Portal 6.1:

NavigationSelectionModel navModel = // see http://publib.boulder.ibm.com/infocenter/wpdoc/v6r1/index.jsp?topic=/com.ibm.wp.ent.doc_v6101/dev/dgn_modelxmp.html on how to get the NavigationSelectionModel
            NavigationNode navNode = (NavigationNode) navModel.getSelectedNode();
            if (navNode != null) {
                ContentNode contentNode = navNode.getContentNode();
                if (contentNode != null) {
                    pageId = contentNode.getObjectID();
                }
            }

The Servlet Request can be accessed via com.ibm.wsspi.portletcontainer.portlet.PortletUtils.getHttpServletRequest(javax.portlet.PortletRequest).

No Comments

Facilitating WebDAV usage on Windows XP

The default WebDAV client on Windows XP is not as usable as it could be. But luckily you can turn web folders into fully featured network drives by applying some more configuration. I just learned that from this blog and the Simple Groupware WebDAV Server web site. Really good to know when working with WebDAV on windows, I believe.

Here is a summary How-to: Read the rest of this entry »

,

No Comments

Disable built-in ZIP Support on Windows XP

Windows XP has built-in ZIP support to manage and explore ZIP archives, which can slow down folder browsing considerably. It is possible to disable the built-in ZIP support in Windows XP. Here is how to do it:
Read the rest of this entry »

No Comments

Linux cheat sheet

Empty an existing file: (see also here):
tail -5 my.log > my.log

Trigger a process and let it run while you’re logging out again (see also here):
nohup <command> &
or, for being able to reattach later, start with

  1. type screen and submit
  2. trigger your longer-running process
  3. detach with the sequence ctrl + a and ctrl + d
  4. logout
  5. later, when logging in again, you can reattach to that console session with:
    screen -r

for the latter, see also this tip.

Symbolic links (see also here):

  • Creation: ln -s target link_name
  • Removal: simply delete it using e.g. rm. It is a file of its own and deletion will not affect the target it is pointing at.

No Comments