Наследование: Identifiable
 public static View_V3 newView(this TM_Xml_Database tmDatabase, Guid parentFolderId, View tmView)
 {
     UserRole.EditArticles.demand();
     var view = tmDatabase.xmlDB_NewView(parentFolderId, tmView);
     return (view.notNull())
         ? tmDatabase.tmView(view.id.guid())
         : null;
 }
Пример #2
0
        public View createTempView()
        {
            "creating temp view".info();
            var newView = new View  {
                                        caption = "test view",
                                        creatorCaption = "guidanceLibrary",
                                        parentFolder = "a folder",
                                        criteria = "",
                                        id = Guid.NewGuid().str(),
                                        library = createTempLibrary().str()
                                     };
            var newFolder = createTempFolder(newView.library.guid());
            tmWebServices.CreateView(newFolder.folderId, newView);
            var createdView = tmWebServices.GetViewById(newView.id.guid());
            Assert.That(createdView.viewId.str().remove("view:") == newView.id.str(), "ids didn't match");
            Assert.That(createdView.caption == newView.caption, "captions didn't match");

            return newView;
            //return createdView;
        }
Пример #3
0
 public View_V3 CreateView(Guid folderId, View view)
 {
     editArticles.demand(); resetCache(); return tmXmlDatabase.newView(folderId, view);
 }
Пример #4
0
 public bool UpdateView(View view)
 {
     editArticles.demand(); resetCache(); return tmXmlDatabase.xmlDB_UpdateView(view).notNull();
 }
        public static urn.microsoft.guidanceexplorer.View xmlDB_UpdateView(this TM_Xml_Database tmDatabase, View tmView, List<Guid> guidanceItems)
        {
            ".... in  xmlDB_UpdateView".info();
            var tmLibrary = tmDatabase.tmLibrary(tmView.library.guid());
            if (tmLibrary.isNull())
            {
                "[TM_Xml_Database] in xmlDB_UpdateView, could not find library with id: {0}".error(tmView.library);
                return null;
            }
            /*var targetFolder = tmLibrary.xmlDB_Folder(tmView.parentFolder, tmDatabase);
            if (targetFolder.isNull())
            {
                "[TM_Xml_Database] in xmlDB_UpdateView, could not find target Folder with name: {0}".error(tmView.parentFolder);
                return null;
            }*/
            var targetView = tmDatabase.xmlDB_View(tmView.id.guid());
            if (targetView.isNull())
            {
                "[TM_Xml_Database] in xmlDB_UpdateView, could not find view with id: {0}".error(tmView.id);
                return null;
            }
            //"Updating view with caption {0} in folder {1} with id {2}".info(targetView.caption, targetFolder.caption, targetView.id);
            targetView.caption = tmView.caption;
            targetView.author = tmView.creator;

            //foreach(var guid in guidanceItems)

            tmLibrary.xmlDB_Save_GuidanceExplorer(tmDatabase);
            return targetView;
            //existingView.creationDate = tmView.lastUpdate // should we also update this?
        }
 public static urn.microsoft.guidanceexplorer.View xmlDB_UpdateView(this TM_Xml_Database tmDatabase, View tmView)
 {
     return tmDatabase.xmlDB_UpdateView(tmView, new List<Guid>());
 }
        public static urn.microsoft.guidanceexplorer.View xmlDB_NewView(this TM_Xml_Database tmDatabase, Guid parentFolderId, View tmView)
        {
            var tmLibrary = tmDatabase.tmLibrary(tmView.library.guid());
            //var guidanceExplorer = tmDatabase.xmlDB_GuidanceExplorer(tmView.library.guid());
            if (tmLibrary.notNull())
            {
                if (tmView.id.isNull() || (tmView.id.isGuid() && tmView.id == Guid.Empty.str()))
                    tmView.id = Guid.NewGuid().str();
                var view = tmView.view();

                if (parentFolderId == Guid.Empty)
                {
                    var guidanceExplorer = tmLibrary.guidanceExplorer(tmDatabase);
                    guidanceExplorer.library.libraryStructure.view.Add(view);
                    //tmLibrary.xmlDB_Save_GuidanceExplorer(tmDatabase);
                    //return tmDatabase.xmlDB_View(tmView.id.guid());
                }
                else
                {
                    var folder = tmDatabase.xmlDB_Folder(tmLibrary.Id, parentFolderId);
                    if (folder.isNull())
                    {
                        "[xmlDB_NewView] could not find parent folder (to add view) with id {0}".error(parentFolderId);
                        return null;
                    }
                    folder.view.Add(view);
                }
                tmLibrary.xmlDB_Save_GuidanceExplorer(tmDatabase);
                return view;
                //return folder.xmlDB_View(tmView.id.guid()); 					// I have to get the reference again since the object is different after the calls to xmlDB_Save_GuidanceExplorer
            }
            return null;
        }
 public static urn.microsoft.guidanceexplorer.View xmlDB_NewView(this TM_Xml_Database tmDatabase, View tmView)
 {
     return tmDatabase.xmlDB_NewView(Guid.Empty,  tmView);
 }
 public static View_V3 newView(this TM_Xml_Database tmDatabase, Guid parentFolderId, View tmView)
 {
     var view = tmDatabase.xmlDB_NewView(parentFolderId, tmView);
     return tmDatabase.tmView(view.id.guid());
 }
 public static urn.microsoft.guidanceexplorer.View xmlDB_UpdateView(this TM_Xml_Database tmDatabase, View tmView)
 {
     UserRole.EditArticles.demand();
     return tmDatabase.xmlDB_UpdateView(tmView, new List<Guid>());
 }
 public static urn.microsoft.guidanceexplorer.View xmlDB_NewView(this TM_Xml_Database tmDatabase, View tmView)
 {
     UserRole.EditArticles.demand();
     return tmDatabase.xmlDB_NewView(Guid.Empty,  tmView);
 }
Пример #12
0
 public View_V3 CreateView(Guid folderId, View view)
 {
     resetCache(); return tmXmlDatabase.newView(folderId, view);
 }
Пример #13
0
 public bool UpdateView(View view)
 {
     resetCache(); return tmXmlDatabase.xmlDB_UpdateView(view).notNull();
 }