[Hippo-cms7-user] Forms

d.clayton d.clayton at lukkien.com
Tue Oct 11 10:57:26 CEST 2011


Hi Ard,

This page: https://wiki.onehippo.com/display/CMS7/HST-2+forms

It's half-way there, but needs finishing.

I'd also like to write a tutorial on how to update the repository using a
user form submission, but I'm not sure if I'm doing it correctly. Could you
check this code please?

    	try {
    		HippoFolderBean assetBase = getAssetBaseBean(request);
    		Node assetBaseNode = assetBase.getNode();
    		Node root = getRoot(assetBaseNode);
			Node usersNode = root.getNode("hippo:configuration/hippo:users");
			if(usersNode != null) {
				System.out.println("Got users node!");
				usersNode.addNode(username, "hipposys:user");
				usersNode.getSession().save();
			}
		} catch (etc.)

The bit I'm concerned about is the hacky way I get a node from somewhere,
then traverse my way up to the root node of the repository using a recursive
function I wrote. I tried to use
getObjectBeanManager(request).getObject(absolutePathToUsersFolder), but I
got the error:

No Descriptor found for node '/hippo:configuration/hippo:users'. Cannot
return a Bean for 'hipposys:userfolder'.

I guess because there's no HippoBean defined for a hipposys:userfolder or
something.

Is there a better way to do this?

Bedankt in advance :)

--
View this message in context: http://hippo.2275632.n2.nabble.com/Forms-tp6876115p6880149.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.



More information about the Hippo-cms7-user mailing list