]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/composites/ItemTemplateTitleComposite.java
Use alias path as key to manage connectors.
[gpl/argeo-slc.git] / plugins / org.argeo.slc.akb.ui / src / main / java / org / argeo / slc / akb / ui / composites / ItemTemplateTitleComposite.java
index d52b6ed1a76e92c00c5afced4a6ae9a17377eb6b..0c21c7e7cef557c86dc45286eecfdd404a2bc356 100644 (file)
@@ -160,8 +160,8 @@ public class ItemTemplateTitleComposite extends Composite {
                                        Node newAlias = definedAliases.get(selIndex);
 
                                        // Only relies on the alias
-                                       itemNode.setProperty(AkbNames.AKB_USED_CONNECTOR, newAlias
-                                                       .getProperty(Property.JCR_TITLE).getString());
+                                       itemNode.setProperty(AkbNames.AKB_USED_CONNECTOR,
+                                                       newAlias.getPath());
                                        part.markDirty();
                                } catch (RepositoryException e) {
                                        throw new AkbException(
@@ -217,9 +217,10 @@ public class ItemTemplateTitleComposite extends Composite {
        private int getCurrAliasIndex() {
                try {
                        if (itemNode.hasProperty(AkbNames.AKB_USED_CONNECTOR)) {
-                               String aliasName = itemNode.getProperty(
+                               String aliasPath = itemNode.getProperty(
                                                AkbNames.AKB_USED_CONNECTOR).getString();
-                               return aliasCmb.indexOf(aliasName);
+                               Node alias = itemNode.getSession().getNode(aliasPath);
+                               return aliasCmb.indexOf(alias.getProperty(Property.JCR_TITLE).getString());
                        } else
                                return -1;
                } catch (RepositoryException re) {