Revision af8569f7
Added by Andreas Kohlbecker about 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/phycobank/ListPresenter.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import java.util.ArrayList; |
12 | 12 |
import java.util.Collection; |
13 |
import java.util.List; |
|
13 | 14 |
import java.util.UUID; |
14 | 15 |
|
15 | 16 |
import org.joda.time.DateTime; |
... | ... | |
17 | 18 |
import com.vaadin.spring.annotation.SpringComponent; |
18 | 19 |
import com.vaadin.spring.annotation.ViewScope; |
19 | 20 |
|
20 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
|
21 | 21 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
22 | 22 |
import eu.etaxonomy.cdm.vaadin.view.phycobank.ListView; |
23 | 23 |
import eu.etaxonomy.vaadin.mvp.AbstractPresenter; |
... | ... | |
31 | 31 |
@ViewScope |
32 | 32 |
public class ListPresenter extends AbstractPresenter<ListView> { |
33 | 33 |
|
34 |
private static final int PAGESIZE =20; |
|
35 |
|
|
36 | 34 |
@Override |
37 | 35 |
public void onViewEnter() { |
38 | 36 |
super.onViewEnter(); |
... | ... | |
43 | 41 |
* @return |
44 | 42 |
*/ |
45 | 43 |
private Collection<RegistrationDTO> listRegistrations() { |
46 |
Pager<TaxonNameBase> pager = getRepo().getNameService().page(TaxonNameBase.class, PAGESIZE, 0, null, null);
|
|
47 |
Collection<RegistrationDTO> dtos = new ArrayList<>(pager.getRecords().size());
|
|
48 |
pager.getRecords().forEach(i -> { dtos.add(new RegistrationDTO(i)); });
|
|
44 |
List<TaxonNameBase> names = getRepo().getNameService().list(TaxonNameBase.class, 500, 0, null, null);
|
|
45 |
Collection<RegistrationDTO> dtos = new ArrayList<>(names.size());
|
|
46 |
names.forEach(name -> { dtos.add(new RegistrationDTO(name)); });
|
|
49 | 47 |
return dtos; |
50 | 48 |
} |
51 | 49 |
|
... | ... | |
73 | 71 |
registeredEntityUuid = name.getUuid(); |
74 | 72 |
|
75 | 73 |
registrationType = RegistrationType.name; |
76 |
status = RegistrationStatus.preparation;
|
|
74 |
status = RegistrationStatus.values()[(int) (Math.random() * RegistrationStatus.values().length)];
|
|
77 | 75 |
internalRegId = Integer.toString(ListPresenter.idAutoincrement++); |
78 | 76 |
registrationId = "http://pyhcobank.org/" + internalRegId; |
79 | 77 |
created = DateTime.now(); |
Also available in: Unified diff
ref #6169 list view layout improvements and coloring statuses