Examples of Media


Examples of javax.print.attribute.standard.Media

        /* set margins at first time */
        MediaMargins margins = null;    // Margins for the dialog Margins fields

        if (isMarginsEnabled) { // Margins fields are enabled and can be edited
           
            Media selectedMedia = (Media) sizeBox.getSelectedItem();
            boolean isMediaSizeSelected = (selectedMedia == null)
                ? false :
                selectedMedia.getClass().isAssignableFrom(MediaSizeName.class);
            MediaSize selectedSize = isMediaSizeSelected
                ? MediaSize.getMediaSizeForName((MediaSizeName) selectedMedia)
                : null;
           
            if (isMediaSupported
View Full Code Here

Examples of javax.print.attribute.standard.Media

        if (service == null || attributes == null) {
            return pf;
        }

        Media media = (Media)attributes.get(Media.class);
        MediaPrintableArea mpa =
            (MediaPrintableArea)attributes.get(MediaPrintableArea.class);
        OrientationRequested orientReq =
           (OrientationRequested)attributes.get(OrientationRequested.class);
View Full Code Here

Examples of org.broadleafcommerce.common.media.domain.Media

            if (valueType == null) {
                throw new IllegalAccessException("Unable to determine the valueType for the rule field (" + populateValueRequest.getProperty().getName() + ")");
            }
       
            if (Media.class.isAssignableFrom(valueType)) {
                Media newMedia = convertJsonToMedia(populateValueRequest.getProperty().getUnHtmlEncodedValue());
                Media media;
                try {
                    media = (Media) populateValueRequest.getFieldManager().getFieldValue(instance,
                            populateValueRequest.getProperty().getName());
                } catch (FieldNotAvailableException e) {
                    throw new IllegalArgumentException(e);
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Media

   public void testAddCatalogItem() {
      byte[] iso = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
      Vdc vdc = lazyGetVdc();
      Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));

      Media sourceMedia = Media.builder().type(VCloudDirectorMediaType.MEDIA).name(name("TestMedia-")).size(iso.length)
               .imageType(Media.ImageType.ISO).description("Test media generated by testAddMedia()").build();
      media = context.getApi().getMediaApi().add(addMedia.getHref(), sourceMedia);

      Checks.checkMediaFor(VCloudDirectorMediaType.MEDIA, media);
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Media

  @Test(description = "Create Key Pair")
  public void testCreateKeyPair() throws URISyntaxException {
    sshKey = SshKeys.generate();
    String keyPairName = "NewKeyPair";
    Vdc currentVDC = lazyGetVdc();
    Media keyPairsContainer = findOrCreateKeyPairContainerInVDCNamed(currentVDC,
        keyPairContainer, keyPairName);
    String keypairValue = context.getApi().getMetadataApi(
        keyPairsContainer.getId()).get(keyPairName);
    assertEquals(keypairValue, generateKeyPair(keyPairName));
  }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Media

  @Test(description = "DeleteKeyPair", dependsOnMethods = { "testCreateKeyPair" })
  public void testDeleteKeyPair() {
    String keyPairName = "NewKeyPair";
    Vdc currentVDC = lazyGetVdc();
    Media keyPairsContainer = findOrCreateKeyPairContainerInVDCNamed(currentVDC,
        keyPairContainer, keyPairName);
    Task removeMedia = mediaApi.remove(keyPairsContainer.getId());
    Checks.checkTask(removeMedia);
    assertTrue(retryTaskSuccess.apply(removeMedia),
        String.format(TASK_COMPLETE_TIMELY, "removeMedia"));

    keyPairsContainer = mediaApi.get(keyPairsContainer.getId());
    assertNull(keyPairsContainer, String.format(OBJ_DEL, MEDIA,
        keyPairsContainer != null ? keyPairsContainer.toString() : ""));
  }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Media

        keyPairsContainer != null ? keyPairsContainer.toString() : ""));
  }

  private Media findOrCreateKeyPairContainerInVDCNamed(Vdc currentVDC,
      String keyPairsContainerName, final String keyPairName) {
    Media keyPairsContainer = null;

    Optional<Media> optionalKeyPairsContainer = Iterables.tryFind(
        findAllEmptyMediaInOrg(), new Predicate<Media>() {

          @Override
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Media

    return keyPairsContainer;
  }

  private Media uploadKeyPairInVCD(Vdc currentVDC,
      String keyPairsContainerName, String keyPairName) {
    Media keyPairsContainer = addEmptyMediaInVDC(currentVDC,
        keyPairsContainerName);
    assertNotNull(keyPairsContainer.getFiles(),
        String.format(OBJ_FIELD_REQ, MEDIA, "files"));
    assertEquals(1, keyPairsContainer.getFiles().size(), String.format(
        OBJ_FIELD_LIST_SIZE_EQ, MEDIA, "files", 1, keyPairsContainer
            .getFiles().size()));

    Link uploadLink = getUploadLinkForMedia(keyPairsContainer);
    // generate an empty iso
    byte[] iso = new byte[] {};
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Media

  private Media addEmptyMediaInVDC(Vdc currentVDC, String keyPairName) {
    Link addMedia = find(
        currentVDC.getLinks(),
        and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));

    Media sourceMedia = Media.builder().type(VCloudDirectorMediaType.MEDIA)
        .name(keyPairName).size(0).imageType(Media.ImageType.ISO)
        .description("iso generated as KeyPair bucket").build();

    Media emptyMedia = mediaApi.add(addMedia.getHref(), sourceMedia);
    Checks.checkMediaFor(MEDIA, emptyMedia);
    return emptyMedia;
  }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Media

         Predicate<Link> addMediaLink = and(relEquals(Link.Rel.ADD), typeEquals(VCloudDirectorMediaType.MEDIA));
         if (contains(lazyGetVdc().getLinks(), addMediaLink)) {
            Link addMedia = find(lazyGetVdc().getLinks(), addMediaLink);
            byte[] iso = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };

            Media sourceMedia = Media.builder().type(VCloudDirectorMediaType.MEDIA).name(name("media"))
                     .size(iso.length).imageType(Media.ImageType.ISO)
                     .description("Test media generated by VmApiLiveTest").build();
            media = context.getApi().getMediaApi().add(addMedia.getHref(), sourceMedia);

            Link uploadLink = getFirst(getFirst(media.getFiles(), null).getLinks(), null);
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.