Showing posts with label webdav. Show all posts
Showing posts with label webdav. Show all posts

Some important URL's for working with WebDav

In the past i blogged about different WebDAV URL's and how i am having difficulty in figuring out which are the right URL's to use and since now i have some visibility in these things i thought i should list out the difference URL's that we are supposed to use

The WebDav URL always begins with http://localhost:10039/wps/mycontenthandler/dav/, my guess is portal makes use of friendly URL mappings to map all the Dav URLs, basic idea is you can create your own URL schema and use the

  1. /themelist: This URL is administration URL that should be used for registering new theme, when you upload theme folder with this URL, two things will happen first the files will get uploaded to WebDAV file store and the theme will be registered in portal data base (Normally we use xmlaccess script to register a theme)

  2. /skinlist: This URL is administration URL that should be used for registering a new Skin in portal database as well as uploading skin related files to WebDAV file store

  3. /contentmodel/wps.content.root: Should be used for accessing the page information and updating the portal page metadata, you can find more information at Using webdav to manage portal pages

  4. /fs-type1: This is generic file store for hosting static files in web dav



The fs-type1 static file store is divided into multiple folders




  • common-resources: Should be used to store the static files such as css, images, JavaScript that will be used by more than one theme

  • iwidgets: folder should be used for storing iWidget.xml file, How to publish iWidget xml in the WebDav store , has more information

  • layout-templates: The layout templates directory is used for storing all the page layout templates, there is one directory for every template. Surprisingly there is no admin URL for registering layout templates, may be because layouts are not stored in portal database(I cant see layout-template element in xmlaccess export)


  • skins: We are supposed to use this folder to update the existing skin related static files

  • themes: We are supposed to use this folder to update the static files in existing theme

  • system:

  • users

  • public:

How to publish iWidget xml in the WebDav store

In the Using iWidgets in portlet entry i blogged about how to use a iWidget as a portlet in websphere portal. In that example i did create a .war file containing widget and installed it on the portal server using WAS Admin console, basic idea was to make that widget xml URL addressable.

But you have one other option which is to upload the widget.xml file to WebDave store of your portal server and then use the WebDav URL for registering widget. I wanted to try that option so i started by creating a simple MyWidgets.xml file like this


<?xml version="1.0" encoding="UTF-8" ?>
<iw:iwidget id="MyWidgets"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget"
supportedModes="view" mode="view" lang="en">
<iw:content mode="view">
<![CDATA[
<div>Hello World - Published in WebDav Store</div>
]]>
</iw:content>
</iw:iwidget>


The MyWidget is very simple, it supports only VIEW mode and in VIEW mode it displays Hello World - Published in WebDav Store as markup to the user.

I did create this file in c:\temp\MyWidget folder. After that i used the AnyClient to create WebDav connection to http://localhost:!0039/wps/mycontenthandler/dav/fs-type1 URL like this



Then i used the client to copy the MyWidgets.xml to fs-types/iwidget folder like this



After copying the MyWidget.xml file to the WebDav repository i used the following configuration task to create a wrapper portlet for the widget


ConfigEngine.bat register-iwidget-
definition -DIWidgetDefinition=dav:fs-type1/iwidgets/MyWidgets.xml -DPorteltUniq
ueName=webspherenotes.MyWidget


Once the task is executed i can add the portlet to page and view it like this

Modify title, metadata properties of page using WebDav client

WPS 7.0 provides one more option for managing your portal pages, which is WebDav. Every portal page is not represented as folder in your WebDav.



On my local the Home -< Fun folder has 5 pages so when i go to corresponding folder in WebDav i see 5 folders. Name of the folder is either ObjectId or unique name. If i go inside a folder that represents a portal page this is what i see




  • localized_en.properties: This is properties file that has value of title and description for the page

  • metadata.properties This file represents the meta data for the page

  • staticcontent: This folder has information about the static content, such as layout.html and option to change the value



This is how the localized_en.properties file for my page looks like, if i change this file and save it using WebDav those changes get stored in the portal database. Ex. I can rename the portal page by changing value of title property in this file


description= Test PageBuilder 2 theme description
title=Test PageBuilder2 Theme


If you want to change any page level meta data values such as caching related data or template file name then you can open metadata.properties file change the corresponding value and save it back. This is how the metadata.properties file for my sample page looks like

com.ibm.portal.bookmarkable=Yes
com.ibm.portal.feed.remote-cache-expiry=86400
com.ibm.portal.layout.template.expiration=1285007105961
com.ibm.portal.IgnoreAccessControlInCaches=false
com.ibm.portal.layout.template.file.name.html=layout.html
com.ibm.portal.remote-cache-expiry=86400
com.ibm.portal.layout.template.ref=dav\:fs-type1/layout-templates/2ColumnEqual/
com.ibm.portal.layout.template.markup=html
com.ibm.portal.layout.template.lastmodified=1285007107434
com.ibm.portal.static.page.file.name.html=layout.html
com.ibm.portal.remote-cache-scope=NON-SHARED

Using WebDAV to manage portal pages

The WebSphere Portal 7.0 allows you to manage portal pages using the WebDav tool. It allows you to do following things


  • Browse through the page hierarchy. Each portal page is represented as a folder. The name of the folder is the unique name or the object ID of the page. Children pages in the topology are represented as subfolders.

  • Change globalization information of pages. To do this, users edit and save properties files that contain the globalization information.

  • Change metadata of pages. To do this, users edit and save properties files that contain the metadata information.

  • For static pages, you can browse, read, create, update, save, copy, move, and delete static content. Users can access the content of static pages via the subfolder staticcontent .

  • Delete pages.



I wanted to try this feature so first i created a WebDav connection to the http://localhost:10039/wps/mycontenthandler/dav/contentmodel/wps.content.root url like this



