├── .github └── pull_request_template.md ├── LICENSE ├── README.md ├── checkstyle.xml └── citesphere ├── .classpath ├── .gitignore ├── .project ├── pom.xml └── src ├── main ├── java │ ├── edu │ │ └── asu │ │ │ └── diging │ │ │ └── citesphere │ │ │ ├── api │ │ │ └── v1 │ │ │ │ ├── CitesphereHeaders.java │ │ │ │ ├── CitesphereTokenEndpoint.java │ │ │ │ ├── TestController.java │ │ │ │ ├── V1Controller.java │ │ │ │ ├── apps │ │ │ │ └── ApplicationsInfoController.java │ │ │ │ ├── model │ │ │ │ └── impl │ │ │ │ │ ├── Collections.java │ │ │ │ │ ├── Group.java │ │ │ │ │ ├── ItemDetails.java │ │ │ │ │ ├── Items.java │ │ │ │ │ └── SyncInfo.java │ │ │ │ ├── upload │ │ │ │ └── RetrieveUploadController.java │ │ │ │ └── user │ │ │ │ ├── AddNewItemController.java │ │ │ │ ├── BaseJobInfoController.java │ │ │ │ ├── CheckAccessController.java │ │ │ │ ├── CitationEntryController.java │ │ │ │ ├── CitesphereSupportedFields.java │ │ │ │ ├── CollectionInfoApiController.java │ │ │ │ ├── CollectionsApiController.java │ │ │ │ ├── GroupApiController.java │ │ │ │ ├── GroupListApiController.java │ │ │ │ ├── ItemApiController.java │ │ │ │ ├── ItemTextController.java │ │ │ │ ├── ItemsApiController.java │ │ │ │ ├── JobInfoController.java │ │ │ │ ├── JsonUtil.java │ │ │ │ └── UserInfoController.java │ │ │ ├── config │ │ │ ├── core │ │ │ │ ├── AuditConfig.java │ │ │ │ ├── CitesphereConfig.java │ │ │ │ ├── CitesphereConnectionSignUp.java │ │ │ │ ├── CitesphereOAuth2AuthenticationProcessingFilter.java │ │ │ │ ├── ClientCredentialsAuthenticationManager.java │ │ │ │ ├── CsrfSecurityRequestMatcher.java │ │ │ │ ├── CustomAuthenticationFailureHandler.java │ │ │ │ ├── ElasticConfig.java │ │ │ │ ├── JacksonConfig.java │ │ │ │ ├── KafkaConfig.java │ │ │ │ ├── MongoConfig.java │ │ │ │ ├── PersistentContext.java │ │ │ │ ├── SecurityContext.java │ │ │ │ ├── SimpleSignInAdapter.java │ │ │ │ ├── ThymeleafConfig.java │ │ │ │ └── ZoteroConfig.java │ │ │ └── web │ │ │ │ └── SocialContext.java │ │ │ ├── core │ │ │ ├── authority │ │ │ │ ├── AuthorityImporter.java │ │ │ │ ├── IImportedAuthority.java │ │ │ │ └── impl │ │ │ │ │ ├── BaseAuthorityImporter.java │ │ │ │ │ ├── ConceptpowerEntry.java │ │ │ │ │ ├── ConceptpowerImporter.java │ │ │ │ │ ├── ConceptpowerResponse.java │ │ │ │ │ ├── ImportedAuthority.java │ │ │ │ │ ├── IsiscbEntry.java │ │ │ │ │ ├── IsiscbImporter.java │ │ │ │ │ ├── IsiscbResponse.java │ │ │ │ │ ├── Pagination.java │ │ │ │ │ ├── ViafAuthorityImporter.java │ │ │ │ │ ├── ViafRecordData.java │ │ │ │ │ └── ViafSearchResponseWrapper.java │ │ │ ├── bib │ │ │ │ ├── ICitationVersionsDao.java │ │ │ │ └── impl │ │ │ │ │ └── CitationVersionDao.java │ │ │ ├── email │ │ │ │ ├── IEmailNotificationManager.java │ │ │ │ └── impl │ │ │ │ │ ├── EmailNotificationManager.java │ │ │ │ │ ├── EmailNotificationSender.java │ │ │ │ │ └── NotSetupMailSender.java │ │ │ ├── exceptions │ │ │ │ ├── AccessForbiddenException.java │ │ │ │ ├── AuthorityImporterNotFoundException.java │ │ │ │ ├── AuthorityServiceConnectionException.java │ │ │ │ ├── CannotFindCitationException.java │ │ │ │ ├── CannotFindCitationVersionException.java │ │ │ │ ├── CannotFindClientException.java │ │ │ │ ├── CitationIsOutdatedException.java │ │ │ │ ├── DownloadExportException.java │ │ │ │ ├── ExportFailedException.java │ │ │ │ ├── ExportTooBigException.java │ │ │ │ ├── ExportTypeNotSupportedException.java │ │ │ │ ├── FileStorageException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ ├── GroupDoesNotExistException.java │ │ │ │ ├── MailNotSetupException.java │ │ │ │ ├── MessageCreationException.java │ │ │ │ ├── SelfCitationException.java │ │ │ │ ├── SyncInProgressException.java │ │ │ │ ├── TokenExpiredException.java │ │ │ │ ├── UserAlreadyExistsException.java │ │ │ │ ├── UserDoesNotExistException.java │ │ │ │ ├── ZoteroHttpStatusException.java │ │ │ │ └── ZoteroItemCreationFailedException.java │ │ │ ├── export │ │ │ │ ├── ExportFinishedCallback.java │ │ │ │ ├── ExportType.java │ │ │ │ ├── IExportJobManager.java │ │ │ │ ├── IExportManager.java │ │ │ │ ├── IExportProcessor.java │ │ │ │ ├── IExportTaskManager.java │ │ │ │ ├── impl │ │ │ │ │ ├── ExportJobManager.java │ │ │ │ │ ├── ExportManager.java │ │ │ │ │ ├── ExportProcessor.java │ │ │ │ │ └── ExportTaskManager.java │ │ │ │ └── proc │ │ │ │ │ ├── Processor.java │ │ │ │ │ └── impl │ │ │ │ │ └── CsvProcessor.java │ │ │ ├── factory │ │ │ │ ├── IUserFactory.java │ │ │ │ ├── IZoteroTokenFactory.java │ │ │ │ ├── ZoteroConstants.java │ │ │ │ ├── impl │ │ │ │ │ ├── UserFactory.java │ │ │ │ │ └── ZoteroTokenFactory.java │ │ │ │ └── zotero │ │ │ │ │ ├── IItemFactory.java │ │ │ │ │ └── impl │ │ │ │ │ ├── ExtraDataObject.java │ │ │ │ │ └── ItemFactory.java │ │ │ ├── kafka │ │ │ │ ├── IJsonMessageCreator.java │ │ │ │ ├── IKafkaRequestProducer.java │ │ │ │ └── impl │ │ │ │ │ ├── ExporterDoneListener.java │ │ │ │ │ ├── JsonMessageCreator.java │ │ │ │ │ ├── KafkaRequestProducer.java │ │ │ │ │ └── ReferenceImporterDoneListener.java │ │ │ ├── model │ │ │ │ ├── IPasswordResetToken.java │ │ │ │ ├── IZoteroToken.java │ │ │ │ ├── Role.java │ │ │ │ ├── ZoteroCreatorTypes.java │ │ │ │ ├── bib │ │ │ │ │ └── CitationVersion.java │ │ │ │ ├── export │ │ │ │ │ ├── ExportStatus.java │ │ │ │ │ ├── IExportTask.java │ │ │ │ │ └── impl │ │ │ │ │ │ └── ExportTask.java │ │ │ │ ├── impl │ │ │ │ │ ├── PasswordResetToken.java │ │ │ │ │ └── ZoteroToken.java │ │ │ │ ├── jobs │ │ │ │ │ ├── IExportJob.java │ │ │ │ │ ├── IGroupSyncJob.java │ │ │ │ │ ├── IJob.java │ │ │ │ │ ├── IUploadFileJob.java │ │ │ │ │ ├── IUploadJob.java │ │ │ │ │ ├── JobStatus.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── ExportJob.java │ │ │ │ │ │ ├── GroupSyncJob.java │ │ │ │ │ │ ├── Job.java │ │ │ │ │ │ ├── JobPhase.java │ │ │ │ │ │ ├── UploadFileJob.java │ │ │ │ │ │ └── UploadJob.java │ │ │ │ └── oauth │ │ │ │ │ ├── IOAuthClient.java │ │ │ │ │ └── impl │ │ │ │ │ ├── DbAccessToken.java │ │ │ │ │ ├── DbRefreshToken.java │ │ │ │ │ ├── OAuthClient.java │ │ │ │ │ └── SerializableObjectConverter.java │ │ │ ├── repository │ │ │ │ ├── CustomCitationConceptRepository.java │ │ │ │ ├── CustomConceptTypeRepository.java │ │ │ │ ├── IdGenerator.java │ │ │ │ ├── PasswordResetTokenRepository.java │ │ │ │ ├── TokenRepository.java │ │ │ │ ├── UserRepository.java │ │ │ │ ├── custom │ │ │ │ │ └── AuthorityRepository.java │ │ │ │ ├── export │ │ │ │ │ └── ExportTaskRepository.java │ │ │ │ ├── jobs │ │ │ │ │ ├── ExportJobRepository.java │ │ │ │ │ ├── GroupSyncJobCustomRepository.java │ │ │ │ │ ├── GroupSyncJobRepository.java │ │ │ │ │ ├── JobRepository.java │ │ │ │ │ ├── UploadFileJobRepository.java │ │ │ │ │ ├── UploadJobRepository.java │ │ │ │ │ └── impl │ │ │ │ │ │ └── GroupSyncJobCustomRepositoryImpl.java │ │ │ │ └── oauth │ │ │ │ │ ├── DbAccessTokenRepository.java │ │ │ │ │ ├── DbRefreshTokenRepository.java │ │ │ │ │ └── OAuthClientRepository.java │ │ │ ├── search │ │ │ │ ├── data │ │ │ │ │ └── ReferenceRepository.java │ │ │ │ ├── model │ │ │ │ │ └── impl │ │ │ │ │ │ ├── Affiliation.java │ │ │ │ │ │ ├── Person.java │ │ │ │ │ │ ├── Reference.java │ │ │ │ │ │ └── Tag.java │ │ │ │ └── service │ │ │ │ │ ├── Indexer.java │ │ │ │ │ ├── SearchEngine.java │ │ │ │ │ └── impl │ │ │ │ │ ├── IndexerImpl.java │ │ │ │ │ ├── ResultPage.java │ │ │ │ │ └── SearchEngineImpl.java │ │ │ ├── service │ │ │ │ ├── IAsyncCitationManager.java │ │ │ │ ├── IAsyncCitationProcessor.java │ │ │ │ ├── IAuthorityService.java │ │ │ │ ├── ICitationCollectionManager.java │ │ │ │ ├── ICitationConceptManager.java │ │ │ │ ├── ICitationManager.java │ │ │ │ ├── ICitationStore.java │ │ │ │ ├── ICitationVersionManager.java │ │ │ │ ├── IConceptTypeManager.java │ │ │ │ ├── IGroupManager.java │ │ │ │ ├── IPasswordResetTokenService.java │ │ │ │ ├── giles │ │ │ │ │ ├── GilesUploadChecker.java │ │ │ │ │ ├── GilesUploadService.java │ │ │ │ │ ├── IGilesConnector.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── GilesCheckUploadResponse.java │ │ │ │ │ │ ├── GilesConnector.java │ │ │ │ │ │ ├── GilesUploadCheckerImpl.java │ │ │ │ │ │ ├── GilesUploadServiceImpl.java │ │ │ │ │ │ └── UploadResponse.java │ │ │ │ ├── impl │ │ │ │ │ ├── AsyncCitationManager.java │ │ │ │ │ ├── AsyncCitationProcessor.java │ │ │ │ │ ├── AsyncDeleteCitationsProcessor.java │ │ │ │ │ ├── AsyncUpdateCitationsProcessor.java │ │ │ │ │ ├── AuthorityService.java │ │ │ │ │ ├── CitationCollectionManager.java │ │ │ │ │ ├── CitationConceptManager.java │ │ │ │ │ ├── CitationManager.java │ │ │ │ │ ├── CitationPage.java │ │ │ │ │ ├── CitationStore.java │ │ │ │ │ ├── CitationVersionManager.java │ │ │ │ │ ├── ConceptTypeManager.java │ │ │ │ │ ├── DbTokenStore.java │ │ │ │ │ ├── GroupManager.java │ │ │ │ │ ├── PasswordResetTokenService.java │ │ │ │ │ └── async │ │ │ │ │ │ ├── AsyncDeleteCitationsResponse.java │ │ │ │ │ │ └── AsyncUpdateCitationsResponse.java │ │ │ │ ├── jobs │ │ │ │ │ ├── IJobCompleteProcessor.java │ │ │ │ │ ├── ISyncJobManager.java │ │ │ │ │ ├── IUploadFileJobManager.java │ │ │ │ │ ├── IUploadJobManager.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── JobCompleteProcessor.java │ │ │ │ │ │ ├── SyncJobManager.java │ │ │ │ │ │ ├── TokenPayload.java │ │ │ │ │ │ ├── UploadFileJobManager.java │ │ │ │ │ │ └── UploadJobManager.java │ │ │ │ ├── jwt │ │ │ │ │ ├── IJobApiTokenContents.java │ │ │ │ │ ├── IJwtTokenService.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── JobApiTokenContents.java │ │ │ │ │ │ └── JwtTokenService.java │ │ │ │ ├── oauth │ │ │ │ │ ├── GrantTypes.java │ │ │ │ │ ├── IOAuthClientManager.java │ │ │ │ │ ├── InternalTokenManager.java │ │ │ │ │ ├── OAuthClientResultPage.java │ │ │ │ │ ├── OAuthCredentials.java │ │ │ │ │ ├── OAuthScope.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── InternalTokenManagerImpl.java │ │ │ │ │ │ └── OAuthClientManager.java │ │ │ │ └── upload │ │ │ │ │ ├── IFileStorageManager.java │ │ │ │ │ └── impl │ │ │ │ │ └── FileStorageManager.java │ │ │ ├── sync │ │ │ │ └── ExtraData.java │ │ │ ├── user │ │ │ │ ├── IUserHelper.java │ │ │ │ ├── IUserManager.java │ │ │ │ └── impl │ │ │ │ │ ├── UserHelper.java │ │ │ │ │ └── UserService.java │ │ │ ├── util │ │ │ │ ├── IGilesUtil.java │ │ │ │ ├── impl │ │ │ │ │ └── GilesUtil.java │ │ │ │ └── model │ │ │ │ │ ├── ICitationHelper.java │ │ │ │ │ └── impl │ │ │ │ │ └── CitationHelper.java │ │ │ └── zotero │ │ │ │ ├── DeletedZoteroElements.java │ │ │ │ ├── IZoteroConnector.java │ │ │ │ ├── IZoteroManager.java │ │ │ │ ├── IZoteroTokenManager.java │ │ │ │ ├── ZoteroCollectionsResponse.java │ │ │ │ ├── ZoteroGroupItemsResponse.java │ │ │ │ └── impl │ │ │ │ ├── ZoteroConnector.java │ │ │ │ ├── ZoteroManager.java │ │ │ │ └── ZoteroTokenManager.java │ │ │ └── web │ │ │ ├── BreadCrumb.java │ │ │ ├── BreadCrumbType.java │ │ │ ├── ChangePasswordController.java │ │ │ ├── CreateAccountController.java │ │ │ ├── ExceptionHandlerAdvice.java │ │ │ ├── HomeController.java │ │ │ ├── RequestPasswordResetController.java │ │ │ ├── ResetPasswordInitiatedController.java │ │ │ ├── admin │ │ │ ├── ApproveAccountController.java │ │ │ ├── ListUserController.java │ │ │ ├── UserRoleController.java │ │ │ ├── forms │ │ │ │ └── AppForm.java │ │ │ └── oauth │ │ │ │ ├── AddOAuthClientController.java │ │ │ │ ├── DeleteOAuthClientController.java │ │ │ │ ├── OAuthClientDetailsController.java │ │ │ │ ├── ShowOAuthClientsController.java │ │ │ │ └── UpdateOAuthClientController.java │ │ │ ├── auth │ │ │ └── OAuthApprovalController.java │ │ │ ├── forms │ │ │ ├── AffiliationForm.java │ │ │ ├── CitationConceptForm.java │ │ │ ├── CitationForm.java │ │ │ ├── ConceptAssignmentForm.java │ │ │ ├── ConceptTypeForm.java │ │ │ ├── CreateAuthorityForm.java │ │ │ ├── EditAuthorityForm.java │ │ │ ├── PersonForm.java │ │ │ └── UserForm.java │ │ │ ├── user │ │ │ ├── AddItemController.java │ │ │ ├── AddReferenceController.java │ │ │ ├── AsyncTaskStatus.java │ │ │ ├── AuthoritySearchResult.java │ │ │ ├── AvailableColumnsDataDto.java │ │ │ ├── CancelSyncJobController.java │ │ │ ├── CitationsDto.java │ │ │ ├── CollectionItemsController.java │ │ │ ├── CreatorController.java │ │ │ ├── DeleteCitationController.java │ │ │ ├── DeleteLocalCitationGroupController.java │ │ │ ├── DownloadGilesFileController.java │ │ │ ├── EditItemController.java │ │ │ ├── FetchItemsController.java │ │ │ ├── FoundAuthorities.java │ │ │ ├── GilesDocumentController.java │ │ │ ├── GroupItemsController.java │ │ │ ├── ItemController.java │ │ │ ├── ItemVersionController.java │ │ │ ├── ItemVersionsController.java │ │ │ ├── ItemsDataDto.java │ │ │ ├── MoveItemsController.java │ │ │ ├── OAuthAppsRevokeTokenController.java │ │ │ ├── OAuthAppsTokenController.java │ │ │ ├── RevertCitationController.java │ │ │ ├── SearchCitationsController.java │ │ │ ├── SearchController.java │ │ │ ├── SearchItemsDataDto.java │ │ │ ├── SyncGilesStatusController.java │ │ │ ├── SyncGroupItemsController.java │ │ │ ├── SyncInfoController.java │ │ │ ├── SyncItemController.java │ │ │ ├── UploadItemFileController.java │ │ │ ├── authorities │ │ │ │ ├── AuthorityController.java │ │ │ │ ├── AuthorityEntryController.java │ │ │ │ ├── AuthorityItemsController.java │ │ │ │ ├── AuthorityListController.java │ │ │ │ ├── CreateAuthorityController.java │ │ │ │ ├── DeleteAuthorityController.java │ │ │ │ └── EditAuthorityController.java │ │ │ ├── concepts │ │ │ │ ├── AddConceptController.java │ │ │ │ ├── EditConceptController.java │ │ │ │ ├── ListConceptsController.java │ │ │ │ └── types │ │ │ │ │ ├── AddConceptTypeController.java │ │ │ │ │ ├── EditConceptTypeController.java │ │ │ │ │ └── ListConceptTypesController.java │ │ │ ├── dto │ │ │ │ └── MoveItemsRequest.java │ │ │ ├── export │ │ │ │ ├── DownloadExportController.java │ │ │ │ ├── ExportController.java │ │ │ │ ├── ExportJobController.java │ │ │ │ └── ListExportsController.java │ │ │ └── jobs │ │ │ │ ├── ImportJobsController.java │ │ │ │ ├── ImportReferencesController.java │ │ │ │ └── SyncJobsController.java │ │ │ └── validation │ │ │ ├── CitationConceptValidator.java │ │ │ ├── ConceptTypeValidator.java │ │ │ ├── FieldMatch.java │ │ │ └── FieldMatchValidator.java │ └── org │ │ └── springframework │ │ └── security │ │ └── core │ │ └── authority │ │ └── SimpleGrantedAuthority.java ├── resources │ ├── app.properties │ ├── config.properties │ ├── creators.properties │ ├── ehcache.xml │ ├── item_type_icons.properties │ ├── labels.properties │ ├── locale │ │ ├── messages.properties │ │ └── messages_en_US.properties │ ├── log4j.xml │ ├── log4j2.xml │ ├── newAccountNotification.txt │ ├── passwordResetEmail.txt │ └── user.properties └── webapp │ ├── WEB-INF │ ├── spring │ │ ├── appServlet │ │ │ └── servlet-context.xml │ │ └── root-context.xml │ ├── tiles-defs.xml │ ├── views │ │ ├── admin │ │ │ ├── apps │ │ │ │ ├── add.html │ │ │ │ ├── details.html │ │ │ │ └── show.html │ │ │ └── user │ │ │ │ └── list.html │ │ ├── auth │ │ │ ├── authorities │ │ │ │ ├── authorityItems.html │ │ │ │ ├── create.html │ │ │ │ ├── edit.html │ │ │ │ ├── list.html │ │ │ │ ├── show.html │ │ │ │ └── showItemsByName.html │ │ │ ├── concepts │ │ │ │ ├── add.html │ │ │ │ ├── edit.html │ │ │ │ ├── list.html │ │ │ │ └── types │ │ │ │ │ ├── add.html │ │ │ │ │ ├── edit.html │ │ │ │ │ └── list.html │ │ │ ├── group │ │ │ │ ├── editConflict.html │ │ │ │ ├── editItem.html │ │ │ │ ├── export │ │ │ │ │ ├── list.html │ │ │ │ │ └── started.html │ │ │ │ ├── item.html │ │ │ │ ├── itemVersion.html │ │ │ │ ├── itemVersions.html │ │ │ │ └── items.html │ │ │ ├── import │ │ │ │ ├── jobs.html │ │ │ │ └── upload.html │ │ │ ├── jobs │ │ │ │ └── list.html │ │ │ ├── oauth_approve.html │ │ │ └── tokens.html │ │ ├── error │ │ │ ├── 403.html │ │ │ ├── 404.html │ │ │ ├── 500.html │ │ │ ├── citationNotFound.html │ │ │ └── gilesDocumentError.html │ │ ├── home.html │ │ ├── layouts │ │ │ └── main.html │ │ ├── login.html │ │ ├── password │ │ │ └── change.html │ │ ├── register.html │ │ └── resetPassword.html │ └── web.xml │ └── resources │ ├── bootstrap │ ├── assets │ │ ├── css │ │ │ └── ie10-viewport-bug-workaround.css │ │ └── js │ │ │ └── ie-emulation-modes-warning.js │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ └── diging-icons.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── grid.css │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── main.js │ │ └── npm.js │ ├── dateFormatting │ ├── dateFormat.min.js │ ├── jquery-dateformat.min.js │ └── moment-with-locales.min.js │ ├── diging-icon-pack │ ├── diging-icon-pack.css │ └── fonts │ │ ├── diging-icon-pack.eot │ │ ├── diging-icon-pack.svg │ │ ├── diging-icon-pack.ttf │ │ └── diging-icon-pack.woff │ ├── font-awesome-4.6.3 │ ├── HELP-US-OUT.txt │ ├── css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── less │ │ ├── animated.less │ │ ├── bordered-pulled.less │ │ ├── core.less │ │ ├── fixed-width.less │ │ ├── font-awesome.less │ │ ├── icons.less │ │ ├── larger.less │ │ ├── list.less │ │ ├── mixins.less │ │ ├── path.less │ │ ├── rotated-flipped.less │ │ ├── screen-reader.less │ │ ├── stacked.less │ │ └── variables.less │ └── scss │ │ ├── _animated.scss │ │ ├── _bordered-pulled.scss │ │ ├── _core.scss │ │ ├── _fixed-width.scss │ │ ├── _icons.scss │ │ ├── _larger.scss │ │ ├── _list.scss │ │ ├── _mixins.scss │ │ ├── _path.scss │ │ ├── _rotated-flipped.scss │ │ ├── _screen-reader.scss │ │ ├── _stacked.scss │ │ ├── _variables.scss │ │ └── font-awesome.scss │ ├── notify │ ├── animate.css │ └── bootstrap-notify.min.js │ └── paginator │ └── jquery.twbsPagination.min.js └── test └── java └── edu └── asu └── diging └── citesphere ├── core ├── export │ └── impl │ │ ├── ExportManagerTest.java │ │ └── ExportTaskManagerTest.java ├── service │ ├── impl │ │ ├── AsyncCitationManagerTest.java │ │ ├── AuthorityServiceTest.java │ │ ├── CitationManagerTest.java │ │ ├── CitationVersionManagerTest.java │ │ └── DbTokenStoreTest.java │ └── oauth │ │ └── impl │ │ └── OAuthClientManagerTest.java └── util │ └── model │ └── impl │ ├── CitationHelperTest.java │ └── GilesUtilTest.java └── web └── validation ├── CitationConceptValidatorTest.java └── ConceptTypeValidatorTest.java /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Guidelines for Pull Requests 2 | 3 | If you haven't yet read our code review guidelines, please do so, You can find them [here](https://diging.atlassian.net/wiki/spaces/DIGING/pages/2256076801/Code+Review+Guidelines). 4 | 5 | Please confirm the following by adding an x for each item (turn `[ ]` into `[x]`). 6 | 7 | - [ ] I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code) 8 | - [ ] I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added) 9 | - [ ] I do not have any sysout statements in my code or commented out code that isn’t needed anymore 10 | - [ ] I am not reformatting any files in the wrong format or without cause. 11 | - [ ] I am not changing file encoding or line endings to something else than UTF-8, LF 12 | - [ ] My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed 13 | - [ ] I have added Javadoc/documentation where appropriate 14 | - [ ] I have added test cases where appropriate 15 | - [ ] I have explained any part of my code/implementation decisions that is not be self-explanatory 16 | 17 | ## Please provide a brief description of your ticket 18 | 19 | 20 | ... Put ticket description here and add link to ticket ... 21 | 22 | ## Are there any other pull requests that this one depends on? 23 | 24 | 25 | ## Anything else the reviewer needs to know? 26 | 27 | ... describe here ... 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Citesphere 2 | 3 | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/diging/citesphere) 4 | [![API Documentation](https://img.shields.io/badge/API%20Documentation-v1.0-orange)](https://documenter.getpostman.com/view/19365454/UVeMJiyx) 5 | 6 | Citesphere is a web application that sits on top of Zotero and allows users to manage their Zotero citations. It allows users to add additional information to their citations that Zotero doesn't support such as specifying author affiliations or author URIs. 7 | 8 | This project is under active development by the Digital Innovation Group at Arizona State University and more information will follow soon. 9 | -------------------------------------------------------------------------------- /citesphere/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /Users/ 3 | /.settings/ 4 | -------------------------------------------------------------------------------- /citesphere/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | citesphere 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.springframework.ide.eclipse.core.springnature 36 | org.eclipse.jem.workbench.JavaEMFNature 37 | org.eclipse.wst.common.modulecore.ModuleCoreNature 38 | org.eclipse.jdt.core.javanature 39 | org.eclipse.m2e.core.maven2Nature 40 | org.eclipse.wst.common.project.facet.core.nature 41 | org.eclipse.wst.jsdt.core.jsNature 42 | 43 | 44 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/CitesphereHeaders.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1; 2 | 3 | public interface CitesphereHeaders { 4 | 5 | public final static String CITESPHERE_API_TOKEN = "Citesphere-API-Token"; 6 | } 7 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/CitesphereTokenEndpoint.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1; 2 | 3 | import java.security.Principal; 4 | import java.util.Map; 5 | 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.security.oauth2.common.OAuth2AccessToken; 8 | import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint; 9 | import org.springframework.web.HttpRequestMethodNotSupportedException; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | 14 | public class CitesphereTokenEndpoint extends TokenEndpoint { 15 | 16 | @SuppressWarnings("deprecation") 17 | @RequestMapping(value = "/oauth/token", method = RequestMethod.POST) 18 | public ResponseEntity postAccessToken(Principal principal, 19 | @RequestParam Map parameters) throws HttpRequestMethodNotSupportedException { 20 | return super.postAccessToken(principal, parameters); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/V1Controller.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | import edu.asu.diging.citesphere.api.v1.model.impl.SyncInfo; 7 | import edu.asu.diging.citesphere.core.model.jobs.impl.GroupSyncJob; 8 | import edu.asu.diging.citesphere.core.service.jobs.ISyncJobManager; 9 | import edu.asu.diging.citesphere.model.bib.ICitationGroup; 10 | 11 | @RequestMapping("/api/v1") 12 | public class V1Controller { 13 | 14 | @Autowired 15 | private ISyncJobManager jobManager; 16 | 17 | protected SyncInfo getSyncInfo(ICitationGroup group) { 18 | GroupSyncJob job = jobManager.getMostRecentJob(group.getGroupId() + ""); 19 | SyncInfo info = new SyncInfo(); 20 | if (job != null) { 21 | info.createdOn = job.getCreatedOn().toString(); 22 | info.status = job.getStatus() != null ? job.getStatus().name() : ""; 23 | } 24 | return info; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/model/impl/Collections.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1.model.impl; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.bib.ICitationCollection; 6 | 7 | public class Collections { 8 | 9 | private Group group; 10 | private List collections; 11 | 12 | public Group getGroup() { 13 | return group; 14 | } 15 | public void setGroup(Group group) { 16 | this.group = group; 17 | } 18 | public List getCollections() { 19 | return collections; 20 | } 21 | public void setCollections(List collections) { 22 | this.collections = collections; 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/model/impl/ItemDetails.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1.model.impl; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.bib.ICitation; 6 | 7 | /** 8 | * Data transfer object to fetch item details and its attachment info 9 | * 10 | * @author Maulik Limbadiya 11 | */ 12 | public class ItemDetails { 13 | 14 | private ICitation item; 15 | private List attachments; 16 | 17 | public ICitation getItem() { 18 | return item; 19 | } 20 | 21 | public void setItem(ICitation item) { 22 | this.item = item; 23 | } 24 | 25 | public List getAttachments() { 26 | return attachments; 27 | } 28 | 29 | public void setAttachments(List attachments) { 30 | this.attachments = attachments; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/model/impl/Items.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1.model.impl; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.bib.ICitation; 6 | 7 | public class Items { 8 | 9 | private Group group; 10 | private List items; 11 | 12 | public Group getGroup() { 13 | return group; 14 | } 15 | 16 | public void setGroup(Group group) { 17 | this.group = group; 18 | } 19 | public List getItems() { 20 | return items; 21 | } 22 | 23 | public void setItems(List items) { 24 | this.items = items; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/model/impl/SyncInfo.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1.model.impl; 2 | 3 | public class SyncInfo { 4 | public String createdOn; 5 | public String status; 6 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/user/CitesphereSupportedFields.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1.user; 2 | 3 | public enum CitesphereSupportedFields { 4 | KEY("key"), 5 | ITEM_TYPE("itemType"), 6 | AUTHORS("authors"), 7 | EDITORS("editors"), 8 | REFERENCES("references"), 9 | OTHER_CREATORS("otherCreators"), 10 | CONCEPT_TAGS("conceptTags") 11 | ; 12 | private final String fieldName; 13 | 14 | CitesphereSupportedFields(final String fieldName) { 15 | this.fieldName = fieldName; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return fieldName; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/api/v1/user/JsonUtil.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.api.v1.user; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import edu.asu.diging.citesphere.api.v1.model.impl.Group; 6 | import edu.asu.diging.citesphere.model.bib.ICitationGroup; 7 | 8 | @Component 9 | public class JsonUtil { 10 | 11 | public Group createGroup(ICitationGroup group) { 12 | Group jsonGroup = new Group(); 13 | jsonGroup.setCreated(group.getCreated()); 14 | jsonGroup.setDescription(group.getDescription()); 15 | jsonGroup.setId(group.getGroupId()); 16 | jsonGroup.setLastModified(group.getLastModified()); 17 | jsonGroup.setName(group.getName()); 18 | jsonGroup.setNumItems(group.getNumItems()); 19 | jsonGroup.setOwner(group.getOwner()); 20 | jsonGroup.setType(group.getType()); 21 | jsonGroup.setUrl(group.getUrl()); 22 | jsonGroup.setVersion(group.getMetadataVersion()); 23 | 24 | return jsonGroup; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/config/core/CitesphereConnectionSignUp.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.config.core; 2 | 3 | import org.springframework.social.connect.Connection; 4 | import org.springframework.social.connect.ConnectionSignUp; 5 | 6 | import edu.asu.diging.citesphere.core.user.IUserHelper; 7 | 8 | public class CitesphereConnectionSignUp implements ConnectionSignUp { 9 | 10 | private IUserHelper userHelper; 11 | 12 | public CitesphereConnectionSignUp(IUserHelper userHelper) { 13 | this.userHelper = userHelper; 14 | } 15 | 16 | public String execute(Connection connection) { 17 | return userHelper.createUser(connection); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/config/core/CsrfSecurityRequestMatcher.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.config.core; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import org.springframework.security.web.util.matcher.RegexRequestMatcher; 8 | import org.springframework.security.web.util.matcher.RequestMatcher; 9 | 10 | public class CsrfSecurityRequestMatcher implements RequestMatcher { 11 | private Pattern allowedMethods = Pattern.compile("^(GET|HEAD|TRACE|OPTIONS)$"); 12 | private RegexRequestMatcher unprotectedMatcher = new RegexRequestMatcher("/api/v1/.*", null); 13 | 14 | @Override 15 | public boolean matches(HttpServletRequest request) { 16 | if(allowedMethods.matcher(request.getMethod()).matches()){ 17 | return false; 18 | } 19 | 20 | return !unprotectedMatcher.matches(request); 21 | } 22 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/config/core/JacksonConfig.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.config.core; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import com.fasterxml.jackson.databind.ObjectMapper; 7 | import com.fasterxml.jackson.databind.SerializationFeature; 8 | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; 9 | 10 | @Configuration 11 | public class JacksonConfig { 12 | 13 | @Bean 14 | public ObjectMapper objectMapper() { 15 | ObjectMapper objectMapper = new ObjectMapper().registerModule(new JavaTimeModule()) 16 | .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); 17 | return objectMapper; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/config/core/ZoteroConfig.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.config.core; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.PropertySource; 7 | import org.springframework.social.zotero.connect.ZoteroConnectionFactory; 8 | 9 | @Configuration 10 | @PropertySource("classpath:/config.properties") 11 | public class ZoteroConfig { 12 | 13 | @Value("${_zotero_client_secret}") 14 | private String zoteroSecret; 15 | 16 | @Value("${_zotero_client_key}") 17 | private String zoteroKey; 18 | 19 | 20 | @Bean 21 | public ZoteroConnectionFactory zoteroConnectionFactory() { 22 | return new ZoteroConnectionFactory(zoteroKey, zoteroSecret); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/IImportedAuthority.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.authority; 2 | 3 | import java.util.Map; 4 | 5 | public interface IImportedAuthority { 6 | 7 | String getName(); 8 | 9 | void setName(String name); 10 | 11 | String getUri(); 12 | 13 | void setUri(String uri); 14 | 15 | Map getProperties(); 16 | 17 | void setProperties(Map properties); 18 | 19 | /** 20 | * Retrieves the identifier of the importer. 21 | *

Example: "VIAF", "Conceptpower", etc.

22 | * 23 | * @return a String representing the identifier of the importer 24 | */ 25 | public String getImporterId(); 26 | 27 | /** 28 | * Sets the identifier for the importer. 29 | * 30 | * @param importerId a String specifying the identifier to be set for the importer 31 | */ 32 | public void setImporterId(String importerId); 33 | 34 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/BaseAuthorityImporter.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.authority.impl; 2 | 3 | import javax.annotation.PostConstruct; 4 | 5 | import org.springframework.web.client.RestTemplate; 6 | 7 | import edu.asu.diging.citesphere.core.authority.AuthorityImporter; 8 | 9 | public abstract class BaseAuthorityImporter implements AuthorityImporter { 10 | 11 | RestTemplate restTemplate; 12 | 13 | @PostConstruct 14 | public void init() { 15 | restTemplate = new RestTemplate(); 16 | } 17 | 18 | public RestTemplate getRestTemplate() { 19 | return restTemplate; 20 | } 21 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ConceptpowerEntry.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.authority.impl; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public class ConceptpowerEntry { 7 | 8 | private String id; 9 | private String concept_uri; 10 | private String lemma; 11 | private String description; 12 | 13 | public String getId() { 14 | return id; 15 | } 16 | 17 | public void setId(String id) { 18 | this.id = id; 19 | } 20 | 21 | public String getConcept_uri() { 22 | return concept_uri; 23 | } 24 | 25 | public void setConcept_uri(String concept_uri) { 26 | this.concept_uri = concept_uri; 27 | } 28 | 29 | public String getLemma() { 30 | return lemma; 31 | } 32 | 33 | public void setLemma(String lemma) { 34 | this.lemma = lemma; 35 | } 36 | 37 | public String getDescription() { 38 | return description; 39 | } 40 | 41 | public void setDescription(String description) { 42 | this.description = description; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ConceptpowerResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.authority.impl; 2 | 3 | import java.util.List; 4 | 5 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class ConceptpowerResponse { 9 | 10 | private List conceptEntries; 11 | 12 | private Pagination pagination; 13 | 14 | public List getConceptEntries() { 15 | return conceptEntries; 16 | } 17 | 18 | public void setConceptEntries(List conceptEntries) { 19 | this.conceptEntries = conceptEntries; 20 | } 21 | 22 | public Pagination getPagination() { 23 | return pagination; 24 | } 25 | 26 | public void setPagination(Pagination pagination) { 27 | this.pagination = pagination; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/IsiscbEntry.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.authority.impl; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public class IsiscbEntry { 7 | 8 | private String id; 9 | private String name; 10 | private String authority_type; 11 | private String description; 12 | 13 | public String getId() { 14 | return id; 15 | } 16 | public void setId(String id) { 17 | this.id = id; 18 | } 19 | public String getName() { 20 | return name; 21 | } 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | public String getAuthority_type() { 26 | return authority_type; 27 | } 28 | public void setAuthority_type(String authority_type) { 29 | this.authority_type = authority_type; 30 | } 31 | public String getDescription() { 32 | return description; 33 | } 34 | public void setDescription(String description) { 35 | this.description = description; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/IsiscbResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.authority.impl; 2 | 3 | import java.util.List; 4 | 5 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class IsiscbResponse { 9 | 10 | private List results; 11 | 12 | private int count; 13 | 14 | public List getResults() { 15 | return results; 16 | } 17 | 18 | public void setResults(List results) { 19 | this.results = results; 20 | } 21 | 22 | public int getCount() { 23 | return count; 24 | } 25 | 26 | public void setCount(int count) { 27 | this.count = count; 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/Pagination.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.authority.impl; 2 | 3 | public class Pagination { 4 | 5 | private long totalNumberOfRecords; 6 | private int pageNumber; 7 | 8 | public long getTotalNumberOfRecords() { 9 | return totalNumberOfRecords; 10 | } 11 | 12 | public void setTotalNumberOfRecords(long totalNumberOfRecords) { 13 | this.totalNumberOfRecords = totalNumberOfRecords; 14 | } 15 | 16 | public int getPageNumber() { 17 | return pageNumber; 18 | } 19 | 20 | public void setPageNumber(int pageNumber) { 21 | this.pageNumber = pageNumber; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/bib/ICitationVersionsDao.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.bib; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.core.model.bib.CitationVersion; 6 | import edu.asu.diging.citesphere.model.bib.ICitation; 7 | 8 | public interface ICitationVersionsDao { 9 | 10 | List getVersions(String groupId, String key, int page, int pageSize); 11 | 12 | int getTotalCount(String groupId, String key); 13 | 14 | ICitation getVersion(String groupId, String key, long version); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/email/IEmailNotificationManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.email; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | import edu.asu.diging.citesphere.core.model.IPasswordResetToken; 7 | import edu.asu.diging.citesphere.user.IUser; 8 | 9 | public interface IEmailNotificationManager { 10 | 11 | public void sendNewAccountRequestPlacementEmail(IUser user, List adminList); 12 | 13 | void sendResetPasswordEmail(IUser user, IPasswordResetToken token) throws IOException; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/AccessForbiddenException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class AccessForbiddenException extends ZoteroHttpStatusException { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public AccessForbiddenException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public AccessForbiddenException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public AccessForbiddenException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public AccessForbiddenException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public AccessForbiddenException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/AuthorityImporterNotFoundException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class AuthorityImporterNotFoundException extends Exception { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public AuthorityImporterNotFoundException() { 8 | super(); 9 | } 10 | 11 | public AuthorityImporterNotFoundException(String message, Throwable cause, boolean enableSuppression, 12 | boolean writableStackTrace) { 13 | super(message, cause, enableSuppression, writableStackTrace); 14 | } 15 | 16 | public AuthorityImporterNotFoundException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | public AuthorityImporterNotFoundException(String message) { 21 | super(message); 22 | } 23 | 24 | public AuthorityImporterNotFoundException(Throwable cause) { 25 | super(cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/AuthorityServiceConnectionException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class AuthorityServiceConnectionException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public AuthorityServiceConnectionException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public AuthorityServiceConnectionException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public AuthorityServiceConnectionException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public AuthorityServiceConnectionException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public AuthorityServiceConnectionException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/CannotFindCitationException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class CannotFindCitationException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public CannotFindCitationException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public CannotFindCitationException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public CannotFindCitationException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public CannotFindCitationException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public CannotFindCitationException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/CannotFindCitationVersionException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class CannotFindCitationVersionException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public CannotFindCitationVersionException() { 11 | super(); 12 | // todo: Auto-generated constructor stub 13 | } 14 | 15 | public CannotFindCitationVersionException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // todo: Auto-generated constructor stub 19 | } 20 | 21 | public CannotFindCitationVersionException(String message, Throwable cause) { 22 | super(message, cause); 23 | // todo: Auto-generated constructor stub 24 | } 25 | 26 | public CannotFindCitationVersionException(String message) { 27 | super(message); 28 | // todo: Auto-generated constructor stub 29 | } 30 | 31 | public CannotFindCitationVersionException(Throwable cause) { 32 | super(cause); 33 | // todo: Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/CannotFindClientException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class CannotFindClientException extends Exception { 4 | 5 | 6 | private static final long serialVersionUID = 1L; 7 | 8 | public CannotFindClientException(String message) { 9 | super(message); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/CitationIsOutdatedException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class CitationIsOutdatedException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public CitationIsOutdatedException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public CitationIsOutdatedException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public CitationIsOutdatedException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public CitationIsOutdatedException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public CitationIsOutdatedException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/DownloadExportException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class DownloadExportException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public DownloadExportException() { 11 | super(); 12 | } 13 | 14 | public DownloadExportException(String message, Throwable cause, boolean enableSuppression, 15 | boolean writableStackTrace) { 16 | super(message, cause, enableSuppression, writableStackTrace); 17 | } 18 | 19 | public DownloadExportException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public DownloadExportException(String message) { 24 | super(message); 25 | } 26 | 27 | public DownloadExportException(Throwable cause) { 28 | super(cause); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/ExportFailedException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class ExportFailedException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public ExportFailedException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public ExportFailedException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public ExportFailedException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public ExportFailedException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public ExportFailedException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/ExportTooBigException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class ExportTooBigException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public ExportTooBigException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public ExportTooBigException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public ExportTooBigException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public ExportTooBigException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public ExportTooBigException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/ExportTypeNotSupportedException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class ExportTypeNotSupportedException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public ExportTypeNotSupportedException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public ExportTypeNotSupportedException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public ExportTypeNotSupportedException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public ExportTypeNotSupportedException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public ExportTypeNotSupportedException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/FileStorageException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class FileStorageException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public FileStorageException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public FileStorageException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public FileStorageException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public FileStorageException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public FileStorageException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.validation.BindException; 11 | import org.springframework.web.bind.annotation.ControllerAdvice; 12 | import org.springframework.web.bind.annotation.ExceptionHandler; 13 | 14 | @ControllerAdvice 15 | public class GlobalExceptionHandler { 16 | 17 | private Logger logger = LoggerFactory.getLogger(getClass()); 18 | 19 | @ExceptionHandler(BindException.class) 20 | public ResponseEntity> handleBindException(BindException ex) { 21 | Map errors = new HashMap<>(); 22 | 23 | ex.getBindingResult().getFieldErrors().forEach(error -> { 24 | logger.error("Error in field ", error.getField(), ": ", error); 25 | errors.put(error.getField(), error.getDefaultMessage()); 26 | }); 27 | 28 | return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(errors); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/GroupDoesNotExistException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class GroupDoesNotExistException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public GroupDoesNotExistException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public GroupDoesNotExistException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public GroupDoesNotExistException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public GroupDoesNotExistException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public GroupDoesNotExistException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/MailNotSetupException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class MailNotSetupException extends RuntimeException { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public MailNotSetupException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public MailNotSetupException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public MailNotSetupException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public MailNotSetupException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public MailNotSetupException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | 37 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/MessageCreationException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class MessageCreationException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public MessageCreationException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public MessageCreationException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public MessageCreationException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public MessageCreationException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public MessageCreationException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/SelfCitationException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class SelfCitationException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public SelfCitationException() { 11 | super(); 12 | // Auto-generated constructor stub 13 | } 14 | 15 | public SelfCitationException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // Auto-generated constructor stub 19 | } 20 | 21 | public SelfCitationException(String message, Throwable cause) { 22 | super(message, cause); 23 | // Auto-generated constructor stub 24 | } 25 | 26 | public SelfCitationException(String message) { 27 | super(message); 28 | // Auto-generated constructor stub 29 | } 30 | 31 | public SelfCitationException(Throwable cause) { 32 | super(cause); 33 | // Auto-generated constructor stub 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/SyncInProgressException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class SyncInProgressException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public SyncInProgressException() { 11 | super(); 12 | } 13 | 14 | public SyncInProgressException(String message, Throwable cause, boolean enableSuppression, 15 | boolean writableStackTrace) { 16 | super(message, cause, enableSuppression, writableStackTrace); 17 | } 18 | 19 | public SyncInProgressException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public SyncInProgressException(String message) { 24 | super(message); 25 | } 26 | 27 | public SyncInProgressException(Throwable cause) { 28 | super(cause); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/TokenExpiredException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class TokenExpiredException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public TokenExpiredException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public TokenExpiredException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public TokenExpiredException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public TokenExpiredException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public TokenExpiredException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class UserAlreadyExistsException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public UserAlreadyExistsException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public UserAlreadyExistsException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public UserAlreadyExistsException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public UserAlreadyExistsException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public UserAlreadyExistsException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/UserDoesNotExistException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class UserDoesNotExistException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public UserDoesNotExistException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public UserDoesNotExistException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public UserDoesNotExistException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public UserDoesNotExistException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public UserDoesNotExistException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/exceptions/ZoteroHttpStatusException.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.exceptions; 2 | 3 | public class ZoteroHttpStatusException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public ZoteroHttpStatusException() { 11 | super(); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public ZoteroHttpStatusException(String message, Throwable cause, boolean enableSuppression, 16 | boolean writableStackTrace) { 17 | super(message, cause, enableSuppression, writableStackTrace); 18 | // TODO Auto-generated constructor stub 19 | } 20 | 21 | public ZoteroHttpStatusException(String message, Throwable cause) { 22 | super(message, cause); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public ZoteroHttpStatusException(String message) { 27 | super(message); 28 | // TODO Auto-generated constructor stub 29 | } 30 | 31 | public ZoteroHttpStatusException(Throwable cause) { 32 | super(cause); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/export/ExportFinishedCallback.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.export; 2 | 3 | import edu.asu.diging.citesphere.core.model.jobs.IExportJob; 4 | 5 | public interface ExportFinishedCallback { 6 | 7 | public void exportFinished(String taskId); 8 | 9 | public void retryExport(IExportJob job); 10 | } 11 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/export/ExportType.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.export; 2 | 3 | public enum ExportType { 4 | CSV("csv"); 5 | 6 | private String fileExtension; 7 | 8 | private ExportType(String ext) { 9 | this.fileExtension = ext; 10 | } 11 | 12 | public String getFileExtension() { 13 | return fileExtension; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/export/IExportJobManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.export; 2 | 3 | import edu.asu.diging.citesphere.core.model.jobs.IExportJob; 4 | import edu.asu.diging.citesphere.core.model.jobs.JobStatus; 5 | 6 | public interface IExportJobManager { 7 | 8 | IExportJob save(IExportJob job); 9 | 10 | IExportJob createJob(JobStatus status, String taskId, String username); 11 | 12 | IExportJob getExportJob(String id); 13 | 14 | IExportJob findByTaskId(String taskId); 15 | 16 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/export/IExportManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.export; 2 | 3 | import edu.asu.diging.citesphere.core.exceptions.AccessForbiddenException; 4 | import edu.asu.diging.citesphere.core.exceptions.DownloadExportException; 5 | import edu.asu.diging.citesphere.core.exceptions.ExportFailedException; 6 | import edu.asu.diging.citesphere.core.exceptions.ExportTooBigException; 7 | import edu.asu.diging.citesphere.core.exceptions.ExportTypeNotSupportedException; 8 | import edu.asu.diging.citesphere.core.exceptions.GroupDoesNotExistException; 9 | import edu.asu.diging.citesphere.core.exceptions.ZoteroHttpStatusException; 10 | import edu.asu.diging.citesphere.core.model.export.IExportTask; 11 | import edu.asu.diging.citesphere.core.model.jobs.IExportJob; 12 | import edu.asu.diging.citesphere.user.IUser; 13 | 14 | public interface IExportManager { 15 | 16 | void export(ExportType exportType, IUser user, String groupId, String collectionId) 17 | throws GroupDoesNotExistException, ExportTypeNotSupportedException, ExportFailedException, 18 | ExportTooBigException, ZoteroHttpStatusException, AccessForbiddenException; 19 | 20 | void distributedExport(ExportType exportType, IUser user, String groupId, String collectionId) 21 | throws GroupDoesNotExistException, ExportTypeNotSupportedException, ExportFailedException, 22 | ExportTooBigException, ZoteroHttpStatusException, AccessForbiddenException; 23 | 24 | String getDistributedExportResult(IExportTask task) throws DownloadExportException; 25 | 26 | void retryExport(IExportJob job); 27 | 28 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/export/IExportProcessor.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.export; 2 | 3 | import edu.asu.diging.citesphere.core.exceptions.ExportFailedException; 4 | import edu.asu.diging.citesphere.core.exceptions.ExportTypeNotSupportedException; 5 | import edu.asu.diging.citesphere.core.exceptions.GroupDoesNotExistException; 6 | import edu.asu.diging.citesphere.core.exceptions.ZoteroHttpStatusException; 7 | import edu.asu.diging.citesphere.core.model.export.IExportTask; 8 | import edu.asu.diging.citesphere.user.IUser; 9 | 10 | public interface IExportProcessor { 11 | 12 | void runExport(ExportType exportType, IUser user, String groupId, String collectionId, IExportTask task, ExportFinishedCallback callback) 13 | throws GroupDoesNotExistException, ExportTypeNotSupportedException, ExportFailedException, ZoteroHttpStatusException; 14 | 15 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/export/IExportTaskManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.export; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.core.model.export.ExportStatus; 6 | import edu.asu.diging.citesphere.core.model.export.IExportTask; 7 | import edu.asu.diging.citesphere.core.model.jobs.IExportJob; 8 | import edu.asu.diging.citesphere.user.IUser; 9 | 10 | public interface IExportTaskManager { 11 | 12 | IExportTask createExportTask(ExportType exportType, String username, ExportStatus status); 13 | 14 | IExportTask saveAndFlush(IExportTask task); 15 | 16 | IExportTask get(String id); 17 | 18 | List getTasks(IUser user, int page); 19 | 20 | int getTasksTotalPages(IUser user); 21 | 22 | int getTasksTotal(IUser user); 23 | 24 | IExportTask save(IExportTask task); 25 | 26 | void updateTask(IExportJob job); 27 | 28 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/export/proc/Processor.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.export.proc; 2 | 3 | import java.util.Iterator; 4 | 5 | import edu.asu.diging.citesphere.core.exceptions.ExportFailedException; 6 | import edu.asu.diging.citesphere.core.export.ExportType; 7 | import edu.asu.diging.citesphere.model.bib.ICitation; 8 | 9 | public interface Processor { 10 | 11 | ExportType getSupportedType(); 12 | 13 | void write(Iterator citations, Appendable writer) throws ExportFailedException; 14 | 15 | String getFileExtension(); 16 | 17 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/factory/IUserFactory.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.factory; 2 | 3 | import edu.asu.diging.citesphere.user.IUser; 4 | import edu.asu.diging.citesphere.web.forms.UserForm; 5 | 6 | public interface IUserFactory { 7 | 8 | IUser createUser(UserForm userForm); 9 | 10 | IUser createUser(String username, String password, String role, boolean enabled); 11 | 12 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/factory/IZoteroTokenFactory.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.factory; 2 | 3 | import edu.asu.diging.citesphere.core.model.IZoteroToken; 4 | import edu.asu.diging.citesphere.user.IUser; 5 | 6 | public interface IZoteroTokenFactory { 7 | 8 | IZoteroToken createZoteroToken(String token, String secret, String userId, IUser user); 9 | 10 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/factory/ZoteroConstants.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.factory; 2 | 3 | public interface ZoteroConstants { 4 | 5 | public final static String CREATOR_TYPE_AUTHOR = "author"; 6 | public final static String CREATOR_TYPE_EDITOR = "editor"; 7 | } 8 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/factory/impl/ZoteroTokenFactory.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.factory.impl; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import edu.asu.diging.citesphere.core.factory.IZoteroTokenFactory; 6 | import edu.asu.diging.citesphere.core.model.IZoteroToken; 7 | import edu.asu.diging.citesphere.core.model.impl.ZoteroToken; 8 | import edu.asu.diging.citesphere.user.IUser; 9 | 10 | @Component 11 | public class ZoteroTokenFactory implements IZoteroTokenFactory { 12 | 13 | /* (non-Javadoc) 14 | * @see edu.asu.diging.citesphere.core.factory.impl.IZoteroTokenFactory#createZoteroToken(java.lang.String, java.lang.String, edu.asu.diging.citesphere.core.model.IUser) 15 | */ 16 | @Override 17 | public IZoteroToken createZoteroToken(String token, String secret, String userId, IUser user) { 18 | IZoteroToken zoteroToken = new ZoteroToken(); 19 | zoteroToken.setToken(token); 20 | zoteroToken.setUserId(userId); 21 | zoteroToken.setUser(user); 22 | zoteroToken.setSecret(secret); 23 | return zoteroToken; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/factory/zotero/IItemFactory.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.factory.zotero; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.social.zotero.api.Item; 6 | 7 | import edu.asu.diging.citesphere.model.bib.ICitation; 8 | 9 | public interface IItemFactory { 10 | 11 | Item createItem(ICitation citation, List collectionIds); 12 | 13 | Item createMetaDataItem(ICitation citation); 14 | 15 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/kafka/IJsonMessageCreator.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.kafka; 2 | 3 | import edu.asu.diging.citesphere.core.exceptions.MessageCreationException; 4 | import edu.asu.diging.citesphere.messages.model.KafkaJobMessage; 5 | 6 | public interface IJsonMessageCreator { 7 | 8 | public String createMessage(KafkaJobMessage ms) throws MessageCreationException; 9 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/kafka/IKafkaRequestProducer.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.kafka; 2 | 3 | import edu.asu.diging.citesphere.core.exceptions.MessageCreationException; 4 | import edu.asu.diging.citesphere.messages.model.KafkaJobMessage; 5 | 6 | public interface IKafkaRequestProducer { 7 | 8 | /* (non-Javadoc) 9 | * @see edu.asu.giles.service.kafka.impl.IOCRRequestProducer#sendOCRRequest(java.lang.String) 10 | */ 11 | void sendRequest(KafkaJobMessage msg, String topic) throws MessageCreationException; 12 | 13 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/kafka/impl/ExporterDoneListener.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.kafka.impl; 2 | 3 | import java.io.IOException; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.kafka.annotation.KafkaListener; 9 | 10 | import com.fasterxml.jackson.databind.ObjectMapper; 11 | 12 | import edu.asu.diging.citesphere.core.service.jobs.IJobCompleteProcessor; 13 | import edu.asu.diging.citesphere.messages.KafkaTopics; 14 | import edu.asu.diging.citesphere.messages.model.KafkaExportReturnMessage; 15 | 16 | public class ExporterDoneListener { 17 | 18 | private final Logger logger = LoggerFactory.getLogger(getClass()); 19 | 20 | @Autowired 21 | private IJobCompleteProcessor jobCompleteProcessor; 22 | 23 | 24 | @KafkaListener(topics = KafkaTopics.REFERENCES_EXPORT_DONE_TOPIC) 25 | public void receiveMessage(String message) { 26 | ObjectMapper mapper = new ObjectMapper(); 27 | KafkaExportReturnMessage msg = null; 28 | try { 29 | msg = mapper.readValue(message, KafkaExportReturnMessage.class); 30 | } catch (IOException e) { 31 | logger.error("Could not unmarshall message.", e); 32 | return; 33 | } 34 | 35 | jobCompleteProcessor.jobComplete(msg); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/kafka/impl/JsonMessageCreator.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.kafka.impl; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import com.fasterxml.jackson.core.JsonProcessingException; 6 | import com.fasterxml.jackson.databind.ObjectMapper; 7 | 8 | import edu.asu.diging.citesphere.core.exceptions.MessageCreationException; 9 | import edu.asu.diging.citesphere.core.kafka.IJsonMessageCreator; 10 | import edu.asu.diging.citesphere.messages.model.KafkaJobMessage; 11 | 12 | @Component 13 | public class JsonMessageCreator implements IJsonMessageCreator { 14 | 15 | /* (non-Javadoc) 16 | * @see edu.asu.giles.service.kafka.impl.IJsonMessageCreator#createMessage(edu.asu.giles.service.requests.IRequest) 17 | */ 18 | @Override 19 | public String createMessage(KafkaJobMessage msg) throws MessageCreationException { 20 | ObjectMapper mapper = new ObjectMapper(); 21 | try { 22 | return mapper.writeValueAsString(msg); 23 | } catch (JsonProcessingException e) { 24 | throw new MessageCreationException("Could not create JSON.", e); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/kafka/impl/ReferenceImporterDoneListener.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.kafka.impl; 2 | 3 | import java.io.IOException; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.kafka.annotation.KafkaListener; 9 | 10 | import com.fasterxml.jackson.databind.ObjectMapper; 11 | 12 | import edu.asu.diging.citesphere.core.service.jobs.IJobCompleteProcessor; 13 | import edu.asu.diging.citesphere.messages.KafkaTopics; 14 | import edu.asu.diging.citesphere.messages.model.KafkaImportReturnMessage; 15 | 16 | public class ReferenceImporterDoneListener { 17 | 18 | private final Logger logger = LoggerFactory.getLogger(getClass()); 19 | 20 | @Autowired 21 | private IJobCompleteProcessor jobCompleteProcessor; 22 | 23 | 24 | @KafkaListener(topics = KafkaTopics.REFERENCES_IMPORT_DONE_TOPIC) 25 | public void receiveMessage(String message) { 26 | ObjectMapper mapper = new ObjectMapper(); 27 | KafkaImportReturnMessage msg = null; 28 | try { 29 | msg = mapper.readValue(message, KafkaImportReturnMessage.class); 30 | } catch (IOException e) { 31 | logger.error("Could not unmarshall message.", e); 32 | // FIXME: handle this case 33 | return; 34 | } 35 | 36 | jobCompleteProcessor.jobComplete(msg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/IPasswordResetToken.java: -------------------------------------------------------------------------------- 1 | 2 | package edu.asu.diging.citesphere.core.model; 3 | 4 | import java.time.OffsetDateTime; 5 | 6 | import edu.asu.diging.citesphere.user.IUser; 7 | 8 | public interface IPasswordResetToken { 9 | 10 | Long getId(); 11 | 12 | void setId(Long id); 13 | 14 | String getToken(); 15 | 16 | void setToken(String token); 17 | 18 | IUser getUser(); 19 | 20 | void setUser(IUser user); 21 | 22 | OffsetDateTime getExpiryDate(); 23 | 24 | void setExpiryDate(OffsetDateTime expiryDate); 25 | 26 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/IZoteroToken.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model; 2 | 3 | import edu.asu.diging.citesphere.user.IUser; 4 | 5 | public interface IZoteroToken { 6 | 7 | String getUserId(); 8 | 9 | void setUserId(String userId); 10 | 11 | String getToken(); 12 | 13 | void setToken(String token); 14 | 15 | IUser getUser(); 16 | 17 | void setUser(IUser user); 18 | 19 | void setSecret(String secret); 20 | 21 | String getSecret(); 22 | 23 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/Role.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model; 2 | 3 | public interface Role { 4 | 5 | public final static String ADMIN = "ROLE_ADMIN"; 6 | public final static String USER = "ROLE_USER"; 7 | public final static String CHANGE_PASSWORD = "ROLE_CHANGE_PASSWORD"; 8 | public final static String TRUSTED_CLIENT = "ROLE_TRUSTED_CLIENT"; 9 | 10 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/ZoteroCreatorTypes.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model; 2 | public interface ZoteroCreatorTypes { 3 | 4 | public final static String AUTHOR = "author"; 5 | public final static String BOOK_AUTHOR = "bookAuthor"; 6 | public final static String REVIEWED_AUTHOR = "reviewedAuthor"; 7 | public final static String EDITOR = "editor"; 8 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/bib/CitationVersion.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.bib; 2 | 3 | public class CitationVersion { 4 | 5 | private long version; 6 | private String key; 7 | private String updatedDate; 8 | private String updatedBy; 9 | 10 | public long getVersion() { 11 | return version; 12 | } 13 | 14 | public void setVersion(long version) { 15 | this.version = version; 16 | } 17 | 18 | public String getKey() { 19 | return key; 20 | } 21 | 22 | public void setKey(String key) { 23 | this.key = key; 24 | } 25 | 26 | public String getUpdatedBy() { 27 | return updatedBy; 28 | } 29 | 30 | public void setUpdatedBy(String updatedBy) { 31 | this.updatedBy = updatedBy; 32 | } 33 | 34 | public String getUpdatedDate() { 35 | return updatedDate; 36 | } 37 | 38 | public void setUpdatedDate(String updatedDate) { 39 | this.updatedDate = updatedDate; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/export/ExportStatus.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.export; 2 | 3 | public enum ExportStatus { 4 | SYNCING, 5 | PENDING, 6 | INITIALIZING, 7 | STARTED, 8 | DONE, 9 | FAILED; 10 | } 11 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/export/IExportTask.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.export; 2 | 3 | import java.time.OffsetDateTime; 4 | 5 | import edu.asu.diging.citesphere.core.export.ExportType; 6 | 7 | public interface IExportTask { 8 | 9 | String getId(); 10 | 11 | void setId(String id); 12 | 13 | String getUsername(); 14 | 15 | void setUsername(String username); 16 | 17 | long getTotalRecords(); 18 | 19 | void setTotalRecords(long totalRecords); 20 | 21 | long getProgress(); 22 | 23 | void setProgress(long progress); 24 | 25 | ExportStatus getStatus(); 26 | 27 | void setStatus(ExportStatus status); 28 | 29 | void setExportType(ExportType exportType); 30 | 31 | ExportType getExportType(); 32 | 33 | void setFinishedOn(OffsetDateTime finishedOn); 34 | 35 | OffsetDateTime getFinishedOn(); 36 | 37 | void setCreatedOn(OffsetDateTime createdOn); 38 | 39 | OffsetDateTime getCreatedOn(); 40 | 41 | void setFilename(String filename); 42 | 43 | String getFilename(); 44 | 45 | void setCollectionName(String collectionName); 46 | 47 | String getCollectionName(); 48 | 49 | void setCollectionId(String collectionId); 50 | 51 | String getCollectionId(); 52 | 53 | void setGroupName(String groupName); 54 | 55 | String getGroupName(); 56 | 57 | void setGroupId(String groupId); 58 | 59 | String getGroupId(); 60 | 61 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/jobs/IExportJob.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.jobs; 2 | 3 | public interface IExportJob extends IJob { 4 | 5 | void setTaskId(String taskId); 6 | 7 | String getTaskId(); 8 | 9 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/jobs/IGroupSyncJob.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.jobs; 2 | 3 | import java.time.OffsetDateTime; 4 | 5 | public interface IGroupSyncJob { 6 | 7 | String getGroupId(); 8 | 9 | void setGroupId(String groupId); 10 | 11 | long getTotal(); 12 | 13 | void setTotal(long total); 14 | 15 | long getCurrent(); 16 | 17 | void setCurrent(long current); 18 | 19 | void setFinishedOn(OffsetDateTime finishedOn); 20 | 21 | OffsetDateTime getFinishedOn(); 22 | 23 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/jobs/IJob.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.jobs; 2 | 3 | import java.time.OffsetDateTime; 4 | import java.util.List; 5 | 6 | import edu.asu.diging.citesphere.core.model.jobs.impl.JobPhase; 7 | 8 | public interface IJob { 9 | 10 | /* (non-Javadoc) 11 | * @see edu.asu.diging.citesphere.core.model.jobs.impl.IUploadJob#getId() 12 | */ 13 | String getId(); 14 | /* (non-Javadoc) 15 | * @see edu.asu.diging.citesphere.core.model.jobs.impl.IUploadJob#setId(java.lang.String) 16 | */ 17 | 18 | void setId(String id); 19 | 20 | /* (non-Javadoc) 21 | * @see edu.asu.diging.citesphere.core.model.jobs.impl.IUploadJob#getUsername() 22 | */ 23 | String getUsername(); 24 | 25 | /* (non-Javadoc) 26 | * @see edu.asu.diging.citesphere.core.model.jobs.impl.IUploadJob#setUsername(java.lang.String) 27 | */ 28 | void setUsername(String username); 29 | 30 | JobStatus getStatus(); 31 | 32 | void setStatus(JobStatus status); 33 | 34 | List getPhases(); 35 | 36 | void setPhases(List phases); 37 | 38 | void setCreatedOn(OffsetDateTime createdOn); 39 | 40 | OffsetDateTime getCreatedOn(); 41 | 42 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/jobs/IUploadFileJob.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.jobs; 2 | 3 | public interface IUploadFileJob extends IJob { 4 | 5 | String getFilename(); 6 | 7 | void setFilename(String filename); 8 | 9 | long getFileSize(); 10 | 11 | void setFileSize(long fileSize); 12 | 13 | String getContentType(); 14 | 15 | void setContentType(String contentType); 16 | 17 | String getCitationGroup(); 18 | 19 | void setCitationGroup(String citationGroup); 20 | 21 | String getItemKey(); 22 | 23 | void setItemKey(String itemKey); 24 | 25 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/jobs/IUploadJob.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.jobs; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.core.model.jobs.impl.JobPhase; 6 | import edu.asu.diging.citesphere.model.bib.ICitationGroup; 7 | 8 | public interface IUploadJob extends IJob { 9 | 10 | String getFilename(); 11 | 12 | void setFilename(String filename); 13 | 14 | public JobStatus getStatus(); 15 | 16 | public void setStatus(JobStatus status); 17 | 18 | public List getPhases(); 19 | 20 | public void setPhases(List phases); 21 | 22 | void setContentType(String contentType); 23 | 24 | String getContentType(); 25 | 26 | void setFileSize(long fileSize); 27 | 28 | long getFileSize(); 29 | 30 | void setCitationGroup(String citationGroup); 31 | 32 | String getCitationGroup(); 33 | 34 | ICitationGroup getCitationGroupDetail(); 35 | 36 | void setCitationGroupDetail(ICitationGroup citationGroupDetail); 37 | 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/jobs/JobStatus.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.jobs; 2 | 3 | public enum JobStatus { 4 | PENDING, 5 | SYNCING, 6 | PREPARED, 7 | STARTED, 8 | DONE, 9 | CANCELED, 10 | FAILURE; 11 | } 12 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/model/jobs/impl/ExportJob.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.model.jobs.impl; 2 | 3 | import javax.persistence.Entity; 4 | 5 | import edu.asu.diging.citesphere.core.model.jobs.IExportJob; 6 | 7 | @Entity 8 | public class ExportJob extends Job implements IExportJob { 9 | 10 | private String taskId; 11 | 12 | @Override 13 | public String getTaskId() { 14 | return taskId; 15 | } 16 | 17 | @Override 18 | public void setTaskId(String taskId) { 19 | this.taskId = taskId; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/CustomCitationConceptRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository; 2 | 3 | import java.util.Optional; 4 | import org.javers.spring.annotation.JaversSpringDataAuditable; 5 | import org.springframework.data.repository.PagingAndSortingRepository; 6 | import edu.asu.diging.citesphere.model.bib.impl.CitationConcept; 7 | import edu.asu.diging.citesphere.user.IUser; 8 | 9 | @JaversSpringDataAuditable 10 | public interface CustomCitationConceptRepository extends PagingAndSortingRepository { 11 | 12 | Optional findFirstByUriAndOwner(String uri, IUser user); 13 | } 14 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/CustomConceptTypeRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository; 2 | 3 | import java.util.Optional; 4 | 5 | import org.javers.spring.annotation.JaversSpringDataAuditable; 6 | import org.springframework.data.repository.PagingAndSortingRepository; 7 | import edu.asu.diging.citesphere.model.bib.impl.ConceptType; 8 | import edu.asu.diging.citesphere.user.IUser; 9 | 10 | @JaversSpringDataAuditable 11 | public interface CustomConceptTypeRepository extends PagingAndSortingRepository { 12 | 13 | Optional findFirstByUriAndOwner(String uri, IUser owner); 14 | } 15 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/IdGenerator.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository; 2 | 3 | import java.io.Serializable; 4 | import java.util.Properties; 5 | 6 | import org.hibernate.HibernateException; 7 | import org.hibernate.MappingException; 8 | import org.hibernate.engine.spi.SharedSessionContractImplementor; 9 | import org.hibernate.id.Configurable; 10 | import org.hibernate.id.IdentifierGenerator; 11 | import org.hibernate.id.enhanced.SequenceStyleGenerator; 12 | import org.hibernate.service.ServiceRegistry; 13 | import org.hibernate.type.LongType; 14 | import org.hibernate.type.Type; 15 | 16 | public class IdGenerator extends SequenceStyleGenerator implements IdentifierGenerator, Configurable { 17 | 18 | private String prefix; 19 | private String numberFormat; 20 | 21 | @Override 22 | public void configure(Type type, Properties properties, ServiceRegistry sr) throws MappingException { 23 | super.configure(LongType.INSTANCE, properties, sr); 24 | prefix = properties.getProperty("prefix"); 25 | numberFormat = "%d"; 26 | } 27 | 28 | @Override 29 | public Serializable generate(SharedSessionContractImplementor session, Object obj) throws HibernateException { 30 | return prefix + String.format(numberFormat, super.generate(session, obj)); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/PasswordResetTokenRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository; 2 | 3 | import org.springframework.data.repository.PagingAndSortingRepository; 4 | 5 | import edu.asu.diging.citesphere.core.model.impl.PasswordResetToken; 6 | 7 | public interface PasswordResetTokenRepository extends PagingAndSortingRepository { 8 | 9 | PasswordResetToken findByToken(String token); 10 | } 11 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/TokenRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository; 2 | 3 | import org.springframework.data.repository.PagingAndSortingRepository; 4 | 5 | import edu.asu.diging.citesphere.core.model.IZoteroToken; 6 | import edu.asu.diging.citesphere.core.model.impl.ZoteroToken; 7 | 8 | public interface TokenRepository extends PagingAndSortingRepository { 9 | 10 | public IZoteroToken findByUserUsername(String userId); 11 | } 12 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.javers.spring.annotation.JaversSpringDataAuditable; 6 | import org.springframework.data.repository.PagingAndSortingRepository; 7 | 8 | import edu.asu.diging.citesphere.user.impl.User; 9 | 10 | @JaversSpringDataAuditable 11 | public interface UserRepository extends PagingAndSortingRepository { 12 | 13 | public List findByEmail(String email); 14 | } 15 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/export/ExportTaskRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.export; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import edu.asu.diging.citesphere.core.model.export.impl.ExportTask; 9 | 10 | public interface ExportTaskRepository extends JpaRepository { 11 | 12 | List findByUsername(String username, Pageable pagable); 13 | 14 | int countByUsername(String username); 15 | } 16 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/jobs/ExportJobRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.jobs; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | import edu.asu.diging.citesphere.core.model.jobs.impl.ExportJob; 9 | 10 | public interface ExportJobRepository extends CrudRepository { 11 | 12 | List findByUsername(String username, Pageable pagable); 13 | 14 | List findByTaskId(String taskId); 15 | } 16 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/jobs/GroupSyncJobCustomRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.jobs; 2 | 3 | import edu.asu.diging.citesphere.core.model.jobs.impl.GroupSyncJob; 4 | 5 | public interface GroupSyncJobCustomRepository { 6 | 7 | void refresh(GroupSyncJob job); 8 | 9 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/jobs/GroupSyncJobRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.jobs; 2 | 3 | import java.util.List; 4 | import java.util.Optional; 5 | 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.data.repository.PagingAndSortingRepository; 8 | 9 | import edu.asu.diging.citesphere.core.model.jobs.impl.GroupSyncJob; 10 | 11 | public interface GroupSyncJobRepository extends PagingAndSortingRepository { 12 | 13 | public Optional findFirstByGroupIdOrderByCreatedOnDesc(String groupId); 14 | 15 | public List findByGroupIdIn(List groupIds, Pageable page); 16 | 17 | public long countByGroupIdIn(List groupIds); 18 | } 19 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/jobs/JobRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.jobs; 2 | 3 | import org.springframework.data.repository.PagingAndSortingRepository; 4 | 5 | import edu.asu.diging.citesphere.core.model.jobs.impl.Job; 6 | 7 | public interface JobRepository extends PagingAndSortingRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/jobs/UploadFileJobRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.jobs; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import edu.asu.diging.citesphere.core.model.jobs.impl.UploadFileJob; 6 | 7 | public interface UploadFileJobRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/jobs/UploadJobRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.jobs; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | import edu.asu.diging.citesphere.core.model.jobs.impl.UploadJob; 9 | 10 | public interface UploadJobRepository extends CrudRepository { 11 | 12 | List findByUsername(String username, Pageable pagable); 13 | } 14 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/jobs/impl/GroupSyncJobCustomRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.jobs.impl; 2 | 3 | import javax.persistence.EntityManager; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Component; 7 | 8 | import edu.asu.diging.citesphere.core.model.jobs.impl.GroupSyncJob; 9 | import edu.asu.diging.citesphere.core.repository.jobs.GroupSyncJobCustomRepository; 10 | 11 | @Component 12 | public class GroupSyncJobCustomRepositoryImpl implements GroupSyncJobCustomRepository { 13 | 14 | @Autowired 15 | private EntityManager entityManager; 16 | 17 | /* (non-Javadoc) 18 | * @see edu.asu.diging.citesphere.core.repository.jobs.impl.GroupSyncJobCustomRepository#refresh(edu.asu.diging.citesphere.core.model.jobs.impl.GroupSyncJob) 19 | */ 20 | @Override 21 | public void refresh(GroupSyncJob job) { 22 | entityManager.refresh(job); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/oauth/DbAccessTokenRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.oauth; 2 | 3 | import java.util.List; 4 | import java.util.Optional; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import edu.asu.diging.citesphere.core.model.oauth.impl.DbAccessToken; 9 | 10 | /** 11 | * Modeled after: 12 | * https://blog.couchbase.com/custom-token-store-spring-securtiy-oauth2/ 13 | * @author jdamerow 14 | * 15 | */ 16 | public interface DbAccessTokenRepository extends JpaRepository { 17 | 18 | List findByClientId(String clientId); 19 | 20 | List findByClientIdAndUsername(String clientId, String username); 21 | 22 | List findByUsername(String username); 23 | 24 | Optional findByTokenId(String tokenId); 25 | 26 | List findByRefreshToken(String refreshToken); 27 | 28 | List findByAuthenticationId(String authenticationId); 29 | 30 | void deleteByClientIdAndUsername(String clientId, String username); 31 | 32 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/oauth/DbRefreshTokenRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.oauth; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import edu.asu.diging.citesphere.core.model.oauth.impl.DbRefreshToken; 8 | 9 | /** 10 | * Modeled after: 11 | * https://blog.couchbase.com/custom-token-store-spring-securtiy-oauth2/ 12 | * 13 | * @author jdamerow 14 | * 15 | */ 16 | public interface DbRefreshTokenRepository extends JpaRepository { 17 | 18 | Optional findByTokenId(String tokenId); 19 | 20 | Optional findByAuthentication(String authentication); 21 | 22 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/repository/oauth/OAuthClientRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.repository.oauth; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import edu.asu.diging.citesphere.core.model.oauth.impl.OAuthClient; 6 | 7 | public interface OAuthClientRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/search/data/ReferenceRepository.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.search.data; 2 | 3 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 4 | 5 | import edu.asu.diging.citesphere.core.search.model.impl.Reference; 6 | 7 | public interface ReferenceRepository extends ElasticsearchRepository { 8 | 9 | void deleteByGroup(String group); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/search/model/impl/Affiliation.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.search.model.impl; 2 | 3 | import org.springframework.data.elasticsearch.annotations.Field; 4 | import org.springframework.data.elasticsearch.annotations.FieldType; 5 | 6 | public class Affiliation { 7 | 8 | @Field(type=FieldType.Text) 9 | private String name; 10 | @Field(type=FieldType.Keyword) 11 | private String uri; 12 | @Field(type=FieldType.Keyword) 13 | private String localAuthorityId; 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | public String getUri() { 22 | return uri; 23 | } 24 | public void setUri(String uri) { 25 | this.uri = uri; 26 | } 27 | public String getLocalAuthorityId() { 28 | return localAuthorityId; 29 | } 30 | public void setLocalAuthorityId(String localAuthorityId) { 31 | this.localAuthorityId = localAuthorityId; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/search/service/Indexer.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.search.service; 2 | 3 | import edu.asu.diging.citesphere.model.bib.ICitation; 4 | 5 | public interface Indexer { 6 | 7 | void indexCitation(ICitation citation); 8 | 9 | void deleteCitation(ICitation citation); 10 | 11 | void deleteCitationByGroupId(String groupId); 12 | 13 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/search/service/SearchEngine.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.search.service; 2 | 3 | import edu.asu.diging.citesphere.core.search.service.impl.ResultPage; 4 | import edu.asu.diging.citesphere.core.service.impl.CitationPage; 5 | 6 | public interface SearchEngine { 7 | 8 | /** 9 | * Search for a given term in a group. 10 | * 11 | * @param searchTerm Term to search for. 12 | * @param groupId Group id of the group that should be searched. 13 | * @param page Current page. 14 | * @param pageSize page size of results. 15 | * @return Page of results 16 | */ 17 | ResultPage search(String searchTerm, String groupId, int page, int pageSize); 18 | 19 | /** 20 | * Fetches the next and previous citation keys for the given search term in group and the current index and page number. 21 | * 22 | * @param searchTerm Term to search for. 23 | * @param groupId Group id of the group that should be searched. 24 | * @param page Current page. 25 | * @param index Index of the current item. 26 | * @param pageSize Size of the page used. 27 | * @return Keys, index and page number for the next and previous items. 28 | */ 29 | CitationPage getPrevAndNextCitation(String searchTerm, String groupId, int page, int index, int pageSize); 30 | 31 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/search/service/impl/ResultPage.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.search.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.bib.ICitation; 6 | 7 | public class ResultPage { 8 | 9 | private List results; 10 | private long totalResults; 11 | private int totalPages; 12 | 13 | public ResultPage(List results, long totalResults, int totalPages) { 14 | super(); 15 | this.results = results; 16 | this.totalResults = totalResults; 17 | this.totalPages = totalPages; 18 | } 19 | 20 | public List getResults() { 21 | return results; 22 | } 23 | public void setResults(List results) { 24 | this.results = results; 25 | } 26 | public long getTotalResults() { 27 | return totalResults; 28 | } 29 | public void setTotalResults(long totalResults) { 30 | this.totalResults = totalResults; 31 | } 32 | public int getTotalPages() { 33 | return totalPages; 34 | } 35 | public void setTotalPages(int totalPages) { 36 | this.totalPages = totalPages; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IAsyncCitationProcessor.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service; 2 | 3 | import edu.asu.diging.citesphere.core.exceptions.ZoteroHttpStatusException; 4 | import edu.asu.diging.citesphere.user.IUser; 5 | 6 | public interface IAsyncCitationProcessor { 7 | 8 | void sync(IUser user, String groupId, long contentVersion, String collectionId) throws ZoteroHttpStatusException; 9 | 10 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/ICitationCollectionManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.core.exceptions.GroupDoesNotExistException; 6 | import edu.asu.diging.citesphere.model.bib.ICitationCollection; 7 | import edu.asu.diging.citesphere.model.bib.impl.CitationCollectionResult; 8 | import edu.asu.diging.citesphere.user.IUser; 9 | 10 | public interface ICitationCollectionManager { 11 | 12 | CitationCollectionResult getCitationCollections(IUser user, String groupId, String parentCollectionId, int page, 13 | String sortBy) throws GroupDoesNotExistException; 14 | 15 | ICitationCollection getCollection(IUser user, String groupId, String collectionId); 16 | 17 | long getTotalCitationCollections(IUser user, String groupId, String parentCollectionId) throws GroupDoesNotExistException; 18 | 19 | List getAllCollections(IUser user, String groupId, String parentCollectionId, String sortBy, int maxCollections) 20 | throws GroupDoesNotExistException; 21 | 22 | void deleteLocalGroupCollections(String groupId); 23 | 24 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/ICitationConceptManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service; 2 | 3 | import java.util.List; 4 | import edu.asu.diging.citesphere.model.bib.ICitationConcept; 5 | import edu.asu.diging.citesphere.user.IUser; 6 | import edu.asu.diging.citesphere.web.forms.CitationConceptForm; 7 | 8 | public interface ICitationConceptManager { 9 | 10 | List findAll(IUser user); 11 | 12 | void create(CitationConceptForm conceptForm, IUser user); 13 | 14 | ICitationConcept get(String conceptId); 15 | 16 | ICitationConcept save(ICitationConcept concept); 17 | 18 | ICitationConcept getByUriAndOwner(String uri, IUser owner); 19 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/ICitationStore.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service; 2 | 3 | import java.util.List; 4 | import java.util.Optional; 5 | 6 | import edu.asu.diging.citesphere.model.bib.ICitation; 7 | 8 | public interface ICitationStore { 9 | 10 | /** 11 | * Method to save citations. This method will also index 12 | * the citation before saving. 13 | * 14 | * @param citation Citation to be saved. 15 | * @return the saved Citation 16 | */ 17 | ICitation save(ICitation citation); 18 | 19 | Optional findById(String id); 20 | 21 | void delete(ICitation citation); 22 | 23 | /** 24 | * Method to fetch non-deleted attachments for an item. 25 | * @param id Key of the item. 26 | * @return Attachments for the provided item key. 27 | */ 28 | List getAttachments(String id); 29 | 30 | /** 31 | * Method to fetch non-deleted notes for an item. 32 | * @param id Key of the item. 33 | * @return Notes for the provided item key. 34 | */ 35 | List getNotes(String id); 36 | 37 | void deleteCitationByGroupId(String groupId); 38 | 39 | List findByGilesDocumentId(String documentId); 40 | 41 | List findByGilesProgressId(String progressId); 42 | 43 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IConceptTypeManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service; 2 | 3 | import java.util.List; 4 | import edu.asu.diging.citesphere.model.bib.IConceptType; 5 | import edu.asu.diging.citesphere.user.IUser; 6 | import edu.asu.diging.citesphere.web.forms.ConceptTypeForm; 7 | 8 | public interface IConceptTypeManager { 9 | 10 | IConceptType create(ConceptTypeForm form, IUser owner); 11 | 12 | List getAllTypes(IUser owner); 13 | 14 | IConceptType get(String id); 15 | 16 | IConceptType getByUriAndOwner(String conceptTypeUri, IUser owner); 17 | 18 | IConceptType save(IConceptType type); 19 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IGroupManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.bib.ICitationGroup; 6 | import edu.asu.diging.citesphere.user.IUser; 7 | 8 | public interface IGroupManager { 9 | 10 | ICitationGroup getGroup(IUser user, String groupId); 11 | 12 | /** 13 | * Does not delete the group completely. Deletes the local copy of the citation group along with its collections and citations. 14 | * @param groupId Zotero id of the group to be deleted 15 | */ 16 | void deleteLocalGroupCopy(String groupId); 17 | 18 | List getGroupInstancesForGroupId(String groupId); 19 | 20 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IPasswordResetTokenService.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service; 2 | 3 | import java.io.IOException; 4 | 5 | import org.springframework.security.oauth2.common.exceptions.InvalidTokenException; 6 | 7 | import edu.asu.diging.citesphere.core.exceptions.TokenExpiredException; 8 | import edu.asu.diging.citesphere.core.exceptions.UserDoesNotExistException; 9 | 10 | public interface IPasswordResetTokenService { 11 | 12 | void resetPassword(String email) throws UserDoesNotExistException, IOException; 13 | 14 | boolean validateToken(String token, String username) throws InvalidTokenException, TokenExpiredException; 15 | 16 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/giles/GilesUploadChecker.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.giles; 2 | 3 | import edu.asu.diging.citesphere.user.IUser; 4 | 5 | public interface GilesUploadChecker { 6 | 7 | void add(String uploadKey); 8 | 9 | // in milliseconds (60000ms = 1m) 10 | void checkUploads(); 11 | 12 | void checkUploadStatus(String citationKey); 13 | 14 | void checkFileUploadStatus(String itemId, IUser principal, String fileId); 15 | 16 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/giles/GilesUploadService.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.giles; 2 | 3 | import org.springframework.web.multipart.MultipartFile; 4 | 5 | import edu.asu.diging.citesphere.model.bib.IGilesUpload; 6 | import edu.asu.diging.citesphere.user.IUser; 7 | 8 | public interface GilesUploadService { 9 | 10 | IGilesUpload uploadFile(IUser user, MultipartFile file, byte[] fileBytes); 11 | 12 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/giles/IGilesConnector.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.giles; 2 | 3 | import org.springframework.http.ResponseEntity; 4 | import org.springframework.web.client.HttpClientErrorException; 5 | 6 | import edu.asu.diging.citesphere.user.IUser; 7 | 8 | public interface IGilesConnector { 9 | 10 | ResponseEntity sendRequest(IUser user, String endpoint, Class returnType) 11 | throws HttpClientErrorException; 12 | 13 | byte[] getFile(IUser user, String fileId); 14 | 15 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/giles/impl/GilesCheckUploadResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.giles.impl; 2 | 3 | public class GilesCheckUploadResponse { 4 | 5 | private String msg; 6 | private String msgCode; 7 | 8 | public String getMsg() { 9 | return msg; 10 | } 11 | public void setMsg(String msg) { 12 | this.msg = msg; 13 | } 14 | public String getMsgCode() { 15 | return msgCode; 16 | } 17 | public void setMsgCode(String msgCode) { 18 | this.msgCode = msgCode; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/giles/impl/UploadResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.giles.impl; 2 | 3 | import java.util.List; 4 | 5 | class UploadResponse { 6 | private String id; 7 | private String checkUrl; 8 | private List documentIds; 9 | 10 | public String getId() { 11 | return id; 12 | } 13 | 14 | public void setId(String id) { 15 | this.id = id; 16 | } 17 | 18 | public String getCheckUrl() { 19 | return checkUrl; 20 | } 21 | 22 | public void setCheckUrl(String checkUrl) { 23 | this.checkUrl = checkUrl; 24 | } 25 | 26 | public List getDocumentIds() { 27 | return documentIds; 28 | } 29 | 30 | public void setDocumentIds(List documentIds) { 31 | this.documentIds = documentIds; 32 | } 33 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/impl/async/AsyncDeleteCitationsResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.impl.async; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.springframework.social.zotero.api.ItemDeletionResponse; 7 | 8 | import edu.asu.diging.citesphere.web.user.AsyncTaskStatus; 9 | 10 | public class AsyncDeleteCitationsResponse { 11 | private AsyncTaskStatus taskStatus; 12 | private Map> response; 13 | private String taskID; 14 | 15 | public AsyncTaskStatus getTaskStatus() { 16 | return taskStatus; 17 | } 18 | 19 | public void setTaskStatus(AsyncTaskStatus taskStatus) { 20 | this.taskStatus = taskStatus; 21 | } 22 | 23 | public Map> getResponse() { 24 | return response; 25 | } 26 | 27 | public void setResponse(Map> response) { 28 | this.response = response; 29 | } 30 | 31 | public void setTaskID(String taskID) { 32 | this.taskID = taskID; 33 | } 34 | 35 | public String getTaskID() { 36 | return taskID; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/impl/async/AsyncUpdateCitationsResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.impl.async; 2 | 3 | import org.springframework.social.zotero.api.ZoteroUpdateItemsStatuses; 4 | 5 | import edu.asu.diging.citesphere.web.user.AsyncTaskStatus; 6 | 7 | public class AsyncUpdateCitationsResponse { 8 | private AsyncTaskStatus taskStatus; 9 | private ZoteroUpdateItemsStatuses response; 10 | private String taskID; 11 | 12 | public AsyncTaskStatus getTaskStatus() { 13 | return taskStatus; 14 | } 15 | 16 | public ZoteroUpdateItemsStatuses getResponse() { 17 | return response; 18 | } 19 | 20 | public void setTaskStatus(AsyncTaskStatus taskStatus) { 21 | this.taskStatus = taskStatus; 22 | } 23 | 24 | public void setResponse(ZoteroUpdateItemsStatuses response) { 25 | this.response = response; 26 | } 27 | 28 | public void setTaskID(String taskID) { 29 | this.taskID = taskID; 30 | } 31 | 32 | public String getTaskID() { 33 | return taskID; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jobs/IJobCompleteProcessor.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jobs; 2 | 3 | import edu.asu.diging.citesphere.messages.model.KafkaExportReturnMessage; 4 | import edu.asu.diging.citesphere.messages.model.KafkaImportReturnMessage; 5 | 6 | public interface IJobCompleteProcessor { 7 | 8 | void jobComplete(KafkaImportReturnMessage msg); 9 | 10 | void jobComplete(KafkaExportReturnMessage msg); 11 | 12 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jobs/ISyncJobManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jobs; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.domain.Pageable; 6 | 7 | import edu.asu.diging.citesphere.core.model.jobs.impl.GroupSyncJob; 8 | import edu.asu.diging.citesphere.user.IUser; 9 | 10 | public interface ISyncJobManager { 11 | 12 | void addJob(GroupSyncJob job); 13 | 14 | GroupSyncJob getMostRecentJob(String groupId); 15 | 16 | List getJobs(IUser user, Pageable page); 17 | 18 | long getJobsCount(IUser user); 19 | 20 | void cancelJob(String jobId); 21 | 22 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jobs/IUploadFileJobManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jobs; 2 | 3 | import org.springframework.social.zotero.exception.ZoteroConnectionException; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import edu.asu.diging.citesphere.core.exceptions.AccessForbiddenException; 7 | import edu.asu.diging.citesphere.core.exceptions.CannotFindCitationException; 8 | import edu.asu.diging.citesphere.core.exceptions.CitationIsOutdatedException; 9 | import edu.asu.diging.citesphere.core.exceptions.GroupDoesNotExistException; 10 | import edu.asu.diging.citesphere.core.exceptions.ZoteroHttpStatusException; 11 | import edu.asu.diging.citesphere.core.exceptions.ZoteroItemCreationFailedException; 12 | import edu.asu.diging.citesphere.model.bib.IGilesUpload; 13 | import edu.asu.diging.citesphere.user.IUser; 14 | 15 | public interface IUploadFileJobManager { 16 | 17 | IGilesUpload createGilesJob(IUser user, MultipartFile file, byte[] fileBytes, String groupId, String itemKey) 18 | throws GroupDoesNotExistException, AccessForbiddenException, CannotFindCitationException, 19 | ZoteroHttpStatusException, ZoteroConnectionException, CitationIsOutdatedException, 20 | ZoteroItemCreationFailedException; 21 | 22 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jobs/IUploadJobManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jobs; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.web.multipart.MultipartFile; 6 | 7 | import edu.asu.diging.citesphere.core.exceptions.GroupDoesNotExistException; 8 | import edu.asu.diging.citesphere.core.model.jobs.IJob; 9 | import edu.asu.diging.citesphere.core.model.jobs.IUploadJob; 10 | import edu.asu.diging.citesphere.user.IUser; 11 | 12 | public interface IUploadJobManager { 13 | 14 | IUploadJob findUploadJob(String id); 15 | 16 | List createUploadJob(IUser user, MultipartFile[] files, List fileBytes, String groupId) throws GroupDoesNotExistException; 17 | 18 | byte[] getUploadedFile(IUploadJob job); 19 | 20 | List getUploadJobs(IUser user, int page); 21 | 22 | IUploadJob findUploadJobFullyLoaded(String id); 23 | 24 | IJob findJob(String id); 25 | 26 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jobs/impl/TokenPayload.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jobs.impl; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | public class TokenPayload { 7 | 8 | private String sub; 9 | 10 | public String getSub() { 11 | return sub; 12 | } 13 | 14 | public void setSub(String sub) { 15 | this.sub = sub; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jwt/IJobApiTokenContents.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jwt; 2 | 3 | public interface IJobApiTokenContents { 4 | 5 | public abstract String getJobId(); 6 | 7 | public abstract void setJobId(String username); 8 | 9 | public abstract boolean isExpired(); 10 | 11 | public abstract void setExpired(boolean expired); 12 | 13 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jwt/IJwtTokenService.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jwt; 2 | 3 | import edu.asu.diging.citesphere.core.model.jobs.IJob; 4 | 5 | public interface IJwtTokenService { 6 | 7 | String generateJobApiToken(IJob job); 8 | 9 | /** 10 | * Method to parse a JWT token. If the token has expired, the returned {@link IJobApiTokenContents} 11 | * will be set to expired. If the token has an incorrect signature, null is returned. 12 | * 13 | * @param token Token to parse. 14 | * @return an object of {@link IJobApiTokenContents} or null if signure is invalid. 15 | */ 16 | IJobApiTokenContents getJobApiTokenContents(String token); 17 | 18 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/jwt/impl/JobApiTokenContents.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.jwt.impl; 2 | 3 | import edu.asu.diging.citesphere.core.service.jwt.IJobApiTokenContents; 4 | 5 | /** 6 | * Class that holds the information that was encoded in a token. 7 | * 8 | * @author Julia Damerow 9 | * 10 | */ 11 | public class JobApiTokenContents implements IJobApiTokenContents { 12 | 13 | private String jobId; 14 | private boolean expired; 15 | 16 | /* (non-Javadoc) 17 | * @see edu.asu.giles.tokens.impl.ITokenContents#getUsername() 18 | */ 19 | @Override 20 | public String getJobId() { 21 | return jobId; 22 | } 23 | /* (non-Javadoc) 24 | * @see edu.asu.giles.tokens.impl.ITokenContents#setUsername(java.lang.String) 25 | */ 26 | @Override 27 | public void setJobId(String username) { 28 | this.jobId = username; 29 | } 30 | /* (non-Javadoc) 31 | * @see edu.asu.giles.tokens.impl.ITokenContents#isExpired() 32 | */ 33 | @Override 34 | public boolean isExpired() { 35 | return expired; 36 | } 37 | /* (non-Javadoc) 38 | * @see edu.asu.giles.tokens.impl.ITokenContents#setExpired(boolean) 39 | */ 40 | @Override 41 | public void setExpired(boolean expired) { 42 | this.expired = expired; 43 | } 44 | 45 | 46 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/oauth/GrantTypes.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.oauth; 2 | 3 | public interface GrantTypes { 4 | 5 | public final static String CLIENT_CREDENTIALS = "client_credentials"; 6 | public final static String AUTHORIZATION_CODE = "authorization_code"; 7 | public final static String PASSWORD = "password"; 8 | public final static String REFRESH_TOKEN = "refresh_token"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/oauth/IOAuthClientManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.oauth; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.security.core.GrantedAuthority; 8 | import org.springframework.security.oauth2.provider.ClientDetails; 9 | import org.springframework.security.oauth2.provider.ClientRegistrationException; 10 | 11 | import edu.asu.diging.citesphere.core.exceptions.CannotFindClientException; 12 | import edu.asu.diging.citesphere.core.model.oauth.impl.OAuthClient; 13 | import edu.asu.diging.citesphere.user.IUser; 14 | 15 | public interface IOAuthClientManager { 16 | 17 | ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException; 18 | 19 | OAuthCredentials create(String name, String description, List scopes, Set grantTypes, String redirectUrl, List authorities, IUser user); 20 | 21 | OAuthClientResultPage getAllClientDetails(Pageable pageable); 22 | 23 | List getAllApps(); 24 | 25 | void deleteClient(String clientId); 26 | 27 | OAuthCredentials updateClientSecret(String clientId) throws CannotFindClientException; 28 | 29 | List getClientsDetails(List clientList); 30 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/oauth/InternalTokenManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.oauth; 2 | 3 | import org.springframework.security.oauth2.common.OAuth2AccessToken; 4 | import org.springframework.security.oauth2.provider.token.ResourceServerTokenServices; 5 | 6 | import edu.asu.diging.citesphere.user.IUser; 7 | 8 | public interface InternalTokenManager extends ResourceServerTokenServices { 9 | 10 | OAuth2AccessToken getAccessToken(IUser user); 11 | 12 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/oauth/OAuthClientResultPage.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.oauth; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.core.model.oauth.IOAuthClient; 6 | 7 | public class OAuthClientResultPage { 8 | 9 | private long totalPages; 10 | private List clientList; 11 | 12 | public long getTotalPages() { 13 | return totalPages; 14 | } 15 | public void setTotalPages(long totalPages) { 16 | this.totalPages = totalPages; 17 | } 18 | public List getClientList() { 19 | return clientList; 20 | } 21 | public void setClientList(List clientList) { 22 | this.clientList = clientList; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/oauth/OAuthCredentials.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.oauth; 2 | 3 | import edu.asu.diging.citesphere.core.model.oauth.IOAuthClient; 4 | 5 | /** 6 | * This class is a temporary holder for app client id and secret to be used after 7 | * creation of a new {@link IOAuthClient}. The generated secret should not be stored 8 | * unencypted. 9 | * 10 | * @author jdamerow 11 | * 12 | */ 13 | public class OAuthCredentials { 14 | 15 | private String clientId; 16 | 17 | private String secret; 18 | 19 | public OAuthCredentials(String clientId, String secret) { 20 | super(); 21 | this.clientId = clientId; 22 | this.secret = secret; 23 | } 24 | 25 | public String getClientId() { 26 | return clientId; 27 | } 28 | public void setClientId(String clientId) { 29 | this.clientId = clientId; 30 | } 31 | public String getSecret() { 32 | return secret; 33 | } 34 | public void setSecret(String secret) { 35 | this.secret = secret; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/oauth/OAuthScope.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.oauth; 2 | 3 | public enum OAuthScope { 4 | READ("read"), 5 | WRITE("write"); 6 | 7 | private String scope; 8 | 9 | private OAuthScope(String scope) { 10 | this.scope = scope; 11 | } 12 | 13 | public String getScope() { 14 | return scope; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/service/upload/IFileStorageManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.service.upload; 2 | 3 | import java.io.IOException; 4 | import java.net.URL; 5 | 6 | import edu.asu.diging.citesphere.core.exceptions.FileStorageException; 7 | 8 | public interface IFileStorageManager { 9 | 10 | void saveFile(String username, String jobId, String filename, byte[] bytes) throws FileStorageException; 11 | 12 | String getFolderPath(String username, String jobId); 13 | 14 | boolean deleteFile(String username, String jobId, String filename, boolean deleteEmptyFolders); 15 | 16 | byte[] getFileContentFromUrl(URL url) throws IOException; 17 | 18 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/sync/ExtraData.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.sync; 2 | 3 | public interface ExtraData { 4 | 5 | public final static String CITESPHERE_PREFIX = "Citesphere:"; 6 | 7 | public final static String CITESPHERE_PATTERN = "(?m)(?s)^" + CITESPHERE_PREFIX + " ?(\\{.*\\}).*?$"; 8 | 9 | public final static String CITESPHERE_METADATA_TAG = "citesphere-metadata"; 10 | } 11 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/user/IUserHelper.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.user; 2 | import org.springframework.social.connect.Connection; 3 | 4 | public interface IUserHelper { 5 | 6 | public abstract String createUser(Connection connection); 7 | 8 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/user/IUserManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.user; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.core.exceptions.UserAlreadyExistsException; 6 | import edu.asu.diging.citesphere.core.exceptions.UserDoesNotExistException; 7 | import edu.asu.diging.citesphere.core.model.Role; 8 | import edu.asu.diging.citesphere.user.IUser; 9 | 10 | public interface IUserManager { 11 | 12 | void create(IUser user) throws UserAlreadyExistsException; 13 | 14 | IUser findByUsername(String username); 15 | 16 | List findAll(); 17 | 18 | void approveAccount(String username, String approver); 19 | 20 | /** 21 | * Adds given role to a user. 22 | * @param username Username of user to be changed. 23 | * @param initiator Username of user initiating the changne. 24 | * @param role Name of role to be added. Use roles defined in {@link Role}. 25 | */ 26 | void addRole(String username, String initiator, String role); 27 | 28 | void removeRole(String username, String initiator, String role); 29 | 30 | void disableUser(String username, String initiator); 31 | 32 | IUser findByEmail(String email); 33 | 34 | void changePassword(IUser user, String password) throws UserDoesNotExistException; 35 | 36 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/user/impl/UserHelper.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.user.impl; 2 | 3 | import org.springframework.social.connect.Connection; 4 | import org.springframework.social.connect.UserProfile; 5 | import org.springframework.stereotype.Service; 6 | 7 | import edu.asu.diging.citesphere.core.user.IUserHelper; 8 | 9 | @Service 10 | public class UserHelper implements IUserHelper { 11 | 12 | /* (non-Javadoc) 13 | * @see edu.asu.giles.config.IUserHelper#createUser(org.springframework.social.connect.Connection) 14 | */ 15 | @Override 16 | public String createUser(Connection connection) { 17 | UserProfile profile = connection.fetchUserProfile(); 18 | return profile.getUsername() + "_" + connection.getKey().getProviderId(); 19 | } 20 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/util/IGilesUtil.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.util; 2 | 3 | import com.fasterxml.jackson.databind.node.ObjectNode; 4 | 5 | import edu.asu.diging.citesphere.model.bib.IGilesUpload; 6 | 7 | /** 8 | * Interface for utilities related to Giles upload jobs. 9 | */ 10 | public interface IGilesUtil { 11 | 12 | /** 13 | * Creates a JSON node representing a Giles upload job and adds it to the specified root node. 14 | * 15 | * @param root the root {@link ObjectNode} to which the job object will be attached 16 | * @param job the {@link IGilesUpload} object containing job information to be represented in JSON form 17 | */ 18 | void createJobObjectNode(ObjectNode root, IGilesUpload job); 19 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/util/impl/GilesUtil.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.util.impl; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Component; 6 | 7 | import com.fasterxml.jackson.databind.ObjectMapper; 8 | import com.fasterxml.jackson.databind.node.ArrayNode; 9 | import com.fasterxml.jackson.databind.node.ObjectNode; 10 | 11 | import edu.asu.diging.citesphere.core.util.IGilesUtil; 12 | import edu.asu.diging.citesphere.model.bib.IGilesUpload; 13 | 14 | @Component 15 | public class GilesUtil implements IGilesUtil { 16 | 17 | private Logger logger = LoggerFactory.getLogger(getClass()); 18 | 19 | @Override 20 | public void createJobObjectNode(ObjectNode root, IGilesUpload job) { 21 | ObjectMapper mapper = new ObjectMapper(); 22 | ArrayNode filesNode = root.putArray("jobs"); 23 | ObjectNode jobNode = mapper.createObjectNode(); 24 | jobNode.put("jobId", job.getProgressId()); 25 | filesNode.add(jobNode); 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/util/model/ICitationHelper.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.util.model; 2 | 3 | import edu.asu.diging.citesphere.model.bib.ICitation; 4 | import edu.asu.diging.citesphere.user.IUser; 5 | import edu.asu.diging.citesphere.web.forms.CitationForm; 6 | 7 | public interface ICitationHelper { 8 | 9 | void updateCitation(ICitation citation, CitationForm form, IUser iUser); 10 | 11 | void addCollection(ICitation citation, String collection, IUser iUser); 12 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/zotero/DeletedZoteroElements.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.zotero; 2 | 3 | import java.util.List; 4 | 5 | public class DeletedZoteroElements { 6 | 7 | private List collections; 8 | private List items; 9 | private List tags; 10 | 11 | public List getCollections() { 12 | return collections; 13 | } 14 | public void setCollections(List collections) { 15 | this.collections = collections; 16 | } 17 | public List getItems() { 18 | return items; 19 | } 20 | public void setItems(List items) { 21 | this.items = items; 22 | } 23 | public List getTags() { 24 | return tags; 25 | } 26 | public void setTags(List tags) { 27 | this.tags = tags; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/zotero/IZoteroTokenManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.zotero; 2 | 3 | import edu.asu.diging.citesphere.core.model.IZoteroToken; 4 | import edu.asu.diging.citesphere.user.IUser; 5 | 6 | public interface IZoteroTokenManager { 7 | 8 | IZoteroToken getToken(IUser user); 9 | 10 | IZoteroToken store(IZoteroToken token); 11 | 12 | } -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/zotero/ZoteroCollectionsResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.zotero; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.bib.ICitationCollection; 6 | 7 | public class ZoteroCollectionsResponse { 8 | 9 | private List collections; 10 | private long contentVersion; 11 | 12 | public List getCollections() { 13 | return collections; 14 | } 15 | public void setCollections(List citations) { 16 | this.collections = citations; 17 | } 18 | public long getContentVersion() { 19 | return contentVersion; 20 | } 21 | public void setContentVersion(long contentVersion) { 22 | this.contentVersion = contentVersion; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/zotero/ZoteroGroupItemsResponse.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.zotero; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.bib.ICitation; 6 | 7 | public class ZoteroGroupItemsResponse { 8 | 9 | private List citations; 10 | private long contentVersion; 11 | 12 | public List getCitations() { 13 | return citations; 14 | } 15 | public void setCitations(List citations) { 16 | this.citations = citations; 17 | } 18 | public long getContentVersion() { 19 | return contentVersion; 20 | } 21 | public void setContentVersion(long contentVersion) { 22 | this.contentVersion = contentVersion; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/core/zotero/impl/ZoteroTokenManager.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.zotero.impl; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import edu.asu.diging.citesphere.core.model.IZoteroToken; 7 | import edu.asu.diging.citesphere.core.model.impl.ZoteroToken; 8 | import edu.asu.diging.citesphere.core.repository.TokenRepository; 9 | import edu.asu.diging.citesphere.core.zotero.IZoteroTokenManager; 10 | import edu.asu.diging.citesphere.user.IUser; 11 | 12 | @Service 13 | public class ZoteroTokenManager implements IZoteroTokenManager { 14 | 15 | @Autowired 16 | private TokenRepository tokenRepo; 17 | 18 | /* (non-Javadoc) 19 | * @see edu.asu.diging.citesphere.core.service.impl.IZoteroTokenManager#getToken(edu.asu.diging.citesphere.core.model.IUser) 20 | */ 21 | @Override 22 | public IZoteroToken getToken(IUser user) { 23 | return (IZoteroToken) tokenRepo.findByUserUsername(user.getUsername()); 24 | } 25 | 26 | @Override 27 | public IZoteroToken store(IZoteroToken token) { 28 | return (IZoteroToken) tokenRepo.save((ZoteroToken)token); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/BreadCrumb.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web; 2 | 3 | public class BreadCrumb { 4 | 5 | private String label; 6 | private BreadCrumbType type; 7 | private String objectId; 8 | private Object object; 9 | 10 | public BreadCrumb(String label, BreadCrumbType type, String objectId, Object object) { 11 | super(); 12 | this.label = label; 13 | this.type = type; 14 | this.objectId = objectId; 15 | this.object = object; 16 | } 17 | 18 | public String getLabel() { 19 | return label; 20 | } 21 | public void setLabel(String label) { 22 | this.label = label; 23 | } 24 | public BreadCrumbType getType() { 25 | return type; 26 | } 27 | public void setType(BreadCrumbType type) { 28 | this.type = type; 29 | } 30 | public String getObjectId() { 31 | return objectId; 32 | } 33 | public void setObjectId(String objectId) { 34 | this.objectId = objectId; 35 | } 36 | 37 | public Object getObject() { 38 | return object; 39 | } 40 | 41 | public void setObject(Object object) { 42 | this.object = object; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/BreadCrumbType.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web; 2 | 3 | public enum BreadCrumbType { 4 | GROUP, 5 | COLLECTION, 6 | ROOT; 7 | } 8 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/ExceptionHandlerAdvice.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web; 2 | 3 | import org.springframework.web.bind.annotation.ControllerAdvice; 4 | import org.springframework.web.bind.annotation.ExceptionHandler; 5 | 6 | import edu.asu.diging.citesphere.core.exceptions.AccessForbiddenException; 7 | import edu.asu.diging.citesphere.core.exceptions.CannotFindCitationException; 8 | import edu.asu.diging.citesphere.core.exceptions.ZoteroHttpStatusException; 9 | 10 | @ControllerAdvice 11 | public class ExceptionHandlerAdvice { 12 | 13 | @ExceptionHandler({ CannotFindCitationException.class }) 14 | public String handleCitationKeyDoesNotExist() { 15 | return "error/citation/notFound"; 16 | } 17 | 18 | @ExceptionHandler({AccessForbiddenException.class}) 19 | public String handleForbidden() { 20 | return "error/403"; 21 | } 22 | 23 | @ExceptionHandler({ZoteroHttpStatusException.class}) 24 | public String handleZoteroException() { 25 | return "error/500"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/HomeController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.Authentication; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | import edu.asu.diging.citesphere.core.service.ICitationManager; 10 | import edu.asu.diging.citesphere.core.zotero.IZoteroTokenManager; 11 | import edu.asu.diging.citesphere.user.IUser; 12 | 13 | @Controller 14 | public class HomeController { 15 | 16 | @Autowired 17 | private IZoteroTokenManager tokenManager; 18 | 19 | @Autowired 20 | private ICitationManager citationManager; 21 | 22 | @RequestMapping(value = "/") 23 | public String home(Authentication authentication, Model model) { 24 | if (authentication != null && authentication.isAuthenticated()) { 25 | IUser user = (IUser) authentication.getPrincipal(); 26 | boolean isConnected = tokenManager.getToken(user) != null; 27 | model.addAttribute("isZoteroConnected", isConnected); 28 | model.addAttribute("user", user); 29 | if (isConnected) { 30 | model.addAttribute("groups", citationManager.getGroups(user)); 31 | } 32 | } 33 | 34 | return "home"; 35 | } 36 | 37 | @RequestMapping(value ="/login") 38 | public String login() { 39 | return "login"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/admin/ApproveAccountController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.admin; 2 | 3 | import java.security.Principal; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | 11 | import edu.asu.diging.citesphere.core.user.IUserManager; 12 | 13 | @Controller 14 | public class ApproveAccountController { 15 | 16 | @Autowired 17 | private IUserManager userManager; 18 | 19 | @RequestMapping(value="/admin/user/{username}/approve", method=RequestMethod.POST) 20 | public String approveAccount(@PathVariable("username") String username, Principal principal) { 21 | userManager.approveAccount(username, principal.getName()); 22 | return "redirect:/admin/user/list"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/admin/ListUserController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.admin; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import edu.asu.diging.citesphere.core.user.IUserManager; 9 | 10 | @Controller 11 | public class ListUserController { 12 | 13 | @Autowired 14 | private IUserManager userManager; 15 | 16 | @RequestMapping("/admin/user/list") 17 | public String list(Model model) { 18 | model.addAttribute("users", userManager.findAll()); 19 | return "admin/user/list"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/admin/forms/AppForm.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.admin.forms; 2 | 3 | public class AppForm { 4 | 5 | private String name; 6 | private String description; 7 | private String grantType; 8 | private String redirectUrl; 9 | 10 | public String getName() { 11 | return name; 12 | } 13 | public void setName(String name) { 14 | this.name = name; 15 | } 16 | public String getDescription() { 17 | return description; 18 | } 19 | public void setDescription(String description) { 20 | this.description = description; 21 | } 22 | public String getGrantType() { 23 | return grantType; 24 | } 25 | public void setGrantType(String grantType) { 26 | this.grantType = grantType; 27 | } 28 | public String getRedirectUrl() { 29 | return redirectUrl; 30 | } 31 | public void setRedirectUrl(String callbackUrl) { 32 | this.redirectUrl = callbackUrl; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/admin/oauth/DeleteOAuthClientController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.admin.oauth; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import edu.asu.diging.citesphere.core.service.oauth.IOAuthClientManager; 11 | 12 | @Controller 13 | public class DeleteOAuthClientController { 14 | 15 | @Autowired 16 | private IOAuthClientManager clientManager; 17 | 18 | @RequestMapping(value = "/admin/apps/{clientId}", method = RequestMethod.DELETE) 19 | public ResponseEntity deleteApp(@PathVariable("clientId") String clientId) { 20 | clientManager.deleteClient(clientId); 21 | return new ResponseEntity<>(HttpStatus.OK); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/admin/oauth/OAuthClientDetailsController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.admin.oauth; 2 | import org.springframework.beans.factory.annotation.Autowired; 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import edu.asu.diging.citesphere.core.model.oauth.IOAuthClient; 9 | import edu.asu.diging.citesphere.core.service.oauth.IOAuthClientManager; 10 | 11 | @Controller 12 | public class OAuthClientDetailsController { 13 | 14 | @Autowired 15 | private IOAuthClientManager clientManager; 16 | 17 | @RequestMapping(value="/admin/apps/{clientId}", method=RequestMethod.GET) 18 | public String showAppDetails(Model model, @PathVariable("clientId") String clientId) { 19 | IOAuthClient details = (IOAuthClient)clientManager.loadClientByClientId(clientId); 20 | model.addAttribute("clientName", details.getName()); 21 | model.addAttribute("clientId", clientId); 22 | model.addAttribute("description", details.getDescription()); 23 | model.addAttribute("redirectUrl", String.join(", ", details.getRegisteredRedirectUri())); 24 | model.addAttribute("applicationType", details.getAuthorizedGrantTypes().contains("authorization_code")?"authorization_code":"client_credentials"); 25 | if(details.getCreatedBy() != null) { 26 | model.addAttribute("createdBy", details.getCreatedBy().getUsername()); 27 | } 28 | return "admin/apps/details"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/admin/oauth/ShowOAuthClientsController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.admin.oauth; 2 | import org.springframework.beans.factory.annotation.Autowired; 3 | import org.springframework.data.domain.Pageable; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | import edu.asu.diging.citesphere.core.service.oauth.IOAuthClientManager; 9 | import edu.asu.diging.citesphere.core.service.oauth.OAuthClientResultPage; 10 | 11 | @Controller 12 | public class ShowOAuthClientsController { 13 | 14 | @Autowired 15 | private IOAuthClientManager clientManager; 16 | 17 | 18 | @RequestMapping(value="/admin/apps", method=RequestMethod.GET) 19 | public String showAllApps(Model model, Pageable pageable) { 20 | OAuthClientResultPage result = clientManager.getAllClientDetails(pageable); 21 | model.addAttribute("clientList", result.getClientList()); 22 | model.addAttribute("currentPage", pageable.getPageNumber()+1); 23 | model.addAttribute("totalPages", result.getTotalPages()); 24 | return "admin/apps/show"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/admin/oauth/UpdateOAuthClientController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.admin.oauth; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestMethod; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | import edu.asu.diging.citesphere.core.exceptions.CannotFindClientException; 11 | import edu.asu.diging.citesphere.core.service.oauth.IOAuthClientManager; 12 | import edu.asu.diging.citesphere.core.service.oauth.OAuthCredentials; 13 | 14 | @Controller 15 | public class UpdateOAuthClientController { 16 | 17 | @Autowired 18 | private IOAuthClientManager clientManager; 19 | 20 | @RequestMapping(value="/admin/apps/{clientId}/secret/update", method=RequestMethod.POST) 21 | public @ResponseBody OAuthCredentials regenerateClientSecret(Model model, @PathVariable("clientId") String clientId) throws CannotFindClientException { 22 | return clientManager.updateClientSecret(clientId); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/auth/OAuthApprovalController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.auth; 2 | 3 | import java.util.Map; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.SessionAttributes; 10 | 11 | @SessionAttributes("authorizationRequest") 12 | @Controller 13 | public class OAuthApprovalController { 14 | 15 | @RequestMapping("/oauth/confirm_access") 16 | public String getAccessConfirmation(Map model, HttpServletRequest request) throws Exception { 17 | return "auth/oauth_approve"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/forms/AffiliationForm.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.forms; 2 | 3 | public class AffiliationForm { 4 | 5 | private String id; 6 | private String name; 7 | private String uri; 8 | 9 | public String getId() { 10 | return id; 11 | } 12 | public void setId(String id) { 13 | this.id = id; 14 | } 15 | public String getName() { 16 | return name; 17 | } 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | public String getUri() { 22 | return uri; 23 | } 24 | public void setUri(String uri) { 25 | this.uri = uri; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/forms/CitationConceptForm.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.forms; 2 | 3 | import javax.validation.constraints.NotEmpty; 4 | import org.hibernate.validator.constraints.URL; 5 | 6 | public class CitationConceptForm { 7 | 8 | @NotEmpty(message = "Name cannot be empty.") 9 | private String name; 10 | 11 | private String description; 12 | 13 | @NotEmpty(message = "Uri cannot be empty.") 14 | @URL 15 | private String uri; 16 | 17 | private String type; 18 | 19 | private String conceptId; 20 | 21 | private String owner; 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public String getDescription() { 32 | return description; 33 | } 34 | 35 | public void setDescription(String description) { 36 | this.description = description; 37 | } 38 | 39 | public String getUri() { 40 | return uri; 41 | } 42 | 43 | public void setUri(String uri) { 44 | this.uri = uri; 45 | } 46 | 47 | public String getType() { 48 | return type; 49 | } 50 | 51 | public void setType(String type) { 52 | this.type = type; 53 | } 54 | 55 | public String getConceptId() { 56 | return conceptId; 57 | } 58 | 59 | public void setConceptId(String conceptId) { 60 | this.conceptId = conceptId; 61 | } 62 | 63 | public String getOwner() { 64 | return owner; 65 | } 66 | 67 | public void setOwner(String owner) { 68 | this.owner = owner; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/forms/ConceptTypeForm.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.forms; 2 | 3 | import javax.validation.constraints.NotEmpty; 4 | 5 | import org.hibernate.validator.constraints.URL; 6 | 7 | public class ConceptTypeForm { 8 | 9 | @NotEmpty(message = "Name cannot be empty.") 10 | private String name; 11 | private String description; 12 | @NotEmpty(message = "Uri cannot be empty.") 13 | @URL 14 | private String uri; 15 | 16 | private String conceptTypeId; 17 | private String owner; 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getDescription() { 28 | return description; 29 | } 30 | 31 | public void setDescription(String description) { 32 | this.description = description; 33 | } 34 | 35 | public String getUri() { 36 | return uri; 37 | } 38 | 39 | public void setUri(String uri) { 40 | this.uri = uri; 41 | } 42 | 43 | public String getConceptTypeId() { 44 | return conceptTypeId; 45 | } 46 | 47 | public void setConceptTypeId(String conceptTypeId) { 48 | this.conceptTypeId = conceptTypeId; 49 | } 50 | 51 | public String getOwner() { 52 | return owner; 53 | } 54 | 55 | public void setOwner(String owner) { 56 | this.owner = owner; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/forms/CreateAuthorityForm.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.forms; 2 | 3 | import javax.validation.constraints.NotEmpty; 4 | 5 | public class CreateAuthorityForm { 6 | 7 | private String description; 8 | 9 | @NotEmpty(message = "Name cannot be empty.") 10 | private String name; 11 | 12 | private String groupId; 13 | 14 | private String uri; 15 | 16 | private String importerId; 17 | 18 | private String importerName; 19 | 20 | public String getDescription() { 21 | return description; 22 | } 23 | 24 | public void setDescription(String description) { 25 | this.description = description; 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | public String getGroupId() { 37 | return groupId; 38 | } 39 | 40 | public void setGroupId(String groupId) { 41 | this.groupId = groupId; 42 | } 43 | 44 | public String getUri() { 45 | return uri; 46 | } 47 | 48 | public void setUri(String uri) { 49 | this.uri = uri; 50 | } 51 | 52 | public String getImporterId() { 53 | return importerId; 54 | } 55 | 56 | public void setImporterId(String importerId) { 57 | this.importerId = importerId; 58 | } 59 | 60 | public String getImporterName() { 61 | return importerName; 62 | } 63 | 64 | public void setImporterName(String importerName) { 65 | this.importerName = importerName; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/forms/EditAuthorityForm.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.forms; 2 | 3 | import javax.validation.constraints.NotEmpty; 4 | 5 | public class EditAuthorityForm { 6 | private String description; 7 | @NotEmpty(message="Name cannot be empty.") 8 | private String name; 9 | 10 | public String getDescription() { 11 | return description; 12 | } 13 | 14 | public void setDescription(String description) { 15 | this.description= description; 16 | } 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/AsyncTaskStatus.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | /** 4 | * This enum represents the states of an async task 5 | */ 6 | public enum AsyncTaskStatus { 7 | PENDING, 8 | COMPLETE 9 | } 10 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/AuthoritySearchResult.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import java.util.List; 4 | 5 | import edu.asu.diging.citesphere.model.authority.IAuthorityEntry; 6 | 7 | public class AuthoritySearchResult { 8 | 9 | private int totalPages; 10 | private int currentPage; 11 | private String groupName; 12 | 13 | private List foundAuthorities; 14 | 15 | public int getTotalPages() { 16 | return totalPages; 17 | } 18 | 19 | public void setTotalPages(int totalPages) { 20 | this.totalPages = totalPages; 21 | } 22 | 23 | public int getCurrentPage() { 24 | return currentPage; 25 | } 26 | 27 | public void setCurrentPage(int currentPage) { 28 | this.currentPage = currentPage; 29 | } 30 | 31 | public List getFoundAuthorities() { 32 | return foundAuthorities; 33 | } 34 | 35 | public void setFoundAuthorities(List foundAuthorities) { 36 | this.foundAuthorities = foundAuthorities; 37 | } 38 | 39 | public String getGroupName() { 40 | return groupName; 41 | } 42 | 43 | public void setGroupName(String groupName) { 44 | this.groupName = groupName; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/AvailableColumnsDataDto.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | /** 4 | * This class binds column and its label together. 5 | */ 6 | public class AvailableColumnsDataDto { 7 | private String column; 8 | private String columnLabel; 9 | 10 | public AvailableColumnsDataDto(String column, String columnLabel) { 11 | this.column = column; 12 | this.columnLabel = columnLabel; 13 | } 14 | 15 | public String getColumn() { 16 | return column; 17 | } 18 | 19 | public void setColumn(String column) { 20 | this.column = column; 21 | } 22 | 23 | public String getColumnLabel() { 24 | return columnLabel; 25 | } 26 | 27 | public void setColumnLabel(String columnLabel) { 28 | this.columnLabel = columnLabel; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/CancelSyncJobController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | 9 | import edu.asu.diging.citesphere.core.service.jobs.ISyncJobManager; 10 | 11 | @Controller 12 | public class CancelSyncJobController { 13 | 14 | @Autowired 15 | private ISyncJobManager syncManager; 16 | 17 | @RequestMapping(value = "/auth/jobs/sync/{jobId}/cancel", method=RequestMethod.POST) 18 | public String cancel(@PathVariable String jobId) { 19 | syncManager.cancelJob(jobId); 20 | return "redirect:/auth/jobs/sync/list"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/CitationsDto.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import edu.asu.diging.citesphere.model.bib.ICitation; 4 | 5 | /** 6 | * This class binds citation, its label and icon together. 7 | */ 8 | public class CitationsDto { 9 | 10 | private ICitation citation; 11 | private String citationLabel; 12 | private String citationIcon; 13 | 14 | public CitationsDto(ICitation citation, String label, String icon) { 15 | this.citation = citation; 16 | this.citationLabel = label; 17 | this.citationIcon = icon; 18 | } 19 | 20 | public ICitation getCitation() { 21 | return citation; 22 | } 23 | 24 | public void setCitation(ICitation citation) { 25 | this.citation = citation; 26 | } 27 | 28 | public String getCitationLabel() { 29 | return citationLabel; 30 | } 31 | 32 | public void setCitationLabel(String citationLabel) { 33 | this.citationLabel = citationLabel; 34 | } 35 | 36 | public String getCitationIcon() { 37 | return citationIcon; 38 | } 39 | 40 | public void setCitationIcon(String citationIcon) { 41 | this.citationIcon = citationIcon; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/CreatorController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.security.core.Authentication; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | import edu.asu.diging.citesphere.core.service.ICitationManager; 15 | import edu.asu.diging.citesphere.model.bib.ItemType; 16 | import edu.asu.diging.citesphere.user.IUser; 17 | 18 | @Controller 19 | public class CreatorController { 20 | 21 | @Autowired 22 | private ICitationManager citationManager; 23 | /** 24 | * Method to retrieve all creator types filtered by item type. 25 | */ 26 | @RequestMapping("/auth/items/{itemType}/creators") 27 | public ResponseEntity> getCreatorsByItemType(Authentication authentication, @PathVariable("itemType") ItemType itemType) { 28 | List creators = new ArrayList<>(); 29 | citationManager.getValidCreatorTypes((IUser) authentication.getPrincipal(), itemType).forEach(f -> creators.add(f)); 30 | return new ResponseEntity>(creators, HttpStatus.OK); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/DeleteLocalCitationGroupController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import java.security.Principal; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.http.HttpHeaders; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestHeader; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | 15 | import edu.asu.diging.citesphere.core.exceptions.GroupDoesNotExistException; 16 | import edu.asu.diging.citesphere.core.service.ICitationCollectionManager; 17 | import edu.asu.diging.citesphere.core.service.ICitationManager; 18 | import edu.asu.diging.citesphere.core.service.IGroupManager; 19 | 20 | @Controller 21 | public class DeleteLocalCitationGroupController{ 22 | 23 | @Autowired 24 | private IGroupManager groupManager; 25 | 26 | @RequestMapping(value = "/auth/group/{zoteroGroupId}/resync", method = RequestMethod.POST) 27 | public ResponseEntity getCollectionsByGroupId(@RequestHeader HttpHeaders headers, 28 | @PathVariable("zoteroGroupId") String groupId, Principal principal) { 29 | groupManager.deleteLocalGroupCopy(groupId); 30 | return new ResponseEntity(HttpStatus.OK); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/FoundAuthorities.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import edu.asu.diging.citesphere.model.authority.IAuthorityEntry; 7 | 8 | public class FoundAuthorities { 9 | 10 | private List userAuthorityEntries; 11 | private Set datasetAuthorityEntries; 12 | private IAuthorityEntry importedAuthority; 13 | 14 | public List getUserAuthorityEntries() { 15 | return userAuthorityEntries; 16 | } 17 | public void setUserAuthorityEntries(List userAuthorityEntries) { 18 | this.userAuthorityEntries = userAuthorityEntries; 19 | } 20 | public Set getDatasetAuthorityEntries() { 21 | return datasetAuthorityEntries; 22 | } 23 | public void setDatasetAuthorityEntries(Set datasetAuthorityEntries) { 24 | this.datasetAuthorityEntries = datasetAuthorityEntries; 25 | } 26 | public IAuthorityEntry getImportedAuthority() { 27 | return importedAuthority; 28 | } 29 | public void setImportedAuthority(IAuthorityEntry importedAuthority) { 30 | this.importedAuthority = importedAuthority; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/OAuthAppsRevokeTokenController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.security.core.Authentication; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import edu.asu.diging.citesphere.core.service.impl.DbTokenStore; 12 | 13 | @Controller 14 | public class OAuthAppsRevokeTokenController { 15 | 16 | @Autowired 17 | private DbTokenStore tokenStore; 18 | 19 | @RequestMapping(value="/auth/tokens/{clientId}", method=RequestMethod.DELETE) 20 | public ResponseEntity revokeAccessForApp(Authentication authentication, @PathVariable("clientId") String clientId) { 21 | tokenStore.revokeAccessToken(clientId, authentication.getName()); 22 | return new ResponseEntity<>(HttpStatus.OK); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/OAuthAppsTokenController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.security.core.Authentication; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import edu.asu.diging.citesphere.core.model.oauth.impl.DbAccessToken; 13 | import edu.asu.diging.citesphere.core.service.impl.DbTokenStore; 14 | import edu.asu.diging.citesphere.core.service.oauth.IOAuthClientManager; 15 | 16 | @Controller 17 | public class OAuthAppsTokenController { 18 | 19 | @Autowired 20 | private DbTokenStore tokenStore; 21 | 22 | @Autowired 23 | private IOAuthClientManager clientManager; 24 | 25 | @RequestMapping(value="/auth/tokens", method=RequestMethod.GET) 26 | public String getAllAccessTokensForUser(Authentication authentication, Model model) { 27 | List tokens = tokenStore.findTokensByUserName(authentication.getName()); 28 | List clientList = new ArrayList<>(); 29 | tokens.forEach(t -> clientList.add(t.getClientId())); 30 | model.addAttribute("clientList",clientManager.getClientsDetails(clientList)); 31 | return "auth/tokens"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/SearchCitationsController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.PropertySource; 5 | import org.springframework.http.HttpStatus; 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.security.core.Authentication; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | 13 | import edu.asu.diging.citesphere.core.search.service.SearchEngine; 14 | import edu.asu.diging.citesphere.core.search.service.impl.ResultPage; 15 | 16 | @Controller 17 | @PropertySource("classpath:/config.properties") 18 | public class SearchCitationsController { 19 | 20 | @Autowired 21 | private SearchEngine engine; 22 | 23 | @RequestMapping(value = { "/auth/group/{zoteroGroupId}/citations/search" }) 24 | public ResponseEntity searchCitations(Authentication authentication, @PathVariable String zoteroGroupId, 25 | @RequestParam(value = "searchTerm", required = false) String searchTerm, 26 | @RequestParam(defaultValue = "0", required = false, value = "page") int page, 27 | @RequestParam(defaultValue = "20", required = false, value = "pageSize") int pageSize) { 28 | return new ResponseEntity(engine.search(searchTerm, zoteroGroupId, Math.max(page - 1, 0), pageSize), HttpStatus.OK); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/SyncInfoController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import edu.asu.diging.citesphere.core.model.jobs.impl.GroupSyncJob; 9 | import edu.asu.diging.citesphere.core.service.jobs.ISyncJobManager; 10 | 11 | @RestController 12 | public class SyncInfoController { 13 | 14 | @Autowired 15 | private ISyncJobManager jobManager; 16 | 17 | @RequestMapping("/auth/group/{zoteroGroupId}/sync/info") 18 | public SyncInfo getSyncInfo(@PathVariable("zoteroGroupId") String groupId) { 19 | GroupSyncJob job = jobManager.getMostRecentJob(groupId); 20 | 21 | SyncInfo info = new SyncInfo(); 22 | 23 | if (job != null) { 24 | info.createdOn = job.getCreatedOn().toString(); 25 | info.total = job.getTotal(); 26 | info.current = job.getCurrent(); 27 | info.status = job.getStatus() != null ? job.getStatus().name() : ""; 28 | } 29 | 30 | return info; 31 | } 32 | 33 | class SyncInfo { 34 | public String createdOn; 35 | public long total; 36 | public long current; 37 | public String status; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user.authorities; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | import edu.asu.diging.citesphere.core.service.IAuthorityService; 10 | import edu.asu.diging.citesphere.model.authority.IAuthorityEntry; 11 | 12 | @Controller 13 | public class AuthorityController { 14 | 15 | @Autowired 16 | private IAuthorityService authorityService; 17 | 18 | @RequestMapping("/auth/authority/{authorityId}") 19 | public String show(@PathVariable("authorityId") String authorityId, Model model) { 20 | IAuthorityEntry entry = authorityService.find(authorityId); 21 | model.addAttribute("entry", entry); 22 | return "auth/authority"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/concepts/ListConceptsController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user.concepts; 2 | 3 | import java.security.Principal; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | import edu.asu.diging.citesphere.core.service.ICitationConceptManager; 11 | import edu.asu.diging.citesphere.core.user.IUserManager; 12 | 13 | @Controller 14 | public class ListConceptsController { 15 | 16 | @Autowired 17 | private ICitationConceptManager conceptManager; 18 | 19 | @Autowired 20 | private IUserManager userManager; 21 | 22 | @RequestMapping("/auth/concepts/list") 23 | public String list(Model model, Principal principal) { 24 | model.addAttribute("concepts", conceptManager.findAll(userManager.findByUsername(principal.getName()))); 25 | return "auth/concepts/list"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/concepts/types/ListConceptTypesController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user.concepts.types; 2 | 3 | import java.security.Principal; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | import edu.asu.diging.citesphere.core.service.IConceptTypeManager; 11 | import edu.asu.diging.citesphere.core.user.IUserManager; 12 | 13 | @Controller 14 | public class ListConceptTypesController { 15 | 16 | @Autowired 17 | private IConceptTypeManager typesManager; 18 | 19 | @Autowired 20 | private IUserManager userManager; 21 | 22 | @RequestMapping("/auth/concepts/types/list") 23 | public String list(Model model, Principal principal) { 24 | model.addAttribute("types", typesManager.getAllTypes(userManager.findByUsername(principal.getName()))); 25 | return "auth/concepts/types/list"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/dto/MoveItemsRequest.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user.dto; 2 | 3 | import java.util.List; 4 | 5 | public class MoveItemsRequest { 6 | private String collectionId; 7 | private List itemIds; 8 | 9 | public String getCollectionId() { 10 | return collectionId; 11 | } 12 | 13 | public List getItemIds() { 14 | return itemIds; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/export/ListExportsController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user.export; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.Authentication; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | 10 | import edu.asu.diging.citesphere.core.export.IExportTaskManager; 11 | import edu.asu.diging.citesphere.user.IUser; 12 | 13 | @Controller 14 | public class ListExportsController { 15 | 16 | @Autowired 17 | private IExportTaskManager exportTaksManager; 18 | 19 | @RequestMapping(value="/auth/exports") 20 | public String list(Authentication authentication, Model model, @RequestParam(value="page", defaultValue="1", required=false) int page) { 21 | page = page-1; // we start counting at 1 in GUI 22 | if (page < 0 ) { 23 | page = 0; 24 | } 25 | IUser user = (IUser) authentication.getPrincipal(); 26 | model.addAttribute("tasks", exportTaksManager.getTasks(user, page)); 27 | model.addAttribute("total", exportTaksManager.getTasksTotalPages(user)); 28 | model.addAttribute("page", page+1); 29 | return "auth/group/export/list"; 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/jobs/ImportJobsController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user.jobs; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.Authentication; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | 10 | import edu.asu.diging.citesphere.core.service.jobs.IUploadJobManager; 11 | import edu.asu.diging.citesphere.user.IUser; 12 | 13 | @Controller 14 | public class ImportJobsController { 15 | 16 | @Autowired 17 | private IUploadJobManager jobManager; 18 | 19 | @RequestMapping("/auth/import/jobs") 20 | public String list(Model model, @RequestParam(value="page", required=false, defaultValue="1") String page, Authentication authentication) { 21 | model.addAttribute("jobs", jobManager.getUploadJobs((IUser) authentication.getPrincipal(), new Integer(page)-1)); 22 | return "auth/import/jobs"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/user/jobs/SyncJobsController.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.user.jobs; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.data.domain.Pageable; 5 | import org.springframework.data.domain.Sort.Direction; 6 | import org.springframework.data.web.PageableDefault; 7 | import org.springframework.security.core.Authentication; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | 12 | import edu.asu.diging.citesphere.core.service.jobs.ISyncJobManager; 13 | import edu.asu.diging.citesphere.user.IUser; 14 | 15 | @Controller 16 | public class SyncJobsController { 17 | 18 | @Autowired 19 | private ISyncJobManager jobManager; 20 | 21 | @RequestMapping("/auth/jobs/sync/list") 22 | public String list(Model model, @PageableDefault(sort = { "createdOn" }, direction = Direction.DESC) Pageable page, 23 | Authentication authentication) { 24 | long total = jobManager.getJobsCount((IUser) authentication.getPrincipal()); 25 | if (total == -1) { 26 | return "redirect:/"; 27 | } 28 | model.addAttribute("jobs", jobManager.getJobs((IUser) authentication.getPrincipal(), page)); 29 | model.addAttribute("total", Math.ceil(total/page.getPageSize())); 30 | model.addAttribute("page", page.getPageNumber() + 1); 31 | return "auth/jobs/list"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /citesphere/src/main/java/edu/asu/diging/citesphere/web/validation/FieldMatch.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.web.validation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | import javax.validation.Constraint; 10 | import javax.validation.Payload; 11 | 12 | /** 13 | * Taken from https://memorynotfound.com/field-matching-bean-validation-annotation-example/. 14 | * @author jdamerow 15 | * 16 | */ 17 | @Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE}) 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Constraint(validatedBy = FieldMatchValidator.class) 20 | @Documented 21 | public @interface FieldMatch 22 | { 23 | String message() default "The fields must match"; 24 | Class[] groups() default {}; 25 | Class[] payload() default {}; 26 | String first(); 27 | String second(); 28 | 29 | @Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE}) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | @interface List 33 | { 34 | FieldMatch[] value(); 35 | } 36 | } -------------------------------------------------------------------------------- /citesphere/src/main/resources/app.properties: -------------------------------------------------------------------------------- 1 | app.url=${app.url} 2 | app.name=${app.name} 3 | app.createUserApprovalPath=login/reset/initiated 4 | app.resetPasswordPath= 5 | app.resetPasswordSubject=Password Reset request for $app 6 | password.reset.expiration=60 7 | 8 | mongo.database.name=${mongo.database.name} 9 | mongo.database.host=${mongo.database.host} 10 | mongo.database.port=${mongo.database.port} 11 | mongo.database.user=${mongo.database.user} 12 | mongo.database.password=${mongo.database.password} 13 | mongo.database.authdb=${mongo.database.authdb} 14 | 15 | _citephere_oauth2_app_clientid=${citesphere.oauth2.app.clientId} 16 | 17 | giles_baseurl=${giles.baseurl} 18 | task_cleanup_cycle=${cleanupCycle} -------------------------------------------------------------------------------- /citesphere/src/main/resources/creators.properties: -------------------------------------------------------------------------------- 1 | _item_attribute_label_translator=Translators 2 | _item_attribute_label_contributor=Contributors 3 | _item_attribute_label_performer=Performers 4 | _item_attribute_label_composer=Composers 5 | _item_attribute_label_wordsBy=Words By 6 | _item_attribute_label_sponsor=Sponsors 7 | _item_attribute_label_cosponsor=Co-Sponsors 8 | _item_attribute_label_commenter=Commenters 9 | _item_attribute_label_seriesEditor=Series Editors 10 | _item_attribute_label_bookAuthor=Book Authors 11 | _item_attribute_label_counsel=Counsels 12 | _item_attribute_label_programmer=Programmers 13 | _item_attribute_label_reviewedAuthor=Reviewed Authors 14 | _item_attribute_label_recipient=Recipients 15 | _item_attribute_label_director=Directors 16 | _item_attribute_label_producer=Producers 17 | _item_attribute_label_scriptwriter=Script Writers 18 | _item_attribute_label_interviewee=Interviewees 19 | _item_attribute_label_interviewer=Interviewers 20 | _item_attribute_label_cartographer=Cartographers 21 | _item_attribute_label_inventor=Inventors 22 | _item_attribute_label_attorneyAgent=Attorney Agents 23 | _item_attribute_label_podcaster=Podcasters 24 | _item_attribute_label_guest=Guests 25 | _item_attribute_label_presenter=Presenters 26 | _item_attribute_label_castMember=Cast Members -------------------------------------------------------------------------------- /citesphere/src/main/resources/locale/messages.properties: -------------------------------------------------------------------------------- 1 | alert.login.bad_credentials=Password or Username are incorrect. 2 | alert.login.user_not_approved=Your account has not been approved by an administrator yet. 3 | alert.login.invalidToken=The token used to reset your password is either invalid or has expired. 4 | alert.login.noPassword=Please provide a password. 5 | alert.login.notAuthenticated=Something went wrong. You could not be authenticated. 6 | alert.login.notMatching=The passwords you have entered do not match. 7 | -------------------------------------------------------------------------------- /citesphere/src/main/resources/locale/messages_en_US.properties: -------------------------------------------------------------------------------- 1 | alert.login.bad_credentials=Password or Username are incorrect. 2 | alert.login.user_not_approved=Your account has not been approved by an administrator yet. 3 | alert.login.invalidToken=The token used to reset your password is either invalid or has expired. 4 | alert.login.noPassword=Please provide a password. 5 | alert.login.notAuthenticated=Something went wrong. You could not be authenticated. 6 | alert.login.notMatching=The passwords you have entered do not match. 7 | 8 | app.creation.invalid.granttype=Please select a valid grant type. 9 | -------------------------------------------------------------------------------- /citesphere/src/main/resources/newAccountNotification.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | Hi $admin! 5 |

6 | 7 |

8 | A new account request for $createdUser ($createdUsername) has been created in $app. 9 |
10 | Please review the account request and approve or reject it here: 11 |
$url 12 |

13 | 14 |

15 | Your $app Team 16 |

17 | 18 |

19 |
20 | -----
21 | This email was automatically generated. Please do not reply. 22 |

23 | 24 | -------------------------------------------------------------------------------- /citesphere/src/main/resources/passwordResetEmail.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | Hi $user! 5 |

6 |

7 | You've requested your password to be reset for $app. To reset your password, please follow this link: 8 | $url. 9 |

10 | 11 |

12 | If you did not request a password reset, please ignore this email and let the system administrator know. 13 |

14 | 15 |

16 | Your $app Team 17 |

18 | 19 |

20 |
21 | -----
22 | This email was automatically generated. Please do not reply. 23 |

24 | 25 | -------------------------------------------------------------------------------- /citesphere/src/main/resources/user.properties: -------------------------------------------------------------------------------- 1 | admin=${admin.password},ROLE_ADMIN,enabled -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/admin/apps/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Add App

4 |
5 |
6 | 7 | 8 | 9 | 10 |

11 | 12 | 13 | 14 |

15 | 16 | 17 | 22 |

23 | 24 | 25 | 26 |

27 | 28 | 29 | 30 |
31 |
32 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/auth/authorities/authorityItems.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 |
Title
18 | 19 | [[${entry.title}]] 20 | 21 |
24 |
25 |
26 | 27 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/auth/authorities/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 10 |

Edit Authority Entry:

11 | 12 |
13 | 14 | 15 | 16 |

17 | 18 | 19 | 20 | 21 |
22 | 24 | 25 | 26 |  Cancel 27 | 28 |

29 |
30 | 31 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/auth/authorities/show.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |

Not Found

7 |
8 | 9 |

10 | 11 |
12 | 13 |

14 | 15 |

16 | 17 |

Created on:

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/auth/concepts/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |

Concepts

9 | 10 |

11 |  Add 12 |

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
URINameDescriptionCreated onCreated by
32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/auth/concepts/types/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |

Concept Types

10 |

11 |  Add 12 |

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
URINameDescriptionCreated onCreated by
33 |
34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/auth/group/export/started.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Your export has started.

6 | 7 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/auth/oauth_approve.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 |
9 |
10 | Do you authorize [[${clientId}]] access to your account on Citesphere (and therefore Zotero)? 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | Approve 21 |       22 | Deny 23 | 24 |
25 | 26 |
27 | 28 |
29 |
30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/error/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/error/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/error/citationNotFound.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | Not Found 5 |
6 | 7 | Sorry, this citation could not be found. 8 | 9 |

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/error/gilesDocumentError.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

5 | File Not Found 6 |
7 | 8 | This file is not available. Maybe you uploaded it with a different Citesphere instance? 9 | 10 |

11 | 12 | 13 |
14 | 15 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/password/change.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 |
9 |
10 |
11 |

Enter your new Password:

12 | 13 |

14 | 15 | 16 | 17 |

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 38 | 39 | 40 | 41 |

42 | 43 | 44 | 45 | 46 |
47 |
48 |
49 | 50 | 51 |
52 | 53 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Register 4 | 5 | 6 |
7 |

Create new Account

8 | 9 |
10 | 11 | 12 | 13 | 14 |

15 | 16 | 17 | 18 |

19 | 20 | 21 | 22 |

23 | 24 | 25 | 26 |

27 | 28 | 29 | 30 |

31 | 32 | 33 | 34 |

35 | 36 |
37 | 38 |
39 |
40 | 41 |
42 | 43 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/WEB-INF/views/resetPassword.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
8 |
9 | 10 |
12 |

Password Reset

13 |

Please enter the email address you used to 14 | register:

15 | 17 |
18 |
19 | 21 |
22 |
23 |
24 |
25 | 26 |
27 |
28 |
29 | 30 |
It looks like you're 31 | logged in. Please logout to reset your password.
32 |
33 |
34 |
35 |
36 | 37 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/bootstrap/assets/css/ie10-viewport-bug-workaround.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /* 8 | * See the Getting Started docs for more information: 9 | * http://getbootstrap.com/getting-started/#support-ie10-width 10 | */ 11 | @-webkit-viewport { width: device-width; } 12 | @-moz-viewport { width: device-width; } 13 | @-ms-viewport { width: device-width; } 14 | @-o-viewport { width: device-width; } 15 | @viewport { width: device-width; } -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/bootstrap/js/main.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $(".date").each(function(index, element) { 3 | var dateStr = $(element).text(); 4 | var parsedDate = new Date(dateStr); 5 | $(element).text(parsedDate.toLocaleString()); 6 | }); 7 | }); -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/diging-icon-pack/fonts/diging-icon-pack.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/diging-icon-pack/fonts/diging-icon-pack.eot -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/diging-icon-pack/fonts/diging-icon-pack.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/diging-icon-pack/fonts/diging-icon-pack.ttf -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/diging-icon-pack/fonts/diging-icon-pack.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/diging-icon-pack/fonts/diging-icon-pack.woff -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diging/citesphere/c430d42235840ab7e074eae4eeeb04f63afd50a4/citesphere/src/main/webapp/resources/font-awesome-4.6.3/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /citesphere/src/main/webapp/resources/font-awesome-4.6.3/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /citesphere/src/test/java/edu/asu/diging/citesphere/core/util/model/impl/GilesUtilTest.java: -------------------------------------------------------------------------------- 1 | package edu.asu.diging.citesphere.core.util.model.impl; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import org.junit.Before; 8 | import org.junit.Test; 9 | import org.mockito.InjectMocks; 10 | import org.mockito.MockitoAnnotations; 11 | import org.springframework.mock.web.MockMultipartFile; 12 | 13 | import com.fasterxml.jackson.databind.ObjectMapper; 14 | import com.fasterxml.jackson.databind.node.ObjectNode; 15 | 16 | import edu.asu.diging.citesphere.core.util.impl.GilesUtil; 17 | import edu.asu.diging.citesphere.model.bib.IGilesUpload; 18 | import edu.asu.diging.citesphere.model.bib.impl.GilesUpload; 19 | 20 | public class GilesUtilTest { 21 | @InjectMocks 22 | private GilesUtil gilesUtilToTest; 23 | 24 | @Before 25 | public void setUp() { 26 | MockitoAnnotations.initMocks(this); 27 | } 28 | 29 | @Test 30 | public void test_createJobObjectNode() { 31 | ObjectMapper mapper = new ObjectMapper(); 32 | ObjectNode root = mapper.createObjectNode(); 33 | IGilesUpload job = new GilesUpload(); 34 | job.setProgressId("test_progress_id"); 35 | gilesUtilToTest.createJobObjectNode(root, job); 36 | } 37 | } 38 | --------------------------------------------------------------------------------