Versions Compared

Key

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

...

Start by selecting File/New/Data Object in the Fedora Admin GUI. Complete the New Object dialog box as shown in Figure 3.
// //

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

Check the box for Use Custom PID and enter demo:100. Note that when you do not assign your own PID, the Fedora repository will create one for you. Select the Create button and you should see a window like that shown in Figure 4. Observe that the PID of the created object (in this case demo:100) is displayed in the title bar.
// //

Section
Wiki Markup
{center}
!worddav319948af5af752845bf27346d9b96313.png|height=598,width=776!
*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=598,width=776!
*Figure 5 -- _Datastream_ Display*
{center}

A few points to note about what you have done so far:

...

Your completed HTML Datastream should look like the dialog as shown in Figure 6 (after you have imported the content).
// //

Section
Wiki Markup
{center}
!worddav7581c768ea49f2bef29a203c98c3ee42.png|height=488688,width=576776!
*Figure 6 -- Adding a New Managed Content _Datastream_*
{center}

A few notes on the contents of this dialog:

...

You're done! Your Datastreams window should now look something like that shown in Figure 7, showing all the Datastreams you have entered in the left-side tabs in the window.
// //

Section
Wiki Markup
{center}
!worddav5b3ad7cd1aaf875e53b397a823159c1d.png|height=488688,width=576776!
*Figure 7 -- Complete _Datastreams_ for Example 1* 
{center}

You will notice as you click through each Datastream that there is a Fedora URL, giving the unique URL to access each Datastream from the Fedora repository. Try going to a browser and entering one of these URLs – the browser will download the Datastream and display it. These URLs can be used by web applications and REST-based web services that access 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 access. You can also try entering the root URL for the entire FDO, which is simply the common prefix of all the Datastream URLs – e.g., http://localhost:8080/fedora/get/demo:100. This accesses the header page for the FDO, which allows you to access its 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).
// //

Section
Wiki Markup
{center}
!worddavac540d3a8081463391d55fd33c857e39.png|height=293493,width=520720! 
*Figure 8 -- Example 1 _Fedora Digital Object_ and _Datastreams_*
{center}

...

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.
// //

Section
Wiki Markup
{center}
!worddav1972a2440b8bde2508fe39ee231c0562.png|height=488,width=576!
*Figure 9 -- Adding a _Datastream_ with Type Redirect* 
{center}

