Example #1
0
        public static List<SmartObject> SmartObjectExplorer()
        {
            List<SmartObject> list = new List<SmartObject>();

            SCConnectionStringBuilder hostServerConnectionString = new SCConnectionStringBuilder();
            hostServerConnectionString.Host = "dlx";
            hostServerConnectionString.Port = 5555;
            hostServerConnectionString.IsPrimaryLogin = true;
            hostServerConnectionString.Integrated = true;
            SourceCode.SmartObjects.Management.SmartObjectManagementServer smomgt = new SourceCode.SmartObjects.Management.SmartObjectManagementServer();
            smomgt.CreateConnection();
            try
            {
                smomgt.Connection.Open(hostServerConnectionString.ConnectionString.ToString());

                SourceCode.SmartObjects.Management.SmartObjectExplorer smartobjects = smomgt.GetSmartObjects();

                foreach (SourceCode.SmartObjects.Management.SmartObjectInfo info in smartobjects.SmartObjectList)
                {

                    list.Add(new SmartObject
                    {

                        Description = info.Metadata.Description.ToString(),
                        Name = info.Name,
                        guid = info.Guid,
                        ArtefactType = "SmartObject",
                        displayname = info.Metadata.DisplayName,

                        Version = info.Version.ToString(),
                       Service =  info.ServiceObjectName,
                       ServiceGUID =  info.ServiceInstanceGuid

                    });

                }

            }
            catch (Exception ex)
            {
                list.Add(new SmartObject
                {

                    Description = ex.Message,
                    Name = ex.Source,
                    ArtefactType = "SmartObject Error"

                });
            }
            finally
            {
                smomgt.Connection.Close();
            }
            return list;
        }
Example #2
0
        public static List<SmartObjectProperty> SmartObjectMethodsExplorer(Guid SmartObjectGUID)
        {
            List<SmartObjectProperty> list = new List<SmartObjectProperty>();

            SCConnectionStringBuilder hostServerConnectionString = new SCConnectionStringBuilder();
            hostServerConnectionString.Host = "dlx";
            hostServerConnectionString.Port = 5555;
            hostServerConnectionString.IsPrimaryLogin = true;
            hostServerConnectionString.Integrated = true;
            SourceCode.SmartObjects.Management.SmartObjectManagementServer smomgt = new SourceCode.SmartObjects.Management.SmartObjectManagementServer();
            smomgt.CreateConnection();
            try
            {
                smomgt.Connection.Open(hostServerConnectionString.ConnectionString.ToString());

                foreach (SourceCode.SmartObjects.Management.SmartMethodInfo info in smomgt.GetSmartObjectInfo(smomgt.GetSmartObjectDefinition(SmartObjectGUID).ToString()).Methods)
                {

                    list.Add(new SmartObjectProperty
                    {

                        Description = info.Metadata.Description.ToString(),
                        Name = info.Name,
                        Type = info.Type.ToString(),
                        Transaction = info.Transaction.ToString(),
                        displayname = info.Metadata.DisplayName
                    });

                }

            }
            catch (Exception ex)
            {
                list.Add(new SmartObjectProperty
                {

                    Description = ex.Message,
                    Name = ex.Source,
                    displayname = "SmartObject Property Error"

                });
            }
            finally
            {
                smomgt.Connection.Close();
            }
            return list;
        }