Examples of BundleEntry


Examples of ca.uhn.fhir.model.api.BundleEntry

    bundle.getPublished().setToCurrentTimeInLocalTimeZone();
    bundle.getLinkBase().setValue(theServerBase);
    bundle.getLinkSelf().setValue(theCompleteUrl);

    for (IResource next : theResult) {
      BundleEntry entry = new BundleEntry();
      bundle.getEntries().add(entry);

      entry.setResource(next);

      RuntimeResourceDefinition def = getContext().getResourceDefinition(next);

      if (next.getId() != null && StringUtils.isNotBlank(next.getId().getValue())) {
        entry.getId().setValue(next.getId().getValue());
        entry.getTitle().setValue(def.getName() + " " + next.getId().getValue());

        StringBuilder b = new StringBuilder();
        b.append(theServerBase);
        b.append('/');
        b.append(def.getName());
        b.append('/');
        String resId = next.getId().getValue();
        b.append(resId);

        /*
         * If this is a history operation, we add the version of the
         * resource to the self link to indicate the version
         */
        if (getResourceOperationType() == RestfulOperationTypeEnum.HISTORY_INSTANCE || getResourceOperationType() == RestfulOperationTypeEnum.HISTORY_TYPE || getSystemOperationType() == RestfulOperationSystemEnum.HISTORY_SYSTEM) {
          IdDt versionId = getIdFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.VERSION_ID);
          if (versionId != null) {
            b.append('/');
            b.append(Constants.PARAM_HISTORY);
            b.append('/');
            b.append(versionId.getValue());
          } else {
            throw new InternalErrorException("Server did not provide a VERSION_ID in the resource metadata for resource with ID " + resId);
          }
        }

        InstantDt published = getInstantFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.PUBLISHED);
        if (published == null) {
          entry.getPublished().setToCurrentTimeInLocalTimeZone();
        } else {
          entry.setPublished(published);
        }

        InstantDt updated = getInstantFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.UPDATED);
        if (updated != null) {
          entry.setUpdated(updated);
        }

        boolean haveQ = false;
        if (thePrettyPrint) {
          b.append('?').append(Constants.PARAM_PRETTY).append("=true");
          haveQ = true;
        }
        if (theResponseEncoding == EncodingUtil.JSON) {
          if (!haveQ) {
            b.append('?');
            haveQ = true;
          } else {
            b.append('&');
          }
          b.append(Constants.PARAM_FORMAT).append("=json");
        }
        if (theNarrativeMode != NarrativeModeEnum.NORMAL) {
          b.append(Constants.PARAM_NARRATIVE).append("=").append(theNarrativeMode.name().toLowerCase());
        }
        entry.getLinkSelf().setValue(b.toString());
      }
    }

    bundle.getTotalResults().setValue(theResult.size());

View Full Code Here

Examples of ca.uhn.fhir.model.api.BundleEntry

    private BundleEntry myEntry;
    private Class<? extends IResource> myResourceType;

    public AtomEntryState(Bundle theInstance, Class<? extends IResource> theResourceType) {
      super(null);
      myEntry = new BundleEntry();
      myResourceType = theResourceType;
      theInstance.getEntries().add(myEntry);
    }
View Full Code Here

Examples of ca.uhn.fhir.model.api.BundleEntry

    private BundleEntry myEntry;
    private Class<? extends IResource> myResourceType;

    public AtomEntryState(Bundle theInstance, Class<? extends IResource> theResourceType) {
      super(null);
      myEntry = new BundleEntry();
      myResourceType = theResourceType;
      theInstance.getEntries().add(myEntry);
    }
View Full Code Here