...

  • 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.

    ...

    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.
    // //

    Section
    Wiki Markup
    {center}
    !worddav72ebf8c8b1101637a55c32bf7397d91f.png|height=488688,width=576776!
    *Figure 10 -- Example 2 _Datastream_ Display* 
    {center}
    

    You're done! Figure 11 illustrates the role of the redirected Datastream at the time of FDO access via the Fedora REST-based interface (API-A-LITE). You can see this by going to the FDO profile page at: http://localhost:8080/fedora/get/demo:200

    You can access the Datastreams for this FDO 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.
    // //

    Section
    Wiki Markup
    {center}
    !worddav908cefe719739375d93c8585ac14aa7e.png|height=289489,width=545745! 
    *Figure 11 -- Example _Fedora Digital Object_ and Redirected _Datastream_* 
    {center}
    

    ...

    Figure 12 shows an abstract view of the different components of the Fedora repository architecture that are key to how Fedora produces "disseminations" of FDO object content.
    // //

    Section
    Wiki Markup
    {center}
    !worddavd2a3455b17ad8f4c77993ff48496a668.png|height=197397,width=206406! 
    *Figure 12 -- Abstract View: Key Fedora Components for Producing Disseminations of Content*  
    {center}
    

    ...

    At the end of the day, FDOs make references to SDefs, SDeps and CModels as the way of providing extended access points for FDOs (i.e., dynamic content disseminations.) This is done by adding special relationships between the objects that are stored in the RELS-EXT Datastreams of those objects.
    Figure 13 indicates the relationships that exist between the four object types. Data objects assert that they conform to a particular Content Model using the hasModel relationship. Content Model objects assert they provide the services included in an SDef using the hasService relationship. Service Deployment objects assert the services for which they provide binding information by using the isDeploymentOf relationship, as well as asserting the Content Models for which they provide service bindings using the isContractorOf relationship.
    // //

    Section
    Wiki Markup
    {center}
    !worddav260b00704cd49b2f81797bbe01694fa5.png|height=310510,width=524724!
    *Figure 13 -- Fundamental _CMA_ Relationships* 
    {center}
    

    Figure 14 illustrates the interactions among Fedora and Web services in response to an access request. As indicated, a client makes a request to the Fedora API (with a URL in this case.) The Fedora repository service then determines the content model that is associated with the FDO for which the request is being made. Once it knows the content model, the Fedora repository can discover what SDefs and SDeps are in play for this FDO. Once all of this information is gathered, the Fedora repository can construct a request to the appropriate web service to transform the Datastreams of the target FDO (demo:2). The Fedora repository service invokes a REST-based request to the web service via HTTP, sending along arguments to enable the web service to obtain the required Datastream inputs to fulfill the request. The Fedora repository mediates all invocations with the external web service. When it receives a response from the web service it streams it back to the original calling client. In this case, the response is a transformation based on the raw material of Datastream1 and Datastream2 in the FDO.
    // //

    Section
    Wiki Markup
    {center}
    !worddav16a77ff05b7cb41adf9bea82f2a3933d.png|height=360560,width=565765! 
    *Figure 14 -- Dynamic Dissemination Access*
    {center}
    

    ...

    Select File/Ingest/One Object/From File... in the Fedora Administrator. This will bring up a file selection dialog box as follows:
    // //

    Section
    Wiki Markup
    {center}
    !worddav766c8e413d3860eaec6409d0a6d5b61c.png|height=366566,width=508708!
    {center}
    

    Browse the file system to select the ingest file for the SDef object whose file name is FEDORA_HOME/userdocs/tutorials/2/example3/SDef.xml. Since this ingest file is encoded as FOXML 1.1 select the FOXML 1.1 radio button as below:
    // //

    Section
    Wiki Markup
    {center}
    !worddav8014f2db32df4f6abbd0857010facd8c.png|height=350550,width=350550!
    {center}
    

    This will create the FDO with PID demo:ex3SDef in your repository. This SDef defines one method getContent. This generic method name is intentional – one could imagine this one SDef being used as the basis for several SDeps, each of which produces "content" via a unique transformation of an underlying source. This is one of the advantages of Fedora – providing a common interface despite multiple underlying representations.

    ...

    The resulting Object window should look like that illustrated in Figure 15.
    // //

    Section
    Wiki Markup
    {center}
    !worddav312dbd28306cd3f7f643185f2cb1dc19.png|height=488688,width=576776!
    *Figure 15 -- Example 3 Linking a _Fedora Digital Object_ to a _Content Model_* 
    {center}
    

    You're done! Figure 16 illustrates the role of this FDO and dissemination service in response to a client request. You can go to the FDO header page at http://localhost:8080/fedora/get/demo:300 and select the View Dissemination Index link. Your newly added dynamic dissemination should now appear, alongside the primitive behaviors for the object. To see the results of this dynamic dissemination, you can either select the Run button for getContent in the Method Index display or simply enter the URL http://localhost:8080/fedora/get/demo:300/demo:ex3SDef/getContentImage Removed directly.
    // //

    Section
    Wiki Markup
    {center}
    !worddav99c4468a3a6c6a98dba66f8cd6c30ba1.png|height=353553,width=565765! 
    *Figure 16 -- Example 3 dissemination via _CMA_* 
    {center}
    

    Example 4 – Modifying Example 3 Using a Redirect Datastream

    Example 3 packages the XSL transform Datastream in the same FDO as the source XML Datastream. However, in many cases you will have XSL transform code that you want to share across several XML sources. This section modifies Example 3 to enable this sharing.

    ...

    You're done! The demo:500 FDO should now behave exactly the same as the demo:300 FDO in Example 3. Figure 17 refines Figure 16 (with some labeling removed for clarity) with the new redirect configuration.
    // //

    Section
    Wiki Markup
    {center}
    !worddav3835f918a3adabdc4b86f8fb9fc60c16.png|height=296496,width=508708!  
    *Figure 17 - Dissemination with Redirect _Datastream_*
    {center}
    

    What's next?

    You should now understand the basic mechanisms through which SDefs, SDeps and CModels interact with Data objects to provide a richer dynamic view of the data stored in those objects. The next tutorial (Tutorial 3 – Not yet available) steps you through the process of using the admin client to create a SDef, a SDep, and a CModel from scratch and a Data object that will function with the control objects to provide customized services similar to those described in the last example of this tutorial. To explore the other features of Fedora, refer to the Fedora Repository Documentation. You can also join the Fedora-users mailing list to ask questions and learn from the experience of other Fedora users.