org.modeshape.jcr.ExecutionContext.getPropertyFactory()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(12.4k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中org.modeshape.jcr.ExecutionContext.getPropertyFactory()方法的一些代码示例,展示了ExecutionContext.getPropertyFactory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.getPropertyFactory()方法的具体详情如下:
包路径:org.modeshape.jcr.ExecutionContext
类名称:ExecutionContext
方法名:getPropertyFactory

ExecutionContext.getPropertyFactory介绍

[英]Get the factory for creating Property objects.
[中]获取用于创建属性对象的工厂。

代码示例

代码示例来源:origin: org.fcrepo/modeshape-jcr

final PropertyFactory propertyFactory() {
  return context.getPropertyFactory();
}

代码示例来源:origin: ModeShape/modeshape

final PropertyFactory propertyFactory() {
  return context.getPropertyFactory();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected final PropertyFactory propertyFactory() {
  return context.getPropertyFactory();
}

代码示例来源:origin: ModeShape/modeshape

protected final PropertyFactory propertyFactory() {
  return context.getPropertyFactory();
}

代码示例来源:origin: ModeShape/modeshape

protected PropertyFactory propertyFactory() {
  return context.getPropertyFactory();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

/**
 * Parse the content of the vendor extension excluding the curly braces in the CND content.
 * 
 * @param vendorExtension the vendor extension string; never null
 * @return the property representing the vendor extension, or null if the vendor extension is incomplete
 */
protected final Property parseVendorExtensionContent( String vendorExtension ) {
  Matcher matcher = VENDOR_PATTERN.matcher(vendorExtension);
  if (!matcher.find()) return null;
  String vendorName = removeQuotes(matcher.group(1));
  String vendorValue = removeQuotes(matcher.group(3));
  assert vendorName != null;
  assert vendorValue != null;
  assert vendorName.length() != 0;
  assert vendorValue.length() != 0;
  return context.getPropertyFactory().create(nameFactory.create(vendorName), vendorValue);
}

代码示例来源:origin: ModeShape/modeshape

/**
 * Parse the content of the vendor extension excluding the curly braces in the CND content.
 * 
 * @param vendorExtension the vendor extension string; never null
 * @return the property representing the vendor extension, or null if the vendor extension is incomplete
 */
protected final Property parseVendorExtensionContent( String vendorExtension ) {
  Matcher matcher = VENDOR_PATTERN.matcher(vendorExtension);
  if (!matcher.find()) return null;
  String vendorName = removeQuotes(matcher.group(1));
  String vendorValue = removeQuotes(matcher.group(3));
  assert vendorName != null;
  assert vendorValue != null;
  assert vendorName.length() != 0;
  assert vendorValue.length() != 0;
  return context.getPropertyFactory().create(nameFactory.create(vendorName), vendorValue);
}

代码示例来源:origin: ModeShape/modeshape

protected LegacySidecarExtraPropertyStore( FileSystemConnector connector ) {
  this.connector = connector;
  this.registry = this.connector.registry();
  this.propertyFactory = this.connector.getContext().getPropertyFactory();
  this.factories = this.connector.getContext().getValueFactories();
  this.stringFactory = factories.getStringFactory();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected LegacySidecarExtraPropertyStore( FileSystemConnector connector ) {
  this.connector = connector;
  this.registry = this.connector.registry();
  this.propertyFactory = this.connector.getContext().getPropertyFactory();
  this.factories = this.connector.getContext().getValueFactories();
  this.stringFactory = factories.getStringFactory();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public boolean initializeIndexStorage(SessionCache session, MutableCachedNode systemNode) {
  this.propFactory = session.getContext().getPropertyFactory();
  assert systemNode != null;
  ChildReferences childReferences = systemNode.getChildReferences(session);
  //initializes the /jcr:system/mode:indexes node if not already present.
  NodeKey indexesNodeKey = systemNode.getKey().withId(INDEXES_NODE_ID); 
  if (!childReferences.hasChild(indexesNodeKey)) {
    MutableCachedNode indexes = createNode(session, systemNode, INDEXES_NODE_ID, ModeShapeLexicon.INDEXES, ModeShapeLexicon.INDEXES);
    indexes.excludeFromSearch();
    return true;
  }
  return false;
}

代码示例来源:origin: ModeShape/modeshape

@Override
public boolean initializeIndexStorage(SessionCache session, MutableCachedNode systemNode) {
  this.propFactory = session.getContext().getPropertyFactory();
  assert systemNode != null;
  ChildReferences childReferences = systemNode.getChildReferences(session);
  //initializes the /jcr:system/mode:indexes node if not already present.
  NodeKey indexesNodeKey = systemNode.getKey().withId(INDEXES_NODE_ID); 
  if (!childReferences.hasChild(indexesNodeKey)) {
    MutableCachedNode indexes = createNode(session, systemNode, INDEXES_NODE_ID, ModeShapeLexicon.INDEXES, ModeShapeLexicon.INDEXES);
    indexes.excludeFromSearch();
    return true;
  }
  return false;
}

代码示例来源:origin: ModeShape/modeshape

SystemContent( SessionCache systemCache ) {
  this.system = systemCache;
  ExecutionContext context = systemCache.getContext();
  this.propertyFactory = context.getPropertyFactory();
  ValueFactories factories = context.getValueFactories();
  this.booleans = factories.getBooleanFactory();
  this.strings = factories.getStringFactory();
  this.names = factories.getNameFactory();
  this.referenceFactory = factories.getReferenceFactory();
  this.weakReferenceFactory = factories.getWeakReferenceFactory();
  this.jcrValues = new JcrValueFactory(context);
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

SystemContent( SessionCache systemCache ) {
  this.system = systemCache;
  ExecutionContext context = systemCache.getContext();
  this.propertyFactory = context.getPropertyFactory();
  ValueFactories factories = context.getValueFactories();
  this.booleans = factories.getBooleanFactory();
  this.strings = factories.getStringFactory();
  this.names = factories.getNameFactory();
  this.referenceFactory = factories.getReferenceFactory();
  this.weakReferenceFactory = factories.getWeakReferenceFactory();
  this.jcrValues = new JcrValueFactory(context);
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

public DocumentTranslator( ExecutionContext context,
              DocumentStore documentStore,
              long largeStringSize ) {
  this.documentStore = documentStore;
  this.largeStringSize.set(largeStringSize);
  this.context = context;
  this.propertyFactory = this.context.getPropertyFactory();
  this.factories = this.context.getValueFactories();
  this.paths = this.factories.getPathFactory();
  this.names = this.factories.getNameFactory();
  this.dates = this.factories.getDateFactory();
  this.binaries = this.factories.getBinaryFactory();
  this.longs = this.factories.getLongFactory();
  this.doubles = this.factories.getDoubleFactory();
  this.uris = this.factories.getUriFactory();
  this.decimals = this.factories.getDecimalFactory();
  this.refs = this.factories.getReferenceFactory();
  this.weakrefs = this.factories.getWeakReferenceFactory();
  this.simplerefs = this.factories.getSimpleReferenceFactory();
  this.strings = this.factories.getStringFactory();
  assert this.largeStringSize.get() >= 0;
}

代码示例来源:origin: ModeShape/modeshape

public DocumentTranslator( ExecutionContext context,
              DocumentStore documentStore,
              long largeStringSize ) {
  this.documentStore = documentStore;
  this.largeStringSize.set(largeStringSize);
  this.context = context;
  this.propertyFactory = this.context.getPropertyFactory();
  this.factories = this.context.getValueFactories();
  this.paths = this.factories.getPathFactory();
  this.names = this.factories.getNameFactory();
  this.dates = this.factories.getDateFactory();
  this.binaries = this.factories.getBinaryFactory();
  this.longs = this.factories.getLongFactory();
  this.doubles = this.factories.getDoubleFactory();
  this.uris = this.factories.getUriFactory();
  this.decimals = this.factories.getDecimalFactory();
  this.refs = this.factories.getReferenceFactory();
  this.weakrefs = this.factories.getWeakReferenceFactory();
  this.simplerefs = this.factories.getSimpleReferenceFactory();
  this.strings = this.factories.getStringFactory();
  assert this.largeStringSize.get() >= 0;
}

代码示例来源:origin: ModeShape/modeshape

protected DeepCopy( SessionNode targetNode,
          WritableSessionCache cache,
          CachedNode sourceNode,
          SessionCache sourceCache,
          String systemWorkspaceKey,
          Connectors connectors ) {
  this.targetCache = cache;
  this.targetNode = targetNode;
  this.sourceCache = sourceCache;
  this.sourceNode = sourceNode;
  this.startingPathInSource = sourceNode.getPath(sourceCache);
  this.propertyFactory = this.targetCache.getContext().getPropertyFactory();
  this.targetWorkspaceKey = targetNode.getKey().getWorkspaceKey();
  this.documentStore = ((WorkspaceCache)sourceCache.getWorkspace()).documentStore();
  this.systemWorkspaceKey = systemWorkspaceKey;
  this.connectors = connectors;
  this.valueFactories = this.targetCache.context().getValueFactories();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected DeepCopy( SessionNode targetNode,
          WritableSessionCache cache,
          CachedNode sourceNode,
          SessionCache sourceCache,
          String systemWorkspaceKey,
          Connectors connectors ) {
  this.targetCache = cache;
  this.targetNode = targetNode;
  this.sourceCache = sourceCache;
  this.sourceNode = sourceNode;
  this.startingPathInSource = sourceNode.getPath(sourceCache);
  this.propertyFactory = this.targetCache.getContext().getPropertyFactory();
  this.targetWorkspaceKey = targetNode.getKey().getWorkspaceKey();
  this.documentStore = ((WorkspaceCache)sourceCache.getWorkspace()).documentStore();
  this.systemWorkspaceKey = systemWorkspaceKey;
  this.connectors = connectors;
  this.valueFactories = this.targetCache.context().getValueFactories();
}

代码示例来源:origin: ModeShape/modeshape

private void storeProjection( Projection projection, SessionCache systemSession ) {
  PropertyFactory propertyFactory = repository.context().getPropertyFactory();
  // we need to store the projection mappings so that we don't loose that information
  NodeKey systemNodeKey = getSystemNode(systemSession).getKey();
  MutableCachedNode systemNode = systemSession.mutable(systemNodeKey);
  ChildReference federationNodeRef = systemNode.getChildReferences(systemSession).getChild(ModeShapeLexicon.FEDERATION);
  if (federationNodeRef == null) {
    // there isn't a federation node present, so we need to add it
    try {
      Property primaryType = propertyFactory.create(JcrLexicon.PRIMARY_TYPE, ModeShapeLexicon.FEDERATION);
      systemNode.createChild(systemSession, systemNodeKey.withId("mode:federation"), ModeShapeLexicon.FEDERATION,
                  primaryType);
      federationNodeRef = systemNode.getChildReferences(systemSession).getChild(ModeShapeLexicon.FEDERATION);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  NodeKey federationNodeKey = federationNodeRef.getKey();
  MutableCachedNode federationNode = systemSession.mutable(federationNodeKey);
  Property primaryType = propertyFactory.create(JcrLexicon.PRIMARY_TYPE, ModeShapeLexicon.PROJECTION);
  Property externalNodeKeyProp = propertyFactory.create(ModeShapeLexicon.EXTERNAL_NODE_KEY, projection.getExternalNodeKey());
  Property projectedNodeKeyProp = propertyFactory.create(ModeShapeLexicon.PROJECTED_NODE_KEY,
                              projection.getProjectedNodeKey());
  Property alias = propertyFactory.create(ModeShapeLexicon.PROJECTION_ALIAS, projection.getAlias());
  federationNode.createChild(systemSession, federationNodeKey.withRandomId(), ModeShapeLexicon.PROJECTION, primaryType,
                externalNodeKeyProp, projectedNodeKeyProp, alias);
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

private void storeProjection( Projection projection, SessionCache systemSession ) {
  PropertyFactory propertyFactory = repository.context().getPropertyFactory();
  // we need to store the projection mappings so that we don't loose that information
  NodeKey systemNodeKey = getSystemNode(systemSession).getKey();
  MutableCachedNode systemNode = systemSession.mutable(systemNodeKey);
  ChildReference federationNodeRef = systemNode.getChildReferences(systemSession).getChild(ModeShapeLexicon.FEDERATION);
  if (federationNodeRef == null) {
    // there isn't a federation node present, so we need to add it
    try {
      Property primaryType = propertyFactory.create(JcrLexicon.PRIMARY_TYPE, ModeShapeLexicon.FEDERATION);
      systemNode.createChild(systemSession, systemNodeKey.withId("mode:federation"), ModeShapeLexicon.FEDERATION,
                  primaryType);
      federationNodeRef = systemNode.getChildReferences(systemSession).getChild(ModeShapeLexicon.FEDERATION);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  NodeKey federationNodeKey = federationNodeRef.getKey();
  MutableCachedNode federationNode = systemSession.mutable(federationNodeKey);
  Property primaryType = propertyFactory.create(JcrLexicon.PRIMARY_TYPE, ModeShapeLexicon.PROJECTION);
  Property externalNodeKeyProp = propertyFactory.create(ModeShapeLexicon.EXTERNAL_NODE_KEY, projection.getExternalNodeKey());
  Property projectedNodeKeyProp = propertyFactory.create(ModeShapeLexicon.PROJECTED_NODE_KEY,
                              projection.getProjectedNodeKey());
  Property alias = propertyFactory.create(ModeShapeLexicon.PROJECTION_ALIAS, projection.getAlias());
  federationNode.createChild(systemSession, federationNodeKey.withRandomId(), ModeShapeLexicon.PROJECTION, primaryType,
                externalNodeKeyProp, projectedNodeKeyProp, alias);
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

SystemContent systemContent = new SystemContent(systemSession);
  MutableCachedNode systemNode = systemContent.mutableSystemNode();
  systemNode.setProperty(systemSession, context.getPropertyFactory().create(ModeShapeLexicon.ACL_COUNT, nodesWithAccessControl));
  systemSession.save();
} catch (RepositoryException e) {

相关文章