public static void emailLogUpdater(ClarifyDataRow record, HistoryItem historyItem, ISchemaCache schemaCache)
        {
            var log = new StringBuilder();

            var from = record.AsString("sender");
            var to = record.AsString("recipient");
            var cclist = record.AsTrimmedString("cc_list");
            var subject = doesEmailLogSubjectExist(schemaCache) ? record.AsTrimmedString("x_subject") : "";
            var message = record.AsString("message");
            var isoDate = record.AsDateTime("creation_time").ToString("s", CultureInfo.InvariantCulture);

            log.Append(HistoryParsers.BEGIN_EMAIL_LOG_HEADER);

            log.AppendLine("{0}: {1}{2}".ToFormat(HistoryBuilderTokens.LOG_EMAIL_DATE, HistoryParsers.BEGIN_ISODATE_HEADER, isoDate));
            const string headerFormat = "{0}: {1}";
            log.AppendLine(headerFormat.ToFormat(HistoryBuilderTokens.LOG_EMAIL_FROM, from));
            log.AppendLine(headerFormat.ToFormat(HistoryBuilderTokens.LOG_EMAIL_TO, to));
            if (cclist.IsNotEmpty()) log.AppendLine(headerFormat.ToFormat(HistoryBuilderTokens.LOG_EMAIL_CC, cclist));
            if (subject.IsNotEmpty()) log.AppendLine(headerFormat.ToFormat(HistoryBuilderTokens.LOG_EMAIL_SUBJECT, subject));

            log.Append(HistoryParsers.END_EMAIL_LOG_HEADER);

            log.AppendLine(message);

            historyItem.Detail = log.ToString();
        }
 public HistoryBuilder(IClarifySession session, ISchemaCache schemaCache, IActEntryTemplatePolicyConfiguration templatePolicyConfiguration, IHistoryItemAssembler historyItemAssembler)
 {
     _session     = session;
     _schemaCache = schemaCache;
     _templatePolicyConfiguration = templatePolicyConfiguration;
     _historyItemAssembler        = historyItemAssembler;
 }
 public HistoryBuilder(IClarifySession session, ISchemaCache schemaCache, IActEntryTemplatePolicyConfiguration templatePolicyConfiguration, IHistoryItemAssembler historyItemAssembler)
 {
     _session = session;
     _schemaCache = schemaCache;
     _templatePolicyConfiguration = templatePolicyConfiguration;
     _historyItemAssembler = historyItemAssembler;
 }
 public SubcaseActEntryTemplatePolicy(HistorySettings settings, ISchemaCache schemaCache, IHistoryOutputParser parser)
     : base(parser)
 {
     _settings = settings;
     _schemaCache = schemaCache;
     _parser = parser;
 }
Пример #5
0
 public HistoryBuilder(IClarifySession session, ISchemaCache schemaCache, IActEntryTemplatePolicyConfiguration templatePolicyConfiguration, IContainer container)
 {
     _session = session;
     _schemaCache = schemaCache;
     _templatePolicyConfiguration = templatePolicyConfiguration;
     _container = container;
 }
Пример #6
0
 public HistoryBuilder(IApplicationClarifySession session, ISchemaCache schemaCache, IActEntryTemplatePolicyConfiguration templatePolicyConfiguration, ILocaleCache localeCache, IContainer container)
 {
     _session     = session;
     _schemaCache = schemaCache;
     _templatePolicyConfiguration = templatePolicyConfiguration;
     _localeCache = localeCache;
     _container   = container;
 }
 public UserSessionStartObserver(WebsiteSettings settings, ISchemaCache schemaCache, IWebApplicationUrl applicationUrl, IClarifySessionUsageReporter sessionUsageReporter, ILogger logger)
 {
     _settings = settings;
     _schemaCache = schemaCache;
     _applicationUrl = applicationUrl;
     _sessionUsageReporter = sessionUsageReporter;
     _logger = logger;
 }
 public NonWorkflowHistoryAssembler(IHistoryMapRegistry models, IServiceLocator services, ICurrentSDKUser user, ISchemaCache schema, IHistoryPrivilegePolicyCache privileges)
 {
     _models     = models;
     _services   = services;
     _user       = user;
     _schema     = schema;
     _privileges = privileges;
 }
 public static void EmailOutActEntry(this ActEntryTemplatePolicyExpression dsl, ISchemaCache schemaCache, IHistoryOutputParser historyOutputParser)
 {
     dsl.ActEntry(3400).DisplayName(HistoryBuilderTokens.LOG_EMAIL_OUT)
         .HtmlizeWith(item => EncodeEmail(historyOutputParser, item))
         .GetRelatedRecord("act_entry2email_log")
         .WithFields(getEmailLogFields(schemaCache))
         .UpdateActivityDTOWith((record, historyItem) => emailLogUpdater(record, historyItem, schemaCache));
 }
 public DovetailGenericModelMapVisitor(IClarifySession session, ISchemaCache schemaCache, IMappingTransformRegistry registry, IServiceLocator services, IMappingVariableExpander expander)
 {
     _session     = session;
     _schemaCache = schemaCache;
     _registry    = registry;
     _services    = services;
     _expander    = expander;
 }
 public UserSessionStartObserver(WebsiteSettings settings, ISchemaCache schemaCache, IWebApplicationUrl applicationUrl, IClarifySessionUsageReporter sessionUsageReporter, ILogger logger)
 {
     _settings             = settings;
     _schemaCache          = schemaCache;
     _applicationUrl       = applicationUrl;
     _sessionUsageReporter = sessionUsageReporter;
     _logger = logger;
 }
