<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css"> <title>Erlang -- cosProperty Examples</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/cosProperty-1.1.15.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>cosProperty</strong><br><strong>User's Guide</strong><br><small>Version 1.1.15</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Chapters</strong></small></p> <ul class="flipMenu" imagepath="../../../../doc/js/flipmenu"> <li id="no" title="The cosProperty Application" expanded="false">The cosProperty Application<ul> <li><a href="ch_contents.html"> Top of chapter </a></li> <li title="Content Overview"><a href="ch_contents.html#id60869">Content Overview</a></li> <li title="Brief description of the User's Guide"><a href="ch_contents.html#id60791">Brief description of the User's Guide</a></li> </ul> </li> <li id="no" title="Introduction to cosProperty" expanded="false">Introduction to cosProperty<ul> <li><a href="ch_introduction.html"> Top of chapter </a></li> <li title="Overview"><a href="ch_introduction.html#id60732">Overview</a></li> </ul> </li> <li id="no" title="Installing cosProperty" expanded="false">Installing cosProperty<ul> <li><a href="ch-install.html"> Top of chapter </a></li> <li title="Installation Process"><a href="ch-install.html#id61968">Installation Process</a></li> </ul> </li> <li id="loadscrollpos" title="cosProperty Examples" expanded="true">cosProperty Examples<ul> <li><a href="ch_example.html"> Top of chapter </a></li> <li title="A tutorial on how to create a simple service"><a href="ch_example.html#id60752">A tutorial on how to create a simple service</a></li> </ul> </li> </ul> </div></div> <div id="content"> <div class="innertube"> <h1>4 cosProperty Examples</h1> <h3><a name="id60752">4.1 A tutorial on how to create a simple service</a></h3> <h4>Initiate the application</h4> <p>To use the cosProperty application Orber must be running.</p> <h4>How to run everything</h4> <p>Below is a short transcript on how to run cosProperty. </p> <div class="example"><pre> %% Start Mnesia and Orber mnesia:delete_schema([node()]), mnesia:create_schema([node()]), orber:install([node()]), mnesia:start(), orber:start(), %% Install Property Service in the IFR. cosProperty:install(), %% Install Property Service in mnesia. cosProperty:install_db(), %% Now start the application. cosProperty:start(), %% To be able to create Property objects we must first a Factory %% of our preferred type. Fac = cosProperty:start_SetDefFactory(), %% Now we can create a Property object. 'CosPropertyService_PropertySetDefFactory': create_propertysetdef(Fac), %% Now we can create any allowed properties. There are many %% options which are all described further in the documentation. </pre></div> </div> <div class="footer"> <hr> <p>Copyright © 2000-2012 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>