/** * {@inheritDoc} * * <p>TODO: to be changed, remove the jalo part. At this moment the jalo-way has to be used * because there is no chance to read the attribute value in SL, because it's not a part of the * model. */ @Override public void setVariantAttributeValue( final VariantProductModel variant, final String qualifier, final Object value) { try { getModelService().setAttributeValue(variant, qualifier, value); } catch (final AttributeNotSupportedException e) { final VariantProduct variantproduct = getModelService().getSource(variant); try { variantproduct.setAttribute(qualifier, getModelService().toPersistenceLayer(value)); } catch (final Exception ex) { throw new SystemException( "cannot write variant attribute value for '" + qualifier + "' due to : " + ex.getMessage(), ex); } } }
/** * {@inheritDoc} * * <p>TODO: to be changed, remove the jalo part. At this moment the jalo-way has to be used * because there is no chance to read the attribute value in SL, because it's not a part of the * model. */ @Override public Object getVariantAttributeValue( final VariantProductModel variant, final String qualifier) { try { return getModelService().getAttributeValue(variant, qualifier); } catch (final AttributeNotSupportedException e) { final VariantProduct variantproduct = getModelService().getSource(variant); try { return getModelService().toModelLayer(variantproduct.getAttribute(qualifier)); } catch (final Exception ex) { throw new SystemException( "cannot read variant attribute value for '" + qualifier + "' due to : " + ex.getMessage(), ex); } } }