I've written a CustomUserDetailServiceImpl.java Spring Security class that handles logging a person into our website.
I've created a custom loadUserbyUsername(String username) function and have it working to a certain extent.
I need to modify this function to retrieve a value stored in a ResourceBundle within the Hippo Repository. I need to figure out how i can obtain the "session" object that i can then use within the snippet of code below: function [ loadUserByUsername(String) ]
try {
Node node = session.getRootNode().getNode("content/documents/administration/crm/crm");
NodeIterator nit = node.getNodes();
while (nit.hasNext()) {
Node nod = nit.nextNode();
if (nod.isNode()
&& nod.getProperty("jcr:primaryType").getValue().getString()
.equals("resourcebundle:resourcebundle")
&& nod.getProperty("resourcebundle:id").getValue().getString().equals("crm.registration.service")
&& nod.getProperty("hippostd:state").getValue().getString().equals("published")
&& nod.getProperty("hippostd:stateSummary").getValue().getString().equals("live")) {
Property property = nod.getProperty("resourcebundle:keys");
Value[] keys = property.getValues();
property = nod.getProperty("resourcebundle:messages");
Value[] messages = property.getValues();
for (int x = 0; x < keys.length; x++) {
map.put(keys[x].getString(), messages[x].getString());
}
}
}
} catch (RepositoryException e) {
System.out.println("ERROR: " + e.getMessage());
}
Any Ideas would help greatly,
Thanks,
Theresa