Пример #12
0
            public ModelQueryVisitor(ISchemaCache schema, ISchemaMetadataCache metadata, PropertyInfo[] properties, IServiceLocator services)
            {
                _schema     = schema;
                _metadata   = metadata;
                _properties = properties;
                _services   = services;

                Properties = new List <MappedProperty>();
            }
 public WorkflowActEntryTemplatePolicy(ISchemaCache schemaCache, 
     IHistoryOutputParser parser,
     HistorySettings historySettings)
     : base(parser)
 {
     _schemaCache = schemaCache;
     _parser = parser;
     _historySettings = historySettings;
 }
 public WorkflowActEntryTemplatePolicy(ISchemaCache schemaCache,
                                       IHistoryOutputParser parser,
                                       HistorySettings historySettings)
     : base(parser)
 {
     _schemaCache     = schemaCache;
     _parser          = parser;
     _historySettings = historySettings;
 }
Пример #15
0
        public ModelQueryService(ISchemaCache schema, ISchemaMetadataCache metadata, ITypeDescriptorCache typeDescriptor, IServiceLocator services, IModelMapRegistry models)
        {
            _schema         = schema;
            _metadata       = metadata;
            _typeDescriptor = typeDescriptor;
            _services       = services;
            _models         = models;

            _results = new Cache <Type, ModelQueryResult>(query);
        }
 public HistoryBuilder(ISchemaCache schema, IOutputEncoder encoder, IHistoryMapEntryBuilder entries, IClarifyListCache lists, IServiceLocator services, IHistoryMapRegistry models, IListCache listCache)
 {
     _schema    = schema;
     _encoder   = encoder;
     _entries   = entries;
     _lists     = lists;
     _services  = services;
     _models    = models;
     _listCache = listCache;
 }
        public ModelBuilder(ModelMap <MODEL> modelMap, IClarifyListCache listCache, ISchemaCache schemaCache, IOutputEncoder outputEncoder, IMapEntryBuilder mapEntryBuilder)
        {
            _modelMap        = modelMap;
            _mapEntryBuilder = mapEntryBuilder;
            _outputEncoder   = outputEncoder;
            _schemaCache     = schemaCache;
            _listCache       = listCache;

            FieldSortMapOverrides = new FieldSortMap[0];
        }
Пример #18
0
 public SeekerAttachmentPolicy(IAttachmentHistoryItemUpdater attachmentHistoryItemUpdater,
                               IHistoryOutputParser historyOutputParser,
                               ILogger logger,
                               ISchemaCache schemaCache,
                               HistorySettings settings)
     : base(historyOutputParser)
 {
     _attachmentHistoryItemUpdater = attachmentHistoryItemUpdater;
     _logger      = logger;
     _schemaCache = schemaCache;
     _settings    = settings;
 }
        public ModelBuilder(IModelMapRegistry models, ISchemaCache schema, IOutputEncoder encoder, IMapEntryBuilder entries, IClarifyListCache lists, IServiceLocator services, ISchemaMetadataCache metadata)
        {
            _models   = models;
            _schema   = schema;
            _encoder  = encoder;
            _entries  = entries;
            _lists    = lists;
            _services = services;
            _metadata = metadata;

            FieldSortMapOverrides = new FieldSortMap[0];
        }
 public SeekerAttachmentPolicy(IAttachmentHistoryItemUpdater attachmentHistoryItemUpdater, 
     IHistoryOutputParser historyOutputParser,
     ILogger logger,
     ISchemaCache schemaCache,
     HistorySettings settings)
     : base(historyOutputParser)
 {
     _attachmentHistoryItemUpdater = attachmentHistoryItemUpdater;
     _logger = logger;
     _schemaCache = schemaCache;
     _settings = settings;
 }
 public override void beforeAll()
 {
     var mother = new ObjectMother(AdministratorClarifySession);
     var @case = mother.CreateCase();
     _schemaCache = Container.GetInstance<ISchemaCache>();
     _emailLogSetup = new LogCaseEmailSetup(@case.IDNumber)
     {
         Message = "message body",
         CCList = "cc-recipient",
         Recipient = "*****@*****.**"
     };
     _emailLogSetup.AdditionalFields.Append("x_subject", AdditionalFieldType.String, "subject");
     _logEmailObjid = AdministratorClarifySession.CreateSupportToolkit().LogCaseEmail(_emailLogSetup).Objid;
 }
        public override void beforeAll()
        {
            var mother = new ObjectMother(AdministratorClarifySession);
            var @case  = mother.CreateCase();

            _schemaCache   = Container.GetInstance <ISchemaCache>();
            _emailLogSetup = new LogCaseEmailSetup(@case.IDNumber)
            {
                Message   = "message body",
                CCList    = "cc-recipient",
                Recipient = "*****@*****.**"
            };
            _emailLogSetup.AdditionalFields.Append("x_subject", AdditionalFieldType.String, "subject");
            _logEmailObjid = AdministratorClarifySession.CreateSupportToolkit().LogCaseEmail(_emailLogSetup).Objid;
        }
 public ProviderDelegator(
     ISchemaCache schemaCache,
     ISchemaMigrator migrator,
     IObjectSchemaExtractor extractor,
     IEnumerable <ISchemaManager> managers,
     IEnumerable <ISchemaQuerier> queriers,
     IEnumerable <IConnectionFactory> connectors
     )
 {
     this.Migrator    = migrator;
     this.Managers    = managers;
     this.Queriers    = queriers;
     this.Extractor   = extractor;
     this.Connectors  = connectors;
     this.SchemaCache = schemaCache;
 }
