private void setProfile(Profile componentProfile) { if (componentProfile != null) profileBox.setToolTipText(componentProfile.getDescription()); else profileBox.setToolTipText(null); Profile chosenProfile = getChosenProfile(); ProfileChoiceMessage message = new ProfileChoiceMessage(chosenProfile); for (Observer<ProfileChoiceMessage> o : getObservers()) try { o.notify(this, message); } catch (Exception e) { logger.error("failure when notifying about profile choice", e); } }
private Element addComponentProfileInternal(Profile componentProfile, License license, SharingPolicy sharingPolicy) throws RegistryException { if (componentProfile == null) throw new RegistryException(("Component profile must not be null")); Element profileElement = null; if (componentProfile instanceof MyExperimentComponentProfile) { MyExperimentComponentProfile myExperimentComponentProfile = (MyExperimentComponentProfile) componentProfile; if (myExperimentComponentProfile.getComponentRegistry() .equals(this)) profileElement = getResource(myExperimentComponentProfile .getUri()); } MyExperimentSharingPolicy permissions = (MyExperimentSharingPolicy) sharingPolicy; if (permissions == null) permissions = MyExperimentComponentRegistry.PRIVATE; if (profileElement == null) { profileElement = uploadFile(componentProfile.getName(), componentProfile.getDescription(), "XML", componentProfile.getXML(), license, permissions.getPolicyString()); tagResource("component profile", profileElement.getAttributeValue("resource")); } return profileElement; }
private Element addComponentProfileInternal(Profile componentProfile, License license, SharingPolicy sharingPolicy) throws RegistryException { if (componentProfile == null) throw new RegistryException(("Component profile must not be null")); Element profileElement = null; if (componentProfile instanceof MyExperimentComponentProfile) { MyExperimentComponentProfile myExperimentComponentProfile = (MyExperimentComponentProfile) componentProfile; if (myExperimentComponentProfile.getComponentRegistry() .equals(this)) profileElement = getResource(myExperimentComponentProfile .getUri()); } MyExperimentSharingPolicy permissions = (MyExperimentSharingPolicy) sharingPolicy; if (permissions == null) permissions = MyExperimentComponentRegistry.PRIVATE; if (profileElement == null) { profileElement = uploadFile(componentProfile.getName(), componentProfile.getDescription(), "XML", componentProfile.getXML(), license, permissions.getPolicyString()); tagResource("component profile", profileElement.getAttributeValue("resource")); } return profileElement; }
@Override protected Profile internalAddComponentProfile(Profile componentProfile, License license, SharingPolicy sharingPolicy) throws RegistryException { if (componentProfile == null) throw new RegistryException(("Component profile must not be null")); try { if (componentProfile instanceof NewComponentProfile) { NewComponentProfile profile = (NewComponentProfile) componentProfile; if (profile.getComponentRegistry().equals(this)) return new NewComponentProfile(this, getComponentProfileById(profile.getId(), NewComponentProfile.ELEMENTS)); } } catch (RegistryException e) { // Do nothing but fall through } return new NewComponentProfile(this, getClient().post( ComponentProfileType.class, objectFactory.createFile(makeComponentProfileCreateRequest( componentProfile.getName(), componentProfile.getDescription(), componentProfile.getXML(), license, sharingPolicy)), COMPONENT_PROFILE_SERVICE, "elements=" + NewComponentProfile.ELEMENTS)); }
@Override protected Profile internalAddComponentProfile(Profile componentProfile, License license, SharingPolicy sharingPolicy) throws RegistryException { if (componentProfile == null) throw new RegistryException(("Component profile must not be null")); try { if (componentProfile instanceof NewComponentProfile) { NewComponentProfile profile = (NewComponentProfile) componentProfile; if (profile.getComponentRegistry().equals(this)) return new NewComponentProfile(this, getComponentProfileById(profile.getId(), NewComponentProfile.ELEMENTS)); } } catch (RegistryException e) { // Do nothing but fall through } checkClientCreated(); return new NewComponentProfile(this, client.post( ComponentProfileType.class, objectFactory .createFile(makeComponentProfileCreateRequest( componentProfile.getName(), componentProfile.getDescription(), componentProfile.getXML(), license, sharingPolicy)), COMPONENT_PROFILE_SERVICE, "elements=" + NewComponentProfile.ELEMENTS)); }