Once the connection is established i can see all the pages in my portal in the directory format. This is screen shot of my portal page which displays all the pages at the Content Root level



This is how they are represented in the WebDav repository. There is a folder corresponding to every portal page and lable. If you drill down in the folder you will notice there is folder corresponding to every child page,..

How to configure WebDav connection in Linux

In the Using WebDav to work with theme in WPS 7 entry you can find details about how to configure a WebDav client on Windows. But i use CentOS on my development machine and i wanted to figure out how to connect to the WebDav server on Linux machine.

It turns on the Nautilus file explorer that i use on my Linux box has native support for connecting to WebDav and its more easier to user then the couple of windows based options

In the Nautilus file explorer click on File -< Connect to Server like this


It will open a Connect to server dialog box, where you can provide details for connecting to the WebDav server like this



Once click on Connect it will ask you for the password and once you provide the password it will connect to server and show the webdav folder like normal file system folder. It will also add this webdav connection in the left hand palette like this. Now your free to navigate in the WebDav folder and work with files like any normal file system files



I used wasadmin as connection name and the themes/PageBuilder2 is the WebDav folder

Using WebDav to work with theme in WPS 7

I was trying to connect to the portal theme using the WebDav theme but it seems that /wps/mycontenthandler/dav/themelist url that i got from the portal documentation does not work, but the /wps/mycontenthandler/dav/fs-type1/themelist works

I did two things first i installed a Free WebDav client called BitKinex, then i configure it to connect to /wps/mycontenthandler/dav/fs-type1/themelist and /wps/mycontenthandler/dav/fs-type1/skinlist url on my local server using the URL and port number of local port like this.



Now when i try to connect to themes this is what i get, PageBuilder2 theme along with the static files in it.



Now i can drill down to file, edit the file, ...

Using WebDAV with WebSphere Portal

WebSphere Portal V7.0 provides a WebDAV implementation that individual services can use by plugging into. Examples of such services are:

  • WebDAV for managing pages and static content

  • WebDAV filestore. For example, this is used by mashup integration in the portal..
    WebDAV for Web Content Management.

  • For details refer to the appropriate sections and topics.



You will have to use one of the WebDav clients to connect and work with portal. I used the WebFolders update from Microsoft to add support for WebDav in my Windows Explorer. Once the update is installed and machine is restarted your ready to use it.

You can follow these steps to get it working

  • In the Windows Explorer click on Tools -< Map Network drive, it will open a dialog like this


  • Click on the Signup for online storage or connect to a web server link, it will start "Add Network place wizard"

  • In that go to "Where do you want to create this network place" page and "Select another network location" option like this


  • On the next page it will ask you "What is the address of this network place?" you should enter address that you want to connect to. In my case i want to get to Manage pages service, so i entered http://localhost:10039/wps/mycontenthandler/dav/contentmodel/ibm.portal.Home/ like this


  • When i click on next, it asks for the username and password for the WebDav and i used the Portal Admin userid and password and once the login was successful i got a connection like this




Important Note As per documentation i should be able to modify page metadata and navigate from here but i got some errors, also connecting to themelist and skinlist did not work.

Problem in connecting to WPS using WebDav client

I tried following the instructions in Using WebDAV with WebSphere Portal entry for connecting to theme by configuring a WebFolder connecting to http://localhost:10039/wps/mycontenthandler/dav/themelist/ url. This url is supposed to give me list of themes.

The first page came back ok with list of themes



But when i tried going into a folder i got error, when i checked the SystemOut.log i saw this error




[9/14/10 16:41:16:734 PDT] 0000002b webcontainer E com.ibm.ws.webcontainer.WebContainer handleRequest SRVE0255E: A WebGroup/Virtual Host to handle / has not been defined.
[9/14/10 16:41:16:828 PDT] 0000002c webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[PROTECTED_HANDLER_47555912]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: EJCBC0001E: The service handler [com.ibm.portal.resolver.webdav.data.WebDavDataFactory] associated with the URI [all:ibm.portal.theme.Portal] could not be located using the COR APIs.
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:637)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1180)
at com.ibm.wps.resolver.servlet.exceptions.ExceptionHelper.sendError(ExceptionHelper.java:108)
at com.ibm.wps.resolver.servlet.FilterChainServlet.sendError(FilterChainServlet.java:295)
at com.ibm.wps.resolver.servlet.FilterChainServlet.sendError(FilterChainServlet.java:322)
at com.ibm.wps.resolver.servlet.FilterChainServlet.service(FilterChainServlet.java:348)
at com.ibm.wps.resolver.servlet.AbstractServlet.service(AbstractServlet.java:530)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at com.ibm.wps.engine.ExtensionFilter$ExtendedFilterChain.doFilter(ExtensionFilter.java:91)
at com.ibm.wps.engine.ExtensionFilter.doFilter(ExtensionFilter.java:178)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.wps.ac.xml.CSRFFilter.doFilter(CSRFFilter.java:214)
at com.ibm.wps.resolver.servlet.AbstractFilter.doFilter(AbstractFilter.java:93)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.wps.engine.ExtendedLocaleFilter.doFilter(ExtendedLocaleFilter.java:113)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.wps.auth.ContentHandlerSessionTimeOutFilter.doFilter(ContentHandlerSessionTimeOutFilter.java:103)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.wps.state.filter.StateCleanup.doFilter(StateCleanup.java:94)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)



I ran into same issue when i tried connecting to http://server:port/wps/mycontenthandler/dav/skinlist/. I am planning to install Current Lotus Web Content Management Cumulative Fix (CF) for WPS 7.0 to see if it helps

Important Note: Finally i am able to use WebDav for modifying PageBuilder2 theme.