Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Wiki Markup
{center}
!worddav4b5e407dacee583f446eadcf9addc2b5.png|height=160,width=402!
*Figure 3 -- New Object Dialog*
{center}

...

Section
Wiki Markup
{center}
!worddav319948af5af752845bf27346d9b96313.png|height=398,width=576!
*Figure 4 -- Configuring an Object* 
{center}

Since our task here is to define the Datastreams in the object, click on the Datastreams tab and you will see a window like that shown in Figure 5. Note that at this point there is only one Datastream in the object ---the DC Datastream containing basic descriptive metadata that was automatically created by Fedora. You can select that Datastream and select the Edit button to see the its default contents, with the DC title and identifier fields already filled in.

Section
Wiki Markup
{center}
!worddav608a69750e00da2921703a97416a49b4.png|height=398,width=576!
*Figure 5 -- Datastream Display*
{center}

...

  1. You will notice that the Control Group of the DC Datastream is Internal XML Metadata. As explained earlier, Fedora has a number of control group types, of which this is one. This type is appropriate for metadata that is represented in XML ---Dublin core metadata being one example. A digital object can have multiple metadata Datastreams, for example MARC, LOM, Dublin Core, and others.
  2. You can directly edit the Dublin Core metadata - e.g., add new Dublin Core fields - by selecting the Edit button and modifying the contents of the text pane. When you press Save Changes..., Fedora will check that the Datastream is well-formed XML.

You may also create Dublin Core metadata (or any other XML-based metadata) in an external XML editor and use using the Import... button to replace the datastream Datastream with this data. When you press Save Changes..., Fedora will check that the datastream Datastream is well-formed XML.

You will notice that there are optional fields on the datastreams Datastreams pane for Format URI (to refine the media type meaning with a URI that more precisely identifies the media type) and Alternate Ids to capture any other existing identifiers you would like to associate with a datastreamDatastream. We will not be using these in this tutorial.

It is now time to add the eprint ePrints document formats as new datastreamsDatastreams. You can find content for creating the datastreams Datastreams for this example in:

  • FEDORA_HOME/userdocs/tutorials/2/example1/artex.html
  • FEDORA_HOME/userdocs/tutorials/2/example1/artex.pdf
  • FEDORA_HOME/userdocs/tutorials/2/example1/artex.tex

To do this, select the New... tab on the left side of the Datastreams window. We'll start with the text/html format. To insert data into the datastreamDatastream, you use the Import... button. This presents a dialog that will allow you to import from your local file system or from a URL.

Your completed HTML datastream Datastream should look like the dialog as shown in Figure 6 (after you have imported the content). Image Removed
Figure 6 - Adding a new managed content datastream
A few

Section
Wiki Markup

{center}
!worddav7581c768ea49f2bef29a203c98c3ee42.png|height=488,width=576!
*Figure 6 -- Adding a New Managed Content Datastream*
{center}

A few notes on the contents of this dialog:

  1. The ID of the datastream Datastream should be a single token. By convention, it describes the purpose of the datastreamDatastream.
  2. The Label can be a longer, more descriptive string.
  3. Note that the Control Group is Managed Content. As shown in the descriptive text this datastream Datastream type is appropriate for any type of data (mime type), in contrast to Internal XML Metadata. Once you select this radio button, you can select from the variety of Mime MIME Types of the managed content - in this case text/html.

You can now select the Save Datastream button and repeat the same process to add the pdf and TeX datastreams Datastreams. For the pdf, you can select Mime Type: application/pdf and import the file ex1.pdf. For TeX, you can select Mime Type: text/plain and import the file ex1.tex. In each case you should enter appropriate IDs and Labels.

You're done! Your Datastreams window should now look something like that shown in Figure 7, showing all the datastreams Datastreams you have entered in the left-side tabs in the window. Image Removed
Figure 7 - Complete datastreams for example 1

Section
Wiki Markup

{center}
!worddav5b3ad7cd1aaf875e53b397a823159c1d.png|height=488,width=576!
*Figure 7 -- Complete Datastreams for Example 1* 
{center}

