Esempio n. 1
0
        public static void ShowOrderDetails(CommandReport commandReport)
        {
            var ordersApi = new OrdersApi();
            var command   = ordersApi.GetCommand(commandReport.CommandId);

            ShowOrderDetails(ordersApi.GetOrder(command.OrderId));
        }
Esempio n. 2
0
        internal override void CommandOperation()
        {
            PSMAttribute c = Project.TranslateComponent <PSMAttribute>(PSMComponentGuid);
            PIMAttribute oldInterpretation = c.Interpretation as PIMAttribute;

            if (c.UsedGeneralizations.Count > 0)
            {
                oldUsedGeneralizations.AddRange(c.UsedGeneralizations.Select(g => g.ID));
            }
            if (c.Interpretation == null)
            {
                oldPimComponentGuid = Guid.Empty;
            }
            else
            {
                oldPimComponentGuid = c.Interpretation;
            }
            if (PIMComponentGuid != Guid.Empty)
            {
                c.Interpretation = Project.TranslateComponent <PIMAttribute>(PIMComponentGuid);
                c.UsedGeneralizations.Clear();
                foreach (PIMGeneralization g in (c.NearestInterpretedClass().Interpretation as PIMClass).GetGeneralizationPathTo((c.Interpretation as PIMAttribute).PIMClass))
                {
                    c.UsedGeneralizations.Add(g);
                }
            }
            else
            {
                c.Interpretation = null;
                c.UsedGeneralizations.Clear();
            }
            Report = new CommandReport(CommandReports.SET_INTERPRETATION, c, oldInterpretation, c.Interpretation);
        }
Esempio n. 3
0
        internal override void CommandOperation()
        {
            if (SchemaGuid == Guid.Empty)
            {
                SchemaGuid = Guid.NewGuid();
            }
            if (SchemaClassGuid == Guid.Empty)
            {
                SchemaClassGuid = Guid.NewGuid();
            }

            PSMSchema psmSchema;

            if (!Project.UsesVersioning)
            {
                psmSchema = new PSMSchema(Project, SchemaGuid, Project.SingleVersion);
            }
            else
            {
                psmSchema = new PSMSchema(Project, SchemaGuid, Project.TranslateComponent <ProjectVersion>(projectVersionGuid));
            }

            new PSMSchemaClass(Project, SchemaClassGuid, psmSchema);
            Report = new CommandReport(CommandReports.PSM_component_added, psmSchema);
        }
Esempio n. 4
0
        internal override void CommandOperation()
        {
            if (AttributeTypeGuid == Guid.Empty)
            {
                AttributeTypeGuid = Guid.NewGuid();
            }

            AttributeType  a  = new AttributeType(Project, AttributeTypeGuid);
            ProjectVersion pv = Project.TranslateComponent <ProjectVersion>(ProjectVersionGuid);

            a.SetProjectVersion(pv);
            a.BaseType      = BaseTypeGuid != Guid.Empty ? Project.TranslateComponent <AttributeType>(BaseTypeGuid) : null;
            a.Name          = Name;
            a.IsSealed      = IsSealed;
            a.XSDDefinition = XSDDefinition;
            if (PSMSchemaGuid != Guid.Empty)
            {
                PSMSchema psmSchema = Project.TranslateComponent <PSMSchema>(PSMSchemaGuid);
                a.Schema = psmSchema;
                psmSchema.PSMSchemaDefinedTypes.Add(a);
            }
            else
            {
                pv.PIMAttributeTypes.Add(a);
            }

            Report = new CommandReport("'{0}' created. ");
        }
Esempio n. 5
0
        internal override void CommandOperation()
        {
            PSMAssociation a = Project.TranslateComponent <PSMAssociation>(associationGuid);
            PSMSchema      s = Project.TranslateComponent <PSMSchema>(schemaGuid);

            if (a.Parent != null)
            {
                index = a.Parent.ChildPSMAssociations.IndexOf(a);
                a.Parent.ChildPSMAssociations.Remove(a);
                parentGuid = a.Parent;
            }
            //else throw new ExolutioCommandException("Deleted association " + a.ToString() + " had null Parent", this);

            isNonTreeAssociation = a.Child.ParentAssociation != a;

            if (a.Child != null)
            {
                childGuid = a.Child;
                if (!isNonTreeAssociation)
                {
                    a.Child.ParentAssociation = null;
                    s.Roots.Add(a.Child);
                }
            }
            //else throw new ExolutioCommandException("Deleted association " + a.ToString() + " had null Child", this);

            interpretation = a.Interpretation;
            s.PSMAssociations.Remove(a);
            Project.mappingDictionary.Remove(a);
            Report = new CommandReport(CommandReports.PSM_component_deleted, a);
        }
