/// <summary>
        /// Creates the subfields.
        /// </summary>
        /// <param name="sourceField">
        /// The source field.
        /// </param>
        /// <param name="action">
        /// The callback action.
        /// </param>
        public void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
        {
            var owner = sourceField.Connector.Owner;
            var subfields = new List<SourceField>
                                {
                                    CreateField(owner, "File Name", ReflectionHelper.GetProperty<IFileProcess>(f => f.OriginalFileName)),
                                    CreateField(owner, "Is Checked Out", ReflectionHelper.GetProperty<IFileProcess>(f => f.Locked)),
                                    CreateField(owner, "Checked Out By", ReflectionHelper.GetProperty<IFileProcess>(f => f.LockedByAccountName)),
                                    CreateField(owner, "Check Out Date", ReflectionHelper.GetProperty<IFileProcess>(f => f.LockedDate))
                                };

            action(sourceField, subfields);
        }
        /// <summary>
        /// Begin subfields loading.
        /// </summary>
        /// <param name="sourceField">The source field.</param>
        /// <param name="action">The callback action.</param>
        public void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
        {
            var owner = sourceField.Connector.Owner;
            var fields = new List<SourceField>
                                 {
                                     new SourceField(owner)
                                         {
                                             DataType = NodeDataType.String,
                                             Name = "Alphanumeric Value",
                                             ConnectorOut = { DataType = NodeDataType.String, Name = "Alphanumeric Value" },
                                             SetName = SetName,
                                             SystemName = "SampleAlphanumeric",
                                             InnerName = "SampleAlphanumeric"
                                         },
                                     new SourceField(owner)
                                         {
                                             DataType = NodeDataType.Boolean,
                                             Name = "Boolean Value",
                                             ConnectorOut = { DataType = NodeDataType.Boolean, Name = "Boolean Value" },
                                             SetName = SetName,
                                             SystemName = "SampleBoolean",
                                             InnerName = "SampleBoolean"
                                         },
                                     new SourceField(owner)
                                         {
                                             DataType = NodeDataType.Double,
                                             Name = "Numeric Value",
                                             ConnectorOut = { DataType = NodeDataType.Double, Name = "Numeric Value" },
                                             SetName = SetName,
                                             SystemName = "SampleNumeric",
                                             InnerName = "SampleNumeric"
                                         }
                                 };

            action(sourceField, fields);
        }
