-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3309 from IQSS/4.5-export-harvest-docs
A quick fix to move the exportAll API calls under /api/admin.
- Loading branch information
Showing
3 changed files
with
62 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package edu.harvard.iq.dataverse.api; | ||
|
||
import edu.harvard.iq.dataverse.DatasetServiceBean; | ||
import java.util.logging.Logger; | ||
import javax.ejb.EJB; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.Response; | ||
|
||
/** | ||
* | ||
* @author Leonid Andreev | ||
* | ||
*/ | ||
|
||
@Path("admin/metadata") | ||
public class Metadata extends AbstractApiBean { | ||
private static final Logger logger = Logger.getLogger(Metadata.class.getName()); | ||
|
||
@EJB | ||
DatasetServiceBean datasetService; | ||
|
||
// The following 2 commands start export all jobs in the background, | ||
// asynchronously. | ||
// (These API calls should probably not be here; | ||
// May be under "/admin" somewhere?) | ||
// exportAll will attempt to go through all the published, local | ||
// datasets *that haven't been exported yet* - which is determined by | ||
// checking the lastexporttime value of the dataset; if it's null, or < the last | ||
// publication date = "unexported" - and export them. | ||
@GET | ||
@Path("/exportAll") | ||
@Produces("application/json") | ||
public Response exportAll() { | ||
datasetService.exportAllAsync(); | ||
return this.accepted(); | ||
} | ||
|
||
// reExportAll will FORCE A FULL REEXPORT on every published, local | ||
// dataset, regardless of the lastexporttime value. | ||
@GET | ||
@Path("/reExportAll") | ||
@Produces("application/json") | ||
public Response reExportAll() { | ||
datasetService.reExportAllAsync(); | ||
return this.accepted(); | ||
} | ||
} |