Esempio n. 6
0
        internal override void CommandOperation()
        {
            PSMDiagram psmDiagram = Project.TranslateComponent <PSMDiagram>(DiagramGuid);

            psmDiagram.ProjectVersion.PSMDiagrams.RemoveChecked(psmDiagram);
            Project.mappingDictionary.Remove(DiagramGuid);
            Report = new CommandReport(CommandReports.PSM_diagram_removed, psmDiagram);
        }
Esempio n. 7
0
        internal override void CommandOperation()
        {
            PIMClass c = Project.TranslateComponent <PIMClass>(deletedClassGuid);

            Report = new CommandReport(CommandReports.PIM_component_deleted, c);
            Project.TranslateComponent <PIMSchema>(schemaGuid).PIMClasses.Remove(c);
            Project.mappingDictionary.Remove(deletedClassGuid);
        }
        internal override void CommandOperation()
        {
            Component component = Project.TranslateComponent <Component>(ComponentGuid);
            Diagram   diagram   = Project.TranslateComponent <Diagram>(DiagramGuid);

            diagram.Components.Remove(component);
            Report = new CommandReport(CommandReports.COMPONENT_REMOVED_FROM_DIAGRAM, component, diagram);
        }
Esempio n. 9
0
        internal override void CommandOperation()
        {
            Component component = Project.TranslateComponent <Component>(NamedComponentGuid);

            oldname        = component.Name;
            component.Name = NewName;
            Report         = new CommandReport(CommandReports.COMPONENT_RENAMED, component, oldname, NewName);
        }
Esempio n. 10
0
        internal override void CommandOperation()
        {
            PIMClass pimClass = Project.TranslateComponent <PIMClass>(classGuid);

            oldAbstract       = pimClass.Abstract;
            pimClass.Abstract = newAbstract;
            Report            = new CommandReport(CommandReports.PIM_CLASS_ABSTRACT_CHANGED, pimClass, oldAbstract, pimClass.Abstract);
        }
Esempio n. 11
0
        internal override void CommandOperation()
        {
            PIMClass pimClass = Project.TranslateComponent <PIMClass>(classGuid);

            oldFinal       = pimClass.Final;
            pimClass.Final = newFinal;
            Report         = new CommandReport(CommandReports.PIM_CLASS_FINAL_CHANGED, pimClass, oldFinal, pimClass.Final);
        }
Esempio n. 12
0
        internal override void CommandOperation()
        {
            ExolutioVersionedObject item1 = (ExolutioVersionedObject)Project.TranslateComponent(Item1ID);
            ExolutioVersionedObject item2 = (ExolutioVersionedObject)Project.TranslateComponent(Item2ID);

            Project.VersionManager.UnregisterVersionLink(item1, item2);
            Report = new CommandReport("Version link removed between {0}#{1} and {2}#{3}", item1.Version, item1, item2.Version, item2);
        }
Esempio n. 13
0
        internal override void CommandOperation()
        {
            PSMContentModel cm = Project.TranslateComponent <PSMContentModel>(cmodelGuid);

            oldtype = cm.Type;
            cm.Type = newtype;
            Report  = new CommandReport(CommandReports.PSM_component_deleted, cm);
        }
        internal override void CommandOperation()
        {
            PIMAttribute PIMAttribute = Project.TranslateComponent <PIMAttribute>(attributeGuid);

            oldDefaultValue           = PIMAttribute.DefaultValue;
            PIMAttribute.DefaultValue = newDefaultValue;

            Report = new CommandReport("Default value of '{0}' changed from '{1}' to '{2}'.", PIMAttribute, oldDefaultValue, newDefaultValue);
        }
Esempio n. 15
0
        internal override void CommandOperation()
        {
            PSMClass  c      = Project.TranslateComponent <PSMClass>(deletedClassGuid);
            PSMSchema schema = Project.TranslateComponent <PSMSchema>(schemaGuid);

            rootIndex = schema.Roots.Remove(c);
            schema.PSMClasses.Remove(c);
            Project.mappingDictionary.Remove(deletedClassGuid);
            Report = new CommandReport(CommandReports.PSM_component_deleted, c);
        }
Esempio n. 16
0
        internal override void CommandOperation()
        {
            if (ClassGuid == Guid.Empty)
            {
                ClassGuid = Guid.NewGuid();
            }
            PIMClass pimClass = new PIMClass(Project, ClassGuid, Project.TranslateComponent <PIMSchema>(schemaGuid));

            Report = new CommandReport(CommandReports.PIM_component_added, pimClass);
        }
