Author: tripod
Date: Wed Apr 27 07:38:52 2005
New Revision: 164985
URL: http://svn.apache.org/viewcvs?rev=164985&view=rev
Log:
- fixing nodedefid error for jcr:nodeTypes
- removing compile-time flag for exposing version histories
Modified:
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java?rev=164985&r1=164984&r2=164985&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
Wed Apr 27 07:38:52 2005
@@ -25,6 +25,7 @@
import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
import org.apache.jackrabbit.core.nodetype.PropDef;
import org.apache.jackrabbit.core.nodetype.ValueConstraint;
+import org.apache.jackrabbit.core.nodetype.NodeDefId;
import org.apache.jackrabbit.core.state.ItemStateException;
import org.apache.jackrabbit.core.state.NoSuchItemStateException;
import org.apache.jackrabbit.core.util.uuid.UUID;
@@ -66,6 +67,8 @@
*/
protected VirtualNodeState createRootNodeState() throws RepositoryException {
VirtualNodeState root = new VirtualNodeState(this, parentId, rootNodeId.getUUID(),
REP_NODETYPES, null);
+ NodeDefId id = ntReg.getEffectiveNodeType(REP_SYSTEM).getApplicableChildNodeDef(JCR_NODETYPES,
REP_NODETYPES).getId();
+ root.setDefinitionId(id);
QName[] ntNames = ntReg.getRegisteredNodeTypes();
for (int i = 0; i < ntNames.length; i++) {
NodeTypeDef ntDef = ntReg.getNodeTypeDef(ntNames[i]);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java?rev=164985&r1=164984&r2=164985&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java
Wed Apr 27 07:38:52 2005
@@ -28,20 +28,11 @@
/**
* The history root node state represents the root node of all version histories.
- * the version histories are dynamically exposed. since there could be very many,
- * it does not return all the child nodes by the {@link #getChildNodeEntries()}}
- * method. this implies, that the version storage is not browsable, but the
- * nodes are nevertheless correctly exposed (this behaviour can be changed, by
- * modifying the compile-time constant {@link #LIST_ALL_HISTORIES}.
+ * the version histories are dynamically exposed.
*/
public class HistoryRootNodeState extends VirtualNodeState {
/**
- * flag for listing all histories
- */
- private static final boolean LIST_ALL_HISTORIES = true;
-
- /**
* the version manager
*/
private final VersionManager vm;
@@ -99,19 +90,17 @@
* {@inheritDoc}
*/
public synchronized List getChildNodeEntries() {
- if (LIST_ALL_HISTORIES) {
- try {
- ArrayList list = new ArrayList(vm.getNumVersionHistories());
- Iterator iter = vm.getVersionHistoryIds();
- while (iter.hasNext()) {
- String id = (String) iter.next();
- QName name = new QName(NS_DEFAULT_URI, id);
- list.add(createChildNodeEntry(name, id, 1));
- }
- return list;
- } catch (RepositoryException e) {
- // ignore
+ try {
+ ArrayList list = new ArrayList(vm.getNumVersionHistories());
+ Iterator iter = vm.getVersionHistoryIds();
+ while (iter.hasNext()) {
+ String id = (String) iter.next();
+ QName name = new QName(NS_DEFAULT_URI, id);
+ list.add(createChildNodeEntry(name, id, 1));
}
+ return list;
+ } catch (RepositoryException e) {
+ // ignore
}
return Collections.EMPTY_LIST;
}
|