Sie zeigen eine alte Version dieser Seite an. Zeigen Sie die aktuelle Version an.

Unterschiede anzeigen Seitenhistorie anzeigen

Version 1 Nächste Version anzeigen »

private void setFieldInitial(CollectableField clctfValue) {
 CollectableField cf = clctfValue;
 if (getValueListProvider() != null && cf != null) {
 CollectableFieldsProvider vlp = getValueListProvider();
 if (vlp instanceof CachingCollectableFieldsProvider) {
 vlp = ((CachingCollectableFieldsProvider)vlp).getDelegate();
 }
 if (vlp instanceof DatasourceBasedCollectableFieldsProvider) {
 try {
 if (getValueListProvider() instanceof CachingCollectableFieldsProvider) {
 cf = CollectionUtils.getSingleIfExist(((CachingCollectableFieldsProvider)getValueListProvider())
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 } else {
 cf = CollectionUtils.getSingleIfExist(((DatasourceBasedCollectableFieldsProvider)vlp)
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 }
 if (cf == null)
 cf = clctfValue;
 } catch (IllegalArgumentException e) {
 // ignore here. VLP has no id or value column set.
 } catch (Exception e) {
 throw new NuclosFatalException(e);
 }
}
}

 getModel().setFieldInitial(cf);
}

@Override
public void setField(CollectableField clctfValue) {
 CollectableField cf = clctfValue;
 if (getValueListProvider() != null && cf != null) {
 CollectableFieldsProvider vlp = getValueListProvider();
 if (vlp instanceof CachingCollectableFieldsProvider) {
 vlp = ((CachingCollectableFieldsProvider)vlp).getDelegate();
 }
 if (vlp instanceof DatasourceBasedCollectableFieldsProvider) {
 try {
 if (getValueListProvider() instanceof CachingCollectableFieldsProvider) {
 cf = CollectionUtils.getSingleIfExist(((CachingCollectableFieldsProvider)getValueListProvider())
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 } else {
 cf = CollectionUtils.getSingleIfExist(((DatasourceBasedCollectableFieldsProvider)vlp)
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 }
 if (cf == null)
 cf = clctfValue;
 } catch (IllegalArgumentException e) {
 // ignore here. VLP has no id or value column set.
 } catch (Exception e) {
 throw new NuclosFatalException(e);
 }
}
}

 super.setField(cf);
}
private void setFieldInitial(CollectableField clctfValue) {
 CollectableField cf = clctfValue;
 if (getValueListProvider() != null && cf != null) {
 CollectableFieldsProvider vlp = getValueListProvider();
 if (vlp instanceof CachingCollectableFieldsProvider) {
 vlp = ((CachingCollectableFieldsProvider)vlp).getDelegate();
 }
 if (vlp instanceof DatasourceBasedCollectableFieldsProvider) {
 try {
 if (getValueListProvider() instanceof CachingCollectableFieldsProvider) {
 cf = CollectionUtils.getSingleIfExist(((CachingCollectableFieldsProvider)getValueListProvider())
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 } else {
 cf = CollectionUtils.getSingleIfExist(((DatasourceBasedCollectableFieldsProvider)vlp)
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 }
 if (cf == null)
 cf = clctfValue;
 } catch (IllegalArgumentException e) {
 // ignore here. VLP has no id or value column set.
 } catch (Exception e) {
 throw new NuclosFatalException(e);
 }
}
}

 getModel().setFieldInitial(cf);
}

@Override
public void setField(CollectableField clctfValue) {
 CollectableField cf = clctfValue;
 if (getValueListProvider() != null && cf != null) {
 CollectableFieldsProvider vlp = getValueListProvider();
 if (vlp instanceof CachingCollectableFieldsProvider) {
 vlp = ((CachingCollectableFieldsProvider)vlp).getDelegate();
 }
 if (vlp instanceof DatasourceBasedCollectableFieldsProvider) {
 try {
 if (getValueListProvider() instanceof CachingCollectableFieldsProvider) {
 cf = CollectionUtils.getSingleIfExist(((CachingCollectableFieldsProvider)getValueListProvider())
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 } else {
 cf = CollectionUtils.getSingleIfExist(((DatasourceBasedCollectableFieldsProvider)vlp)
 .getCollectableFields(Collections.singletonList(IdUtils.unsafeToId(clctfValue.getValueId()))));
 }
 if (cf == null)
 cf = clctfValue;
 } catch (IllegalArgumentException e) {
 // ignore here. VLP has no id or value column set.
 } catch (Exception e) {
 throw new NuclosFatalException(e);
 }
}
}

 super.setField(cf);
}
  • Keine Stichwörter