Examples of ApiObject


Examples of com.dottydingo.hyperion.api.ApiObject

        EndpointResponse response = phaseContext.getEndpointResponse();

        ApiVersionPlugin<ApiObject,PersistentObject> apiVersionPlugin = phaseContext.getVersionPlugin();
        EntityPlugin plugin = phaseContext.getEntityPlugin();

        ApiObject clientObject = marshaller.unmarshall(request.getInputStream(),apiVersionPlugin.getApiClass());
        clientObject.setId(null);

        PersistenceContext persistenceContext = buildPersistenceContext(phaseContext);
        Set<String> fieldSet = persistenceContext.getRequestedFields();
        if(fieldSet != null)
            fieldSet.add("id");

        ApiObject saved = plugin.getPersistenceOperations().createOrUpdateItem(clientObject, persistenceContext);
        if(saved != null)
        {
            processChangeEvents(phaseContext,persistenceContext);
            if(persistenceContext.getWriteContext() == WriteContext.create)
            {
                response.setResponseCode(201);
                String location = String.format("%s%s/%s",request.getBaseUrl(),request.getRequestUri(),saved.getId());
                response.setHeader("Location", location);
            }
            else
            {
                response.setResponseCode(200);
View Full Code Here

Examples of com.dottydingo.hyperion.api.ApiObject

        EntityPlugin plugin = phaseContext.getEntityPlugin();

        PersistenceContext persistenceContext = buildPersistenceContext(phaseContext);

        RequestContext<ApiObject> requestContext = marshaller.unmarshallWithContext(request.getInputStream(), apiVersionPlugin.getApiClass());
        ApiObject clientObject = requestContext.getRequestObject();

        List ids = plugin.getKeyConverter().covertKeys(phaseContext.getId());
        if(ids.size() != 1)
            throw new BadRequestException("A single id must be provided for an update.");

        Set<String> setFields = requestContext.getSetFields();

        persistenceContext.setProvidedFields(setFields);

        Set<String> fieldSet = persistenceContext.getRequestedFields();
        if(fieldSet != null)
            fieldSet.add("id");

        ApiObject saved = plugin.getPersistenceOperations().updateItem(ids, clientObject, persistenceContext);

        processChangeEvents(phaseContext,persistenceContext);

        if(saved != null)
        {
View Full Code Here

Examples of com.dottydingo.hyperion.api.ApiObject

        EndpointResponse response = phaseContext.getEndpointResponse();

        ApiVersionPlugin<ApiObject,PersistentObject> apiVersionPlugin = phaseContext.getVersionPlugin();
        EntityPlugin plugin = phaseContext.getEntityPlugin();

        ApiObject clientObject = marshaller.unmarshall(request.getInputStream(),apiVersionPlugin.getApiClass());
        clientObject.setId(null);

        PersistenceContext persistenceContext = buildPersistenceContext(phaseContext);
        Set<String> fieldSet = persistenceContext.getRequestedFields();
        if(fieldSet != null)
            fieldSet.add("id");


        ApiObject saved = plugin.getPersistenceOperations().createOrUpdateItem(clientObject, persistenceContext);
        if(saved != null)
        {
            processChangeEvents(phaseContext,persistenceContext);
            if(persistenceContext.getWriteContext() == WriteContext.create)
            {
                response.setResponseCode(201);
                String location = String.format("%s%s/%s",request.getBaseUrl(),request.getRequestUri(),saved.getId());
                response.setHeader("Location", location);
            }
            else
            {
                response.setResponseCode(200);
View Full Code Here

Examples of com.dottydingo.hyperion.api.ApiObject

        ApiVersionPlugin<ApiObject,PersistentObject> apiVersionPlugin = phaseContext.getVersionPlugin();
        EntityPlugin plugin = phaseContext.getEntityPlugin();

        PersistenceContext persistenceContext = buildPersistenceContext(phaseContext);

        ApiObject clientObject = marshaller.unmarshall(request.getInputStream(), apiVersionPlugin.getApiClass());

        List ids = plugin.getKeyConverter().covertKeys(phaseContext.getId());
        if(ids.size() != 1)
            throw new BadRequestException("A single id must be provided for an update.");

        Set<String> fieldSet = persistenceContext.getRequestedFields();
        if(fieldSet != null)
            fieldSet.add("id");

        ApiObject saved = plugin.getPersistenceOperations().updateItem(ids, clientObject, persistenceContext);

        processChangeEvents(phaseContext,persistenceContext);

        if(saved != null)
        {
View Full Code Here

Examples of org.jsondoc.core.annotation.ApiObject

 
  public static Set<ApiObjectDoc> getApiObjectDocs(Set<Class<?>> classes) {
    Set<ApiObjectDoc> pojoDocs = new TreeSet<ApiObjectDoc>();
    for (Class<?> pojo : classes) {
      log.debug("Getting JSONDoc for class: " + pojo.getName());
      ApiObject annotation = pojo.getAnnotation(ApiObject.class);
      ApiObjectDoc pojoDoc = ApiObjectDoc.buildFromAnnotation(annotation, pojo);
      if(pojo.isAnnotationPresent(ApiVersion.class)) {
        pojoDoc.setSupportedversions(ApiVersionDoc.buildFromAnnotation(pojo.getAnnotation(ApiVersion.class)));
      }
     
      if(annotation.show()) {
        pojoDocs.add(pojoDoc);
      }
    }
    return pojoDocs;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.