/** * This curator decides to curate the publication. * * @param publication the publication */ @LifecycleTransition(fromStatus = CvPublicationStatusType.NEW, toStatus = CvPublicationStatusType.ASSIGNED) public void claimOwnership(Publication publication) { IntactContext intactContext = IntactContext.getCurrentInstance(); final User previousOwner = publication.getCurrentOwner(); publication.setCurrentOwner(intactContext.getUserContext().getUser()); changeStatus(publication, CvPublicationStatusType.ASSIGNED, CvLifecycleEventType.SELF_ASSIGNED, "Claimed ownership"); // Notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireOwnerChanged( publication, previousOwner, intactContext.getUserContext().getUser() ); listener.fireAssigned( publication, null, intactContext.getUserContext().getUser() ); } }
/** * This curator decides to curate the publication. * * @param publication the publication */ @LifecycleTransition(fromStatus = CvPublicationStatusType.NEW, toStatus = CvPublicationStatusType.ASSIGNED) public void claimOwnership(Publication publication) { IntactContext intactContext = IntactContext.getCurrentInstance(); final User previousOwner = publication.getCurrentOwner(); publication.setCurrentOwner(intactContext.getUserContext().getUser()); changeStatus(publication, CvPublicationStatusType.ASSIGNED, CvLifecycleEventType.SELF_ASSIGNED, "Claimed ownership"); // Notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireOwnerChanged( publication, previousOwner, intactContext.getUserContext().getUser() ); listener.fireAssigned( publication, null, intactContext.getUserContext().getUser() ); } }
private void createDefaultUsers() { User admin = new User( "admin", "Admin", "N/A", "intact-admin@ebi.ac.uk" ); admin.setPassword("d033e22ae348aeb5660fc2140aec35850c4da997"); createAdminUser(admin); // Make the default user an admin if it does not exist User user = intactContext.getUserContext().getUser(); if (user != null) { createAdminUser(user); } }
private void createDefaultUsers() { User admin = new User( "admin", "Admin", "N/A", "intact-admin@ebi.ac.uk" ); admin.setPassword("d033e22ae348aeb5660fc2140aec35850c4da997"); createAdminUser(admin); // Make the default user an admin if it does not exist User user = intactContext.getUserContext().getUser(); if (user != null) { createAdminUser(user); } }
protected void addLifecycleEvent(Publication publication, String cvLifecycleEventIdentifier, String comment) { IntactContext intactContext = IntactContext.getCurrentInstance(); final CvObjectDao<CvLifecycleEvent> cvObjectDao = intactContext.getDaoFactory().getCvObjectDao( CvLifecycleEvent.class ); CvLifecycleEvent lifecycleEvent = cvObjectDao.getByIdentifier( cvLifecycleEventIdentifier ); publication.addLifecycleEvent(new LifecycleEvent(lifecycleEvent, intactContext.getUserContext().getUser(), comment)); }
protected void addLifecycleEvent(Publication publication, String cvLifecycleEventIdentifier, String comment) { IntactContext intactContext = IntactContext.getCurrentInstance(); final CvObjectDao<CvLifecycleEvent> cvObjectDao = intactContext.getDaoFactory().getCvObjectDao( CvLifecycleEvent.class ); CvLifecycleEvent lifecycleEvent = cvObjectDao.getByIdentifier( cvLifecycleEventIdentifier ); publication.addLifecycleEvent(new LifecycleEvent(lifecycleEvent, intactContext.getUserContext().getUser(), comment)); }
/** * A publication is assigned to another curator, who will be the owner. * * @param publication the publication * @param curator the curator to be assigned */ @LifecycleTransition(fromStatus = CvPublicationStatusType.NEW, toStatus = CvPublicationStatusType.ASSIGNED) public void assignToCurator(Publication publication, User curator ) { final User previousOwner = publication.getCurrentOwner(); publication.setCurrentOwner( curator ); final User currentUser = IntactContext.getCurrentInstance().getUserContext().getUser(); changeStatus(publication, CvPublicationStatusType.ASSIGNED, CvLifecycleEventType.ASSIGNED, "Assigned to: "+ curator.getLogin() + " by " + currentUser.getLogin() ); // Notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireOwnerChanged( publication, previousOwner, curator ); listener.fireAssigned( publication, currentUser, curator ); } } }
/** * A publication is assigned to another curator, who will be the owner. * * @param publication the publication * @param curator the curator to be assigned */ @LifecycleTransition(fromStatus = CvPublicationStatusType.NEW, toStatus = CvPublicationStatusType.ASSIGNED) public void assignToCurator(Publication publication, User curator ) { final User previousOwner = publication.getCurrentOwner(); publication.setCurrentOwner( curator ); final User currentUser = IntactContext.getCurrentInstance().getUserContext().getUser(); changeStatus(publication, CvPublicationStatusType.ASSIGNED, CvLifecycleEventType.ASSIGNED, "Assigned to: "+ curator.getLogin() + " by " + currentUser.getLogin() ); // Notify listeners for ( LifecycleEventListener listener : getListeners() ) { listener.fireOwnerChanged( publication, previousOwner, curator ); listener.fireAssigned( publication, currentUser, curator ); } } }