Example #3
0
 /// <summary>
 /// 현재 개체가 동일한 형식의 다른 개체와 같은지 여부를 나타냅니다.
 /// </summary>
 /// <returns>
 /// 현재 개체가 <paramref name="other"/> 매개 변수와 같으면 true이고, 그렇지 않으면 false입니다.
 /// </returns>
 /// <param name="other">이 개체와 비교할 개체입니다.</param>
 public bool Equals(IExpressionField other)
 {
     return((other != null) && GetHashCode().Equals(other.GetHashCode()));
 }
            /// <summary>
            /// Begins the load.
            /// </summary>
            /// <param name="sourceField">The source field.</param>
            /// <param name="action">The action.</param>
            public override void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                DisplaylistFieldInfo.GetDisplaylistFieldInfo(
                    _fieldId, (crs, cre) =>
                        {
                            if (cre.Error != null)
                            {
                                action(sourceField, Enumerable.Empty<IExpressionField>());
                                return;
                            }

                            BeginLoadProcessFields(cre.Object.CrossRefProcessId, sourceField, action);
                        });
            }
            /// <summary>
            /// Begins the load process fields.
            /// </summary>
            /// <param name="publishedProcessId">The published process identifier.</param>
            /// <param name="sourceField">The source field.</param>
            /// <param name="action">The action.</param>
            protected async void BeginLoadProcessFields(
                int publishedProcessId, IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                var result = new SourceFieldList();

                try
                {
                    var processRetriever = await PublishedProcessFieldsRetriever.GetPublishedProcessFieldsAsync(publishedProcessId);

                    AddIdFields(processRetriever.Process, result, null, SourceFieldSetNames.Item);
                    AddStateFields(processRetriever.Process, result, null, SourceFieldSetNames.Item);
                    AddVersionFields(processRetriever.Process, result, null, SourceFieldSetNames.Item);

                    foreach (var field in processRetriever.Fields)
                    {
                        result.Fields.Add(CreateSourceField(new ProcessFieldInfoWrapper(field), sourceField.Connector.Owner));
                    }
                }
                catch (DataPortalException)
                {
                }
                finally
                {
                    if (action != null)
                        action(sourceField, result.Fields);
                }
            }
 public void BeginLoad(IExpressionField field, Action<IExpressionField, IEnumerable<IExpressionField>> action)
 {
     action(field, GetSubfields(field.Connector.Owner));
 }
            /// <summary>
            /// Begins the load worker.
            /// </summary>
            /// <param name="sourceField">The source field.</param>
            /// <param name="action">The action.</param>
            /// <param name="processId">The process identifier.</param>
            public void BeginLoadWorker(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action, int processId)
            {
                FieldList.BeginGetFieldList(
                    processId, 
                    (s, e) =>
                {
                    var result = new List<IExpressionField>();

                    foreach (var field in e.Object)
                    {
                        if (field.ColumnType == ColumnTypes.MultiReference)
                        {
                            var sf = new SourceField(sourceField.Connector.Owner)
                            {
                                DataType = NodeDataType.String,
                                Name = field.Name,
                                ConnectorOut = { DataType = NodeDataType.String, Name = field.Name },
                                SetName = SourceFieldSetNames.Item,
                                InnerName = field.SystemName,
                                SystemName = string.Format("{0}.{1}", ((SourceField)sourceField).SystemName, field.SystemName)
                            };
                            result.Add(sf);
                        }
                        else if (field.ColumnType == ColumnTypes.Result)
                        {
                            var sf = new SourceField(sourceField.Connector.Owner)
                            {
                                DataType = NodeDataType.Result,
                                Name = field.Name,
                                ConnectorOut = { DataType = NodeDataType.Result, Name = field.Name },
                                SetName = SourceFieldSetNames.Item,
                                InnerName = field.SystemName,
                                SystemName = string.Format("{0}.{1}", ((SourceField)sourceField).SystemName, field.SystemName)
                            };
                            result.Add(sf);
                        }
                        else
                        {
                            if (field.FieldType.ColumnType != ColumnTypes.Reference)
                            {
                                var dataType = SourceNodeFactory.GetDataType(ExpressionDesignerSystemParametersViewModel.GetType(field.FieldType));
                                var sf = new SourceField(sourceField.Connector.Owner)
                                {
                                    DataType = dataType,
                                    Name = field.Name,
                                    ConnectorOut = { DataType = dataType, Name = field.Name },
                                    SetName = SourceFieldSetNames.Item,
                                    InnerName = field.SystemName,
                                    SystemName = string.Format("{0}.{1}", ((SourceField)sourceField).SystemName, field.SystemName)
                                };
                                result.Add(sf);
                            }
                            else
                            {
                                result.Add(new SourceField(sourceField.Connector.Owner)
                                {
                                    DataType = NodeDataType.CrossReference,
                                    Name = field.Name,
                                    ConnectorOut = { DataType = NodeDataType.CrossReference, Name = field.Name },
                                    SetName = SourceFieldSetNames.Item,
                                    InnerName = field.SystemName,
                                    SystemName = string.Format("{0}.{1}Member", ((SourceField)sourceField).SystemName, field.SystemName),
                                    SubfieldsRetriever = new CrSubfieldsRetriever(field.Id)
                                });
                            }
                        }
                    }

                    action(sourceField, result);
                });
            }
