Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 71d40963b505df4524269198e237b3e3 > files > 782

virtuoso-opensource-doc-6.1.4-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head profile="http://internetalchemy.org/2003/02/profile">
  <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" />
  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
  <meta name="dc.title" content="2. Installation Guide" />
  <meta name="dc.subject" content="2. Installation Guide" />
  <meta name="dc.creator" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" />
  <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="parent" href="installation.html" title="Chapter Contents" />
  <link rel="prev" href="installcrweb.html" title="Creating a Web Browser Application to Access RDF Data Using The Virtuoso ADO.Net Provider" />
  <link rel="next" href="installnetriadd.html" title="Creating A Simple .NET RIA Services Application To Display Data&#10;From Virtuoso" />
  <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="doc.css" />
  <link rel="stylesheet" type="text/css" href="/doc/translation.css" />
  <title>2. Installation Guide</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
  <meta name="author" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="copyright" content="OpenLink Software, 1999 - 2009" />
  <meta name="keywords" content="" />
  <meta name="GENERATOR" content="OpenLink XSLT Team" />
 </head>
 <body>
  <div id="header">
    <a name="installsilver" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>2. Installation Guide</h1>
  </div>
  <div id="navbartop">
   <div>
      <a class="link" href="installation.html">Chapter Contents</a> | <a class="link" href="installcrweb.html" title="Creating a Web Browser Application to Access RDF Data Using The Virtuoso ADO.Net Provider">Prev</a> | <a class="link" href="installnetriadd.html" title="Creating A Simple .NET RIA Services Application To Display Data&#10;From Virtuoso">Next</a>
   </div>
  </div>
  <div id="currenttoc">
   <form method="post" action="/doc/adv_search.vspx">
    <div class="search">Keyword Search: <br />
        <input type="text" name="q" /> <input type="submit" name="go" value="Go" />
    </div>
   </form>
   <div>
      <a href="http://www.openlinksw.com/">www.openlinksw.com</a>
   </div>
   <div>
      <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a>
   </div>
    <br />
   <div>
      <a href="index.html">Book Home</a>
   </div>
    <br />
   <div>
      <a href="contents.html">Contents</a>
   </div>
   <div>
      <a href="preface.html">Preface</a>
   </div>
    <br />
   <div class="selected">
      <a href="installation.html">Installation Guide</a>
   </div>
    <br />
   <div>
      <a href="installwin32.html">Virtuoso for Windows</a>
   </div>
   <div>
      <a href="linuxinstall.html">Virtuoso for Linux (Enterprise Edition)</a>
   </div>
   <div>
      <a href="unxinstvirt.html">Virtuoso for Unix (Enterprise Edition)</a>
   </div>
   <div>
      <a href="unixpersonainstall.html">Virtuoso for Unix (Personal Edition)</a>
   </div>
   <div>
      <a href="installmacosx.html">Virtuoso for Mac OS X</a>
   </div>
   <div>
      <a href="installvsgrid.html">Virtuoso ADO.Net Data Grid Form Application</a>
   </div>
   <div>
      <a href="installvsent.html">Using Visual Studio 2008 to Build an Entity Frameworks based Windows Form Application</a>
   </div>
   <div>
      <a href="installusado.html">Using Visual Studio 2008 to Build an ADO.NET Data Services based Application</a>
   </div>
   <div>
      <a href="installwfas.html">Windows Form Application for accessing Virtuoso RDF data via SPASQL using the Virtuoso ADO.Net Provider</a>
   </div>
   <div>
      <a href="installcrweb.html">Creating a Web Browser Application to Access RDF Data Using The Virtuoso ADO.Net Provider</a>
   </div>
   <div class="selected">
      <a href="installsilver.html">Creating a Silverlight Application to consume the service</a>
    <div>
        <a href="#installsilverpreq" title="Pre-requisites">Pre-requisites</a>
        <a href="#installsilvercrser" title="Creating the Application for Silverlight.">Creating the Application for Silverlight.</a>
    </div>
   </div>
   <div>
      <a href="installnetriadd.html">Creating A Simple .NET RIA Services Application To Display Data
