public IEnumerable <IActionDefinition> RetrieveActionDefinitions()
        {
            using (LogMethodExecution logger = new LogMethodExecution("Rest CDK", "RetrieveActionDefinitions"))
            {
                var actionDefinitions = new List <IActionDefinition>();
                var createDef         = new ActionDefinition
                {
                    SupportsInput   = true,
                    KnownActionType = KnownActions.Create,
                    SupportsBulk    = false,
                    FullName        = KnownActions.Create.ToString(),
                    Name            = KnownActions.Create.ToString(),
                    Description     = string.Empty
                };

                actionDefinitions.Add(createDef);

                var queryDef = new ActionDefinition
                {
                    SupportsConstraints      = true,
                    SupportsRelations        = false,
                    SupportsLookupConditions = false,
                    SupportsSequences        = false,
                    KnownActionType          = KnownActions.Query,
                    SupportsBulk             = false,
                    Name        = KnownActions.Query.ToString(),
                    FullName    = KnownActions.Query.ToString(),
                    Description = string.Empty
                };

                actionDefinitions.Add(queryDef);

                return(actionDefinitions);
            }
        }
        /// <summary>
        /// Retrieves a single ObjectDefinition, by name.
        /// </summary>
        /// <param name="objectName"></param>
        /// <param name="shouldGetProperties"></param>
        /// <param name="shouldGetRelations"></param>
        /// <returns></returns>
        public IObjectDefinition RetrieveObjectDefinition(string objectName, bool shouldGetProperties = false, bool shouldGetRelations = false)
        {
            //GoToWebinar doesn't have any entities with parent/child relationships.
            //As such, we're not using the 'shouldGetRelations' parameter

            IObjectDefinition objectDefinition = null;

            using (LogMethodExecution logger = new LogMethodExecution("Rest CDK Example", "RetrieveObjectDefinition"))
            {
                //extract the one type that Scribe Online is asking for:
                if (EntityCollection.Count > 0)
                {
                    foreach (var keyValuePair in EntityCollection)
                    {
                        if (keyValuePair.Key == objectName)
                        {
                            Type entityType = keyValuePair.Value;
                            if (entityType != null)
                            {
                                //hand the type down to our reflection method and create an IObjectDefiniton for Scribe Online
                                objectDefinition = GetObjectDefinition(entityType, shouldGetProperties);
                            }
                        }
                    }
                }
            }

            return(objectDefinition);
        }
 public IEnumerable <IObjectDefinition> RetrieveObjectDefinitions(bool shouldGetProperties = false, bool shouldGetRelations = false)
 {
     using (LogMethodExecution logger = new LogMethodExecution("Rest CDK", "RetrieveObjectDefinitions"))
     {
         foreach (var entityType in EntityCollection)
         {
             yield return(RetrieveObjectDefinition(entityType.Key, shouldGetProperties, shouldGetRelations));
         }
     }
 }
 /// <summary>
 /// Retrieves all ObjectDefinitions that this connector offers.
 /// </summary>
 /// <param name="shouldGetProperties"></param>
 /// <param name="shouldGetRelations"></param>
 /// <returns></returns>
 public IEnumerable <IObjectDefinition> RetrieveObjectDefinitions(bool shouldGetProperties = false, bool shouldGetRelations = false)
 {
     //Loop through our collection of entities and let the other methods create the Metadata as they need it.
     using (LogMethodExecution logger = new LogMethodExecution("Rest CDK Example", "RetrieveObjectDefinitions"))
     {
         foreach (var entityType in EntityCollection)
         {
             yield return(RetrieveObjectDefinition(entityType.Key, shouldGetProperties, shouldGetRelations));
         }
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Retrieve a list of Connector-supported CRUD actions. 
        /// These actions will be reflected in the operations that will be executed from
        /// 'ExecuteOperation' method found in the IConnector implemented class.
        /// Note: Object level action support is defined in RetrieveObjectDefinition and RetrieveObjectDefinitions.
        /// </summary>
        /// <returns>A collection of IActionDefinition that this connect supports</returns>
        public IEnumerable<IActionDefinition> RetrieveActionDefinitions()
        {
            //GoToWebinar only supports Create and Retrieve. So we will hand those back as supported actions.
            //Build and hand back a hard-coded list since this won't change.

            using (LogMethodExecution logger = new LogMethodExecution("Rest CDK Example", "RetrieveActionDefinitions"))
            {
                var actionDefinitions = new List<IActionDefinition>();
                var createDef = new ActionDefinition
                {
                    SupportsInput = true,
                    KnownActionType = KnownActions.Create,
                    SupportsBulk = false,
                    FullName = KnownActions.Create.ToString(),
                    Name = KnownActions.Create.ToString(),
                    Description = string.Empty
                };

                actionDefinitions.Add(createDef);

                var queryDef = new ActionDefinition
                {
                    SupportsConstraints = true,
                    SupportsRelations = false,
                    SupportsLookupConditions = false,
                    SupportsSequences = false,
                    KnownActionType = KnownActions.Query,
                    SupportsBulk = false,
                    Name = KnownActions.Query.ToString(),
                    FullName = KnownActions.Query.ToString(),
                    Description = string.Empty
                };

                actionDefinitions.Add(queryDef);

                return actionDefinitions;
            }
        }
        /// <summary>
        /// Retrieve a list of Connector-supported CRUD actions.
        /// These actions will be reflected in the operations that will be executed from
        /// 'ExecuteOperation' method found in the IConnector implemented class.
        /// Note: Object level action support is defined in RetrieveObjectDefinition and RetrieveObjectDefinitions.
        /// </summary>
        /// <returns>A collection of IActionDefinition that this connect supports</returns>
        public IEnumerable <IActionDefinition> RetrieveActionDefinitions()
        {
            //GoToWebinar only supports Create and Retrieve. So we will hand those back as supported actions.
            //Build and hand back a hard-coded list since this won't change.

            using (LogMethodExecution logger = new LogMethodExecution("Rest CDK Example", "RetrieveActionDefinitions"))
            {
                var actionDefinitions = new List <IActionDefinition>();
                var createDef         = new ActionDefinition
                {
                    SupportsInput   = true,
                    KnownActionType = KnownActions.Create,
                    SupportsBulk    = false,
                    FullName        = KnownActions.Create.ToString(),
                    Name            = KnownActions.Create.ToString(),
                    Description     = string.Empty
                };

                actionDefinitions.Add(createDef);

                var queryDef = new ActionDefinition
                {
                    SupportsConstraints      = true,
                    SupportsRelations        = false,
                    SupportsLookupConditions = false,
                    SupportsSequences        = false,
                    KnownActionType          = KnownActions.Query,
                    SupportsBulk             = false,
                    Name        = KnownActions.Query.ToString(),
                    FullName    = KnownActions.Query.ToString(),
                    Description = string.Empty
                };

                actionDefinitions.Add(queryDef);

                return(actionDefinitions);
            }
        }
        public IObjectDefinition RetrieveObjectDefinition(string objectName, bool shouldGetProperties = false, bool shouldGetRelations = false)
        {
            IObjectDefinition objectDefinition = null;

            using (LogMethodExecution logger = new LogMethodExecution("Rest CDK", "RetrieveObjectDefinition"))
            {
                if (EntityCollection.Count > 0)
                {
                    foreach (var keyValuePair in EntityCollection)
                    {
                        if (keyValuePair.Key == objectName)
                        {
                            Type entityType = keyValuePair.Value;
                            if (entityType != null)
                            {
                                objectDefinition = GetObjectDefinition(entityType, shouldGetProperties);
                            }
                        }
                    }
                }
            }

            return(objectDefinition);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Retrieves all ObjectDefinitions that this connector offers.
 /// </summary>
 /// <param name="shouldGetProperties"></param>
 /// <param name="shouldGetRelations"></param>
 /// <returns></returns>
 public IEnumerable<IObjectDefinition> RetrieveObjectDefinitions(bool shouldGetProperties = false, bool shouldGetRelations = false)
 {
     //Loop through our collection of entities and let the other methods create the Metadata as they need it.
     using (LogMethodExecution logger = new LogMethodExecution("Rest CDK Example", "RetrieveObjectDefinitions"))
     {
         foreach (var entityType in EntityCollection)
         {
             yield return RetrieveObjectDefinition(entityType.Key, shouldGetProperties, shouldGetRelations);
         }
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Retrieves a single ObjectDefinition, by name.
        /// </summary>
        /// <param name="objectName"></param>
        /// <param name="shouldGetProperties"></param>
        /// <param name="shouldGetRelations"></param>
        /// <returns></returns>
        public IObjectDefinition RetrieveObjectDefinition(string objectName, bool shouldGetProperties = false, bool shouldGetRelations = false)
        {
            //GoToWebinar doesn't have any entities with parent/child relationships.
            //As such, we're not using the 'shouldGetRelations' parameter

            IObjectDefinition objectDefinition = null;

            using (LogMethodExecution logger = new LogMethodExecution("Rest CDK Example", "RetrieveObjectDefinition"))
            {

                //extract the one type that Scribe Online is asking for:
                if (EntityCollection.Count > 0)
                {
                    foreach (var keyValuePair in EntityCollection)
                    {
                        if (keyValuePair.Key == objectName)
                        {
                            Type entityType = keyValuePair.Value;
                            if (entityType != null)
                            {
                                //hand the type down to our reflection method and create an IObjectDefiniton for Scribe Online
                                objectDefinition = GetObjectDefinition(entityType, shouldGetProperties);
                            }
                        }
                    }
                }

            }

            return objectDefinition;
        }