private Collection<ComponentParameter> synchronizeComponentParameters( Collection<ComponentParameter> componentParametersToSynchronize, Component parentComponent ) { List<ComponentParameter> componentParameters = new ArrayList<ComponentParameter>(componentParametersToSynchronize.size()); for ( ComponentParameter componentParameter : componentParametersToSynchronize ) { if (componentParameter.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().isTransient(componentParameter)) { componentParameter = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().getByAc(componentParameter.getAc()); } componentParameter.setCvParameterType( synchronize (componentParameter.getCvParameterType())); componentParameter.setCvParameterUnit( synchronize (componentParameter.getCvParameterUnit())); componentParameter.setComponent(parentComponent); componentParameters.add(componentParameter); } return componentParameters; }
/** * Retrieves the parameters from a participant, initializing them if necessary. * Do not set the initialized collection of parameters because parameters cannot be orphan * @param component the component * @return The returned parameters are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentParameter> ensureInitializedComponentParameters(Component component) { Collection<ComponentParameter> parameters; if (IntactCore.isInitialized(component.getParameters())) { parameters = component.getParameters(); } else { parameters = IntactContext.getCurrentInstance().getDaoFactory().getComponentParameterDao().getByComponentAc(component.getAc()); } return parameters; }
/** * Retrieves the parameters from a participant, initializing them if necessary. * Do not set the initialized collection of parameters because parameters cannot be orphan * @param component the component * @return The returned parameters are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentParameter> ensureInitializedComponentParameters(Component component) { Collection<ComponentParameter> parameters; if (IntactCore.isInitialized(component.getParameters())) { parameters = component.getParameters(); } else { parameters = IntactContext.getCurrentInstance().getDaoFactory().getComponentParameterDao().getByComponentAc(component.getAc()); } return parameters; }
private Collection<ComponentParameter> synchronizeComponentParameters( Collection<ComponentParameter> componentParametersToSynchronize, Component parentComponent ) { List<ComponentParameter> componentParameters = new ArrayList<ComponentParameter>(componentParametersToSynchronize.size()); for ( ComponentParameter componentParameter : componentParametersToSynchronize ) { if (componentParameter.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().isTransient(componentParameter)) { componentParameter = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().getByAc(componentParameter.getAc()); } componentParameter.setCvParameterType( synchronize (componentParameter.getCvParameterType())); componentParameter.setCvParameterUnit( synchronize (componentParameter.getCvParameterUnit())); componentParameter.setComponent(parentComponent); componentParameters.add(componentParameter); } return componentParameters; }