@Override public Map<String, String> getInstallableUnitProperties(IInstallableUnit iu) { return profile.getInstallableUnitProperties(iu); }
private void rememberIUProfileProperties(IInstallableUnit iu, IRequirement req, IProfileChangeRequest originalRequest, boolean includeProfile) { Map<String, String> allProperties = new HashMap<String, String>(); if (includeProfile) { Map<String, String> tmp = new HashMap<String, String>(profile.getInstallableUnitProperties(iu)); List<String> propertiesToRemove = ((ProfileChangeRequest) originalRequest).getInstallableUnitProfilePropertiesToRemove().get(iu); if (propertiesToRemove != null) { for (String toRemove : propertiesToRemove) { tmp.remove(toRemove); } } allProperties.putAll(tmp); } Map<String, String> propertiesInRequest = ((ProfileChangeRequest) originalRequest).getInstallableUnitProfilePropertiesToAdd().get(iu); if (propertiesInRequest != null) allProperties.putAll(propertiesInRequest); propertiesPerRequirement.put(req, allProperties); List<String> removalInRequest = ((ProfileChangeRequest) originalRequest).getInstallableUnitProfilePropertiesToRemove().get(iu); if (removalInRequest != null) removedPropertiesPerRequirement.put(req, removalInRequest); }
private void rememberIUProfileProperties(IInstallableUnit iu, IRequirement req, IProfileChangeRequest originalRequest, boolean includeProfile) { Map<String, String> allProperties = new HashMap<String, String>(); if (includeProfile) { Map<String, String> tmp = new HashMap<String, String>(profile.getInstallableUnitProperties(iu)); List<String> propertiesToRemove = ((ProfileChangeRequest) originalRequest).getInstallableUnitProfilePropertiesToRemove().get(iu); if (propertiesToRemove != null) { for (String toRemove : propertiesToRemove) { tmp.remove(toRemove); } } allProperties.putAll(tmp); } Map<String, String> propertiesInRequest = ((ProfileChangeRequest) originalRequest).getInstallableUnitProfilePropertiesToAdd().get(iu); if (propertiesInRequest != null) allProperties.putAll(propertiesInRequest); propertiesPerRequirement.put(req, allProperties); List<String> removalInRequest = ((ProfileChangeRequest) originalRequest).getInstallableUnitProfilePropertiesToRemove().get(iu); if (removalInRequest != null) removedPropertiesPerRequirement.put(req, removalInRequest); }
for (Entry<String, String> entry : target.getInstallableUnitProperties(iu).entrySet()) { request.setInstallableUnitProfileProperty(iu, entry.getKey(), entry.getValue()); Map<String, String> propertiesToSet = new HashMap<>(target.getInstallableUnitProperties(iu)); for (Entry<String, String> entry : current.getInstallableUnitProperties(iu).entrySet()) { String key = entry.getKey(); String newValue = propertiesToSet.get(key);
private static void addSharedProfileBaseIUs(final IProfile sharedProfile, final Profile userProfile) { IQuery<IInstallableUnit> rootIUQuery = QueryUtil.createMatchQuery( // "profileProperties[$0] == 'true' || (touchpointType != null && touchpointType.id == $1)", //$NON-NLS-1$ IProfile.PROP_PROFILE_ROOT_IU, NATIVE_TOUCHPOINT_TYPE); IQueryResult<IInstallableUnit> rootIUs = sharedProfile.query(rootIUQuery, null); for (Iterator<IInstallableUnit> iterator = rootIUs.iterator(); iterator.hasNext();) { IInstallableUnit iu = iterator.next(); userProfile.addInstallableUnit(iu); userProfile.addInstallableUnitProperties(iu, sharedProfile.getInstallableUnitProperties(iu)); userProfile.setInstallableUnitProperty(iu, IProfile.PROP_PROFILE_LOCKED_IU, IU_LOCKED); userProfile.setInstallableUnitProperty(iu, PROP_BASE, Boolean.TRUE.toString()); } IInstallableUnit sharedProfileIU = createSharedProfileIU(sharedProfile); userProfile.addInstallableUnit(sharedProfileIU); userProfile.setInstallableUnitProperty(sharedProfileIU, PROP_INCLUSION_RULES, STRICT); userProfile.setInstallableUnitProperty(sharedProfileIU, PROP_BASE, Boolean.TRUE.toString()); }
private static void addSharedProfileBaseIUs(final IProfile sharedProfile, final Profile userProfile) { IQuery<IInstallableUnit> rootIUQuery = QueryUtil.createMatchQuery( // "profileProperties[$0] == 'true' || (touchpointType != null && touchpointType.id == $1)", //$NON-NLS-1$ IProfile.PROP_PROFILE_ROOT_IU, NATIVE_TOUCHPOINT_TYPE); IQueryResult<IInstallableUnit> rootIUs = sharedProfile.query(rootIUQuery, null); for (Iterator<IInstallableUnit> iterator = rootIUs.iterator(); iterator.hasNext();) { IInstallableUnit iu = iterator.next(); userProfile.addInstallableUnit(iu); userProfile.addInstallableUnitProperties(iu, sharedProfile.getInstallableUnitProperties(iu)); userProfile.setInstallableUnitProperty(iu, IProfile.PROP_PROFILE_LOCKED_IU, IU_LOCKED); userProfile.setInstallableUnitProperty(iu, PROP_BASE, Boolean.TRUE.toString()); } IInstallableUnit sharedProfileIU = createSharedProfileIU(sharedProfile); userProfile.addInstallableUnit(sharedProfileIU); userProfile.setInstallableUnitProperty(sharedProfileIU, PROP_INCLUSION_RULES, STRICT); userProfile.setInstallableUnitProperty(sharedProfileIU, PROP_BASE, Boolean.TRUE.toString()); }
private void writeInstallableUnitsProperties(Iterator<IInstallableUnit> it, int size, IProfile profile) { if (size == 0) return; start(IUS_PROPERTIES_ELEMENT); attribute(COLLECTION_SIZE_ATTRIBUTE, size); while (it.hasNext()) { IInstallableUnit iu = it.next(); Map<String, String> properties = profile.getInstallableUnitProperties(iu); if (properties.isEmpty()) continue; start(IU_PROPERTIES_ELEMENT); attribute(ID_ATTRIBUTE, iu.getId()); attribute(VERSION_ATTRIBUTE, iu.getVersion().toString()); writeProperties(properties); end(IU_PROPERTIES_ELEMENT); } end(IUS_PROPERTIES_ELEMENT); } }
private void writeInstallableUnitsProperties(Iterator<IInstallableUnit> it, int size, IProfile profile) { if (size == 0) return; start(IUS_PROPERTIES_ELEMENT); attribute(COLLECTION_SIZE_ATTRIBUTE, size); while (it.hasNext()) { IInstallableUnit iu = it.next(); Map<String, String> properties = profile.getInstallableUnitProperties(iu); if (properties.isEmpty()) continue; start(IU_PROPERTIES_ELEMENT); attribute(ID_ATTRIBUTE, iu.getId()); attribute(VERSION_ATTRIBUTE, iu.getVersion().toString()); writeProperties(properties); end(IU_PROPERTIES_ELEMENT); } end(IUS_PROPERTIES_ELEMENT); } }