Codota Logo
TemplateManagementService.templateOfId
Code IndexAdd Codota to your IDE (free)

How to use
templateOfId
method
in
org.ldp4j.application.kernel.template.TemplateManagementService

Best Java code snippets using org.ldp4j.application.kernel.template.TemplateManagementService.templateOfId (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: ldp4j/ldp4j

public <T extends ResourceTemplate> T templateOfId(String templateId, Class<? extends T> templateClass) {
  checkNotNull(templateClass,"Template class cannot be null");
  ResourceTemplate found = templateOfId(templateId);
  if(found==null) {
    return null;
  } else if(!templateClass.isInstance(found)) {
    throw new IllegalArgumentException("Cannot cast template '"+templateId+"' to '"+templateClass.getCanonicalName()+"' ("+found.getClass().getCanonicalName()+")");
  }
  return templateClass.cast(found);
}
origin: ldp4j/ldp4j

ResourceTemplate loadTemplate(String templateId) {
  return this.writeSessionService.templateManagementService().templateOfId(templateId);
}
origin: ldp4j/ldp4j

private Class<? extends ResourceHandler> resolveHandler(ResourceId resourceId) {
  ResourceTemplate template = this.templateManagementService.templateOfId(resourceId.templateId());
  return template!=null?template.handlerClass():null;
}
origin: ldp4j/ldp4j

ResourceTemplate resourceTemplate(Resource resource) {
  return this.engine().templateManagementService().templateOfId(resource.id().templateId());
}
origin: ldp4j/ldp4j

private <T extends Resource> Adapter adapter(T resource, WriteSessionConfiguration configuration) {
  ResourceTemplate template=this.templateManagementService.templateOfId(resource.id().templateId());
  Class<? extends ResourceHandler> handlerClass = template.handlerClass();
  ResourceHandler delegate=this.templateManagementService.getHandler(handlerClass);
  return AdapterFactory.newAdapter(resource,delegate,this.writeSessionService,configuration);
}
origin: ldp4j/ldp4j

protected final Container rootContainer(Name<?> name, String templateId) {
  return (Container)this.delegate.getModelFactory().createResource(ServiceRegistry.getInstance().getService(TemplateManagementService.class).templateOfId(templateId), name);
}
origin: ldp4j/ldp4j

protected final Resource rootResource(Name<?> name, String templateId) {
  return this.delegate.getModelFactory().createResource(ServiceRegistry.getInstance().getService(TemplateManagementService.class).templateOfId(templateId), name);
}
origin: ldp4j/ldp4j

private URI getIndirectId(Container container, DataSet dataSet) {
  TemplateIntrospector introspector=
    TemplateIntrospector.
      newInstance(
        this.templateManagementService.
          templateOfId(container.id().templateId()));
  if(!introspector.isIndirectContainer()) {
    return null;
  }
  URI insertedContentRelation=introspector.getInsertedContentRelation();
  IndirectIdCollector collector=
    new IndirectIdCollector(
      false,
      insertedContentRelation,
      getInsertedContentRelationProperty(dataSet,insertedContentRelation));
  return collector.getIndirectId();
}
origin: ldp4j/ldp4j

private String generatePathForMember(Resource child, Container parent, String desiredPath) throws EndpointNotFoundException {
  Member member = parent.findMember(child.id());
  if(member!=null) {
    Endpoint endpoint=getResourceEndpoint(parent.id());
    ContainerTemplate parentTemplate=this.templateManagementService.templateOfId(parent.id().templateId(),ContainerTemplate.class);
    if(parentTemplate==null) {
      throw new IllegalStateException("Could not find template resource '"+parent+"'");
    }
    String slugPath=getSlugPath(parent, desiredPath);
    return
      PathBuilder.
        create().
          addSegment(endpoint.path()).
          addSegment(parentTemplate.memberPath().or("")).
          addSegment(member.number()).
          addSegment(slugPath).
          build();
  }
  return null;
}
origin: ldp4j/ldp4j

private void prepareSession(final Action action, final ResourceSnapshot snapshot) {
  logAction(Stage.PREPARATION,action,snapshot);
  final Resource resource=
    this.modelFactory.
      createResource(this.templateManagementService.templateOfId(snapshot.templateId()), snapshot.name());
  doPrepareSession(resource);
}
origin: ldp4j/ldp4j

private <T extends Resource> T publishResource(Class<? extends T> clazz, String templateId, Name<?> resourceName, String path) {
  Transaction transaction = RuntimeDelegate.getInstance().getTransactionManager().currentTransaction();
  transaction.begin();
  Resource newResource=this.modelFactory.createResource(this.tms.templateOfId(templateId),resourceName);
  T resource=clazz.cast(newResource);
  RuntimeDelegate.getInstance().getResourceRepository().add(resource);
  Endpoint endpoint=this.modelFactory.createEndpoint(path,resource,new Date(),EntityTag.createStrong(path));
  RuntimeDelegate.getInstance().getEndpointRepository().add(endpoint);
  transaction.commit();
  return resource;
}
origin: ldp4j/ldp4j

private String generatePathForAttachment(Resource child, Resource parent) throws EndpointNotFoundException {
  Attachment attachment=parent.findAttachment(child.id());
  if(attachment==null) {
    return null;
  }
  Endpoint endpoint=getResourceEndpoint(parent.id());
  ResourceTemplate parentTemplate=this.templateManagementService.templateOfId(parent.id().templateId());
  AttachedTemplate attachedTemplate = parentTemplate.attachedTemplate(attachment.id());
  return
    PathBuilder.
      create().
        addSegment(endpoint.path()).
        addSegment(attachedTemplate.path()).
        addSegment(attachment.version()>0?attachment.version():null).
        build();
}
origin: ldp4j/ldp4j

private Resource initialize(final String id, final String path) {
  final Transaction transaction=
    RuntimeDelegate.
      getInstance().
        getTransactionManager().
          currentTransaction();
  transaction.begin();
  try {
    this.uow = UnitOfWork.newCurrent();
    final Resource resource=
      this.modelFactory.createResource(
        this.templateManagementService.templateOfId("personTemplate"),
        name(id));
    final Endpoint endpoint=this.modelFactory.createEndpoint(path,resource,new Date(),EntityTag.createStrong(path));
    RuntimeDelegate.getInstance().getResourceRepository().add(resource);
    RuntimeDelegate.getInstance().getEndpointRepository().add(endpoint);
    UnitOfWork.setCurrent(null);
    transaction.commit();
    return resource;
  } finally {
    if(transaction.isActive()) {
      transaction.rollback();
    }
  }
}
org.ldp4j.application.kernel.templateTemplateManagementServicetemplateOfId

Popular methods of TemplateManagementService

  • configure
  • getHandler
  • templateOfHandler
  • <init>
  • getState
  • serviceBuilder

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now