Revision 0e7c806f
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java | ||
---|---|---|
58 | 58 |
IEntityPersistenceService<T> { |
59 | 59 |
|
60 | 60 |
|
61 |
private static final String PROPERTY_PROTECTED_TITLECACHE = "Protect TitleCache"; |
|
61 | 62 |
private static final String TYPE_PROPERTY = Messages.BulkEditorE4_TYPE; |
62 | 63 |
private static final String ID_PROPERTY = "Id"; //$NON-NLS-1$ |
63 | 64 |
private static final String UUID_PROPERTY = "Uuid"; //$NON-NLS-1$ |
... | ... | |
120 | 121 |
public List<String> getPropertyKeys(){ |
121 | 122 |
List<String> properties = new ArrayList<>(); |
122 | 123 |
properties.add(getName()); |
124 |
properties.add(PROPERTY_PROTECTED_TITLECACHE); |
|
123 | 125 |
properties.addAll(getPropertyKeys_internal()); |
124 | 126 |
properties.add(TYPE_PROPERTY); |
125 | 127 |
properties.add(ID_PROPERTY); |
... | ... | |
133 | 135 |
public Object getPropertyValue(T cdmBase, String property){ |
134 | 136 |
if(property.equals(getName())){ |
135 | 137 |
return getText(cdmBase); |
136 |
}else if(property.equals(TYPE_PROPERTY)){ |
|
138 |
} |
|
139 |
else if(property.equals(PROPERTY_PROTECTED_TITLECACHE) |
|
140 |
&&cdmBase.isInstanceOf(IdentifiableEntity.class)){ |
|
141 |
return HibernateProxyHelper.deproxy(cdmBase, IdentifiableEntity.class).isProtectedTitleCache(); |
|
142 |
} |
|
143 |
else if(property.equals(TYPE_PROPERTY)){ |
|
137 | 144 |
return getTypeText(cdmBase); |
138 |
}else if(property.equals(UUID_PROPERTY)){ |
|
145 |
} |
|
146 |
else if(property.equals(UUID_PROPERTY)){ |
|
139 | 147 |
return cdmBase.getUuid(); |
140 |
}else if(property.equals(ID_PROPERTY)){ |
|
148 |
} |
|
149 |
else if(property.equals(ID_PROPERTY)){ |
|
141 | 150 |
return cdmBase.getId(); |
142 | 151 |
} |
143 | 152 |
return null; |
... | ... | |
384 | 393 |
} |
385 | 394 |
|
386 | 395 |
public String getText(T entity) { |
387 |
if(entity instanceof IdentifiableEntity){
|
|
388 |
IdentifiableEntity identifiableEntity = (IdentifiableEntity) HibernateProxyHelper.deproxy(entity);
|
|
396 |
if(entity.isInstanceOf(IdentifiableEntity.class)){
|
|
397 |
IdentifiableEntity identifiableEntity = HibernateProxyHelper.deproxy(entity, IdentifiableEntity.class);
|
|
389 | 398 |
String text = identifiableEntity.getTitleCache(); |
390 | 399 |
return text; |
391 | 400 |
} |
Also available in: Unified diff
ref #7502 Add boolean property columns