X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2FAbstractCmsEntryPoint.java;h=2cd86ce08edc115300b1e9cda9d0309b4d8626bc;hb=92b77a90db637e71a7ccbc76fc12bad6ba4a289a;hp=40a01a454421bd97b66393b25c3fe150859bc2e1;hpb=f50f77cf8febeeb302e9581628104e340f80537e;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/AbstractCmsEntryPoint.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/AbstractCmsEntryPoint.java index 40a01a454..2cd86ce08 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/ui/AbstractCmsEntryPoint.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/ui/AbstractCmsEntryPoint.java @@ -278,24 +278,6 @@ public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint implement // auth int colonIndex = prefix.indexOf('$'); if (colonIndex > 0) { - // String user = prefix.substring(0, colonIndex); - // // if (isAnonymous()) { - // String token = prefix.substring(colonIndex + 1); - // LoginContext lc = new LoginContext(NodeConstants.LOGIN_CONTEXT_USER, new - // CallbackHandler() { - // - // @Override - // public void handle(Callback[] callbacks) throws IOException, - // UnsupportedCallbackException { - // for (Callback callback : callbacks) { - // if (callback instanceof NameCallback) - // ((NameCallback) callback).setName(user); - // else if (callback instanceof PasswordCallback) - // ((PasswordCallback) callback).setPassword(token.toCharArray()); - // } - // - // } - // }); SharedSecret token = new SharedSecret(new AuthPassword(X_SHARED_SECRET + '$' + prefix)) { @Override @@ -320,8 +302,10 @@ public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint implement Node newNode = null; if (session.nodeExists(newNodePath)) newNode = session.getNode(newNodePath); - else - throw new CmsException("Data " + newNodePath + " does not exist"); + else { +// throw new CmsException("Data " + newNodePath + " does not exist"); + newNode = null; + } setNode(newNode); } String title = publishMetaData(getNode()); @@ -344,7 +328,7 @@ public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint implement private String publishMetaData(Node node) throws RepositoryException { // Title String title; - if (node.isNodeType(NodeType.MIX_TITLE) && node.hasProperty(Property.JCR_TITLE)) + if (node != null && node.isNodeType(NodeType.MIX_TITLE) && node.hasProperty(Property.JCR_TITLE)) title = node.getProperty(Property.JCR_TITLE).getString() + " - " + getBaseTitle(); else title = getBaseTitle(); @@ -354,6 +338,8 @@ public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint implement return null; StringBuilder js = new StringBuilder(); + if (title == null) + title = ""; title = title.replace("'", "\\'");// sanitize js.append("document.title = '" + title + "';"); jsExecutor.execute(js.toString());