Пример #24
0
 public DefaultActEntryResolutionPolicy(ISchemaCache schema)
 {
     _schema = schema;
 }
        public static void NoteActEntry(this ActEntryTemplatePolicyExpression dsl, ISchemaCache schemaCache)
        {
            const string noteField = "description";

            if (schemaCache.IsValidField("notes_log", "x_is_internal"))
            {
                dsl.ActEntry(1700).DisplayName(HistoryBuilderTokens.LOG_NOTE)
                    .GetRelatedRecord("act_entry2notes_log")
                    .WithFields(noteField, "internal", "x_is_internal")
                    .UpdateActivityDTOWith((row, dto) => setInternalLog(row, dto, noteField));
                return;
            }

            dsl.ActEntry(1700).DisplayName(HistoryBuilderTokens.LOG_NOTE)
                .GetRelatedRecord("act_entry2notes_log")
                .WithFields(noteField, "internal")
                .UpdateActivityDTOWith((row, dto) =>
                {
                    dto.Detail = row[noteField].ToString();
                    dto.Internal = row["internal"].ToString();
                });
        }
Пример #26
0
 public ModelInspectorVisitor(ISchemaCache schemaCache, IServiceLocator services)
 {
     _schemaCache = schemaCache;
     _services    = services;
 }
 public CachedSchemaManager(ISchemaCache schemaCache, ISchemaManager impl)
 {
     this.Impl        = impl;
     this.SchemaCache = schemaCache;
 }
 public CachedObjectSchemaExtractor(ISchemaCache schemaCache, IObjectSchemaExtractor impl)
 {
     this.Impl        = impl;
     this.SchemaCache = schemaCache;
 }
Пример #29
0
 public DovetailGenericModelMapVisitor(IClarifySessionCache sessionCache, ISchemaCache schemaCache)
 {
     _sessionCache = sessionCache;
     _schemaCache  = schemaCache;
 }
 public DovetailGenericModelMapVisitor(IClarifySessionCache sessionCache, ISchemaCache schemaCache)
 {
     _sessionCache = sessionCache;
     _schemaCache = schemaCache;
 }
 public UserSessionEndObserver(Func<IApplicationClarifySession> session, ISchemaCache schemaCache, ILogger logger)
 {
     _session = session;
     _schemaCache = schemaCache;
     _logger = logger;
 }
Пример #32
0
 public SubcaseActEntryTemplatePolicy(HistorySettings settings, ISchemaCache schemaCache, IHistoryOutputParser parser) : base(parser)
 {
     _settings    = settings;
     _schemaCache = schemaCache;
     _parser      = parser;
 }
 public ModelInspectorVisitor(ISchemaCache schemaCache)
 {
     _schemaCache = schemaCache;
 }
 private static bool doesEmailLogSubjectExist(ISchemaCache schemaCache)
 {
     return schemaCache.IsValidField("email_log", "x_subject");
 }
Пример #35
0
 public UserSessionEndObserver(Func <IApplicationClarifySession> session, ISchemaCache schemaCache, ILogger logger)
 {
     _session     = session;
     _schemaCache = schemaCache;
     _logger      = logger;
 }
        private static string[] getEmailLogFields(ISchemaCache schemaCache)
        {
            string[] emailLogFields = {"message", "sender", "recipient", "cc_list", "creation_time"};

            if (doesEmailLogSubjectExist(schemaCache))
            {
                emailLogFields = emailLogFields.Concat(new [] {"x_subject"}).ToArray();
            }

            return emailLogFields;
        }