public static Subscribe ( Node doclibrary ) : void | ||
doclibrary | Node | |
return | void |
public bool Start() { if (!Configuration.SubscriptionServiceEnabled) { return(false); } // renew subscriptions // 1: go through doclibs with email addresses var doclibs = ContentQuery.Query("+TypeIs:DocumentLibrary +ListEmail:* -ListEmail:\"\""); if (doclibs.Count > 0) { Logger.WriteInformation("Exchange subscription service enabled, running subscriptions (" + doclibs.Count.ToString() + " found)", ExchangeHelper.ExchangeLogCategory); foreach (var doclib in doclibs.Nodes) { try { ExchangeHelper.Subscribe(doclib); } catch (Exception ex) { Logger.WriteException(ex, ExchangeHelper.ExchangeLogCategory); } } } else { Logger.WriteInformation("Exchange subscription service enabled, no subscriptions found.", ExchangeHelper.ExchangeLogCategory); } return(true); }
public bool Start() { if (Settings.GetValue(MailHelper.MAILPROCESSOR_SETTINGS, MailHelper.SETTINGS_MODE, null, MailProcessingMode.ExchangePull) != MailProcessingMode.ExchangePush) { return(false); } // renew subscriptions // 1: go through doclibs with email addresses var doclibs = ContentQuery.Query("+TypeIs:DocumentLibrary +ListEmail:* -ListEmail:\"\""); if (doclibs.Count > 0) { SnLog.WriteInformation(String.Concat("Exchange subscription service enabled, running subscriptions (", doclibs.Count.ToString(), " found)"), categories: ExchangeHelper.ExchangeLogCategory); foreach (var doclib in doclibs.Nodes) { try { ExchangeHelper.Subscribe(doclib); } catch (Exception ex) { SnLog.WriteException(ex, categories: ExchangeHelper.ExchangeLogCategory); } } } else { SnLog.WriteInformation("Exchange subscription service enabled, no subscriptions found.", categories: ExchangeHelper.ExchangeLogCategory); } return(true); }
public static void Subscribe(Node doclibrary) { var service = ExchangeHelper.CreateConnection(doclibrary["ListEmail"] as string); ExchangeHelper.Subscribe(doclibrary, service); }