Example #8
0
        //public ExpressionConnector(ConnectorType connectorType, NodeDataType nodeDataType, string name)
        //{
        //    _connectorType = connectorType;
        //    _dataType = nodeDataType;
        //    _name = name;
        //}

        /// <summary>
        /// Initializes a new instance of the <see cref="ExpressionConnector"/> class.
        /// </summary>
        /// <param name="connectorType">Type of the connector.</param>
        /// <param name="expressionField">The expression field.</param>
        /// <exception cref="System.ArgumentNullException">expressionField</exception>
        public ExpressionConnector(ConnectorType connectorType, IExpressionField expressionField)
        {
            if (expressionField == null) throw new ArgumentNullException("expressionField");

            Id = expressionField.Id;
            _connectorType = connectorType;
            _dataType = expressionField.DataType;
            _name = expressionField.Name;
            _field = expressionField;
            _connector = expressionField.Connector;

            if (_connector != null)
            {
                _connector.PropertyChanged += OnConnectorPropertyChanged;
            }
        }
            /// <summary>
            /// Begins the load.
            /// </summary>
            /// <param name="destinationField">The destination field.</param>
            /// <param name="action">The action.</param>
            /// <exception cref="System.ArgumentNullException">action</exception>
            public void BeginLoad(IExpressionField destinationField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                if (action == null) throw new ArgumentNullException("action");

                var fields = new List<DestinationField>();

                foreach (
                    var df in
                        _process.GetAllFields()
                                .Where(f => !IsCalculated(f))
                                .Where(f => CanFilter(f.FieldType))
                                .Select(field => CreateDestinationField(field, destinationField.Connector.Owner))
                                .Where(df => df != null))
                {
                    df.IsKey = false;
                    df.IsKeyEnabled = false;
                    df.IsKeyVisible = true;
                    df.MarkAsKeyWhenConnected = true;

                    fields.Add(df);
                }

                action(destinationField, fields);
            }
            /// <summary>
            /// Begins the load.
            /// </summary>
            /// <param name="sourceField">The source field.</param>
            /// <param name="action">The action.</param>
            public void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                var result = _type.Fields
                    .Where(CanBeSourceField)
                    .Select(subfield => CreateSourceField(subfield, sourceField.Connector.Owner));

                action(sourceField, result);
            }
            /// <summary>
            /// Begins the load.
            /// </summary>
            /// <param name="field">The field.</param>
            /// <param name="action">The action.</param>
            public void BeginLoad(IExpressionField field, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                var dataType = SourceNodeFactory.GetDataType(_type.Type);

                var result = new SourceField(field.Connector.Owner)
                                 {
                                     DataType = dataType,
                                     Name = Constants.ArrayItemGenericFieldName,
                                     ConnectorOut =
                                         {
                                             DataType = dataType,
                                             Name = Constants.ArrayItemGenericFieldName
                                         },
                                     SetName = SourceFieldSetNames.IntegrationServiceSourceItem,
                                     InnerName = string.Empty,
                                     SystemName = Constants.ArrayItemGenericFieldName
                                 };

                action(field, new[] { result });
            }
Example #12
0
 /// <summary>
 /// 현재 개체가 동일한 형식의 다른 개체와 같은지 여부를 나타냅니다.
 /// </summary>
 /// <returns>
 /// 현재 개체가 <paramref name="other"/> 매개 변수와 같으면 true이고, 그렇지 않으면 false입니다.
 /// </returns>
 /// <param name="other">이 개체와 비교할 개체입니다.</param>
 public bool Equals(IExpressionField other) {
     return (other != null) && GetHashCode().Equals(other.GetHashCode());
 }
 /// <summary>
 /// Begins the load.
 /// </summary>
 /// <param name="sourceField">The source field.</param>
 /// <param name="action">The action.</param>
 public void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
 {
     BeginLoadFields(fields => action(sourceField, CreateExpressionFields(fields, sourceField.Connector.Owner)));
 }
            public void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                var result = _type.Fields.Where(_fieldSelector).Select(f => _fieldFactory(f, sourceField.Connector.Owner));

                action(sourceField, result);
            }
