I'm still trying to get to the repository to add new users. My component is connected to the side and I have all needed value in FormMap.
Problem is that i don't know how to do this. In my last question Registration users in Hippo cms I got answer that I need connect component to /hippo:configuration/hippo:users.
How to do?
This is my actual component:
package org.example.components;
import javax.jcr.Session;
import org.hippoecm.hst.component.support.bean.BaseHstComponent;
import org.hippoecm.hst.core.component.HstComponentException;
import org.hippoecm.hst.core.component.HstRequest;
import org.hippoecm.hst.core.component.HstResponse;
import org.hippoecm.hst.component.support.forms.FormMap;
import org.hippoecm.hst.component.support.forms.FormUtils;
import org.hippoecm.hst.component.support.forms.FormField;
import org.hippoecm.hst.content.annotations.Persistable;
import org.hippoecm.hst.content.beans.Node;
import org.hippoecm.hst.content.beans.standard.HippoFolderBean;
public class SignUpComponent extends BaseHstComponent {
@Override
public void doBeforeRender(HstRequest request, HstResponse response) {
super.doBeforeRender(request, response);
}
@Persistable
@Override
public void doAction(HstRequest request, HstResponse response) throws HstComponentException {
FormMap map = new FormMap(request, new String[]{"username","email","password"});
FormField username = map.getField("username");
FormField password = map.getField("password");
FormField email = map.getField("email");
try {
// NOTE: This session will be logged out automatically in the normal HST request processing thread.
Session persistableSession = request.getRequestContext().getSession();
} catch (Exception e) {
}
Node users = persistableSession.getNode("/hippo:configuration/hippo:users");
}
Although imports Node does not work
error: cannot find symbol
I also tried
Node users = getSiteContentBaseBean(request).getNode().getSession().getRootNode().getNode("/hippo:configuration/hippo:users");