/** * Get the namespace registry with durable prefixes as used by the query indexes. * * @return the durable namespace registry; never null */ public NamespaceRegistry getNamespaceRegistry() { // TODO: Durable namespace registry return context.getNamespaceRegistry(); }
/** * Get the namespace registry with durable prefixes as used by the query indexes. * * @return the durable namespace registry; never null */ public NamespaceRegistry getNamespaceRegistry() { // TODO: Durable namespace registry return context.getNamespaceRegistry(); }
protected PathBasedChangeAdapter( ExecutionContext context, NodeTypePredicate matcher, String workspaceName, ProvidedIndex<?> index, Name propertyName) { super(context, workspaceName, matcher, index); assert propertyName != null; this.propertyName = propertyName.getString(context.getNamespaceRegistry()); }
@Override public String getName() { if (name == null) return null; return name.getString(context.getNamespaceRegistry()); }
public ReadableVisitor( ExecutionContext context ) { CheckArg.isNotNull(context, "context"); this.context = context; this.registry = context == null ? null : context.getNamespaceRegistry(); }
@Override public String[] getDeclaredSupertypeNames() { if (declaredSupertypeNames == null) return new String[0]; String[] names = new String[declaredSupertypeNames.length]; for (int i = 0; i < declaredSupertypeNames.length; i++) { names[i] = declaredSupertypeNames[i].getString(context.getNamespaceRegistry()); } return names; }
@Override public String getPrimaryItemName() { if (primaryItemName == null) { return null; } // Translate the name to the correct prefix. Need to check the session to support url-remapping. return primaryItemName.getString(context.getNamespaceRegistry()); }
@Override public String getPrimaryItemName() { if (primaryItemName == null) { return null; } // Translate the name to the correct prefix. Need to check the session to support url-remapping. return primaryItemName.getString(context.getNamespaceRegistry()); }
protected final boolean matches( ExecutionContext context, String actual, Name name ) { return actual.equals(name.getString(context.getNamespaceRegistry())); }
@Override public String getName() { // Translate the name to the correct prefix. Need to check the session to support url-remapping. return name.getString(context.getNamespaceRegistry()); }
protected final boolean matches( ExecutionContext context, IndexColumnDefinition defn, Name name ) { return defn.getPropertyName().equals(name.getString(context.getNamespaceRegistry())); }
/** * Create an instance of an execution context that uses the {@link AccessController#getContext() current JAAS calling context} * , with default implementations for all other components (including default namespaces in the * {@link #getNamespaceRegistry() namespace registry}. */ @SuppressWarnings( "synthetic-access" ) public ExecutionContext() { this(new NullSecurityContext(), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); initializeDefaultNamespaces(this.getNamespaceRegistry()); assert securityContext != null; }
@Override public String getDefaultPrimaryTypeName() { if (defaultPrimaryType == null) return null; return defaultPrimaryType.getString(getContext().getNamespaceRegistry()); }
protected JcrValueFactory( ExecutionContext context ) { this.valueFactories = context.getValueFactories(); this.namespaces = context.getNamespaceRegistry(); this.executionContextProcessId = context.getProcessId(); }
@Override public Iterator<Property> getProperties( Collection<?> namePatterns, NodeCache cache ) { WorkspaceCache wsCache = workspaceCache(cache); final NamespaceRegistry registry = wsCache.context().getNamespaceRegistry(); return new PatternIterator<Property>(getProperties(wsCache), namePatterns) { @Override protected String matchable( Property value ) { return value.getName().getString(registry); } }; }
@Override public Iterator<Property> getProperties( Collection<?> namePatterns, NodeCache cache ) { final AbstractSessionCache session = session(cache); final NamespaceRegistry registry = session.context().getNamespaceRegistry(); return new PatternIterator<Property>(getProperties(session), namePatterns) { @Override protected String matchable( Property value ) { return value.getName().getString(registry); } }; }
SystemNamespaceRegistry( JcrRepository.RunningState repository ) { this.repository = repository; this.cache = new SimpleNamespaceRegistry(); // Pre-load all of the built-in namespaces ... this.cache.register(new ExecutionContext().getNamespaceRegistry().getNamespaces()); }
@Override public String toString() { return getOperationName() + " '" + this.startingPathInSource.getString(sourceCache.getContext().getNamespaceRegistry()) + "' in workspace '" + sourceCache.getWorkspace().toString() + "' into '" + this.targetNode.getPath(targetCache).getString(targetCache.getContext().getNamespaceRegistry()) + "' in workspace '" + targetCache.getWorkspace().toString() + "'"; }
@Before public void beforeEach() { problems = new SimpleProblems(); context = new ExecutionContext(); context.getNamespaceRegistry().register(ModeShapeLexicon.Namespace.PREFIX, ModeShapeLexicon.Namespace.URI); context.getNamespaceRegistry().register(JcrLexicon.Namespace.PREFIX, JcrLexicon.Namespace.URI); context.getNamespaceRegistry().register(JcrNtLexicon.Namespace.PREFIX, JcrNtLexicon.Namespace.URI); // Set up the importer ... importer = new CndImporter(context); }
private JcrPropertyDefinition propertyDefinitionFor( NodeType nodeType, Name propertyName ) { PropertyDefinition propertyDefs[] = nodeType.getPropertyDefinitions(); String property = propertyName.getString(context.getNamespaceRegistry()); for (int i = 0; i < propertyDefs.length; i++) { if (propertyDefs[i].getName().equals(property)) { return (JcrPropertyDefinition)propertyDefs[i]; } } throw new IllegalStateException("Could not find property definition name " + property + " for type " + nodeType.getName() + ". Test setup is invalid."); }