String parent = getParentWOContext(filePath);  rootResource.proppatchMethod(parent,new PropertyName("DAV:","categories"),categories.toString(),true); }
if(getSetCategoriesOnParent()){ String parent = getParentResource(filePath);  rootResource.proppatchMethod(parent,new PropertyName("DAV:","categories"),categories.toString(),true); } }
	public void saveCategoriesSettings(String resourcePath, UIComponent comp) {		//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;		int count = 0;		while(iter.hasNext()) {			String text = iter.next().toString();			smc = (HtmlSelectBooleanCheckbox)comp.getParent().findComponent(CATEGORY+count++);			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			if(resourcePath == null) {				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 = resourcePath;				String serverURI = service.getWebdavServerURI();				if(!resourcePath.startsWith(serverURI)) {					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();			}		}	}