|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <title>Basic Page created based on semantic forms web services</title> |
| 6 | + <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css"/> |
| 7 | + <script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> |
| 8 | + <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> |
| 9 | + |
| 10 | + <!-- bootstrap --> |
| 11 | + <link rel="stylesheet" href="stylesheets/bootstrap.min.css"/> |
| 12 | + <link rel="stylesheet" href="stylesheets/bootstrap-theme.min.css"/> |
| 13 | + <script src="javascripts/bootstrap.min.js" type="text/javascript"></script> |
| 14 | + |
| 15 | + <script src="javascripts/wikipedia.js" type="text/javascript"></script> |
| 16 | + <script src="javascripts/formInteractions.js" type="text/javascript"></script> |
| 17 | + |
| 18 | + <script type="text/javascript"> |
| 19 | + function loadForm(uriToCall, displayDivId) { |
| 20 | + console.log('Calling URL: ' + uriToCall); |
| 21 | + $.ajax({ |
| 22 | + url: uriToCall, |
| 23 | + context: document.body |
| 24 | + }).done(function(data) { |
| 25 | + var formElem = document.getElementById(displayDivId); |
| 26 | + formElem.innerHTML = data; |
| 27 | + }); |
| 28 | + }; |
| 29 | + |
| 30 | + function populateForms() { |
| 31 | + // Display: give URI instance (FOAF profile), and form specification URI (to set fields order, etc) |
| 32 | + loadForm( |
| 33 | + '/form?displayuri=' + encodeURIComponent( 'http://jmvanel.free.fr/jmv.rdf#me' ) + |
| 34 | + '&formuri=' + encodeURIComponent( 'http://deductions-software.com/ontologies/forms#personForm' ), |
| 35 | + 'display' ); |
| 36 | + // Create: give form specification URI, and class of instance to create |
| 37 | + loadForm( |
| 38 | + '/create?uri=' + encodeURIComponent( 'http://xmlns.com/foaf/0.1/Person' ) + |
| 39 | + '&formuri=' + encodeURIComponent( 'http://deductions-software.com/ontologies/forms#personForm' ), |
| 40 | + 'create' ); |
| 41 | + // Edition: give URI instance (FOAF profile), and form specification URI |
| 42 | + loadForm( |
| 43 | + '/form?displayuri=' + encodeURIComponent( 'http://jmvanel.free.fr/jmv.rdf#me' ) + |
| 44 | + '&formuri=' + encodeURIComponent( 'http://deductions-software.com/ontologies/forms#personForm' ) + |
| 45 | + '&Edit=yes', |
| 46 | + 'edit' ); |
| 47 | + }; |
| 48 | + </script> |
| 49 | + </head> |
| 50 | + <body> |
| 51 | + <div class="container"> |
| 52 | + <div class="row"> |
| 53 | + <div class="page-header"> |
| 54 | + <h1>Example of Client Application based on SF</h1> |
| 55 | + </div> |
| 56 | + <p> |
| 57 | + This application will allow you to create Persons, Projects and Ideas. |
| 58 | + </p> |
| 59 | + </div> |
| 60 | + <div class="row"> |
| 61 | + <ul class="nav nav-pills" role="tablist"> |
| 62 | + <li role="presentation"> |
| 63 | + <a href="#display" aria-controls="display" role="tab" data-toggle="tab"> |
| 64 | + Display data about a person |
| 65 | + </a> |
| 66 | + </li> |
| 67 | + <li role="presentation"> |
| 68 | + <a href="#create" aria-controls="create" role="tab" data-toggle="tab"> |
| 69 | + Create a new person ( ! ;) ) |
| 70 | + </a> |
| 71 | + </li> |
| 72 | + <li role="presentation"> |
| 73 | + <a href="#edit" aria-controls="edit" role="tab" data-toggle="tab"> |
| 74 | + Modify data for a person |
| 75 | + </a> |
| 76 | + </li> |
| 77 | + </ul> |
| 78 | + |
| 79 | + <div class="tab-content"> |
| 80 | + <div role="tabpanel" class="tab-pane fade" id="display"></div> |
| 81 | + <div role="tabpanel" class="tab-pane fade" id="create"></div> |
| 82 | + <div role="tabpanel" class="tab-pane fade" id="edit"></div> |
| 83 | + </div> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + <script> |
| 87 | + $('#display a').click(function (e) { |
| 88 | + e.preventDefault() |
| 89 | + $(this).tab('show') |
| 90 | + }); |
| 91 | + |
| 92 | + $('#create a').click(function (e) { |
| 93 | + e.preventDefault() |
| 94 | + $(this).tab('show') |
| 95 | + }); |
| 96 | + |
| 97 | + $('#edit a').click(function (e) { |
| 98 | + e.preventDefault() |
| 99 | + $(this).tab('show') |
| 100 | + }); |
| 101 | + |
| 102 | + $(document).ready(function() { |
| 103 | + populateForms(); |
| 104 | + }); |
| 105 | + </script> |
| 106 | + </body> |
| 107 | +</html> |
0 commit comments