From Virtuoso</a>
   </div>
   <div>
      <a href="installnetriavd.html">Creating a .Net RIA Services Application That Will Update Virtuoso Data</a>
   </div>
   <div>
      <a href="clusterstcnf.html">Cluster Installation and Config</a>
   </div>
    <br />
  </div>
  <div id="text">
    <a name="installsilver" />
    <h2>2.11. Creating a Silverlight Application to consume the service</h2>
<p>This section will guide you through creating an application for Silverlight that will consume
the ADO.Net Data Service created in <a href="installcrweb.html">Creating a Web Browser Application to Access RDF Data Using The
Virtuoso ADO.Net Provider.</a>
</p>
      
        <a name="installsilverpreq" />
    <h3>2.11.1. Pre-requisites</h3>
<ol>
    <li>The <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&amp;displaylang=en">Microsoft Silverlight 2 Tools for Visual Studio 2008 SP1</a>
    </li>
    <li>The ADO.Net Data Service created in <a href="installcrweb.html">Creating a Web Browser Application to Access RDF Data Using The
Virtuoso ADO.Net Provider.</a>
    </li>
      <li>The Visual Studio project used to create the ADO.Net Data Service.</li>
    </ol>
    <br />
    
        <a name="installsilvercrser" />
    <h3>2.11.2. Creating the Application for Silverlight.</h3>
<ol>
    <li>Open the ADO.Net Data Service project in <strong>Visual Studio</strong>
    </li>
      <li>In the <strong>Solution Explorer</strong> right click on the RDFWebDemo solution and add a new Project. </li>
      <li>In the <strong>Add New Project</strong> dialog select
<strong>Silverlight Application</strong> and click <strong>OK</strong>. This will open
the <strong>Add Silverlight Application</strong> dialog.
      <table class="figure" border="0" cellpadding="0" cellspacing="0">
      <tr>
       <td>
              <img alt="Add Silverlight Application" src="../images/ui/sparqlwinf32.png" />
       </td>
      </tr>
      <tr>
            <td>Figure: 2.11.2.1. Add Silverlight Application</td>
      </tr>
        </table>
  </li>
      <li>Select <strong>Link this Silverlight Control into an existing Web Site</strong> and make
sure the Web Site selected is RDFWebDemo. Select
<strong>Add a test page that references the application</strong> and <strong>Make it the start
page</strong>.
      <table class="figure" border="0" cellpadding="0" cellspacing="0">
      <tr>
       <td>
              <img alt="Add a test page" src="../images/ui/sparqlwinf33.png" />
       </td>
      </tr>
      <tr>
            <td>Figure: 2.11.2.1. Add a test page</td>
      </tr>
        </table>
  </li>
      <li>In Solution Explorer, select RDFWebDemo, open the Project menu and select Properties. </li>
      <li>Select the <strong>Web</strong> tab, and select <strong>Specific Page</strong>
in the <strong>Start Action</strong> section. Click on the ellipsis and select
SilverlightApplication1TestPage.html as the start page. </li>
    <li>Add a reference to the data service. In the <strong>Solution Explorer</strong> right click
on SilverlightApplication1 and select <strong>Add Service Reference</strong>
    </li>
      <li>In the <strong>Add Service Reference</strong> dialog click the <strong>Discover</strong>
button. Your ADO.Net Data Service should appear in the Address box and the Services box. </li>
      <li>Select the service and click <strong>OK</strong>. ServiceReference1 will now be added to
the ServiceReferences. </li>
      <li>Open page.xaml.cs and add references to the service and to the System.Data.Services.Client
assembly by adding the following using statements at the top of the file:
  <div>
          <pre class="programlisting">
using System.Data.Services.Client;
using SilverlightApplication1.ServiceReference1;
</pre>
        </div>
  </li>
      <li>We need at create a data service context to reference the data from the service and to load data
from the view, sparqlview, exposed by the service. Add the following lines to the page constructor after
InitializeComponent()
<div>
          <pre class="programlisting">
DataServiceContext svcCtx = new DataServiceContext(new Uri(&quot;WebDataService1.svc&quot;, UriKind.Relative));
svcCtx.BeginExecute&lt;sparqlview&gt;(new Uri(&quot;sparqlview&quot;, UriKind.Relative), loadSCallback, svcCtx);
</pre>
        </div>
  </li>
      <li>Add the loadSCallback method to the page class. The method loads the data from sparqlview and
