String filePath = service.getURI(resourcePath);
String filePath = resourcePath; String serverURI = service.getWebdavServerURI(); if(!resourcePath.startsWith(serverURI)) { filePath = service.getURI(resourcePath); }
	public void processAction(ActionEvent actionEvent) throws AbortProcessingException {		UIComponent comp = actionEvent.getComponent();		String id = comp.getId();		if(id.equalsIgnoreCase(ADD_BUTTON_ID)) {			//Add a category to the list of selectable categories			//This is input for adding a category			HtmlInputText newCategoryInput = (HtmlInputText) comp.getParent().findComponent(ADD_CATEGORY_TEXT_ID);			CategoryUtil.addCategory(newCategoryInput.getValue().toString());			return;		}		if(id.equalsIgnoreCase(SAVE_ID)) {			//save the selection of categories to the article			//Build together the categories string			StringBuffer categories = new StringBuffer();			Iterator iter = CategoryUtil.getCategories().iterator();			HtmlSelectBooleanCheckbox smc = null;			while(iter.hasNext()) {				String text = iter.next().toString();				smc = (HtmlSelectBooleanCheckbox)comp.getParent().findComponent(CATEGORY+text);				boolean bool = ((Boolean)smc.getValue()).booleanValue();//				System.out.println("Category "+text+" was set to "+bool);				if(bool) {					categories.append(text).append(",");				}			}			if(smc!=null) {				//Store categories to file and folder				resourcePath = (String)smc.getAttributes().get(RESOURCE_PATH);				IWContext iwc = IWContext.getInstance();				try {					IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwc,IWSlideSession.class);					IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwc,IWSlideService.class);					String filePath = service.getURI(resourcePath);					WebdavRootResource rootResource = session.getWebdavRootResource();						//Store new settings					if(categories.length()>0) {//						System.out.println("Proppatch: filepath="+filePath+" categories value="+categories);						rootResource.proppatchMethod(filePath,new PropertyName("DAV:","categories"),categories.toString(),true);						//Also set the metadata on the parent folder						String parent = getParentWOContext(filePath);//						System.out.println("Proppatch: filepath="+parent+" categories value="+categories);						rootResource.proppatchMethod(parent,new PropertyName("DAV:","categories"),categories.toString(),true);					}					//Clear the cashed data so that it will be reloaded.					WebDAVMetadataResource resource = (WebDAVMetadataResource) IBOLookup.getSessionInstance(							iwc, WebDAVMetadataResource.class);					resource.clear();				}				catch (RemoteException e) {					e.printStackTrace();				}				catch (HttpException e) {					e.printStackTrace();				}				catch (IOException e) {					e.printStackTrace();				}			}			return;		}	}