private Keyring keyring;
private Repository repository;
private Keyring keyring;
private Repository repository;
+ // RElevant default node indexers
private ArtifactIndexer artifactIndexer = new ArtifactIndexer();
private JarFileIndexer jarFileIndexer = new JarFileIndexer();
private DistributionBundleIndexer distBundleIndexer = new DistributionBundleIndexer();
private ArtifactIndexer artifactIndexer = new ArtifactIndexer();
private JarFileIndexer jarFileIndexer = new JarFileIndexer();
private DistributionBundleIndexer distBundleIndexer = new DistributionBundleIndexer();
private PdeSourcesIndexer pdeSourceIndexer = new PdeSourcesIndexer(
artifactIndexer, jarFileIndexer);
private PdeSourcesIndexer pdeSourceIndexer = new PdeSourcesIndexer(
artifactIndexer, jarFileIndexer);
if (node.getSession().hasPendingChanges()) {
node.getSession().save();
if (log.isDebugEnabled())
if (node.getSession().hasPendingChanges()) {
node.getSession().save();
if (log.isDebugEnabled())
- log.debug("Processed artifact "
+ log.debug("Processed jar artifact "
+ node.getPath());
}
monitor.worked(1);
+ node.getPath());
}
monitor.worked(1);
if (node.getSession().hasPendingChanges()) {
node.getSession().save();
if (log.isDebugEnabled())
if (node.getSession().hasPendingChanges()) {
node.getSession().save();
if (log.isDebugEnabled())
- log.debug("Processed artifact " + node.getPath());
+ log.debug("Processed pom artifact " + node.getPath());
}
monitor.worked(1);
} else {
}
monitor.worked(1);
} else {
import org.argeo.slc.jcr.SlcTypes;
/**
import org.argeo.slc.jcr.SlcTypes;
/**
- * Abstract the base a given modular distribution set that is the parent all
- * versions of the same distribution
+ * Abstract the base of a given modular distribution set i.e. the parent of all
+ * versions of a given modular distribution
*/
public class ModularDistBaseElem extends DistParentElem {
*/
public class ModularDistBaseElem extends DistParentElem {
final static public String AETHER_BINARIES_TYPE = "binaries";
final static public String AETHER_DEP_TYPE = "dep";
private String type;
final static public String AETHER_BINARIES_TYPE = "binaries";
final static public String AETHER_DEP_TYPE = "dep";
private String type;
- private Node artifactBase;
+ private Node modularDistBase;
public ModularDistBaseElem(WorkspaceElem wkspElem, String name,
public ModularDistBaseElem(WorkspaceElem wkspElem, String name,
- Node artifactBase, String type) {
+ Node modularDistBase, String type) {
super(name, wkspElem.inHome(), wkspElem.isReadOnly());
setParent(wkspElem);
super(name, wkspElem.inHome(), wkspElem.isReadOnly());
setParent(wkspElem);
- this.artifactBase = artifactBase;
+ this.modularDistBase = modularDistBase;
this.type = type;
}
public Node getCategoryBase() {
// TODO clean this
if (type.equals(AETHER_CATEGORY_BASE))
this.type = type;
}
public Node getCategoryBase() {
// TODO clean this
if (type.equals(AETHER_CATEGORY_BASE))
+ return modularDistBase;
- return artifactBase.getParent();
+ return modularDistBase.getParent();
} catch (RepositoryException e) {
throw new SlcException("unable tyo get parent node for "
} catch (RepositoryException e) {
throw new SlcException("unable tyo get parent node for "
- * Override normal behavior to initialize children only when first requested
+ * Override normal behaviour to initialise children only when first requested
*/
@Override
public synchronized boolean hasChildren() {
*/
@Override
public synchronized boolean hasChildren() {
- * Override normal behavior to initialize children only when first requested
+ * Override normal behaviour to initialise children only when first requested
*/
@Override
public synchronized Object[] getChildren() {
if (isLoaded()) {
return super.getChildren();
} else {
*/
@Override
public synchronized Object[] getChildren() {
if (isLoaded()) {
return super.getChildren();
} else {
- // initialize current object
try {
NodeIterator ni = getDistVersions();
while (ni != null && ni.hasNext()) {
try {
NodeIterator ni = getDistVersions();
while (ni != null && ni.hasNext()) {
return super.getChildren();
} catch (RepositoryException re) {
throw new ArgeoException(
return super.getChildren();
} catch (RepositoryException re) {
throw new ArgeoException(
- "Unexcpected error while initializing children SingleJcrNode",
- re);
+ "Unable to retrieve children for "
+ + modularDistBase, re);
if (AETHER_CATEGORY_BASE.equals(type))
return null;
if (AETHER_CATEGORY_BASE.equals(type))
return null;
- QueryManager queryManager = artifactBase.getSession()
+ QueryManager queryManager = modularDistBase.getSession()
.getWorkspace().getQueryManager();
QueryObjectModelFactory factory = queryManager.getQOMFactory();
Selector source = factory.selector(
SlcTypes.SLC_MODULAR_DISTRIBUTION,
SlcTypes.SLC_MODULAR_DISTRIBUTION);
Constraint constraint = factory.descendantNode(
.getWorkspace().getQueryManager();
QueryObjectModelFactory factory = queryManager.getQOMFactory();
Selector source = factory.selector(
SlcTypes.SLC_MODULAR_DISTRIBUTION,
SlcTypes.SLC_MODULAR_DISTRIBUTION);
Constraint constraint = factory.descendantNode(
- source.getSelectorName(), artifactBase.getPath());
+ source.getSelectorName(), modularDistBase.getPath());
// Ordering order = factory.descending(factory.propertyValue(
// source.getSelectorName(), SlcNames.SLC_ARTIFACT_VERSION));
// Ordering[] orderings = { order };
// Ordering order = factory.descending(factory.propertyValue(
// source.getSelectorName(), SlcNames.SLC_ARTIFACT_VERSION));
// Ordering[] orderings = { order };
}
protected void workspaceInit(String workspaceName) {
}
protected void workspaceInit(String workspaceName) {
+ Session workspaceAdminSession = null;
- Session workspaceAdminSession = jcrRepository.login(workspaceName);
+ workspaceAdminSession = jcrRepository.login(workspaceName);
workspaceSessions.put(workspaceName, adminSession);
JcrUtils.addPrivilege(workspaceAdminSession, "/",
SlcConstants.ROLE_SLC, "jcr:all");
workspaceSessions.put(workspaceName, adminSession);
JcrUtils.addPrivilege(workspaceAdminSession, "/",
SlcConstants.ROLE_SLC, "jcr:all");
workspaceIndexers.put(workspaceName, workspaceIndexer);
} catch (RepositoryException e) {
log.error("Cannot initialize workspace " + workspaceName, e);
workspaceIndexers.put(workspaceName, workspaceIndexer);
} catch (RepositoryException e) {
log.error("Cannot initialize workspace " + workspaceName, e);
+ } finally {
+ JcrUtils.logoutQuietly(workspaceAdminSession);
public void setSecurityWorkspace(String securityWorkspace) {
this.securityWorkspace = securityWorkspace;
}
public void setSecurityWorkspace(String securityWorkspace) {
this.securityWorkspace = securityWorkspace;
}
+}
\ No newline at end of file