Conference Management Design and implementation documentation
Conference Management
Database: Meetingdb
Data sheet: 1, meeting_info 2, Meeting_join_user (one-to-many relationships)
Menu
1. The meeting I initiated ( Public )
2. meetings to be attended ( Public )
3. Meetings awaiting approval (admin, manager, supervisor)
4. All meeting List (Admin)
Note: Roles are now in accordance with the individual's own design role, later need to change the corresponding role of the platform
To create a meeting: When you create a meeting, insert data from the relevant participants into Meeting_join_user Table
To delete a meeting: When you delete a meeting, The data from the relevant participants are Meeting_join_user Table Delete
Preview The Meeting Details page: View meeting Details
To query the meeting participants list: View a list of meeting participant's information
List with participating conferences:
reply to participation in the meeting: Bounce window reply to participate in the meeting
Conference Flowchart:
Employee: Create meeting (Submit)s---- approval (submit)---- release
Manager, Supervisor: Create a meeting (submit)----- Release
Run:
Employees: (Meetings I initiated, meetings to attend)
Supervisor/Manager: (The meeting I initiated, the meeting to be attended, the meeting to be approved)
Administrator: (I initiated the meeting, the meeting to be attended, the meeting to be approved, the list of all meeting management)
development of technical key points records:
Add Data:
Add data to the C table after saving the action of the operation, or before the action .
when adding data to table A, add data to the C table as well:
(function () {var doc = getcurrentdocument (); var meeting_id=getitemvalueasstring ("meeting_id"); var aa = Doc.getitemvalueasstring ("User_list"); The Form User selection box field if (!aa.equals (") && aa.length () >0) {var docids = Splittext (AA,"; "); var userlist = CreateObject ("Java.util.ArrayList"); for (var i = 0; i < docids.length; i++) {if (docids! = null) {var us Ervo = Getuserbyid (Docids[i]); Userlist.add (Uservo);}} var formprocess = getformprocess (); var process = getdocumentprocess (); var form = Formprocess.doviewbyformname ("Meeting_join_user", Getapplication ()); if (Userlist!=null && userlist.size () >0) {for (var i = 0; i < userlist.size (); i++) {//cyclic condition var Datauser = Userli St.get (i); var itemdoc = Process.donew (Form,getwebuser (), createparamstable ()), Var userid=datauser.getid (), var sql = " SELECT * from Tlk_meeting_join_user where item_meeting_id= ' "+meeting_id; SQL + = "' and item_user_id= '" +userid+ "'"; var existlist = querybysql (sql); if (Existlist!=null && existlist.size () >0) {}else{vAr depts = datauser.getdepartments (); var departmentname = ""; for (var iter = Depts.iterator (); Iter.hasnext ();) {var dept = iter.next ();d epartmentname = Dept.getname ();} Itemdoc.setparent (Doc.getid ()); Itemdoc.setauthor (userid);//itemdoc.setistmp (false); Itemdoc.setapplicationid ( Getapplication ()); Itemdoc.setdomainid (Datauser.getdomainid ()); Itemdoc.addstringitem ("meeting_id", meeting_id); Itemdoc.addstringitem ("user_id", UserID), Itemdoc.addstringitem ("username", datauser.getname ()); Itemdoc.addstringitem ("Tel_phone", Datauser.gettelephone ()); Itemdoc.addstringitem ("department", Departmentname); Itemdoc.addstringitem ("Message", ""), Itemdoc.addstringitem ("status", "Wait"), Itemdoc.adddateitem ("Add_date", Gettoday ());p rocess.docreate (Itemdoc);}}}) ()
Delete data:
when A table deletes data, It also deletes the data to the C table:
(The same principle as when adding data):
(function () {var params = getparameter ("_selects"); if (params!=null && params!= "") {var recordids = Splittext (params, ";"); /Get the selected record group Idvar RecordID = ""; var appid=getapplication ();//Get App Idvar a=new Packages.cn.myapps.core.deploy.application.ejb.ApplicationProcessBean ();//Instantiate Application application processing var avo=a.doview ( AppID);//Get the Software Application object var did=avo.getdatasourceid ();//Get the Idvar of the data source Db=new Packages.cn.myapps.core.dynaform.dts.datasource.ejb.DataSourceProcessBean ();//Application of the instantiated data source processing class Var kk=db.doview (DID) ;//Get Data source object var dbsname=kk.getname ();//Get Data source name var process = new Packages.cn.myapps.core.dynaform.document.ejb.DocumentProcessBean (Getapplication ()); Instantiate the Document object for (Var i=0;i<recordids.length;i++) {var id = recordids[i];//process.doremove (recordids[i]);//According to the document ID, Delete Document object var sql = "Delete from Tlk_meeting_join_user where parent= '" +id+ "'"; Equals (Dbsname)) {deletebydsname (dbsname,sql);}}}) ()
To attend meeting data query:
Data query SQL
(function () { var user = Getwebuser (); var UserID = User.getid (), Var sql= "", if (Null!=userid | |! "". Equals (userid)) { sql = "Select U.item_status, m.* from Tlk_meeting_join_user as U-left joins tlk_meeting_info as M on U . item_meeting_id =m.item_meeting_id where u.item_user_id= ' "+userid+" ' and M.item_meeting_status= ' published ' and M.ITEM_START _time>=now () ";} return SQL;}) ()
View column Jump View (current page)
Query a meeting participant list
(function () {var request = $WEB. Getparamstable (). Gethttprequest ();//Get current Requestvar curr= getcurrentdocument (); var Meetingid=getitemvalueasstring ("meeting_id"); var uid = Getwebuser (). GetId () var url1= "/http" +request.getservername () + ":" +request.getserverport () + Request.getcontextpath (); var view_id= "11e6-10d5-c8907e8b-a931-c7e163d030f2";//view ID, browser HTTP request can see var oldurl = Url1 + "/portal/dynaform/view/displayview.action?_viewid=" +view_id+ "&cleartemp=true&application= 11e6-10c7-cb2f4e2b-a931-c7e163d030f2&meetingid= "+meetingid+" &_resourceid= 11e6-10da-4b00d761-a931-c7e163d030f2 "; var Rtn =" <a style=\ "cursor:pointer;\" href= "" +oldurl+ "' title= ' query attendees ' > <font color= ' Blue ' > Check attendees </font></a> "; return RTN;}) ();
Receive parameters on the view to query related records:
(function () {var request = $WEB. Getparamstable (). Gethttprequest (); var meetingid = Request.getparameter ("Meetingid"); if (Isnotnull (Meetingid)) { request.getsession (). SetAttribute ("Usermeetingid", Meetingid); } else{ meetingid = Request.getsession (). getattribute ("Usermeetingid"); } println ("=======mid==========" +meetingid); var sql= "select * from Tlk_meeting_join_user where item_meeting_id= '" +meetingid+ "'"; return SQL;}) ()
View column Jump form (pop-up window)
Reply to the meeting:
(function () {var doc = getcurrentdocument ();//Current Document object var Meetingid = doc.getitemvalueasstring ("meeting_id");//Gets the row The conference Idvar user = Getwebuser (); var UserID = User.getid ();//Gets the current user's idprintln ("=======m=======" +meetingid);p rintln ("=======u=======" +userid); var docid= "";//Record ID var formid= "11e6-10d2-5c67ecc1-a931-c7e163d030f2";//the corresponding recorded form ID fixed if (meetingid!=null && userid!=null) {var sql = "Select * from Tlk_meeting_join_user where item_meeting_id= '" +meetingid;sql + = "' and item_user_id = ' "+userid+" ' ", var userlist = querybysql (sql);p rintln (" ============= "+userlist.size ()); if (Userlist!=null & & Userlist.size () >0) {//Traversal result set for (var iter1 = Userlist.iterator (); Iter1.hasnext ();) {var itemdoc = Iter1.next (); if (itemdoc!=null) {Docid=itemdoc.getid ();//Gets the ID of the queried document println ("======m======" +itemdoc.getitemvalueasstring (" meeting_id ")); println ("======u======" +itemdoc.getitemvalueasstring ("user_id"));}}}} var subject = "Reply"; var request = $WEB. GetparamstaBLE (). Gethttprequest ();//Get current request var url1= "/http" +request.getservername () + ":" +request.getserverport () + Request.getcontextpath (); var oldurl = url1+ "/portal/dynaform/document/view.action?user_reply=yes&_docid=" +docid+ "&_formid=" +formid ; Oldurl + = "&application=" +getapplication (); Oldurl + = "&isedit=true&signatureexist=false"; var url = "OBPM.dialog.show ({opener:window.parent,title: ' Reply to Meeting ', URL: '" +oldurl+ "', Width:960,height:500,close: function () {}}) "; Return "<a style=\" cursor:pointer;\ "onclick=\" "+url+"; \ "><font color= ' Blue ' >" +subject+ "</font> </a> ";}) ();
form action Jump Template form (meeting Details page) (preview)
View column Jump Template form
(function () {var id= ""; var formid= "" var applicationid= "" var url= "" Var pnama=getitemvalueasstring ("meeting_id"); var sql= "Select ID, Formid, applicationid,domainid from Tlk_meeting_info where item_meeting_id= '" +pnama+ "'"; var querys= Querybysql (SQL); println ("sql****" +sql); if (querys!=null&& querys.size () >0) {var iter = Querys.iterator (); if (iter! = null & amp;& Iter.hasnext ()) {doc = Iter.next (); id = Doc.getid (); Formid=doc.getformid (); applicationid= Doc.getapplicationid ();} var request = $WEB. Getparamstable (). gethttprequest (); URL + = "/http" + request.getservername () + ":" + Request.getserverport () + Request.getcontextpath (); var templateform= "11e6-1259-48d33857-8df4-1fe7f193ff40";// Template Idurl + = "/portal/dynaform/document/view.action?_docid=" +id+ "&_formid=" +formid+ "&_templateForm=" + templateform+ "&application=" +applicationid;} return URL;}) ()
process to determine if a role is allowed to enter the path
determine if a role is allowed to enter a path:(supervisor, manager)
var Rtn = False;var Curdoc = getcurrentdocument (), var webUser = Curdoc.getauthor (), var roles = Webuser.getroles (); if (roles ! = null && roles.size () >0) {for (var iter = Roles.iterator (); Iter.hasnext ();) {var Rolevo = Iter.next (); var role Name = Rolevo.getname (), if ("Supervisor". Equals (roleName) | | " Manager ". Equals (RoleName)) {RTN = True;break;}}} Rtn
determine if a role is allowed to enter a path:(Employee) (the code is almost identical, just return to True/false to adjust)
var Rtn = True;var Curdoc = getcurrentdocument (), var webUser = Curdoc.getauthor (), var roles = Webuser.getroles (); if (roles ! = null && roles.size () >0) {for (var iter = Roles.iterator (); Iter.hasnext ();) {var Rolevo = Iter.next (); var RoleName = Rolevo.getname (), if ("Supervisor". Equals (roleName) | | " Manager ". Equals (RoleName)) {RTN = False;break;}}} Rtn
Path Execution Script: (Change the state of the Database Meeting_status field)
var doc =getcurrentdocument ();d oc.finditem ("Meeting_status"). SetValue ("Pending approval");
var doc =getcurrentdocument ();d oc.finditem ("Meeting_status"). SetValue ("published");
When the Process execution path is published, the message is sent in the station,
var doc =getcurrentdocument ();d oc.finditem ("Meeting_status"). SetValue ("published"); var userids = doc.getitemvalueasstring ("User_list"), var meetingtitle = doc.getitemvalueasstring ("title"), var startTime = doc.getitemvalueasstring ("Start_ var address = doc.getitemvalueasstring ("Address"),//Send message informing attendee var Send_way = doc.getitemvalueasstring ("Send_ "Msgtitle=meetingtitle;var msgcontent=" "+meetingtitle+" meeting, Start Time: "+starttime+" Location: "+address;var Receiverid=userids;var msgdescription= "" var emailpassword= "" Var senderid=doc.getitemvalueasstring ("user_id"); var uid = Getwebuser (). GetId (); println ("======cu=======" +uid) println ("======s=======" +senderid)//Call # include "Autosqllib";d elivermassage (send_ , Msgtitle, Msgcontent, Receiverid,msgdescription,emailpassword, SenderID);/* function format: delivermassage (Manner, Msgtitle, Msgcontent, Receiverid, Msgdescription, Emailpassword, SenderID) function Description: manner: is the sending category "10,20,30"; string type title: is the subject msgcontent: Content Receiverid: Recipient's idmsgdescription: Description Emailpassword: To send a message, the required mailbox password SenderID: The value of the type (can not be passed) (Date type */function delivermassage (manner, title, content, Receiverid, description, Emailpassword, SenderID) {content = description + content; var curuserprocess = getuserprocess (); var curuser = Getwebuser (); var userids = Receiverid; if (Manner.indexof ("ten") >-1) {var msreceiver = CreateObject ("Java.util.ArrayList"); Msreceiver = Getuseridlist (UserIDs); if (msreceiver! = null && msreceiver.size () > 0) {for (var j = 0; J < Msreceiver.siz E (); J + +) {sendMessage (SenderID, Msreceiver.get (j), title, content); }}} if (Manner.indexof ("") >-1) {var docid = getId (); var receiver = ""; var isreply = false; var ismass = true; var Smsuser = CreateObject ("Java.util.ArrayList"); Smsuser = Getuserlist (UserIDs); if (smsuser! = null && smsuser.size ()) {if (smsuser.size () = = 0) { Ismass = false; } for (var i = 0; i < smsuser.size (); i++) {receiver = Receiver + Smsuser.get (i). Gettelephone () + ","; } sendsms (DocId, title, content, receiver, isreply, ismass); }} if (Manner.indexof ("") >-1 && emailpassword) {var Uservo = curuserprocess. Doview (SenderID); var from = Uservo.getemail (); [Email][email protected][/email] var to = ""; [Email][email protected][/email] var smuser = CreateObject ("Java.util.ArrayList"); Smuser = Getuserlist (UserIDs); var i = From.indexof ("@"); var host = from.substring (i + 1); teemlink.com var user = from; [Email][email protected][/email]//var emailpassword=getitemvalue ("Emailpassword"); 123456 var BBC = null; CC var validate = true; var subject = title; var body = content; if (smuser! = null && smuser.size () > 0) {for (var i = 0; i < smuser.size (); i++) { to = Smuser.get (i). Getemail (); SendMail (from, to, subject, body, host, user, Emailpassword, BBC, validate); }}}}//gets the userid combined to return the list collection function Getuseridlist (userids) {var userprocess = getuserprocess ( ); var useridlist = CreateObject ("Java.util.ArrayList"); var userlist = CreateObject ("Java.util.ArrayList"); var doc = GetcurrenTdocument (); var Domainid = Getdomainid (); Useridlist = Userids.split (";"); for (var i = 0; i < useridlist.length; i++) {var user = Userprocess.doview (useridlist[i]); Userlist.add (User.getid ()); } return userlist;} Gets the User Object collection function getuserlist (userids) {var userprocess = getuserprocess (); var useridlist = CreateObject ("Java.util.ArrayList"); var userlist = CreateObject ("Java.util.ArrayList"); var doc = getcurrentdocument (); var Domainid = Getdomainid (); Useridlist = Userids.split (";"); for (var i = 0; i < useridlist.length; i++) {var user = Userprocess.doview (useridlist[i]); var Uservo = Getuserbyid (User.getid ()); Userlist.add (Uservo); } return userlist;}
Design and implementation of MYAPPS Conference Management