public ITouchpointData getTouchpointData() { return MetadataFactory.createTouchpointData(instructions); }
public ITouchpointData getTouchpointData() { return MetadataFactory.createTouchpointData(instructions); }
public ITouchpointData getTouchpointData() { return MetadataFactory.createTouchpointData(instructions); }
private void setupPermissions(InstallableUnitDescription iu, FileSetDescriptor descriptor) { Map<String, String> touchpointData = new HashMap<String, String>(); String[][] permsList = descriptor.getPermissions(); for (int i = 0; i < permsList.length; i++) { String[] permSpec = permsList[i]; String configurationData = " chmod(targetDir:${installFolder}, targetFile:" + permSpec[1] + ", permissions:" + permSpec[0] + ");"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ touchpointData.put("install", configurationData); //$NON-NLS-1$ iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); } } }
private void setupPermissions(InstallableUnitDescription iu, FileSetDescriptor descriptor) { Map<String, String> touchpointData = new HashMap<String, String>(); String[][] permsList = descriptor.getPermissions(); for (int i = 0; i < permsList.length; i++) { String[] permSpec = permsList[i]; String configurationData = " chmod(targetDir:${installFolder}, targetFile:" + permSpec[1] + ", permissions:" + permSpec[0] + ");"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ touchpointData.put("install", configurationData); //$NON-NLS-1$ iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); } } }
private void setupPermissions(InstallableUnitDescription iu, FileSetDescriptor descriptor) { Map<String, String> touchpointData = new HashMap<>(); String[][] permsList = descriptor.getPermissions(); for (int i = 0; i < permsList.length; i++) { String[] permSpec = permsList[i]; String configurationData = " chmod(targetDir:${installFolder}, targetFile:" + permSpec[1] + ", permissions:" + permSpec[0] + ");"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ touchpointData.put("install", configurationData); //$NON-NLS-1$ iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); } } }
protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info, String configSpec) { Collection<ITouchpointAdvice> advice = info.getAdvice(configSpec, false, iu.getId(), iu.getVersion(), ITouchpointAdvice.class); if (currentInstructions == null) { if (advice == null || advice.isEmpty()) return; currentInstructions = Collections.emptyMap(); } ITouchpointData result = MetadataFactory.createTouchpointData(currentInstructions); if (advice != null) { for (ITouchpointAdvice entry : advice) { result = entry.getTouchpointData(result); } } iu.addTouchpointData(result); }
protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info, String configSpec) { Collection<ITouchpointAdvice> advice = info.getAdvice(configSpec, false, iu.getId(), iu.getVersion(), ITouchpointAdvice.class); if (currentInstructions == null) { if (advice == null || advice.isEmpty()) return; currentInstructions = Collections.emptyMap(); } ITouchpointData result = MetadataFactory.createTouchpointData(currentInstructions); if (advice != null) { for (ITouchpointAdvice entry : advice) { result = entry.getTouchpointData(result); } } iu.addTouchpointData(result); }
protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info, String configSpec) { Collection<ITouchpointAdvice> advice = info.getAdvice(configSpec, false, iu.getId(), iu.getVersion(), ITouchpointAdvice.class); if (currentInstructions == null) { if (advice == null || advice.isEmpty()) return; currentInstructions = Collections.emptyMap(); } ITouchpointData result = MetadataFactory.createTouchpointData(currentInstructions); if (advice != null) { for (ITouchpointAdvice entry : advice) { result = entry.getTouchpointData(result); } } iu.addTouchpointData(result); }
protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info, String configSpec) { Collection<ITouchpointAdvice> advice = info.getAdvice(configSpec, false, iu.getId(), iu.getVersion(), ITouchpointAdvice.class); if (currentInstructions == null) { if (advice == null || advice.isEmpty()) return; currentInstructions = CollectionUtils.emptyMap(); } ITouchpointData result = MetadataFactory.createTouchpointData(currentInstructions); if (advice != null) { for (ITouchpointAdvice entry : advice) { result = entry.getTouchpointData(result); } } iu.addTouchpointData(result); }
private void publishExecutableCU(ExecutablesDescriptor execDescriptor, IPublisherResult result) { InstallableUnitFragmentDescription cu = createSkeletonExecutableCU(execDescriptor); String[] config = parseConfigSpec(configSpec); String os = config[1]; Map<String, String> touchpointData = computeInstallActions(execDescriptor, os); cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); IInstallableUnit unit = MetadataFactory.createInstallableUnit(cu); result.addIU(unit, IPublisherResult.ROOT); }
private void publishExecutableCU(ExecutablesDescriptor execDescriptor, IPublisherResult result) { InstallableUnitFragmentDescription cu = createSkeletonExecutableCU(execDescriptor); String[] config = parseConfigSpec(configSpec); String os = config[1]; Map<String, String> touchpointData = computeInstallActions(execDescriptor, os); cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); IInstallableUnit unit = MetadataFactory.createInstallableUnit(cu); result.addIU(unit, IPublisherResult.ROOT); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultFeatureConfigurationUnit(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId(ECLIPSE_FEATURE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on features IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_FEATURE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); cu.setFilter(INSTALL_FEATURES_FILTER); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("install", "installFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ touchpointData.put("uninstall", "uninstallFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
/** * Publishes the IUs that cause the executable to be actually set as the launcher for * the profile */ private void publishExecutableSetter(ExecutablesDescriptor brandedExecutables, IPublisherResult result) { InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription(); String executableName = brandedExecutables.getExecutableName(); String id = getExecutableId() + '.' + executableName; iud.setId(id); iud.setVersion(version); iud.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI); iud.setCapabilities(new IProvidedCapability[] {createSelfCapability(id, version)}); iud.setFilter(createFilterSpec(configSpec)); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("configure", "setLauncherName(name:" + executableName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ touchpointData.put("unconfigure", "setLauncherName()"); //$NON-NLS-1$ //$NON-NLS-2$ iud.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); result.addIU(MetadataFactory.createInstallableUnit(iud), IPublisherResult.ROOT); }
/** * Publishes the IUs that cause the executable to be actually set as the launcher for * the profile */ private void publishExecutableSetter(ExecutablesDescriptor brandedExecutables, IPublisherResult result) { InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription(); String executableName = brandedExecutables.getExecutableName(); String id = getExecutableId() + '.' + executableName; iud.setId(id); iud.setVersion(version); iud.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI); iud.setCapabilities(new IProvidedCapability[] {createSelfCapability(id, version)}); iud.setFilter(createFilterSpec(configSpec)); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("configure", "setLauncherName(name:" + executableName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ touchpointData.put("unconfigure", "setLauncherName()"); //$NON-NLS-1$ //$NON-NLS-2$ iud.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); result.addIU(MetadataFactory.createInstallableUnit(iud), IPublisherResult.ROOT); }
private void publishExecutableCU(ExecutablesDescriptor execDescriptor, IPublisherResult result) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String id = createCUIdString(idBase, TYPE, flavor, configSpec); cu.setId(id); cu.setVersion(version); cu.setFilter(createFilterSpec(configSpec)); String executableId = getExecutableId(); cu.setHost(new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, executableId, new VersionRange(version, true, version, true), null, false, false)}); cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); //TODO bug 218890, would like the fragment to provide the launcher capability as well, but can't right now. cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version)}); cu.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE); String[] config = parseConfigSpec(configSpec); String os = config[1]; Map<String, String> touchpointData = computeInstallActions(execDescriptor, os); cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); IInstallableUnit unit = MetadataFactory.createInstallableUnit(cu); result.addIU(unit, IPublisherResult.ROOT); }