forked from DSpace/DSpace
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DSC-737] Restrict export formats by groups and Bulk Item export with…
… metadata and bitstream
- Loading branch information
mohamed eskander
committed
Nov 29, 2023
1 parent
a6c4932
commit e87c9f8
Showing
10 changed files
with
744 additions
and
5 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
63 changes: 63 additions & 0 deletions
63
...main/java/org/dspace/content/integration/crosswalks/METSStreamDisseminationCrosswalk.java
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,63 @@ | ||
/** | ||
* The contents of this file are subject to the license and copyright | ||
* detailed in the LICENSE and NOTICE files at the root of the source | ||
* tree and available online at | ||
* | ||
* http://www.dspace.org/license/ | ||
*/ | ||
package org.dspace.content.integration.crosswalks; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.sql.SQLException; | ||
import javax.annotation.PostConstruct; | ||
|
||
import org.dspace.authorize.AuthorizeException; | ||
import org.dspace.content.DSpaceObject; | ||
import org.dspace.content.crosswalk.CrosswalkException; | ||
import org.dspace.content.crosswalk.METSDisseminationCrosswalk; | ||
import org.dspace.content.crosswalk.StreamDisseminationCrosswalk; | ||
import org.dspace.core.Context; | ||
import org.jdom2.Element; | ||
import org.jdom2.output.Format; | ||
import org.jdom2.output.XMLOutputter; | ||
|
||
/** | ||
* Implementation of {@link StreamDisseminationCrosswalk} that produces a METS | ||
* manifest for the DSpace item as a metadata description, using | ||
* {@link METSDisseminationCrosswalk}. | ||
* | ||
* @author Luca Giamminonni (luca.giamminonni at 4science.it) | ||
* | ||
*/ | ||
public class METSStreamDisseminationCrosswalk implements StreamDisseminationCrosswalk { | ||
|
||
private METSDisseminationCrosswalk metsDisseminationCrosswalk; | ||
|
||
@PostConstruct | ||
public void setup() { | ||
metsDisseminationCrosswalk = new METSDisseminationCrosswalk("AIP"); | ||
} | ||
|
||
@Override | ||
public boolean canDisseminate(Context context, DSpaceObject dso) { | ||
return metsDisseminationCrosswalk.canDisseminate(dso); | ||
} | ||
|
||
@Override | ||
public void disseminate(Context context, DSpaceObject dso, OutputStream out) | ||
throws CrosswalkException, IOException, SQLException, AuthorizeException { | ||
|
||
Element element = metsDisseminationCrosswalk.disseminateElement(context, dso); | ||
|
||
XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat()); | ||
xmlOutputter.output(element, out); | ||
|
||
} | ||
|
||
@Override | ||
public String getMIMEType() { | ||
return "application/xml"; | ||
} | ||
|
||
} |
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
Oops, something went wrong.