Examples of ca.uhn.fhir.model.api.BundleEntry

    bundle.getPublished().setToCurrentTimeInLocalTimeZone();
    bundle.getLinkBase().setValue(theServerBase);
    bundle.getLinkSelf().setValue(theCompleteUrl);

    for (IResource next : theResult) {
      BundleEntry entry = new BundleEntry();
      bundle.getEntries().add(entry);

      entry.setResource(next);
      TagList list = (TagList) next.getResourceMetadata().get(ResourceMetadataKeyEnum.TAG_LIST);
      if (list != null) {
        for (Tag tag : list) {
          if (StringUtils.isNotBlank(tag.getTerm())) {
            entry.addCategory().setTerm(tag.getTerm()).setLabel(tag.getLabel()).setScheme(tag.getScheme());
          }
        }
      }

      RuntimeResourceDefinition def = getContext().getResourceDefinition(next);

      if (next.getId() != null && StringUtils.isNotBlank(next.getId().getValue())) {
        entry.getId().setValue(next.getId().getValue());
        entry.getTitle().setValue(def.getName() + " " + next.getId().getValue());

        StringBuilder b = new StringBuilder();
        b.append(theServerBase);
        b.append('/');
        b.append(def.getName());
        b.append('/');
        String resId = next.getId().getValue();
        b.append(resId);

        /*
         * If this is a history operation, we add the version of the
         * resource to the self link to indicate the version
         */
        if (getResourceOperationType() == RestfulOperationTypeEnum.HISTORY_INSTANCE || getResourceOperationType() == RestfulOperationTypeEnum.HISTORY_TYPE || getSystemOperationType() == RestfulOperationSystemEnum.HISTORY_SYSTEM) {
          IdDt versionId = getIdFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.VERSION_ID);
          if (versionId != null) {
            b.append('/');
            b.append(Constants.PARAM_HISTORY);
            b.append('/');
            b.append(versionId.getValue());
          } else {
            throw new InternalErrorException("Server did not provide a VERSION_ID in the resource metadata for resource with ID " + resId);
          }
        }

        InstantDt published = getInstantFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.PUBLISHED);
        if (published == null) {
          entry.getPublished().setToCurrentTimeInLocalTimeZone();
        } else {
          entry.setPublished(published);
        }

        InstantDt updated = getInstantFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.UPDATED);
        if (updated != null) {
          entry.setUpdated(updated);
        }

        TagList tagList = getTagListFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.TAG_LIST);
        if (tagList != null) {
          for (Tag nextTag : tagList) {
            entry.addCategory(nextTag);
          }
        }

        boolean haveQ = false;
        if (thePrettyPrint) {
          b.append('?').append(Constants.PARAM_PRETTY).append("=true");
          haveQ = true;
        }
        if (theResponseEncoding == EncodingEnum.JSON) {
          if (!haveQ) {
            b.append('?');
            haveQ = true;
          } else {
            b.append('&');
          }
          b.append(Constants.PARAM_FORMAT).append("=json");
        }
        if (theNarrativeMode != NarrativeModeEnum.NORMAL) {
          b.append(Constants.PARAM_NARRATIVE).append("=").append(theNarrativeMode.name().toLowerCase());
        }
        entry.getLinkSelf().setValue(b.toString());
      }
    }

    bundle.getTotalResults().setValue(theResult.size());

View Full Code Here

Examples of ca.uhn.fhir.model.api.BundleEntry

    private BundleEntry myEntry;
    private Class<? extends IResource> myResourceType;

    public AtomEntryState(Bundle theInstance, Class<? extends IResource> theResourceType) {
      super(null);
      myEntry = new BundleEntry();
      myResourceType = theResourceType;
      theInstance.getEntries().add(myEntry);
    }
View Full Code Here