Esempio n. 17
0
        internal override void CommandOperation()
        {
            if (AttributeGuid == Guid.Empty)
            {
                AttributeGuid = Guid.NewGuid();
            }
            PSMAttribute psmAttribute = new PSMAttribute(Project, AttributeGuid, Project.TranslateComponent <PSMClass>(classGuid), Project.TranslateComponent <PSMSchema>(schemaGuid));

            Report = new CommandReport(CommandReports.PSM_component_added, psmAttribute);
        }
Esempio n. 18
0
        internal override void CommandOperation()
        {
            PIMAttribute a = Project.TranslateComponent <PIMAttribute>(attributeGuid);

            Report = new CommandReport(CommandReports.PIM_component_deleted, a);
            Project.TranslateComponent <PIMSchema>(schemaGuid).PIMAttributes.Remove(a);
            classGuid = a.PIMClass;
            index     = Project.TranslateComponent <PIMClass>(classGuid).PIMAttributes.Remove(a);
            Project.mappingDictionary.Remove(attributeGuid);
        }
Esempio n. 19
0
        internal override void CommandOperation()
        {
            if (OCLScriptGuid == Guid.Empty)
            {
                OCLScriptGuid = Guid.NewGuid();
            }
            Schema    schema    = Project.TranslateComponent <Schema>(schemaGuid);
            OCLScript oclScript = new OCLScript(Project, OCLScriptGuid, schema);

            Report = new CommandReport("New OCL script was added to '{0}'.", schema);
        }
Esempio n. 20
0
        internal override void CommandOperation()
        {
            IHasCardinality owner          = Project.TranslateComponent <Component>(ComponentGuid) as IHasCardinality;
            string          oldCardinality = owner.CardinalityString;

            oldLower    = owner.Lower;
            oldUpper    = owner.Upper;
            owner.Lower = newLower;
            owner.Upper = newUpper;
            Report      = new CommandReport(CommandReports.CARDINALITY_CHANGED, owner, oldCardinality, owner.CardinalityString);
        }
Esempio n. 21
0
        internal override void CommandOperation()
        {
            PIMGeneralization g = Project.TranslateComponent <PIMGeneralization>(deletedGeneralizationGuid);

            Report        = new CommandReport(CommandReports.PIM_component_deleted, g);
            specificClass = g.Specific;
            generalClass  = g.General;
            g.Specific.GeneralizationAsSpecific = null;
            index = g.General.GeneralizationsAsGeneral.Remove(g);
            Project.TranslateComponent <PIMSchema>(schemaGuid).PIMGeneralizations.Remove(g);
            Project.mappingDictionary.Remove(deletedGeneralizationGuid);
        }
Esempio n. 22
0
        public ArgumentsTag(CommandReport report)
        {
            AddClass("table");
            AddHeaderRow(tr => tr.Header("Arguments").Attr("colspan", 2));

            report.Arguments.Each(x => {
                AddBodyRow(tr => {
                    tr.Cell(x.Name).AddClass("command-arg-name");
                    tr.Cell(x.Description).AddClass("command-arg-description");
                });
            });
        }
        internal override void CommandOperation()
        {
            PSMAttribute psmAttribute = Project.TranslateComponent <PSMAttribute>(attributeGuid);

            oldForm = psmAttribute.Element;
            psmAttribute.Element = newForm;

            string newFormString = newForm ? "element" : "attribute";
            string oldFormString = oldForm ? "element" : "attribute";

            Report = new CommandReport("XML form of {0} changed from {1} to {2}.", psmAttribute, oldFormString, newFormString);
        }
Esempio n. 24
0
        internal override void CommandOperation()
        {
            PSMSchema s      = Project.TranslateComponent <PSMSchema>(schemaGuid);
            string    report = s.ToString();

            schemaClassGuid = s.PSMSchemaClass;
            Name            = s.PSMSchemaClass.Name;
            s.UnRegisterPSMSchemaClass(s.PSMSchemaClass);
            index = Project.LatestVersion.PSMSchemas.Remove(s);
            Project.mappingDictionary.Remove(schemaClassGuid);
            Project.mappingDictionary.Remove(schemaGuid);
            Report = new CommandReport(CommandReports.PSM_component_deleted, report);
        }
Esempio n. 25
0
        internal override void CommandOperation()
        {
            PSMSchema       s  = Project.TranslateComponent <PSMSchema>(schemaGuid);
            PSMContentModel cm = Project.TranslateComponent <PSMContentModel>(cmodelGuid);

            type = cm.Type;

            rootIndex = s.Roots.Remove(cm);

            Project.TranslateComponent <PSMSchema>(schemaGuid).PSMContentModels.Remove(cm);
            Project.mappingDictionary.Remove(cm);
            Report = new CommandReport(CommandReports.PSM_component_deleted, cm);
        }