Example #15
0
 public void BeginLoad(IExpressionField destinationField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
 {
     var list = new[]
                    {
                        new SourceField(null)
                            {
                                DataType = NodeDataType.Int,
                                Name = "Id",
                                SetName = SourceFieldSetNames.CurrentUserInfo,
                                InnerName = "Id",
                                SystemName = "Utils.CurrentUserRolesList.Id",
                                ConnectorOut = { DataType = NodeDataType.Int, Name = "Id" }
                            },
                        new SourceField(null)
                            {
                                DataType = NodeDataType.String,
                                Name = "Name",
                                SetName = SourceFieldSetNames.CurrentUserInfo,
                                InnerName = "Name",
                                SystemName = "Utils.CurrentUserRolesList.Name",
                                ConnectorOut = { DataType = NodeDataType.String, Name = "Name" }
                            }
                    };
     action(destinationField, list);
 }
            /// <summary>
            /// Begins the load.
            /// </summary>
            /// <param name="destinationField">The destination field.</param>
            /// <param name="action">The action.</param>
            public void BeginLoad(IExpressionField destinationField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                var owner = destinationField.Connector.Owner;
                var nameField = CreateField(Constants.ExpressionDesignerFileNameFieldName, NodeDataType.String, owner);
                var contentField = CreateField(Constants.ExpressionDesignerFileContentFieldName, NodeDataType.ByteArray, owner);
                var locationField = CreateField(Constants.ExpressionDesignerFileLocationFieldName, NodeDataType.String, owner);

                action(destinationField, new[] { nameField, contentField, locationField });
            }
            /// <summary>
            /// Begins the load.
            /// </summary>
            /// <param name="destinationField">The destination field.</param>
            /// <param name="action">The action.</param>
            /// <exception cref="System.ArgumentNullException">
            /// action
            /// or
            /// destinationField
            /// </exception>
            public void BeginLoad(IExpressionField destinationField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                if (action == null) throw new ArgumentNullException("action");
                if (destinationField == null) throw new ArgumentNullException("destinationField");

                var fields = new List<IExpressionField>();
                var owner = destinationField.Connector.Owner;

                // Version Date.
                var dataType = DestinationNodeFactory.GetDataType(typeof(DateTime));
                var df = new DestinationField(owner)
                             {
                                 Name = "Version Date",
                                 SystemName = Constants.VersionDate,
                                 DataType = dataType,
                                 SetName = SourceFieldSetNames.Item,
                                 ConnectorIn = { DataType = dataType, Name = "Version Date" },
                                 IsKeyVisible = true,
                                 IsKeyEnabled = false
                             };

                fields.Add(df);

                // Version Number.
                dataType = DestinationNodeFactory.GetDataType(typeof(string));
                df = new DestinationField(owner)
                         {
                             Name = Constants.VersionNumberName,
                             SystemName = Constants.VersionNumber,
                             DataType = dataType,
                             SetName = SourceFieldSetNames.Item,
                             ConnectorIn = { DataType = dataType, Name = Constants.VersionNumberName, IsNullable = false },
                             IsKeyVisible = true,
                             IsKeyEnabled = false
                         };

                fields.Add(df);

                // Version Master.
                dataType = DestinationNodeFactory.GetDataType(typeof (string));
                df = new DestinationField(owner)
                         {
                             Name = "Version Master",
                             SystemName = Constants.VersionMaster,
                             DataType = dataType,
                             ConnectorIn = { DataType = dataType, Name = "Version Master", IsNullable = false },
                             SubfieldsRetriever = new VersionMasterSubfieldsRetriever(_process),
                             IsKeyVisible = true,
                             IsKeyEnabled = false
                         };

                fields.Add(df);

                action(destinationField, fields);
            }
 public void BeginLoad(IExpressionField destinationField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
 {
     action(destinationField, CreateSampleFields(destinationField.Connector.Owner));
 }
            /// <summary>
            /// Begins the load.
            /// </summary>
            /// <param name="destinationField">The destination field.</param>
            /// <param name="action">The action.</param>
            public async void BeginLoad(IExpressionField destinationField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                ProcessEdit res;
                var fields = new List<DestinationField>();

                try
                {
                    res = await ProcessEdit.GetProcessAsync(new ProcessCriteria(_crossRefProcessId, true));
                }
                catch (Exception)
                {
                    action(destinationField, fields);
                    return;
                }

                var crProcess = res;

                foreach (var df in
                    crProcess.GetAllFields()
                             .Where(IncludeField)
                             .Select(field => CreateDestinationField(field, destinationField.Connector.Owner))
                             .Where(df => df != null))
                {
                    df.IsKey = false;
                    df.IsKeyEnabled = false;
                    df.MarkAsKeyWhenConnected = true;
                    fields.Add(df);
                }

                action(destinationField, fields);
            }
Example #20
0
            public void BeginLoad(IExpressionField field, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                if (field == null) throw new ArgumentNullException("field");
                if (action == null) throw new ArgumentNullException("action");

                var result = new List<IExpressionField>
                {
                    new SourceField(field.Connector.Owner)
                        {
                            DataType = NodeDataType.String, 
                            Name = "Name", 
                            SetName = SourceFieldSetNames.Item, 
                            SystemName = field.Name + ".Name", 
                            ConnectorOut = { DataType = NodeDataType.String, Name = field.Name + ".Name" },
                        },
                    new SourceField(field.Connector.Owner)
                        {
                            DataType = NodeDataType.String, 
                            Name = "Author", 
                            SetName = SourceFieldSetNames.Item, 
                            SystemName = field.Name + ".Author", 
                            ConnectorOut = { DataType = NodeDataType.String, Name = field.Name + ".Author" },
                            SubfieldsRetriever = new CRSubfieldsRetriever()
                        }
                };

                action(field, result);
            }
 /// <summary>
 /// Begins the load.
 /// </summary>
 /// <param name="sourceField">The source field.</param>
 /// <param name="action">The action.</param>
 public virtual void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
 {
 }
 /// <summary>
 /// Begins the load.
 /// </summary>
 /// <param name="field">The field.</param>
 /// <param name="action">The action.</param>
 public abstract void BeginLoad(IExpressionField field, Action<IExpressionField, IEnumerable<IExpressionField>> action);
 /// <summary>
 /// Begins the load.
 /// </summary>
 /// <param name="sourceField">The source field.</param>
 /// <param name="action">The action.</param>
 public override void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
 {
     ChecklistFieldInfo.GetChecklistFieldInfo(
         this.FieldId,
         (crs, cre) =>
             {
                 if (cre.Error == null)
                 {
                     PublishedProcessInfo.BeginGetProcessInfo(
                         cre.Object.CrossRefProcessId,
                         (pps, ppe) =>
                             {
                                 if (ppe.Error == null)
                                     BeginLoadWorker(sourceField, action, ppe.Object.ProcessId);
                             });
                 }
             });
 }
            public void BeginLoad(IExpressionField sourceField, Action<IExpressionField, IEnumerable<IExpressionField>> action)
            {
                var fields = new List<IExpressionField>();

                foreach (var field in GetFields(_type).Where(_fieldFilter))
                {
                    var resultField = _resultFields != null
                        ? _resultFields.FirstOrDefault(f => f.Name == field.Name && f.DeclaringTypeName == field.DeclaringType.Name)
                        : null;

                    fields.Add(_fieldFactory(field, resultField, sourceField.Connector.Owner));
                }

                if (_resultFields != null)
                {
                    foreach (var resultField in _resultFields.Where(f => f.DeclaringTypeName != _type.Name))
                    {
                        var declaringType = _type.DeclaringService.FindTypeByName(resultField.DeclaringTypeName);
                        if (declaringType == null || !_type.IsAssignableFrom(declaringType))
                            continue;

                        var field = GetFields(declaringType).FirstOrDefault(f => f.Name == resultField.Name);
                        if (field == null || !_fieldFilter(field))
                            continue;

                        fields.Add(_fieldFactory(field, resultField, sourceField.Connector.Owner));
                    }
                }

                action(sourceField, fields);
            }