Examples of ca.uhn.fhir.model.api.BundleEntry

    bundle.getPublished().setToCurrentTimeInLocalTimeZone();
    bundle.getLinkBase().setValue(theServerBase);
    bundle.getLinkSelf().setValue(theCompleteUrl);

    for (IResource next : theResult) {
      BundleEntry entry = new BundleEntry();
      bundle.getEntries().add(entry);

      entry.setResource(next);

      RuntimeResourceDefinition def = getContext().getResourceDefinition(next);

      if (next.getId() != null && StringUtils.isNotBlank(next.getId().getValue())) {
        entry.getId().setValue(next.getId().getValue());
        entry.getTitle().setValue(def.getName() + " " + next.getId().getValue());

        StringBuilder b = new StringBuilder();
        b.append(theServerBase);
        b.append('/');
        b.append(def.getName());
        b.append('/');
        String resId = next.getId().getValue();
        b.append(resId);

        /*
         * If this is a history operation, we add the version of the
         * resource to the self link to indicate the version
         */
        if (getResourceOperationType() == RestfulOperationTypeEnum.HISTORY_INSTANCE || getResourceOperationType() == RestfulOperationTypeEnum.HISTORY_TYPE || getSystemOperationType() == RestfulOperationSystemEnum.HISTORY_SYSTEM) {
          IdDt versionId = getIdFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.VERSION_ID);
          if (versionId != null) {
            b.append('/');
            b.append(Constants.PARAM_HISTORY);
            b.append('/');
            b.append(versionId.getValue());
          } else {
            throw new InternalErrorException("Server did not provide a VERSION_ID in the resource metadata for resource with ID " + resId);
          }
        }

        InstantDt published = getInstantFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.PUBLISHED);
        if (published == null) {
          entry.getPublished().setToCurrentTimeInLocalTimeZone();
        } else {
          entry.setPublished(published);
        }

        InstantDt updated = getInstantFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.UPDATED);
        if (updated != null) {
          entry.setUpdated(updated);
        }

        boolean haveQ = false;
        if (thePrettyPrint) {
          b.append('?').append(Constants.PARAM_PRETTY).append("=true");
          haveQ = true;
        }
        if (theResponseEncoding == EncodingUtil.JSON) {
          if (!haveQ) {
            b.append('?');
            haveQ = true;
          } else {
            b.append('&');
          }
          b.append(Constants.PARAM_FORMAT).append("=json");
        }
        if (theNarrativeMode != NarrativeModeEnum.NORMAL) {
          b.append(Constants.PARAM_NARRATIVE).append("=").append(theNarrativeMode.name().toLowerCase());
        }
        entry.getLinkSelf().setValue(b.toString());
      }
    }

    bundle.getTotalResults().setValue(theResult.size());

View Full Code Here

Examples of ca.uhn.fhir.model.api.BundleEntry

    private BundleEntry myEntry;

    public AtomEntryState(Bundle theInstance) {
      super(null);
      myEntry = new BundleEntry();
      theInstance.getEntries().add(myEntry);
    }
View Full Code Here

Examples of ca.uhn.fhir.model.api.BundleEntry

    private BundleEntry myEntry;
    private Class<? extends IResource> myResourceType;

    public AtomEntryState(Bundle theInstance, Class<? extends IResource> theResourceType) {
      super(null);
      myEntry = new BundleEntry();
      myResourceType = theResourceType;
      theInstance.getEntries().add(myEntry);
    }
View Full Code Here

Examples of org.apache.karaf.eik.core.equinox.BundleEntry

            // Skip the Felix OSGi Framework
            if (SystemBundleNames.FELIX.toString().equals(id)) {
                continue;
            }

            final BundleEntry entry = new BundleEntry.Builder(getBundleId(models[i])).autostart(getAutoStart(id)).startLevel(
                    getStartLevel(id)).build();

            final boolean inWorkspace = models[i].getUnderlyingResource() != null;
            if (inWorkspace) {
                workspacePlugins.add(entry.toString());
            } else {
                // By default, only add the plugin if it is in the Karaf model
                final Version v = Version.parseVersion(models[i].getPluginBase().getVersion());
                if (karafPlatform.getState().getBundle(id, v) != null && startupSection.containsPlugin(id)) {
                    externalPlugins.add(entry.toString());
                }
            }
        }

        configuration.setAttribute(IPDELauncherConstants.WORKSPACE_BUNDLES, KarafCorePluginUtils.join(workspacePlugins, ","));
View Full Code Here

Examples of org.apache.karaf.eik.core.equinox.BundleEntry

            }

            final String bundleLocation =
                KarafCorePluginUtils.getBundleLocation(b);

            final BundleEntry entry =
                new BundleEntry.Builder(bundleLocation).startLevel("1").autostart("start").build(); //$NON-NLS-1$ $NON-NLS-2$

            bundleEntries.add(entry);
        }
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.