scope="prototype">
<property name="jcrKeyring" ref="jcrKeyring" />
<property name="repositoryRegister" ref="repositoryRegister" />
+ <property name="repositoryFactory" ref="repositoryFactory" />
</bean>
</beans>
import java.util.List;
import javax.jcr.Node;
+import javax.jcr.RepositoryFactory;
import javax.jcr.Session;
import org.argeo.eclipse.ui.TreeParent;
// Business Objects
final private RepositoryRegister repositoryRegister;
+ final private RepositoryFactory repositoryFactory;
final private Session userSession;
final private JcrKeyring jcrKeyring;
final private boolean sortChildren;
private TreeObjectsComparator itemComparator = new TreeObjectsComparator();
public NodeContentProvider(JcrKeyring jcrKeyring,
- RepositoryRegister repositoryRegister, Boolean sortChildren) {
+ RepositoryRegister repositoryRegister,
+ RepositoryFactory repositoryFactory, Boolean sortChildren) {
this.userSession = jcrKeyring != null ? jcrKeyring.getSession() : null;
this.jcrKeyring = jcrKeyring;
this.repositoryRegister = repositoryRegister;
+ this.repositoryFactory = repositoryFactory;
this.sortChildren = sortChildren;
}
if (repositoriesNode != null)
repositoriesNode.dispose();
repositoriesNode = new RepositoriesNode("Repositories",
- repositoryRegister, null, jcrKeyring);
+ repositoryRegister, repositoryFactory, null, jcrKeyring);
}
}
public class RepositoriesNode extends TreeParent implements ArgeoNames {
private final RepositoryRegister repositoryRegister;
+ private final RepositoryFactory repositoryFactory;
private final JcrKeyring jcrKeyring;
public RepositoriesNode(String name, RepositoryRegister repositoryRegister,
- TreeParent parent, JcrKeyring jcrKeyring) {
+ RepositoryFactory repositoryFactory, TreeParent parent,
+ JcrKeyring jcrKeyring) {
super(name);
this.repositoryRegister = repositoryRegister;
+ this.repositoryFactory = repositoryFactory;
this.jcrKeyring = jcrKeyring;
}
params.put(ArgeoJcrConstants.JCR_REPOSITORY_URI, uri);
params.put(ArgeoJcrConstants.JCR_REPOSITORY_ALIAS,
remoteNode.getName());
- Repository repository = repositoryRegister
+ Repository repository = repositoryFactory
.getRepository(params);
RemoteRepositoryNode remoteRepositoryNode = new RemoteRepositoryNode(
remoteNode.getName(), repository, this, jcrKeyring,
import javax.jcr.Property;
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
import javax.jcr.Value;
import javax.jcr.observation.Event;
import javax.jcr.observation.EventListener;
/* DEPENDENCY INJECTION */
private JcrKeyring jcrKeyring;
private RepositoryRegister repositoryRegister;
+ private RepositoryFactory repositoryFactory;
// This page widgets
private TreeViewer nodesViewer;
top.setLayout(gl);
nodeContentProvider = new NodeContentProvider(jcrKeyring,
- repositoryRegister, sortChildNodes);
+ repositoryRegister, repositoryFactory, sortChildNodes);
// nodes viewer
nodesViewer = createNodeViewer(top, nodeContentProvider);
this.jcrKeyring = jcrKeyring;
}
+ public void setRepositoryFactory(RepositoryFactory repositoryFactory) {
+ this.repositoryFactory = repositoryFactory;
+ }
+
}