Ejemplo n.º 1
0
        private void LoadSelection(DataSelectionViewModel currentViewModel)
        {
            // TODO: Consider caching here

            if (currentViewModel.CurrentContainer != null)
            {
                eavClient.LoadMetadata(currentViewModel.CurrentContainer);

                if (currentViewModel.CurrentSubject != null)
                {
                    eavClient.LoadRootInstances(currentViewModel.CurrentSubject, currentViewModel.CurrentContainer);

                    foreach (IModelRootInstance instance in currentViewModel.CurrentSubject.Instances)
                    {
                        eavClient.LoadData(instance);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public ActionResult EditRootContainer(ContextViewModel postedModel)
        {
            MetadataModel metadata = TempData["Metadata"] as MetadataModel;

            postedModel.FixupContainerOrder();
            metadata.DialogStack.Push(postedModel);

            IModelRootContainer eavContainer = FindContainer(metadata.CurrentContext.Containers, ID) as IModelRootContainer;

            // TODO: Check state after loading metadata, verify that Modified doesn't go away if set
            if (eavContainer.ObjectState != ObjectState.Deleted && eavContainer.ObjectState != ObjectState.New && !eavContainer.ChildContainers.Any() && !eavContainer.Attributes.Any())
            {
                eavClient.LoadMetadata(eavContainer);
            }

            metadata.DialogStack.Push(new ContainerViewModel(eavContainer)
            {
                Existing = true
            });

            TempData["Metadata"] = metadata;

            return(BuildResult("Container Editor", Url.Content("~/Metadata/ContainerEditorDialog"), Url.Content("~/Metadata/UpdateRootContainer"), null));
        }