Esempio n. 26
0
        public UsageTableTag(CommandReport report)
        {
            AddClass("table");
            AddClass("usages-table");
            AddHeaderRow(tr => tr.Header("Usages").Attr("colspan", 2));

            report.Usages.Each(x => {
                AddBodyRow(tr => {
                    tr.Cell(x.Description);
                    tr.Cell(x.Usage).AddClass("command-usage");
                });
            });
        }
        public CommandSectionTag(string applicationName, CommandReport report)
            : base("section")
        {
            AddClass("command-section");
            var h4 = Add("h4");

            h4.Add("span")
            .Text(applicationName + " " + report.Name)
            .AddClass("section-header")
            .Id(report.Name);

            h4.Add("i").AddClass("command-description").Text(report.Description);
        }
Esempio n. 28
0
        public CommandSectionTag(string applicationName, CommandReport report)
            : base("section")
        {
            AddClass("command-section");
            var h4 = Add("h4");

            h4.Add("span")
                .Text(applicationName + " " + report.Name)
                .AddClass("section-header")
                .Id(report.Name);

            h4.Add("i").AddClass("command-description").Text(report.Description);
        }
Esempio n. 29
0
        public FlagsTag(CommandReport report)
        {
            AddClass("table");
            AddHeaderRow(tr => tr.Header("Flags").Attr("colspan", 2));

            report.Flags.Each(x =>
            {
                AddBodyRow(tr =>
                {
                    tr.Cell(x.UsageDescription).AddClass("command-flag-usage");
                    tr.Cell(x.Description).AddClass("command-flag-description");
                });
            });
        }
Esempio n. 30
0
        public FlagsTag(CommandReport report)
        {
            AddClass("table");
            AddHeaderRow(tr => tr.Header("Flags").Attr("colspan", 2));

            report.Flags.Each(x =>
            {
                AddBodyRow(tr =>
                {
                    tr.Cell(x.UsageDescription).AddClass("command-flag-usage");
                    tr.Cell(x.Description).AddClass("command-flag-description");
                });
            });
        }
Esempio n. 31
0
        internal override void CommandOperation()
        {
            //PSMClass c = Project.TranslateComponent<PSMAttribute>(ComponentGuids.First()).PSMClass;
            oldOrder = new List <Guid>();

            foreach (TComponentType component in OwnerCollection)
            {
                oldOrder.Add(component.ID);
            }

            OrderAsInList(ComponentGuids);

            Report = new CommandReport(CommandReports.Components_reordered);
        }
Esempio n. 32
0
 internal override void CommandOperation()
 {
     if (GeneralizationGuid == Guid.Empty)
     {
         GeneralizationGuid = Guid.NewGuid();
     }
     new PIMGeneralization(
         Project,
         GeneralizationGuid,
         Project.TranslateComponent <PIMSchema>(schemaGuid),
         Project.TranslateComponent <PIMClass>(generalClassGuid),
         Project.TranslateComponent <PIMClass>(specificClassGuid));
     Report = new CommandReport(CommandReports.PIM_component_added, Project.TranslateComponent <PIMGeneralization>(GeneralizationGuid));
 }
Esempio n. 33
0
        public ArgumentsTag(CommandReport report)
        {
            AddClass("table");
            AddHeaderRow(tr => tr.Header("Arguments").Attr("colspan", 2));

            report.Arguments.Each(x =>
            {
                AddBodyRow(tr =>
                {
                    tr.Cell(x.Name).AddClass("command-arg-name");
                    tr.Cell(x.Description).AddClass("command-arg-description");
                });
            });
        }
Esempio n. 34
0
        public UsageTableTag(CommandReport report)
        {
            AddClass("table");
            AddClass("usages-table");
            AddHeaderRow(tr => tr.Header("Usages").Attr("colspan", 2));

            report.Usages.Each(x =>
            {
                AddBodyRow(tr =>
                {
                    tr.Cell(x.Description);
                    tr.Cell(x.Usage).AddClass("command-usage");
                });
            });
        }
        public static IEnumerable<HtmlTag> CommandBodyTags(string applicationName, CommandReport report)
        {
            if (report.Usages.Count() == 1)
            {
                yield return new SingleUsageTag(report.Usages.Single());
            }
            else
            {
                yield return new UsageTableTag(report);
            }

            if (report.Arguments.Any())
            {
                yield return new ArgumentsTag(report);
            }

            if (report.Flags.Any())
            {
                yield return new FlagsTag(report);
            }
        }