Examples of Features


Examples of org.apache.abdera.ext.features.Features

 
  @Test
  public void testFeatures() throws Exception {
    Abdera abdera = Abdera.getInstance();
    Collection coll = abdera.getFactory().newCollection();
    Features features = FeaturesHelper.addFeaturesElement(coll);
    features.addFeature(
      "http://example.com/features/foo",
      null, "foo & here");
    features.addFeature(
      "http://example.com/features/bar",
      null, null);
   
    assertEquals(Status.SPECIFIED,FeaturesHelper.getFeatureStatus(
      coll, "http://example.com/features/foo"));
View Full Code Here

Examples of org.apache.abdera.ext.features.Features

    Abdera abdera = Abdera.getInstance();
    Service service = abdera.newService();
    Workspace workspace = service.addWorkspace("a");
    Collection collection1 = workspace.addCollection("a1","a1");
    collection1.setAcceptsEntry();
    Features features = FeaturesHelper.addFeaturesElement(collection1);
    features.addFeature(FeaturesHelper.FEATURE_SUPPORTS_DRAFTS);
    Collection collection2 = workspace.addCollection("a2","a2");
    collection2.setAccept("image/*");
   
    Selector s1 = new FeatureSelector(FeaturesHelper.FEATURE_SUPPORTS_DRAFTS);
   
View Full Code Here

Examples of org.apache.karaf.eik.core.features.Features

                return featuresRepository.getFeatures().getName();
            } else {
                return featuresRepository.getName();
            }
        } else if (element instanceof Features) {
            final Features features = (Features) element;
            if (features.getName() != null) {
                return features.getName();
            } else  if (features.getParent() != null) {
                return features.getParent().getName();
            } else {
                return null;
            }
        } else if (element instanceof Feature) {
            final Feature feature = (Feature) element;
View Full Code Here

Examples of org.apache.karaf.eik.core.features.Features

                    if (f == null) {
                        // TODO: Set some sort of warning
                        continue;
                    }

                    final Features featuresContainer = (Features) f.getParent();
                    final FeaturesRepository featuresRepository = featuresContainer.getParent();

                    checkedFeatures.add(new AvailableFeature(f, featuresRepository));
                }

                Display.getDefault().syncExec(new Runnable() {
View Full Code Here

Examples of org.apache.karaf.eik.core.features.Features

            return featuresRepositories.toArray();
        } else if (parentElement instanceof FeaturesRepository) {
            final FeaturesRepository featuresRepository = (FeaturesRepository) parentElement;
            return featuresRepository.getFeatures().getFeatures().toArray();
        } else if (parentElement instanceof Features) {
            final Features features = (Features) parentElement;
            return features.getFeatures().toArray();
        } else if (parentElement instanceof Feature) {
            final Feature feature = (Feature) parentElement;
            return ListUtils.union(feature.getFeatures(), feature.getBundles()).toArray();
        } else {
            return new Object[0];
View Full Code Here

Examples of org.apache.karaf.eik.core.features.Features

        if (element instanceof AbstractContentModel) {
            return ((AbstractContentModel) element).getParent();
        } else if (element instanceof FeaturesRepository) {
            return featuresRepositories;
        } else if (element instanceof Features) {
            final Features features = (Features) element;
            return features.getParent();
        } else if (element instanceof Feature) {
            return ((Feature)element).getParent();
        } else {
            return null;
        }
View Full Code Here

Examples of org.apache.karaf.eik.core.features.Features

            return featuresRepositories.size() > 0;
        } else if (element instanceof FeaturesRepository) {
            final FeaturesRepository featuresRepository = (FeaturesRepository) element;
            return featuresRepository.getFeatures().getFeatures().size() > 0;
        } else if (element instanceof Features) {
            final Features features = (Features) element;
            return features.getFeatures().size() > 0;
        } else if (element instanceof Feature) {
            final Feature feature = (Feature) element;
            return feature.getBundles().size() > 0 || feature.getFeatures().size() > 0;
        } else {
            return false;
View Full Code Here

Examples of org.apache.karaf.eik.core.features.Features

        } else if (element.getName().equalsIgnoreCase("feature")) {
            return new Feature(element);
        } else if (element.getName().equalsIgnoreCase("bundle")) {
            return new Bundle(element);
        } else if (element.getName().equalsIgnoreCase("features")) {
            return new Features(element, null);
        } else {
            return object;
        }
    }
View Full Code Here

Examples of org.apache.karaf.features.internal.model.Features

                    String existingFeatureRepos = retrieveProperty(properties, FEATURES_REPOSITORIES);
                    if (!existingFeatureRepos.contains(uri.toString())) {
                        existingFeatureRepos = existingFeatureRepos + uri.toString();
                        properties.put(FEATURES_REPOSITORIES, existingFeatureRepos);
                    }
                    Features repo = readFeatures(uri);
                    for (Feature feature : repo.getFeature()) {
                        featureSet.add(feature);
                        if (startupFeatures != null && startupFeatures.contains(feature.getName())) {
                            installFeature(feature, null);
                        } else if (bootFeatures != null && bootFeatures.contains(feature.getName())) {
                            localRepoFeatures.add(feature);
                            missingDependencies.addAll(feature.getDependencies());
                            String existingBootFeatures = retrieveProperty(properties, FEATURES_BOOT);
                            if (!existingBootFeatures.contains(feature.getName())) {
                                existingBootFeatures = existingBootFeatures + feature.getName();
                                properties.put(FEATURES_BOOT, existingBootFeatures);
                            }
                        } else if (installedFeatures != null && installedFeatures.contains(feature.getName())) {
                            localRepoFeatures.add(feature);
                            missingDependencies.addAll(feature.getDependencies());
                        }
                    }
                    if (addTransitiveFeatures) {
                        addMissingDependenciesToRepo();
                    }
                    FileOutputStream out = new FileOutputStream(featuresCfgFile);
                    try {
                        properties.save(out);
                    } finally {
                        out.close();
                    }
                }
            } else {
                getLog().info("Installing feature " + uri + " to system and startup.properties");
                Features features = readFeatures(uri);
                for (Feature feature : features.getFeature()) {
                    installFeature(feature, null);
                }
            }
        }
View Full Code Here

Examples of org.apache.karaf.features.internal.model.Features

                repoFile = new File(featuresPath);
            } else {
                repoFile = new File(uri);
            }
            InputStream in = new FileInputStream(repoFile);
            Features features;
            try {
                features = JaxbUtil.unmarshal(in, false);
            } finally {
                in.close();
            }
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.