You will notice as you click through each datastream Datastream that there is a Fedora URL, giving the unique URL to access each datastream Datastream from the Fedora repository. Try going to a browser and entering one of these URLs - the browser will download the datastream Datastream and display it. These URLs can be used by web applications and REST-based web services that access datastreams Datastreams from Fedora digital objects. Note that if you are building SOAP-based web services, there are also SOAP methods (getDataStream and getDatastreamDissemination) that provide datastream Datastream access. You can also try entering the root URL for the entire digital object, which is simply the common prefix of all the datastream Datastream URLs - e.g., http://localhost:8080/fedora/get/demo:100Image Removed. This accesses the header page for the digital object, which allows you to access its datastreams Datastreams (available through the item index hyperlink) and disseminations (available through the dissemination index hyperlink).

Figure 8 illustrates the structure of the object you have created and the correspondence of REST-based access requests to the object and its components (via API-A-LITE).
Image Removed
Figure 8 - Example 1 digital object and datastreams

Section
Wiki Markup

{center}
!worddavac540d3a8081463391d55fd33c857e39.png|height=293,width=520! 
*Figure 8 -- Example 1 Digital Object and Datastreams*
{center}

Example 2: Creating a

...

Surrogate for Distributed Content

The previous example demonstrated how to aggregate imported content into a Fedora digital object. There are many reasons why importing content into a repository might not be appropriate such as rights restrictions or the dynamic nature of the content. To accommodate these restrictions, digital objects in Fedora may contain datastreams that reference externally managed content, and in fact may mix local and distributed data sources.
This section describes how to do this where the motivating example is the creation of a hypothetical learning object in an educational digital library, such as the NSDL. The digital object created in this example combines three frog images from the NSDL collection and some locally-managed text.

To get started follow the same procedure as illustrated in Figure 3, this time entering Example 2 as the Label and demo:200 as the custom PID. As in Example 1, select the Datastreams tab and then enter the information as shown in Figure 9.

Figure 9 - Adding a datastream with type Redirect
You will enter the datastream identifier of IMAGE1, a label for this datastream, and then information about the content. The content is of MIME type image/gif. You should select the Control Group of Redirect, and then enter a URL that specifies the Location of the image file, specifically:
http://www.frogsonice.com/froggy/images/toads.gif
A few notes on the contents of this dialog:
• Pertaining to the selection of a Control Group, you have two choices if you want the datastream to point to content that resides outside the Fedora repository (External Referenced Content and Redirect). In this case we chose Redirect . To review, the meaning of the two options for mapping to external content are:
o External Referenced Content is useful when you want Fedora to mediate access to the datastream, for example when you want to hide the source URL from the user. Fedora mediates access to these datastreams, meaning that the content is streamed through the Fedora server.
o Redirect. makes use of a simple HTTP redirect to provide the content. This is useful when there are relative hyperlinks in the external content, but reveals the source URL to the user.
• Make sure that the MIME Type choice matches that of the content offered by the external source, in this case image/gif.
In the same manner, you can now proceed to add the two other datastreams with locations: http://www.werc.usgs.gov/fieldguide/images/hycafr.jpg and http://www.aquariumofpacific.org/images/olc/treefrog600.jpg
You should respectively identify these datastreams as IMAGE2 and IMAGE3. (Note that if these sample URLs are no longer active, you can enter other URLs pointing to jpeg images to complete this tutorial exercise.)
Finally, add another datastream labeled MyText (containing some descriptive text about the images), with MIME Type text/html. Assign this datastream a Control Group of Managed Content indicating that the content will be imported and stored permanently in the Fedora repository. Import the content from the following location:
FEDORA_HOME/userdocs/tutorials/2/example2/mytext.html.
The resulting datastream window should now look like that shown in Figure 10.


Figure 10 - Example 2 datastream display
You're done! Figure 11 illustrates the role of the redirected datastream at the time of digital object access via the Fedora REST-based interface (API-A-LITE). You can see this by going to the digital object profile page at: http://localhost:8080/fedora/get/demo:200
You can access the datastreams for this digital object by viewing the item linked to from the object profile page. Then, select the link for one of the redirected datastreams. Fedora will redirect your browser to the location of the datastream content, without streaming the content through the Fedora repository server.


Figure 11 - Example digital object and redirected datastream

...