Ejemplo n.º 1
0
 public List<ItemMasterRow> SearchWizFolioCollection(string terms, int start, int count)
 {
     List<ItemMasterRow> listItems = null;
     try
     {
         string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=wizfoliosearch&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication=" + Authentication + "&terms=" + HttpUtility.UrlEncode(terms) + "&start=" + start + "&count=" + count;
         CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
         JavaScriptSerializer js = new JavaScriptSerializer();
         listItems = js.Deserialize<List<ItemMasterRow>>(req.GetResponse());
     }
     catch (Exception ex)
     {
         this.log.WriteLine(LogType.Error, "User::SearchWizFolioCollection", ex.ToString());
     }
     return listItems;
 }
Ejemplo n.º 2
0
 private void refreshCitedItem()
 {
     try
     {
         List<string> user_servers = new List<string>();
         List<string> user_ids = new List<string>();
         if (rci.UserList.Count > 0)
         {
             Dictionary<int, User>.KeyCollection keycoll = rci.UserList.Keys;
             foreach (int key in keycoll)
             {
                 user_ids.Add(rci.UserList[key].UserID + "");
             }
         }
         JavaScriptSerializer sr = new JavaScriptSerializer();
         //string strRequestURL = Properties.Settings.Default.URL_ROOTSERVER.Replace("http://", "https://") + Properties.Settings.Default.URI_ROOTDATAHANDLER + "?op=getusersserveraddress&userlist=" + sr.Serialize(user_ids);
         string strRequestURL = Properties.Settings.Default.URL_ROOTSERVER + Properties.Settings.Default.URI_ROOTDATAHANDLER + "?op=getusersserveraddress&userlist=" + sr.Serialize(user_ids);
         CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
         user_servers = sr.Deserialize<List<string>>(Regex.Replace(req.GetResponse(), @"^\(|\)$", ""));
         for (int i = 0; i < user_ids.Count; i++)
         {
             rci.UserList[int.Parse(user_ids[i])].ServerAddress = user_servers[i];
         }
         listMasterRefItemIDs = new List<int>();
         itemDownloader(0);
         quarantineReferenceList();
     }
     catch (Exception ex)
     {
         log.WriteLine(LogType.Error, "DocumentFormatter::refreshCitedItem", ex.ToString());
     }
 }
Ejemplo n.º 3
0
 public CitationStyle LoadStyle(StyleOwner owner, string name)
 {
     string type = (owner == StyleOwner.Public) ? "official" : "user";
     CitationStyle style = new CitationStyle();
     string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=style&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication=" + Authentication + "&type=" + type + "&name=" + name;
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     JavaScriptSerializer js = new JavaScriptSerializer();
     style = js.Deserialize<CitationStyle>(req.GetResponse());
     return style;
 }
Ejemplo n.º 4
0
 public List<string> LoadUserCitationStyleNames()
 {
     List<string> listStyles = new List<string>();
     try
     {
         string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=userstylenames&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication=" + Authentication;
         CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
         JavaScriptSerializer js = new JavaScriptSerializer();
         listStyles = js.Deserialize<List<string>>(req.GetResponse());
     }
     catch(Exception ex)
     {
         this.log.WriteLine(LogType.Error, "User::LoadUserCitationStyleNames", ex.ToString());
     }
     return listStyles;
 }
Ejemplo n.º 5
0
 public IEnumerable<Folder> LoadFolders()
 {
     IEnumerable<Folder> enumFolders = null;
     try
     {
         List<Folder> listFolders = new List<Folder>();
         string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=ownfolder&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication="+Authentication;
         CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
         JavaScriptSerializer js = new JavaScriptSerializer();
         listFolders = js.Deserialize<List<Folder>>(req.GetResponse());
         enumFolders = listFolders.OrderBy(Folder => Folder.Name);
     }
     catch(Exception ex)
     {
         this.log.WriteLine(LogType.Error, "User::LoadFolders", ex.ToString());
     }
     return enumFolders;
 }
Ejemplo n.º 6
0
 public List<ItemMasterRow> LoadItemsInRange(int iFolderID, int iStart, int iCount)
 {
     List<ItemMasterRow> listItems = new List<ItemMasterRow>();
     string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=itemsinrange&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication=" + Authentication + "&folderid=" + iFolderID +"&start=" + iStart + "&count=" + iCount;
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     JavaScriptSerializer js = new JavaScriptSerializer();
     listItems = js.Deserialize<List<ItemMasterRow>>(req.GetResponse());
     return listItems;
 }
Ejemplo n.º 7
0
 public List<ItemMasterRow> LoadColleagueItemsInRange(string serveraddress, int userid, string folderid, int start, int count)
 {
     List<ItemMasterRow> listItems = new List<ItemMasterRow>();
     string strRequestURL = "http://" + serveraddress + "/" + Properties.Settings.Default.URI_LOCALSHARESERVICE + "?op=getitemsbyfolder&targetid=" + userid + "&authentication=" + Authentication + "&folderid=" + folderid + "&from=" + start + "&count=" + count + "&sortorder=0&direction=0&filterfield=2&filterby=&noabstract=false";
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     JavaScriptSerializer js = new JavaScriptSerializer();
     listItems = js.Deserialize<List<ItemMasterRow>>(Regex.Replace(req.GetResponse(), @"^\(|\)$", ""));
     return listItems;
 }
