Project

General

Profile

« Previous | Next » 

Revision aa47a3ed

Added by Andreas Kohlbecker over 6 years ago

fix #7083 possible to edit preferredStableUri of TypeSpecimens

View differences:

src/main/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImpl.java
22 22
import org.springframework.transaction.annotation.Transactional;
23 23

  
24 24
import eu.etaxonomy.cdm.api.application.CdmRepository;
25
import eu.etaxonomy.cdm.debug.PersistentContextAnalyzer;
26 25
import eu.etaxonomy.cdm.model.common.VersionableEntity;
27 26
import eu.etaxonomy.cdm.model.name.Registration;
28 27
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
......
158 157

  
159 158
            Session session = repo.getSession();
160 159

  
161
            PersistentContextAnalyzer regAnalyzer = new PersistentContextAnalyzer(dto.getOwner(), session);
162
            regAnalyzer.printEntityGraph(System.out);
163
            regAnalyzer.printCopyEntities(System.out);
160
//            PersistentContextAnalyzer regAnalyzer = new PersistentContextAnalyzer(dto.getOwner(), session);
161
//            regAnalyzer.printEntityGraph(System.out);
162
//            regAnalyzer.printCopyEntities(System.out);
164 163

  
165 164
            session.merge(dto.getOwner());
166 165

  
src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/SpecimenTypeDesignationDTO.java
194 194
        std.getTypeSpecimen().setAccessionNumber(accessionNumber);
195 195
    }
196 196

  
197
    public URI getPreferredStableUri(){
198
        return std.getTypeSpecimen().getPreferredStableUri();
199
    }
200

  
201
    public void setPreferredStableUri(URI uri){
202
        std.getTypeSpecimen().setPreferredStableUri(uri);
203
    }
204

  
197 205
    public URI getMediaUri(){
198 206
        if(checkMediaSpecimen()){
199 207
            MediaRepresentationPart part = findMediaRepresentationPart();
src/main/java/eu/etaxonomy/cdm/vaadin/util/converter/UriConverter.java
22 22
 */
23 23
public final class UriConverter implements Converter<String, URI> {
24 24

  
25
    private static final long serialVersionUID = -6695362724769275484L;
26

  
25 27
    public UriConverter() {
26 28

  
27 29
    }
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationDTORow.java
22 22
import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
23 23

  
24 24
/**
25
 * CollectionRow for {@link SpecimenTypeDesignationDTO}
25 26
 * SpecimenTypeDesignationDTORow needs to be instantiated by a EditorInstantiator which can only be provided by the presenter
26 27
 *  {@link SpecimenTypeDesignationWorkingsetEditorPresenter#handleViewEntered()}
27 28
 *
......
39 40
    ListSelect typeStatus = new ListSelect();
40 41
    ToOneRelatedEntityCombobox<eu.etaxonomy.cdm.model.occurrence.Collection> collection =
41 42
            new ToOneRelatedEntityCombobox<eu.etaxonomy.cdm.model.occurrence.Collection>(null, eu.etaxonomy.cdm.model.occurrence.Collection.class);
42
    TextField accessionNumber = new TextField(); // "Accession number");
43
    TextField mediaUri = new TextField(); // "Image URI");
43
    TextField accessionNumber = new TextField();
44
    TextField preferredStableUri = new TextField();
45
    TextField mediaUri = new TextField();
44 46
    ToOneRelatedEntityCombobox<Reference> mediaSpecimenReference =
45 47
            new ToOneRelatedEntityCombobox<Reference>(null, Reference.class);
46 48
    TextField mediaSpecimenReferenceDetail = new TextField(); //"Image reference detail");
......
52 54
        typeStatus.setRows(1);
53 55
        typeStatus.setRequired(true);
54 56
        accessionNumber.setWidth(100, Unit.PIXELS);
57
        preferredStableUri.setWidth(150, Unit.PIXELS);
58
        preferredStableUri.setConverter(new UriConverter());
55 59
        collection.setWidth(150, Unit.PIXELS);
56 60
        mediaUri.setWidth(150, Unit.PIXELS);
57 61
        mediaUri.setConverter(new UriConverter());
......
71 75
        return new Component[]{
72 76
                kindOfUnit, typeStatus,
73 77
                collection, accessionNumber,
78
                preferredStableUri,
74 79
                mediaUri, mediaSpecimenReference,
75 80
                mediaSpecimenReferenceDetail, mediaSpecimenReferenceDetail
76 81
                };
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetPopupEditor.java
161 161
        typeDesignationsCollectionField.getLayout().setColumns(3);
162 162

  
163 163
        typeDesignationsCollectionField.setPropertyHeader("accessionNumber", "Access. num.");
164
        typeDesignationsCollectionField.setPropertyHeader("preferredStableUri", "Stable URI");
164 165
        typeDesignationsCollectionField.setPropertyHeader("mediaSpecimenReference", "Image reference");
165 166
        typeDesignationsCollectionField.setPropertyHeader("mediaSpecimenReferenceDetail", "Reference detail");
166 167

  

Also available in: Unified diff