* @author a.kohlbecker
* @since Jun 7, 2017
*/
-public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends T> implements FilterablePagingProvider<V>, FilterableCountProvider {
+public class CdmFilterablePagingProvider<T extends IdentifiableEntity, V extends T>
+ implements FilterablePagingProvider<V>, FilterableCountProvider {
private static final Logger logger = LogManager.getLogger();
}
}
- /**
- * @return
- */
private List<Restriction<?>> prepareRestrictions(String filter, MatchMode matchMode) {
List<Restriction<?>> prepared = new ArrayList<>(restrictions.size());
for(Restriction<?> r : restrictions) {
return prepared;
}
- /**
- *
- */
protected void checkNotMixed() {
if(!restrictions.isEmpty() && !criteria.isEmpty()){
throw new RuntimeException("Citeria and Restrictions must not be used at the same time");
}
}
- /**
- * @return the pageSize
- */
public int getPageSize() {
return pageSize;
}
- /**
- * @param pageSize the pageSize to set
- */
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
- /**
- * @return the initStrategy
- */
public List<String> getInitStrategy() {
return initStrategy;
}
- /**
- * @param initStrategy the initStrategy to set
- */
public void setInitStrategy(List<String> initStrategy) {
this.initStrategy = initStrategy;
}
public void addRestriction(Restriction<?> restriction){
restrictions.add(restriction);
}
-}
+}
\ No newline at end of file
/**
* @author a.kohlbecker
* @since Mar 17, 2017
- *
*/
public class RegistrationItem extends GridLayout {
private ICdmEntityUuidCacher cache;
- /**
- *
- */
public RegistrationItem(RegistrationDTO item, AbstractView<?,?> parentView, ICdmEntityUuidCacher cache) {
super(GRID_COLS, GRID_ROWS);
this.cache = cache;
setItem(item, parentView);
}
- /**
- *
- */
- public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView<?,?> parentView, ICdmEntityUuidCacher cache) {
- super(GRID_COLS, GRID_ROWS);
- this.cache = cache;
- init();
- blockedByButton.setVisible(false);
- setWorkingSet(workingSet, parentView);
- }
+ public RegistrationItem(RegistrationWorkingSet workingSet, AbstractView<?,?> parentView, ICdmEntityUuidCacher cache) {
+ super(GRID_COLS, GRID_ROWS);
+ this.cache = cache;
+ init();
+ blockedByButton.setVisible(false);
+ setWorkingSet(workingSet, parentView);
+ }
public void init() {
releasedLabel.setVisible(false);
addComponent(releasedLabel, 2, 3);
setComponentAlignment(releasedLabel, Alignment.BOTTOM_RIGHT);
-
}
public void setItem(RegistrationDTO regDto, AbstractView<?,?> parentView){
referenceEditorAction, FontAwesome.EDIT, null, submitterName);
}
- /**
- * @return
- */
private UserHelper cdmUserHelper() {
if(cache != null){
return UserHelperAccess.userHelper().withCache(cache);
}
}
-
- /**
- * @param submitterUserName TODO
- *
- */
private void updateUI(String citationString, DateTime created, TimePeriod datePublished, int validationProblemsCount,
Object openButtonEvent, Resource openButtonIcon, RegistrationDTO regDto, String submitterUserName) {
getValidationProblemsButton().setEnabled(true);
// getMessageButton().addStyleName(RegistrationStyles.STYLE_FRIENDLY_FOREGROUND);
getValidationProblemsButton().addClickListener(e -> {
- ShowDetailsEvent detailsEvent;
+ ShowDetailsEvent<?,?> detailsEvent;
if(regDto != null){
detailsEvent = new ShowDetailsEvent<RegistrationDTO, UUID>(
e,
updateDateLabels(created, datePublished, registrationDate);
}
-
private void updateDateLabels(DateTime created, TimePeriod datePublished, DateTime released) {
if(created != null){
getCreatedLabel().setValue("<span class=\"caption\">" + LABEL_CAPTION_CREATED + "</span> " + created.toString(ISODateTimeFormat.yearMonthDay()));
return regDto.getUuid();
}
- /**
- * @param showBlockingRelations the showBlockingRelations to set
- */
public void showBlockingRegistrations(Set<RegistrationDTO> blockingRegDTOs) {
if(blockingRelationsPanel == null) {
}
/* ====== RegistrationItemDesign Getters ====== */
- /**
- * @return the typeStateLabel
- */
+
public Label getTypeStateLabel() {
return stateLabel;
}
- /**
- * @return the identifierLink
- */
public Link getIdentifierLink() {
return identifierLink;
}
- /**
- * @return the citationSummaryLabel
- */
public Label getCitationSummaryLabel() {
return citationSummaryLabel;
}
- /**
- * @return the blockedByButton
- */
public Button getBlockedByButton() {
return blockedByButton;
}
- /**
- * @return the validationProblemsButton
- */
public BadgeButton getValidationProblemsButton() {
return validationProblemsButton;
}
- /**
- * @return the openButton
- */
public Button getOpenButton() {
return openButton;
}
- /**
- * @return the createdLabel
- */
public Label getCreatedLabel() {
return createdLabel;
}
- /**
- * @return the publishedLabel
- */
public Label getPublishedLabel() {
return publishedLabel;
}
-
- /**
- * @return
- */
public Label getReleasedLabel() {
return releasedLabel;
}
- /**
- * @return the submitterLabel
- */
public Label getSubmitterLabel() {
return submitterLabel;
}
- /**
- * @return the showBlockingRelations
- */
public boolean isShowBlockingRelations() {
return blockingRelationsPanel != null;
}
-
-
- /* --------------------------------------- */
-
-}
+}
\ No newline at end of file
*/
public class RegistrationEditorAction extends AbstractEditorAction<Registration> {
- /**
- * @param eventType
- */
public RegistrationEditorAction(EditorActionType type) {
super(type);
}
-
- /**
- * @param action
- * @param source
- */
public RegistrationEditorAction(EditorActionType action, Button source, Field<Registration> target, AbstractView sourceView) {
super(action, source, target, sourceView);
}
- /**
- * @param action
- * @param entityId
- * @param source
- * @param sourceView
- */
public RegistrationEditorAction(EditorActionType action, UUID entityUuid, Button source, Field<Registration> target, AbstractView sourceView) {
super(action, entityUuid, source, target, sourceView);
}
-
-
-
-
-}
+}
\ No newline at end of file
select.setNullSelectionAllowed(false);
return select;
}
-
-
});
loadWorkingSet(getView().getCitationUuid());
if(value != null && value instanceof RegistrationStatus){
if(!Objects.equals(value, reg.getStatus())){
reg.updateStatusAndDate((RegistrationStatus)value);
- cdmStore.saveBean(reg, (AbstractView)getView());
+ cdmStore.saveBean(reg, (AbstractView<?,?>)getView());
refreshView(true);
}
} else {
public static final String ACTION_EDIT = "edit";
- /**
- * Open a popup editor for an existing TaxonName if the nameUuid is
- * given otherwise a blank editor will open if the nameUuid is null.
- *
- * @param nameUuid can be null
- */
- public void openNameEditor(UUID nameUuid);
-
- /**
- * Open a popup editor for an existing Reference if the referenceUuid is
- * given otherwise a blank editor will open if the referenceUuid is null.
- *
- * @param referenceUuid can be null
- */
- public void openReferenceEditor(UUID referenceUuid);
-
public void setSubheaderText(String subheaderText);
public void setHeaderText(String subheaderText);
import static eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStyles.LABEL_NOWRAP;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
public static final String NAME = "workingset";
- private List<CssLayout> registrations = new ArrayList<>();
-
private String headerText = "Registration Workingset Editor";
private String subheaderText = "";
));
}
- @Override
- public void openReferenceEditor(UUID referenceUuid) {
- // TODO Auto-generated method stub
- }
-
- @Override
- public void openNameEditor(UUID nameUuid) {
- // TODO Auto-generated method stub
- }
-
@Override
protected String getHeaderText() {
return headerText;
new ReferenceEllypsisFormatter(ReferenceEllypsisFormatter.LabelType.BIBLIOGRAPHIC),
ReferenceEllypsisFormatter.INIT_STRATEGY
);
- TypedEntityCaptionGenerator<Reference> titleCacheGenrator = new TypedEntityCaptionGenerator<Reference>();
+ TypedEntityCaptionGenerator<Reference> titleCacheGenrator = new TypedEntityCaptionGenerator<>();
// referencePagingProvider.addRestriction(new Restriction("type", Operator.AND_NOT, null, ReferenceType.Section, ReferenceType.Journal, ReferenceType.PrintSeries));
Criterion criterion = Restrictions.not(Restrictions.or(Restrictions.in("type", new ReferenceType[]{ReferenceType.Section, ReferenceType.Journal, ReferenceType.PrintSeries})));
continueButton.setEnabled(false);
continueButton.addClickListener(e -> {
- UUID refUuid = null;
- referenceCombobox.commit();
- if(referenceCombobox.getValue() != null){
- refUuid = referenceCombobox.getValue().getUuid();
- }
- getViewEventBus().publish(this,
- new RegistrationEditorAction(EditorActionType.ADD,
- // passing the refId is hack, bit for some reason the presenter is always referring to the wrong view
- refUuid,
- continueButton,
- null,
- StartRegistrationViewBean.this)
+ UUID refUuid = null;
+ referenceCombobox.commit(); //Note by AM: why is this necessary, the data should be read only
+ if(referenceCombobox.getValue() != null){
+ refUuid = referenceCombobox.getValue().getUuid();
+ }
+ getViewEventBus().publish(this,
+ new RegistrationEditorAction(EditorActionType.ADD,
+ // passing the refId is hack, bit for some reason the presenter is always referring to the wrong view
+ refUuid,
+ continueButton,
+ null,
+ StartRegistrationViewBean.this)
);
- }
- );
+ }
+ );
vlayout.addComponents(publicationLayout, continueButton);
vlayout.setComponentAlignment(publicationLayout, Alignment.TOP_CENTER);
addContentComponent(vlayout, 1f);
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean allowAnonymousAccess() {
return false;
}
- /**
- * {@inheritDoc}
- */
@Override
public Collection<Collection<GrantedAuthority>> allowedGrantedAuthorities() {
return null;
this.accessDeniedMessage = accessDeniedMessage;
}
-
- /**
- * {@inheritDoc}
- */
@Override
protected String getHeaderText() {
return "New Registration";
}
- /**
- * {@inheritDoc}
- */
@Override
protected String getSubHeaderText() {
return SUBHEADER_DEEFAULT;
}
- /**
- * {@inheritDoc}
- */
@Override
public void enter(ViewChangeEvent event) {
-
getPresenter().handleViewEntered();
-
}
// ------- StartRegistrationView interface methods ----- //
- /**
- * @return the referenceCombobox
- */
@Override
public LazyComboBox<TypedEntityReference<Reference>> getReferenceCombobox() {
return referenceCombobox;
}
- /**
- * @return the newPublicationButton
- */
@Override
public Button getNewPublicationButton() {
return newPublicationButton;
}
- /**
- * @return the newPublicationButton
- */
@Override
public Button getRemoveNewPublicationButton() {
return removeNewPublicationButton;
}
- /**
- * @return the newPublicationButton
- */
@Override
public Button getContinueButton() {
return continueButton;
}
- /**
- * @return the newPublicationLabel
- */
@Override
public Label getNewPublicationLabel() {
return newPublicationLabel;
}
-
-
-
-}
+}
\ No newline at end of file