Ejemplo n.º 8
0
 public IEnumerable<Colleague> LoadColleagues()
 {
     IEnumerable<Colleague> enumColleagues = null;
     //string strRequestURL = Properties.Settings.Default.URL_ROOTSERVER.Replace("http://", "https://") + Properties.Settings.Default.URI_ROOTDATAHANDLER + "?op=getallcolleagues&userid=" + UserID;
     string strRequestURL = Properties.Settings.Default.URL_ROOTSERVER + Properties.Settings.Default.URI_ROOTDATAHANDLER + "?op=getallcolleagues&userid=" + UserID;
     List<Colleague> listColleagues = new List<Colleague>();
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     JavaScriptSerializer js = new JavaScriptSerializer();
     listColleagues = js.Deserialize<List<Colleague>>(Regex.Replace(req.GetResponse(), @"^\(|\)$", ""));
     enumColleagues = listColleagues.OrderBy(Colleague => Colleague.ForeName);
     return enumColleagues;
 }
Ejemplo n.º 9
0
 public IEnumerable<Folder> LoadColleagueFolders(string serveraddress, int userid, int parentid)
 {
     IEnumerable<Folder> enumFolders = null;
     try
     {
         List<Folder> listFolders = new List<Folder>();
         string strRequestURL = "http://" + serveraddress + "/" + Properties.Settings.Default.URI_LOCALSHARESERVICE + "?op=getsharedfoldersalt&targetid=" + userid + "&authentication=" + Authentication + "&parentid=" + parentid;
         CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
         JavaScriptSerializer js = new JavaScriptSerializer();
         listFolders = js.Deserialize<List<Folder>>(Regex.Replace(req.GetResponse(), @"^\(|\)$", ""));
         enumFolders = listFolders.OrderBy(Folder => Folder.Name);
     }
     catch (Exception ex)
     {
         this.log.WriteLine(LogType.Error, "User::LoadColleagueFolders", ex.ToString());
     }
     return enumFolders;
 }
Ejemplo n.º 10
0
 public List<ItemMasterRow> LoadColleagueItems(string serveraddress, int userid, string folderid)
 {
     List<ItemMasterRow> listItems = new List<ItemMasterRow>();
     string strRequestURL = "http://" + serveraddress + "/" + Properties.Settings.Default.URI_LOCALSHARESERVICE + "?op=getitemsbyfolderalt&targetid=" + userid + "&authentication=" + Authentication + "&folderid=" + folderid;
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     JavaScriptSerializer js = new JavaScriptSerializer();
     listItems = js.Deserialize<List<ItemMasterRow>>(Regex.Replace(req.GetResponse(), @"^\(|\)$", ""));
     return listItems;
 }
Ejemplo n.º 11
0
 public int GetItemCount(int iFolderID)
 {
     int count = 0;
     string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=itemscount&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication=" + Authentication + "&folderid=" + iFolderID;
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     JavaScriptSerializer js = new JavaScriptSerializer();
     count = int.Parse(req.GetResponse());
     return count;
 }
Ejemplo n.º 12
0
 public ItemMasterRow GetItem(string serveraddress, string userid, int itemid, string accesscode)
 {
     ItemMasterRow item = null;
     if(Globals.ThisAddIn.GetItem(ref item, itemid))
     {
         return item;
     }
     try
     {
         string strRequestURL = "http://" + serveraddress + "/" + Properties.Settings.Default.URI_LOCALSHARESERVICE + "?op=getitem&targetid=" + userid + "&itemid=" + itemid + "&accesscode=" + accesscode + "&authentication=" + Authentication;
         CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
         JavaScriptSerializer js = new JavaScriptSerializer();
         item = js.Deserialize<ItemMasterRow>(Regex.Replace(req.GetResponse(), @"^\(|\)$", ""));
     }
     catch (Exception ex)
     {
         this.log.WriteLine(LogType.Error, "User::LoadItems", ex.ToString());
     }
     return item;
 }
Ejemplo n.º 13
0
 public int GetColleagueItemCount(string serveraddress, int userid, string folderid)
 {
     Dictionary<string, object> data = new Dictionary<string, object>();
     string strRequestURL = "http://" + serveraddress + "/" + Properties.Settings.Default.URI_LOCALSHARESERVICE + "?op=getfolderinfo&targetid=" + userid + "&authentication=" + Authentication + "&folderid=" + folderid + "&sortorder=0&direction=0&filterfield=2&filterby=";
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     JavaScriptSerializer js = new JavaScriptSerializer();
     string serial = Regex.Replace(req.GetResponse(), @"^\(""|""\)$", "");
     data = js.Deserialize<Dictionary<string, object>>(Regex.Replace(serial, @"\\", ""));
     if (data.ContainsKey("Count"))
         return (int)data["Count"];
     else
         return 0;
 }
Ejemplo n.º 14
0
 public bool CheckStyleAccess(string name)
 {
     string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=styleaccess&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication=" + Authentication + "&name=" + name;
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL);
     return (req.GetResponse() == "1");
 }
Ejemplo n.º 15
0
 public List<ItemMasterRow> AddItems(object listItems)
 {
     string strRequestURL = ServerAddress + Properties.Settings.Default.URI_LOCALDATASERVICE + "?op=additems&from=" + DeviceTypes.MSWordWin.ToString() + "&authentication=" + Authentication;
     JavaScriptSerializer js = new JavaScriptSerializer();
     string strPostData = "items=" + HttpUtility.UrlEncode(js.Serialize(listItems));
     CustomHttpRequest req = new CustomHttpRequest(strRequestURL, strPostData);
     List<ItemMasterRow> items = new List<ItemMasterRow>();
     items = js.Deserialize<List<ItemMasterRow>>(req.GetResponse());
     return items;
 }