Imported Upstream version 1.0.1
[platform/upstream/iotivity.git] / service / resource-container / examples / tizen / ContainerServerApp / src / container.cpp
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************/
20
21 #include "container.h"
22
23 #include "rcmain.h"
24 #include "RCSResourceContainer.h"
25
26 #include <string>
27
28 using namespace std;
29 using namespace OC;
30 using namespace OIC::Service;
31
32 # define checkContainer NULL!=container?true:false
33
34 RCSResourceContainer *container;
35 static bool s_containerFlag = false;
36 static bool s_hueBundleFlag = false;
37 static bool s_bmiBundleFlag = false;
38
39 static Evas_Object *log_entry = NULL;
40 static Evas_Object *listnew = NULL;
41 static Evas_Object *naviframe = NULL;
42
43 // Function to update the log in UI
44 void *updateContainerLog(void *data)
45 {
46     string *log = (string *)data;
47     // Show the log
48     elm_entry_entry_append(log_entry, (*log).c_str());
49     elm_entry_cursor_end_set(log_entry);
50     return NULL;
51 }
52
53 static void list_selected_cb(void *data, Evas_Object *obj, void *event_info)
54 {
55     Elm_Object_Item *it = (Elm_Object_Item *)event_info;
56     elm_list_item_selected_set(it, EINA_FALSE);
57 }
58
59 static void onDestroy()
60 {
61     container = nullptr;
62 }
63
64 static void listBundles(void *data, Evas_Object *obj, void *event_info)
65 {
66     dlog_print(DLOG_INFO, LOG_TAG, "#### listBundles starting");
67     string logMessage = "";
68
69     if (checkContainer)
70     {
71         std::list<unique_ptr<RCSBundleInfo>> bundles = container->listBundles();
72         std::list<unique_ptr<RCSBundleInfo>>::iterator bundleIt;
73         logMessage += "Bundle List Size : " + to_string(bundles.size()) + "<br>";
74
75         for (bundleIt = bundles.begin(); bundleIt != bundles.end(); bundleIt++)
76         {
77             string bundleString((*bundleIt)->getID().c_str());
78             logMessage += "Bundle ID : " + bundleString + "<br>";
79         }
80     }
81     else
82     {
83         logMessage = "NO CONTAINER <br>";
84     }
85
86     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
87     logMessage += "----------------------<br>";
88     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
89                                           &logMessage);
90
91     dlog_print(DLOG_INFO, LOG_TAG, "#### listBundles exit");
92 }
93
94 static void listHueResources(void *data, Evas_Object *obj, void *event_info)
95 {
96     dlog_print(DLOG_INFO, LOG_TAG, "#### listHueResources starting");
97     string logMessage = "";
98
99     if (checkContainer)
100     {
101         std::list<string> resources = container->listBundleResources("oic.bundle.hueSample");
102         std::list<string>::iterator resourceIt;
103         logMessage += "Resource Bundle Size : " + to_string(resources.size()) + "<br>";
104         for (resourceIt = resources.begin(); resourceIt != resources.end(); resourceIt++)
105         {
106             string resourceString((*resourceIt).c_str());
107             logMessage += "Resource URI : " +  resourceString + "<br>";
108         }
109     }
110     else
111     {
112         logMessage = "NO CONTAINER <br>";
113     }
114
115     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
116     logMessage += "----------------------<br>";
117     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
118                                           &logMessage);
119
120     dlog_print(DLOG_INFO, LOG_TAG, "#### listHueResources exit");
121 }
122
123 static void listBMIResources(void *data, Evas_Object *obj, void *event_info)
124 {
125     dlog_print(DLOG_INFO, LOG_TAG, "#### listBMIResources starting");
126     string logMessage = "";
127
128     if (checkContainer)
129     {
130         if (s_bmiBundleFlag)
131         {
132             std::list<string> resources = container->listBundleResources("oic.bundle.BMISensor");
133             std::list<string>::iterator resourceIt;
134             logMessage += "Resource Bundle Size : " + to_string(resources.size()) + "<br>";
135             for (resourceIt = resources.begin(); resourceIt != resources.end(); resourceIt++)
136             {
137                 string resourceString((*resourceIt).c_str());
138                 logMessage += "Resource URI : " +  resourceString + "<br>";
139             }
140         }
141         else
142         {
143             logMessage = "FIRST ADD AND START BMI BUNDLE <br>";
144         }
145
146     }
147     else
148     {
149         logMessage = "NO CONTAINER <br>";
150     }
151
152     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
153     logMessage += "----------------------<br>";
154     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
155                                           &logMessage);
156
157     dlog_print(DLOG_INFO, LOG_TAG, "#### listBMIResources exit");
158 }
159
160 static void addHueResourceConfig(void *data, Evas_Object *obj, void *event_info)
161 {
162     dlog_print(DLOG_INFO, LOG_TAG, "#### addHueResourceConfig starting");
163     string logMessage = "";
164
165     if (checkContainer)
166     {
167         std::map<string, string> resourceParams;
168         resourceParams["resourceType"] = "oic.r.light";
169         resourceParams["address"] = "http://192.168.0.2/api/newdeveloper/lights/1";
170         if (s_hueBundleFlag)
171         {
172             container->addResourceConfig("oic.bundle.hueSample", "", resourceParams);
173             logMessage += "1 Light Resource added<br>";
174             listHueResources(NULL, NULL, NULL);
175         }
176         else
177         {
178             logMessage += "HUE BUNDLE NOT FOUND<br>";
179         }
180     }
181     else
182     {
183         logMessage = "NO CONTAINER <br>";
184     }
185
186     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
187     logMessage += "----------------------<br>";
188     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
189                                           &logMessage);
190
191     dlog_print(DLOG_INFO, LOG_TAG, "#### addHueResourceConfig exit");
192 }
193
194 static void addBMIResourceConfig(void *data, Evas_Object *obj, void *event_info)
195 {
196     dlog_print(DLOG_INFO, LOG_TAG, "#### addBMIResourceConfig starting");
197     string logMessage = "";
198
199     if (checkContainer)
200     {
201         std::map<string, string> resourceParams;
202         resourceParams["resourceType"] = "oic.softsensor";
203         if (s_bmiBundleFlag)
204         {
205             container->addResourceConfig("oic.bundle.BMISensor", "", resourceParams);
206             logMessage += "Resource added<br>";
207             listBMIResources(NULL, NULL, NULL);
208         }
209         else
210         {
211             logMessage += "BMI BUNDLE NOT FOUND<br>";
212         }
213
214     }
215     else
216     {
217         logMessage = "NO CONTAINER <br>";
218     }
219
220     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
221     logMessage += "----------------------<br>";
222     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
223                                           &logMessage);
224
225     dlog_print(DLOG_INFO, LOG_TAG, "#### addBMIResourceConfig exit");
226 }
227
228 static void removeHueResourceConfig(void *data, Evas_Object *obj, void *event_info)
229 {
230     dlog_print(DLOG_INFO, LOG_TAG, "#### removeHueResourceConfig starting");
231     string logMessage = "";
232
233     if (checkContainer)
234     {
235         std::list<string> resources = container->listBundleResources("oic.bundle.hueSample");
236         std::list<string>::iterator resourceIt;
237         if (!resources.size())
238         {
239             logMessage += "No Resource to remove <br>";
240         }
241         else
242         {
243             resourceIt = resources.begin();
244             string resourceString((*resourceIt).c_str());
245             if (s_hueBundleFlag)
246             {
247                 container->removeResourceConfig("oic.bundle.hueSample", resourceString);
248                 logMessage += "Resource removed <br>";
249                 listHueResources(NULL, NULL, NULL);
250             }
251             else
252             {
253                 logMessage += "HUE BUNDLE NOT FOUND<br>";
254             }
255         }
256         listHueResources(NULL, NULL, NULL);
257     }
258     else
259     {
260         logMessage = "NO CONTAINER <br>";
261     }
262
263     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
264     logMessage += "----------------------<br>";
265     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
266                                           &logMessage);
267
268     dlog_print(DLOG_INFO, LOG_TAG, "#### removeHueResourceConfig exit");
269 }
270
271 static void removeBMIResourceConfig(void *data, Evas_Object *obj, void *event_info)
272 {
273     dlog_print(DLOG_INFO, LOG_TAG, "#### removeBMIResourceConfig starting");
274     string logMessage = "";
275
276     if (checkContainer)
277     {
278         std::list<string> resources = container->listBundleResources("oic.bundle.BMISensor");
279         std::list<string>::iterator resourceIt;
280         if (!resources.size())
281         {
282             logMessage += "No Resource to remove <br>";
283         }
284         else
285         {
286             resourceIt = resources.begin();
287             string resourceString((*resourceIt).c_str());
288             if (s_bmiBundleFlag)
289             {
290                 container->removeResourceConfig("oic.bundle.BMISensor", resourceString);
291                 logMessage += "Resource removed <br>";
292                 listBMIResources(NULL, NULL, NULL);
293             }
294             else
295             {
296                 logMessage += "BMI BUNDLE NOT FOUND<br>";
297             }
298         }
299         listHueResources(NULL, NULL, NULL);
300     }
301     else
302     {
303         logMessage = "NO CONTAINER <br>";
304     }
305
306     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
307     logMessage += "----------------------<br>";
308     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
309                                           &logMessage);
310
311     dlog_print(DLOG_INFO, LOG_TAG, "#### removeBMIResourceConfig exit");
312 }
313
314 static void addHueBundle(void *data, Evas_Object *obj, void *event_info)
315 {
316     dlog_print(DLOG_INFO, LOG_TAG, "#### addHUEBundle starting");
317
318     string logMessage = "";
319
320     if (checkContainer)
321     {
322         std::map<string, string> bundleParams;
323         container->addBundle("oic.bundle.hueSample", "",
324                              "/opt/usr/apps/org.tizen.containerserver/lib/libHueBundle.so",
325                              "huesample", bundleParams);
326         logMessage += "HUE Bundle added <br>";
327     }
328     else
329     {
330         logMessage = "NO CONTAINER <br>";
331     }
332
333     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
334     logMessage += "----------------------<br>";
335     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
336                                           &logMessage);
337
338     dlog_print(DLOG_INFO, LOG_TAG, "#### addHUEBundle exit");
339 }
340
341 static void addBMIBundle(void *data, Evas_Object *obj, void *event_info)
342 {
343     dlog_print(DLOG_INFO, LOG_TAG, "#### addBMIBundle starting");
344
345     string logMessage = "";
346
347     if (checkContainer)
348     {
349         std::map<string, string> bundleParams;
350         container->addBundle("oic.bundle.BMISensor", "",
351                              "/opt/usr/apps/org.tizen.containerserver/lib/libBMISensorBundle.so",
352                              "bmisensor", bundleParams);
353         logMessage += "BMI Bundle added <br>";
354     }
355     else
356     {
357         logMessage = "NO CONTAINER <br>";
358     }
359
360     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
361     logMessage += "----------------------<br>";
362     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
363                                           &logMessage);
364
365     dlog_print(DLOG_INFO, LOG_TAG, "#### addBMIBundle exit");
366 }
367
368 static void removeHueBundle(void *data, Evas_Object *obj, void *event_info)
369 {
370     dlog_print(DLOG_INFO, LOG_TAG, "#### removeHUEBundle starting");
371     string logMessage = "";
372
373     if (checkContainer)
374     {
375         container->removeBundle("oic.bundle.hueSample");
376         logMessage += "BMI Bundle removed <br>";
377         s_hueBundleFlag = false;
378     }
379     else
380     {
381         logMessage = "NO CONTAINER <br>";
382     }
383
384     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
385     logMessage += "----------------------<br>";
386     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
387                                           &logMessage);
388
389     dlog_print(DLOG_INFO, LOG_TAG, "#### removeHUEBundle exit");
390 }
391
392 static void removeBMIBundle(void *data, Evas_Object *obj, void *event_info)
393 {
394     dlog_print(DLOG_INFO, LOG_TAG, "#### removeBMIBundle starting");
395     string logMessage = "";
396
397     if (checkContainer)
398     {
399         container->removeBundle("oic.bundle.BMISensor");
400         logMessage += "BMI Bundle removed <br>";
401         s_hueBundleFlag = false;
402     }
403     else
404     {
405         logMessage = "NO CONTAINER <br>";
406     }
407
408     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
409     logMessage += "----------------------<br>";
410     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
411                                           &logMessage);
412
413     dlog_print(DLOG_INFO, LOG_TAG, "#### removeBMIBundle exit");
414 }
415
416 static void startHueBundle(void *data, Evas_Object *obj, void *event_info)
417 {
418     dlog_print(DLOG_INFO, LOG_TAG, "#### startHUEBundle starting");
419     string logMessage = "";
420
421     if (checkContainer)
422     {
423         container->startBundle("oic.bundle.hueSample");
424         logMessage += "HUE Bundle started <br>";
425         s_hueBundleFlag = true;
426     }
427     else
428     {
429         logMessage = "NO CONTAINER <br>";
430     }
431
432     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
433     logMessage += "----------------------<br>";
434     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
435                                           &logMessage);
436
437     dlog_print(DLOG_INFO, LOG_TAG, "#### startHUEBundle exit");
438 }
439
440 static void startBMIBundle(void *data, Evas_Object *obj, void *event_info)
441 {
442     dlog_print(DLOG_INFO, LOG_TAG, "#### startBMIBundle starting");
443     string logMessage = "";
444
445     if (checkContainer)
446     {
447         container->startBundle("oic.bundle.BMISensor");
448         logMessage += "BMI Bundle started <br>";
449         s_bmiBundleFlag = true;
450     }
451     else
452     {
453         logMessage = "NO CONTAINER <br>";
454     }
455
456     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
457     logMessage += "----------------------<br>";
458     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
459                                           &logMessage);
460
461     dlog_print(DLOG_INFO, LOG_TAG, "#### startBMIBundle exit");
462 }
463
464 static void stopHueBundle(void *data, Evas_Object *obj, void *event_info)
465 {
466     dlog_print(DLOG_INFO, LOG_TAG, "#### stopHUEBundle starting");
467     string logMessage = "";
468
469     if (checkContainer)
470     {
471         container->stopBundle("oic.bundle.hueSample");
472         logMessage += "HUE Bundle stopped <br>";
473         s_hueBundleFlag = false;
474     }
475     else
476     {
477         logMessage = "NO CONTAINER <br>";
478     }
479
480     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
481     logMessage += "----------------------<br>";
482     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
483                                           &logMessage);
484
485     dlog_print(DLOG_INFO, LOG_TAG, "#### stopHUEBundle exit");
486 }
487
488 static void stopBMIBundle(void *data, Evas_Object *obj, void *event_info)
489 {
490     dlog_print(DLOG_INFO, LOG_TAG, "#### stopBMIBundle starting");
491     string logMessage = "";
492
493     if (checkContainer)
494     {
495         container->stopBundle("oic.bundle.BMISensor");
496         logMessage += "BMI Bundle stopped <br>";
497         s_bmiBundleFlag = false;
498     }
499     else
500     {
501         logMessage = "NO CONTAINER <br>";
502     }
503
504     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
505     logMessage += "----------------------<br>";
506     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
507                                           &logMessage);
508
509     dlog_print(DLOG_INFO, LOG_TAG, "#### stopBMIBundle exit");
510 }
511
512 void *showContainerAPIs(void *data)
513 {
514     // Add items to the list only if the list is empty
515     const Eina_List *eina_list = elm_list_items_get(listnew);
516     int count = eina_list_count(eina_list);
517     if (!count)
518     {
519         elm_list_item_append(listnew, "1. List Bundles", NULL, NULL,
520                              listBundles, NULL);
521
522         elm_list_item_append(listnew, "2. List Hue resources", NULL, NULL,
523                              listHueResources, NULL);
524
525         elm_list_item_append(listnew, "3. Add HUE Bundle Resource", NULL, NULL,
526                              addHueResourceConfig, NULL);
527
528         elm_list_item_append(listnew, "4. Remove HUE Bundle Resource", NULL, NULL,
529                              removeHueResourceConfig, NULL);
530
531         elm_list_item_append(listnew, "5. Add BMI Bundle", NULL, NULL,
532                              addBMIBundle, NULL);
533
534         elm_list_item_append(listnew, "6. Start BMI Bundle", NULL, NULL,
535                              startBMIBundle, NULL);
536
537         elm_list_item_append(listnew, "7. Remove BMI Bundle", NULL, NULL,
538                              removeBMIBundle, NULL);
539
540         elm_list_item_append(listnew, "8. Stop BMI Bundle", NULL, NULL,
541                              stopBMIBundle, NULL);
542
543         elm_list_go(listnew);
544     }
545     return NULL;
546 }
547
548 // Method to be called when the start container UI Button is selected
549 static void startContainer(void *data, Evas_Object *obj, void *event_info)
550 {
551     std::string xmlDescription =
552         "/opt/usr/apps/org.tizen.containerserver/lib/ResourceContainerConfig.xml";
553     string logMessage = "";
554
555     if (NULL != listnew)
556     {
557         dlog_print(DLOG_INFO, LOG_TAG, "#### Container starting");
558         container = RCSResourceContainer::getInstance();
559
560         if (!s_containerFlag)
561         {
562             container->startContainer(xmlDescription);
563             s_containerFlag = true;
564             s_hueBundleFlag = true;
565             logMessage += "CONTAINER STARTED<br>";
566             logMessage += "HUE BUNDLE STARTED<br>";
567         }
568         else
569         {
570             logMessage += "ALREADY STARTED<br>";
571         }
572     }
573     else
574     {
575         dlog_print(DLOG_ERROR, LOG_TAG, "list is NULL - So unable to add items!!!");
576     }
577
578     // Show the UI list of group APIs
579     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showContainerAPIs, NULL);
580
581     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
582     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
583                                           &logMessage);
584 }
585
586 // Method to be called when the stop container UI Button is selected
587 static void stopContainer(void *data, Evas_Object *obj, void *event_info)
588 {
589     string logMessage = "";
590
591     dlog_print(DLOG_INFO, LOG_TAG, "#### Container stopped");
592
593     if (checkContainer)
594     {
595         s_containerFlag = false;
596         removeHueBundle(NULL, NULL, NULL);
597         stopHueBundle(NULL, NULL, NULL);
598
599         container->stopContainer();
600         logMessage += "CONTAINER STOPPED<br>";
601         container = NULL;
602     }
603     else
604     {
605         logMessage += "NO CONTAINER <br>";
606     }
607
608     dlog_print(DLOG_INFO, LOG_TAG, "#### %s", logMessage.c_str());
609     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
610                                           &logMessage);
611 }
612
613 static Eina_Bool
614 naviframe_pop_cb(void *data, Elm_Object_Item *it)
615 {
616     onDestroy();
617
618     if (NULL != log_entry)
619     {
620         evas_object_del(log_entry);
621         log_entry = NULL;
622     }
623     if (NULL != listnew)
624     {
625         evas_object_del(listnew);
626         listnew = NULL;
627     }
628
629     ui_app_exit();
630     return EINA_TRUE;
631 }
632
633 // Method to set up server screens
634 void containerCreateUI(void *data)
635 {
636     s_containerFlag = false;
637     s_hueBundleFlag = false;
638     Evas_Object *layout;
639     Evas_Object *scroller;
640     Evas_Object *nf = (Evas_Object *)data;
641     Evas_Object *start_button;
642     Evas_Object *stop_button;
643     Elm_Object_Item *nf_it;
644     naviframe = nf;
645
646     // Scroller
647     scroller = elm_scroller_add(nf);
648     elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
649     elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
650
651     // Layout
652     layout = elm_layout_add(nf);
653     elm_layout_file_set(layout, ELM_DEMO_EDJ, "container_layout");
654     evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
655
656     elm_object_content_set(scroller, layout);
657
658     // Button
659     start_button = elm_button_add(layout);
660     elm_object_part_content_set(layout, "start_button", start_button);
661     elm_object_text_set(start_button, "Start Container");
662     evas_object_smart_callback_add(start_button, "clicked", startContainer, NULL);
663
664     // Button
665     stop_button = elm_button_add(layout);
666     elm_object_part_content_set(layout, "stop_button", stop_button);
667     elm_object_text_set(stop_button, "Stop Container");
668     evas_object_smart_callback_add(stop_button, "clicked", stopContainer, NULL);
669
670     // List
671     listnew = elm_list_add(layout);
672     elm_list_mode_set(listnew, ELM_LIST_COMPRESS);
673     evas_object_smart_callback_add(listnew, "selected", list_selected_cb, NULL);
674     elm_object_part_content_set(layout, "listnew", listnew);
675     elm_list_go(listnew);
676
677     // log_entry - text area for log
678     log_entry = elm_entry_add(layout);
679     elm_entry_scrollable_set(log_entry, EINA_TRUE);
680     elm_entry_editable_set(log_entry, EINA_FALSE);
681     elm_object_part_text_set(log_entry, "elm.guide", "Logs will be updated here!!!");
682     evas_object_size_hint_weight_set(log_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
683     evas_object_size_hint_align_set(log_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
684     elm_object_part_content_set(layout, "log", log_entry);
685
686     nf_it = elm_naviframe_item_push(nf, "Container Server", NULL, NULL, scroller, NULL);
687     elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, NULL);
688 }