[SAMPLE APP][RESOURCE-MANAGER] Model section added
authorMichal Pawluk <m.pawluk@samsung.com>
Fri, 4 Sep 2015 06:07:19 +0000 (08:07 +0200)
committerMichal Pawluk <m.pawluk@samsung.com>
Mon, 7 Sep 2015 06:31:19 +0000 (08:31 +0200)
Change-Id: Iceba2206597b660bddf6d67a5795def34c2831e5
Signed-off-by: Michal Pawluk <m.pawluk@samsung.com>
org.tizen.sampledescriptions/html/mobile_n/resource_manager_sd_mn.htm

index 89e83a1..2b77282 100644 (file)
@@ -444,7 +444,35 @@ void controller_set_language(viewdata_s *vd, char *locale)
 
 <h3 id="model">Model</h3>
 
+  <p>
+  The responsibility of the application's "Model" module is to operate directly on the Resource Manager API. The additional benefit of this module is that the simplification of the API function calling,
+  error checking and message logging is performed here.
+  <br>
+  Some of the functions implemented within the "Model" module were briefly described in the <a href="#app-init">Application initialization</a> and <a href="#app-finit">Application termination</a> sections
+  (<span style="font-family: Courier New,Courier,monospace">model_init()</span>, <span style="font-family: Courier New,Courier,monospace">model_finit()</span>,
+  <span style="font-family: Courier New,Courier,monospace">__model_init_app_resource_manager()</span>,
+  <span style="font-family: Courier New,Courier,monospace">__model_release_app_resource_manager()</span>. Other functions are briefly described here.
+  </p>
+
+  <p>
+  The path to the resource file pointed by the <span style="font-family: Courier New,Courier,monospace">type</span> and <span style="font-family: Courier New,Courier,monospace">id</span>
+  is obtained with the <span style="font-family: Courier New,Courier,monospace">model_get_app_resource()</span> function.
+  </p>
+
+<pre class="prettyprint">
+bool model_get_app_resource(app_resource_e type, const char *id, char **path)
+{
+&nbsp;&nbsp;&nbsp;*path = NULL;
+
+&nbsp;&nbsp;&nbsp;int ret = app_resource_manager_get(type, id, path);
+&nbsp;&nbsp;&nbsp;if (ret != APP_RESOURCE_ERROR_NONE) {
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;controller_log(DLOG_ERROR, "Function app_resource_manager_get() failed with error %d.", ret);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;
+&nbsp;&nbsp;&nbsp;}
 
+&nbsp;&nbsp;&nbsp;return true;
+}
+</pre>
 
 <script type="text/javascript" src="../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../scripts/showhide.js"></script>