Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsModMeetingView.cpp
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsModMeetingView.cpp
4  *
5  * Description: WsModMeetingView : a module to render Asterisk running conference call
6  *
7  * Created: 16/01/2013 11:07:15
8  *
9  * Author: Guy Deleeuw : guy.deleeuw@gmail.com
10  *
11  */
12 
13 #include <boost/filesystem.hpp>
14 
15 #include <iostream>
16 #include <dlfcn.h>
17 #include <stdlib.h>
18 #include <stdio.h>
19 #include <fcntl.h>
20 #include <unistd.h>
21 
22 #include <gdcore/bdAsterisk/ConnectionHandler.h>
23 #include <gdcore/bdAsterisk/MeetMeList.h>
24 #include <gdcore/bdAsterisk/MeetMeListAnswer.h>
25 #include <gdcore/bdAsterisk/MeetMeMuteUnMute.h>
26 
27 #include <Wt/WApplication>
28 #include <Wt/WBoostAny>
29 
30 #include <gdwtcore/WAsterisk/gdMeetingView.h>
31 
32 #include <Logger/WsLogger.h>
33 
34 #include "WsModMeetingView.h"
35 
36 using namespace Wt;
37 
38 extern "C" {
40  {
41  void* hndl = dlopen("libwt.so", RTLD_NOW | RTLD_GLOBAL);
42  if ( hndl == NULL ) {
43  fprintf(stderr, "WsModMeetingViewInit : cannot load wt.so shared library! %s\n", dlerror());
44  return;
45  }
46  }
47 }
48 
49 
50 
51 
52 WsMeetingView::WsMeetingView(Wt::WContainerWidget* parent)
53  : gdMeetingView(parent)
54 {
55 }
56 
58 {
59 }
60 
62 {
63  long rowHeight = asNumber(option("rowHeight"));
64  if ( rowHeight > 0 )
65  setRowHeight(rowHeight);
66  std::string sHideHeader = asString(option("hideHeader")).narrow();
67  if ( sHideHeader == "true" )
68  hideHeader(true);
69  hideColumns(asString(option("hideColumns")).narrow());
70  setServer(asString(option("server")).narrow());
71  long lPort = asNumber(option("port"));
72  if ( lPort > 0 )
73  setRowHeight(lPort);
74  setRootNumber(asString(option("rootNumber")).narrow());
75  setUser(asString(option("user")).narrow());
76  setPassword(asString(option("password")).narrow());
77  long lConf = asNumber(option("conferenceID"));
78  if ( lConf > 0 )
79  setConferenceID(lConf);
80  gdMeetingView::load();
81 }
82 
83 
84 
86  : WsModule()
87 {
88  wApp->messageResourceBundle().use(wApp->docRoot() + wApp->resourcesUrl() + "WsModMeetingView/Transl/WsModMeetingView");
89 }
90 
92 {
93 }
94 
95 WWidget* WsModMeetingView::createContentsMenuBar(WContainerWidget* parent) const
96 {
97  return 0;
98 }
99 
100 WWidget* WsModMeetingView::createContents(WContainerWidget* parent) const
101 {
102  WsMeetingView* dirView = new WsMeetingView(parent);
103  dirView->setOptions(options());
104  return dirView;
105 }
106 
107 WsEditorWidget* WsModMeetingView::createEditor(WContainerWidget* parent) const
108 {
109  return 0;
110 }
111 
112 WWidget* WsModMeetingView::createAdmin(WContainerWidget* parent) const
113 {
114  return 0;
115 }
116 
118 {
119  return true;
120 }
121 
122 std::string WsModMeetingView::description() const
123 {
124  return "WsModMeetingView wittyShare module";
125 }
126 
WsEditorWidget * createEditor(Wt::WContainerWidget *parent=0) const
Create the contents for an editor (create a view of options).
Wt::WWidget * createContents(Wt::WContainerWidget *parent=0) const
Create the contents.
bool saveEditor() const
Wt::WWidget * createAdmin(Wt::WContainerWidget *parent=0) const
Create the contents for an administrator.
virtual void load()
std::string description() const
Return the description of the module.
const std::vector< WsOption > & options() const
Get all options.
Definition: WsOption.cpp:70
Wt::WWidget * createContentsMenuBar(Wt::WContainerWidget *parent=0) const
Create the functionalities.
const boost::any & option(const std::string &attribute) const
Get an options value.
Definition: WsOption.cpp:62
WsMeetingView(Wt::WContainerWidget *parent=0)
void setOptions(const std::vector< WsOption > &vOptions)
Set all options.
Definition: WsOption.cpp:57
void WsModMeetingViewInit(void)