puts it in a List. This List populates a list box on the page.
<div>
          <pre class="programlisting">
private void loadSCallback(IAsyncResult asyncResult)
{   List&lt;Uri&gt; uList = new List&lt;Uri&gt;();
    DataServiceContext ctx = asyncResult.AsyncState as DataServiceContext;
    foreach (sparqlview sv in ctx.EndExecute&lt;sparqlview&gt;(asyncResult))
     uList.Add(new Uri(sv.s));
    listBox1.DataContext = uList;
}
</pre>
        </div>
  </li>
      <li>Add the list box to the page. In the <strong>Solution Explorer</strong> double click on
page.xaml to open it in the editor. Add the following code between the &lt;grid&gt; and &lt;/grid&gt; tags.
<div>
          <pre class="programlisting">
&lt;ListBox x:Name=&quot;listBox1&quot;
    HorizontalAlignment=&quot;Stretch&quot;
    Margin=&quot;25,8,26,-78&quot; Grid.RowSpan=&quot;1&quot;
    Grid.Row=&quot;0&quot; VerticalAlignment=&quot;Stretch&quot;
    ItemsSource=&quot;{Binding Mode=OneWay}&quot; &gt;
    &lt;ListBox.ItemTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;StackPanel x:Name=&quot;DisplayListData&quot;
             Orientation=&quot;Horizontal&quot;
             VerticalAlignment=&quot;Bottom&quot;
             Margin=&quot;5&quot; &gt;
                &lt;HyperlinkButton
                 Content =&quot;{Binding}&quot;
                 NavigateUri=&quot;{Binding}&quot;
                 Margin=&quot;5,0,0,0&quot;
                 VerticalAlignment=&quot;Bottom&quot;
                 HorizontalAlignment=&quot;Left&quot;
                 FontSize=&quot;12&quot;&gt;
                &lt;/HyperlinkButton&gt;
            &lt;/StackPanel&gt;
        &lt;/DataTemplate&gt;
    &lt;/ListBox.ItemTemplate&gt;
&lt;/ListBox&gt;
</pre>
        </div>
  </li>
      <li>Build the Silverlight application and launch without debugging using <strong>Ctrl F5</strong>.
This will launch the browser and open SilverlightApplication1TestPage.aspx.
        <table class="figure" border="0" cellpadding="0" cellspacing="0">
      <tr>
       <td>
              <img alt="SilverlightApplication1TestPage.aspx" src="../images/ui/sparqlwinf34.png" />
       </td>
      </tr>
      <tr>
            <td>Figure: 2.11.2.1. SilverlightApplication1TestPage.aspx</td>
      </tr>
        </table>
  </li>
    </ol>
<p>
Clicking on one of the IRIs will open the page using description.vsp.
</p>
            <table class="figure" border="0" cellpadding="0" cellspacing="0">
    <tr>
     <td>
          <img alt="using description.vsp" src="../images/ui/sparqlwinf35.png" />
     </td>
    </tr>
    <tr>
        <td>Figure: 2.11.2.1. using description.vsp</td>
    </tr>
    </table>
    <br />
<table border="0" width="90%" id="navbarbottom">
    <tr>
        <td align="left" width="33%">
          <a href="installcrweb.html" title="Creating a Web Browser Application to Access RDF Data Using The Virtuoso ADO.Net Provider">Previous</a>
          <br />Creating a Web Browser Application to Access RDF Data Using The Virtuoso ADO.Net Provider</td>
     <td align="center" width="34%">
          <a href="installation.html">Chapter Contents</a>
     </td>
        <td align="right" width="33%">
          <a href="installnetriadd.html" title="Creating A Simple .NET RIA Services Application To Display Data&#10;From Virtuoso">Next</a>
          <br />Creating A Simple .NET RIA Services Application To Display Data
From Virtuoso</td>
    </tr>
    </table>
  </div>
  <div id="footer">
    <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div>
   <div id="validation">
    <a href="http://validator.w3.org/check/referer">
        <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" />
    </a>
    <a href="http://jigsaw.w3.org/css-validator/">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" />
    </a>
   </div>
  </div>
 </body>
</html>