switched to new href() syntax,
fixed bug in user.register where the db field name was used instead of the corresponding property name
This commit is contained in:
parent
45eabd9fca
commit
5e04d833f1
1 changed files with 20 additions and 11 deletions
|
@ -406,9 +406,16 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, Runn
|
||||||
|
|
||||||
unode = new Node (uname);
|
unode = new Node (uname);
|
||||||
String usernameField = userMapping.getNameField ();
|
String usernameField = userMapping.getNameField ();
|
||||||
if (usernameField == null)
|
String usernameProp = null;
|
||||||
usernameField = "name";
|
if (usernameField != null) {
|
||||||
unode.setString (usernameField, uname);
|
Relation namerel= userMapping.columnNameToProperty (usernameField);
|
||||||
|
if (namerel != null)
|
||||||
|
usernameProp = namerel.propname;
|
||||||
|
}
|
||||||
|
if (usernameProp == null)
|
||||||
|
usernameProp = "name";
|
||||||
|
unode.setName (uname);
|
||||||
|
unode.setString (usernameProp, uname);
|
||||||
unode.setString ("password", password);
|
unode.setString ("password", password);
|
||||||
unode.setPrototype ("user");
|
unode.setPrototype ("user");
|
||||||
unode.setDbMapping (userMapping);
|
unode.setDbMapping (userMapping);
|
||||||
|
@ -474,21 +481,23 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, Runn
|
||||||
public String getNodePath (INode n, String tmpname) {
|
public String getNodePath (INode n, String tmpname) {
|
||||||
INode root = getDataRoot ();
|
INode root = getDataRoot ();
|
||||||
INode users = getUserRoot ();
|
INode users = getUserRoot ();
|
||||||
String href = n.getUrl (root, users, tmpname);
|
String siteroot = props.getProperty ("rootPrototype");
|
||||||
|
String href = n.getUrl (root, users, tmpname, siteroot);
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNodeHref (INode n, String tmpname) {
|
public String getNodeHref (INode n, String tmpname) {
|
||||||
INode root = getDataRoot ();
|
INode root = getDataRoot ();
|
||||||
INode users = getUserRoot ();
|
INode users = getUserRoot ();
|
||||||
// check base uri from app.properties
|
|
||||||
|
// check base uri and optional root prototype from app.properties
|
||||||
String base = props.getProperty ("baseURI");
|
String base = props.getProperty ("baseURI");
|
||||||
if (base != null)
|
String siteroot = props.getProperty ("rootPrototype");
|
||||||
setBaseURI (base);
|
|
||||||
String href = n.getHref (root, users, tmpname, baseURI == null ? "/" : baseURI);
|
setBaseURI (base);
|
||||||
// add cache teaser
|
String href = n.getUrl (root, users, tmpname, siteroot);
|
||||||
// href = href + "&tease="+((int) (Math.random ()*999));
|
|
||||||
return href;
|
return baseURI + href;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBaseURI (String uri) {
|
public void setBaseURI (String uri) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue