Examples of ResourceData


Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

    }
    final File ttfCache = new File(location, filename);
    try
    {
      final ResourceKey resourceKey = resourceManager.createKey(ttfCache);
      final ResourceData data = resourceManager.load(resourceKey);
      final InputStream stream = data.getResourceAsStream(resourceManager);

      final HashMap<String, FontFileRecord> cachedSeenFiles;
      final HashMap<String, DefaultFontFamily> cachedFontFamilies;
      final HashMap<String, DefaultFontFamily> cachedFullFontNames;
      final HashMap<String, DefaultFontFamily> cachedAlternateNames;
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

      }

      sizeLabel.setText(null);
      try
      {
        final ResourceData resourceData = resourceManager.loadRawData(bundleKey);
        final Object size = resourceData.getAttribute(ResourceData.CONTENT_LENGTH);
        if (size != null)
        {
          sizeLabel.setText(String.valueOf(size));
        }
      }
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

    }
    final File ttfCache = new File(location, "samples-cache.ser");// NON-NLS
    try
    {
      final ResourceKey resourceKey = resourceManager.createKey(ttfCache);
      final ResourceData data = resourceManager.load(resourceKey);
      final InputStream stream = data.getResourceAsStream(resourceManager);

      final HashMap cachedSeenFiles;

      try
      {
View Full Code Here

Examples of org.wso2.carbon.registry.common.ResourceData

            }
           
            ResourceData [] resourceDataList = new ResourceData [resultSize];
            for (int i=0; i<resultSize; i++) {

                ResourceData resourceData = new ResourceData();
                resourceData.setResourcePath(childPaths[i]);

                if (childPaths[i] != null) {
                    if (RegistryConstants.ROOT_PATH.equals(childPaths[i])) {
                        resourceData.setName("root");
                    } else {
                        String[] parts = childPaths[i].split(RegistryConstants.PATH_SEPARATOR);
                        resourceData.setName(parts[parts.length - 1]);
                    }
                }

                try {
                    Resource child = registry.get(childPaths[i]);

                    resourceData.setResourceType(child instanceof Collection ?
                            "collection" : "resource");
                    resourceData.setAuthorUserName(child.getAuthorUserName());
                    resourceData.setDescription(child.getDescription());
                    resourceData.setAverageRating(registry.getAverageRating(child.getPath()));
                    Calendar createdDateTime = Calendar.getInstance();
                    createdDateTime.setTime(child.getCreatedTime());
                    resourceData.setCreatedOn(createdDateTime);
                    CommonUtil.populateAverageStars(resourceData);

                    child.discard();

                    resourceDataList [i] = resourceData;
View Full Code Here

Examples of org.wso2.carbon.registry.common.ResourceData

            TaggedResourcePath[] taggedPaths = registry.getResourcePathsWithTag(tag);
            resourceDataList = new ResourceData [taggedPaths.length];
            for (int i=0; i<taggedPaths.length; i++) {
                String resultPath = taggedPaths[i].getResourcePath();

                ResourceData resourceData = new ResourceData();
                resourceData.setResourcePath(resultPath);

                if (resultPath != null) {
                    if (resultPath.equals(RegistryConstants.ROOT_PATH)) {
                        resourceData.setName(RegistryConstants.ROOT_PATH);
                    } else {
                        String[] parts = resultPath.split(RegistryConstants.PATH_SEPARATOR);
                        resourceData.setName(parts[parts.length - 1]);
                    }
                }

                try {
                    Resource child = registry.get(resultPath);

                    resourceData.setResourceType(child instanceof Collection ?
                            "collection" : "resource");
                    resourceData.setAuthorUserName(child.getAuthorUserName());
                    resourceData.setDescription(child.getDescription());
                    resourceData.setAverageRating(registry.getAverageRating(child.getPath()));
                    Calendar createdDateTime = Calendar.getInstance();
                    createdDateTime.setTime(child.getCreatedTime());
                    resourceData.setCreatedOn(createdDateTime);

                    Map counts = taggedPaths[i].getTagCounts();
                    Object [] keySet = counts.keySet().toArray();
                    TagCount [] tagCounts = new TagCount [counts.size()];
                    for(int j=0; j<counts.size(); j++) {
                        TagCount tagCount = new TagCount();
                        tagCount.setKey((String)keySet[j]);
                        tagCount.setValue(new Long((String)counts.get(keySet[j])));
                        tagCounts[j] = tagCount;
                    }
                    resourceData.setTagCounts(tagCounts);
                   
                    CommonUtil.populateAverageStars(resourceData);

                    child.discard();
View Full Code Here

Examples of org.wso2.carbon.registry.common.ResourceData

            } catch (Exception e) {
                return new ResourceData[0];
            }
            resourceDataList = new ResourceData [paths.length];
            for(int i=0; i<paths.length; i++){
                ResourceData resourceData = new ResourceData();
                resourceData.setResourcePath(paths[i]);

                if (paths[i] != null) {
                    if (paths[i].equals(RegistryConstants.ROOT_PATH)) {
                        resourceData.setName(RegistryConstants.ROOT_PATH);
                    } else {
                        String[] parts = paths[i].split(RegistryConstants.PATH_SEPARATOR);
                        resourceData.setName(parts[parts.length - 1]);
                    }
                }

                try {
                    Resource child = registry.get(paths[i]);

                    resourceData.setResourceType(child instanceof Collection ?
                            "collection" : "resource");
                    resourceData.setAuthorUserName(child.getAuthorUserName());
                    resourceData.setDescription(child.getDescription());
                    resourceData.setAverageRating(registry.getAverageRating(child.getPath()));
                    Calendar createdDateTime = Calendar.getInstance();
                    createdDateTime.setTime(child.getCreatedTime());
                    resourceData.setCreatedOn(createdDateTime);
                    CommonUtil.populateAverageStars(resourceData);

                    child.discard();

                    resourceDataList[i] = resourceData;
View Full Code Here

Examples of org.wso2.carbon.registry.common.ResourceData

            TaggedResourcePath[] taggedPaths = registry.getResourcePathsWithTag(tag);
            resourceDataList = new ResourceData [taggedPaths.length];
            for (int i=0; i<taggedPaths.length; i++) {
                String resultPath = taggedPaths[i].getResourcePath();

                ResourceData resourceData = new ResourceData();
                resourceData.setResourcePath(resultPath);

                if (resultPath != null) {
                    if (resultPath.equals(RegistryConstants.ROOT_PATH)) {
                        resourceData.setName(RegistryConstants.ROOT_PATH);
                    } else {
                        String[] parts = resultPath.split(RegistryConstants.PATH_SEPARATOR);
                        resourceData.setName(parts[parts.length - 1]);
                    }
                }

                try {
                    Resource child = registry.get(resultPath);

                    resourceData.setResourceType(child instanceof Collection ?
                            "collection" : "resource");
                    resourceData.setAuthorUserName(child.getAuthorUserName());
                    resourceData.setDescription(child.getDescription());
                    resourceData.setAverageRating(registry.getAverageRating(child.getPath()));
                    Calendar createdDateTime = Calendar.getInstance();
                    createdDateTime.setTime(child.getCreatedTime());
                    resourceData.setCreatedOn(createdDateTime);

                    Map counts = taggedPaths[i].getTagCounts();
                    Object [] keySet = counts.keySet().toArray();
                    TagCount [] tagCounts = new TagCount [counts.size()];
                    for(int j=0; j<counts.size(); j++) {
                        TagCount tagCount = new TagCount();
                        tagCount.setKey((String)keySet[j]);
                        tagCount.setValue((Long)counts.get(keySet[j]));
                        tagCounts[j] = tagCount;
                    }
                    resourceData.setTagCounts(tagCounts);
                   
                    CommonUtil.populateAverageStars(resourceData);

                    child.discard();
View Full Code Here

Examples of org.wso2.carbon.registry.common.ResourceData

            } catch (Exception e) {
                return new ResourceData[0];
            }
            resourceDataList = new ResourceData [paths.length];
            for(int i=0; i<paths.length; i++){
                ResourceData resourceData = new ResourceData();
                resourceData.setResourcePath(paths[i]);

                if (paths[i] != null) {
                    if (paths[i].equals(RegistryConstants.ROOT_PATH)) {
                        resourceData.setName(RegistryConstants.ROOT_PATH);
                    } else {
                        String[] parts = paths[i].split(RegistryConstants.PATH_SEPARATOR);
                        resourceData.setName(parts[parts.length - 1]);
                    }
                }

                try {
                    Resource child = registry.get(paths[i]);

                    resourceData.setResourceType(child instanceof Collection ?
                            "collection" : "resource");
                    resourceData.setAuthorUserName(child.getAuthorUserName());
                    resourceData.setDescription(child.getDescription());
                    resourceData.setAverageRating(registry.getAverageRating(child.getPath()));
                    Calendar createdDateTime = Calendar.getInstance();
                    createdDateTime.setTime(child.getCreatedTime());
                    resourceData.setCreatedOn(createdDateTime);
                    CommonUtil.populateAverageStars(resourceData);

                    child.discard();

                    resourceDataList[i] = resourceData;
View Full Code Here

Examples of org.wso2.carbon.registry.common.ResourceData

            }*/

            ResourceData[] resourceDataList = new ResourceData[resultSize];
            for (int i = 0; i < resultSize; i++) {

                ResourceData resourceData = new ResourceData();
                resourceData.setResourcePath(childPaths[i]);

                if (childPaths[i] != null) {
                    if (RegistryConstants.ROOT_PATH.equals(childPaths[i])) {
                        resourceData.setName("root");
                    } else {
                        String[] parts = childPaths[i].split(RegistryConstants.PATH_SEPARATOR);
                        resourceData.setName(parts[parts.length - 1]);
                    }
                }

                try {
                    Resource child = registry.get(childPaths[i]);

                    resourceData.setResourceType(child instanceof Collection ?
                                                 "collection" : "resource");
                    resourceData.setAuthorUserName(child.getAuthorUserName());
                    resourceData.setDescription(child.getDescription());
                    resourceData.setAverageRating(registry.getAverageRating(child.getPath()));
                    Calendar createdDateTime = Calendar.getInstance();
                    createdDateTime.setTime(child.getCreatedTime());
                    resourceData.setCreatedOn(createdDateTime);
                    CommonUtil.populateAverageStars(resourceData);

                    child.discard();

                    resourceDataList[i] = resourceData;
View Full Code Here

Examples of org.wso2.carbon.registry.common.ResourceData

    return true;
  }

  private ResourceData loadResourceByPath(UserRegistry registry, String path) throws RegistryException {
    ResourceData resourceData = new ResourceData();
    resourceData.setResourcePath(path);

    if (path != null) {
      if (RegistryConstants.ROOT_PATH.equals(path)) {
        resourceData.setName("root");
      } else {
        String[] parts = path.split(RegistryConstants.PATH_SEPARATOR);
        resourceData.setName(parts[parts.length - 1]);
      }
    }

    Resource child = registry.get(path);

    resourceData.setResourceType(child instanceof Collection ? "collection"
        : "resource");
    resourceData.setAuthorUserName(child.getAuthorUserName());
    resourceData.setDescription(child.getDescription());
    resourceData.setAverageRating(registry
        .getAverageRating(child.getPath()));
    Calendar createdDateTime = Calendar.getInstance();
    createdDateTime.setTime(child.getCreatedTime());
    resourceData.setCreatedOn(createdDateTime);
    CommonUtil.populateAverageStars(resourceData);

    child.discard();

    return resourceData;
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.