/// <summary>
        /// Nodeses the loaded succesfull.
        /// </summary>
        /// <param name="nodeloader">The nodeloader.</param>
        public override void NodesLoadedSuccesfull(CoIBaseNodeLoader nodeloader)
        {
            if (nodeloader.Mode == CoINodeLoaderMode.InitialLoad)
            {
                UPMCircleOfInfluencePage newPage = this.CreatePageInstance();
                newPage.RootNode       = this.currentNodeLoader.RootNode;
                newPage.Invalid        = false;
                newPage.ConfigProvider = ((UPMCircleOfInfluencePage)this.Page).ConfigProvider;
                UPMCircleOfInfluencePage oldPage = (UPMCircleOfInfluencePage)this.Page;
                this.TopLevelElement = newPage;
                if (!oldPage.Invalid && oldPage.RootNode.Invalid)
                {
                    // return from edit
                    newPage.RefreshedNode = newPage.RootNode;
                    this.InformAboutDidChangeTopLevelElement(oldPage, newPage, new List <IIdentifier> {
                        oldPage.RootNode.Identifier
                    }, null);
                }
                else
                {
                    this.InformAboutDidChangeTopLevelElement(oldPage, newPage, null, null);
                }
            }
            else if (this.currentNodeLoader.Mode == CoINodeLoaderMode.Reload)
            {
                this.InformAboutDidChangeTopLevelElement(this.Page, this.Page, this.currentNodeLoader.ChangedIdentifiers, null);
            }

            this.currentNodeLoader = null;
        }
        /// <summary>
        /// Builds the page.
        /// </summary>
        protected override void BuildPage()
        {
            base.BuildPage();
            this.ConfigName = this.ViewReference.ContextValueForKey("RootNodeConfigName");
            UPMCircleOfInfluencePage page       = this.CreatePageInstance();
            string rootNodeFieldGroup           = null;
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;

            if (!string.IsNullOrEmpty(this.ConfigName))
            {
                SearchAndList searchAndList = configStore.SearchAndListByName(this.ConfigName);
                rootNodeFieldGroup = searchAndList.FieldGroupName;
            }

            if (string.IsNullOrEmpty(rootNodeFieldGroup))
            {
                rootNodeFieldGroup = this.ViewReference.ContextValueForKey("RootNodeFieldGroup");
            }

            FieldControl details     = configStore.FieldControlByNameFromGroup("Details", rootNodeFieldGroup);
            FieldControl miniDetails = configStore.FieldControlByNameFromGroup("MiniDetails", rootNodeFieldGroup);

            this.rootNodeFieldControl = new FieldControl(new List <FieldControl> {
                details, miniDetails
            });
            this.ApplyViewConfigOnPage(page);
            this.ApplyLoadingStatusOnPage(page);
            page.Invalid         = true;
            this.TopLevelElement = page;
        }
Esempio n. 3
0
        private void FillPageWithResult(UPCRMResult result)
        {
            this.vistedNodes      = new Dictionary <IIdentifier, UPMCoINode>();
            this.nodeIdConfigDict = new Dictionary <IIdentifier, UPConfigTreeViewTable>();

            // Root Node Query
            if (result.RowCount == 1)
            {
                UPCRMResultRow row      = (UPCRMResultRow)result.ResultRowAtIndex(0);
                UPMCoINode     rootNode = CoITreeNodeLoader.CreateNodeFromResultRow(row, 0, this.expandChecker, null, null);
                this.vistedNodes[rootNode.Identifier]      = rootNode;
                this.nodeIdConfigDict[rootNode.Identifier] = this.rootTreeNode.RootNode;

                // Only root configured
                if (this.rootTreeNode.RootNode.ChildNodes.Count == 0)
                {
                    UPMCircleOfInfluencePage newPage = this.CreatePageInstance();
                    newPage.RootNode       = rootNode;
                    newPage.Invalid        = false;
                    newPage.ConfigProvider = ((UPMCircleOfInfluencePage)this.Page).ConfigProvider;
                    UPMCircleOfInfluencePage oldPage = (UPMCircleOfInfluencePage)this.Page;
                    this.TopLevelElement = newPage;
                    this.InformAboutDidChangeTopLevelElement(oldPage, newPage, null, null);
                }

                foreach (UPConfigTreeViewTable childTree in this.rootTreeNode.RootNode.ChildNodes)
                {
                    CoITreeNodeLoader nodeLoader = new CoITreeNodeLoader(rootNode, childTree, this.ViewReference, 0, this.vistedNodes, this.nodeIdConfigDict, this.recordIdentifierInfoAreaConfigMapping);
                    nodeLoader.TheDelegate = this;
                    nodeLoader.Mode        = CoINodeLoaderMode.InitialLoad;
                    this.pendingNodeLoader.Add(nodeLoader);
                    this.pendingNodeLoaderCount++;
                }
                // TODO: This is buggy and will be implemented in CRM-5621

                /*
                 * foreach (CoITreeNodeLoader _loader in this.pendingNodeLoader)
                 * {
                 *  _loader.LoadNodeSubNodes();
                 * }
                 */
            }
            else
            {
                // Request Mode Offline and jump To Online Node
                if (result.RowCount == 0 && this.RequestOption == UPRequestOption.Offline)
                {
                    // Offline Configured and Online Record
                    UPMCircleOfInfluencePage newPage = this.CreatePageInstance();
                    newPage.Status = UPMMessageStatus.MessageStatusWithMessageDetails(string.Empty, LocalizedString.TextOfflineNotAvailable);
                    UPMCircleOfInfluencePage oldPage = (UPMCircleOfInfluencePage)this.Page;
                    this.TopLevelElement = newPage;
                    this.InformAboutDidChangeTopLevelElement(oldPage, newPage, null, null);
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Applies the view configuration on page.
        /// </summary>
        /// <param name="page">The page.</param>
        protected void ApplyViewConfigOnPage(UPMCircleOfInfluencePage page)
        {
            string jsonNodesViewConfig = this.ViewReference.ContextValueForKey("nodesViewConfiguration");

            if (string.IsNullOrEmpty(jsonNodesViewConfig))
            {
                jsonNodesViewConfig = this.ViewReference.ContextValueForKey("NodesViewConfiguration");
            }

            page.ConfigProvider = new UPMCoIViewConfigProvider();
            page.ConfigProvider.ApplyJsonConfig(jsonNodesViewConfig);
        }
 private void FillPageWithResult(UPCRMResult result)
 {
     this.vistedNodes = new Dictionary <IIdentifier, UPMCoINode>();
     if (result.RowCount == 1)
     {
         UPCRMResultRow row      = (UPCRMResultRow)result.ResultRowAtIndex(0);
         UPMCoINode     rootNode = CoINodeLoader.CreateRootNodeFromResultRow(row, this.RootRecordIdentification, 0, this.expandChecker);
         this.vistedNodes[rootNode.Identifier] = rootNode;
         if (this.MaxDepth > 0)
         {
             this.currentNodeLoader             = new CoINodeLoader(rootNode, this.ViewReference, 0, this.MaxDepth, this.vistedNodes);
             this.currentNodeLoader.TheDelegate = this;
             this.currentNodeLoader.Mode        = CoINodeLoaderMode.InitialLoad;
             this.currentNodeLoader.LoadNodeSubNodes();
         }
         else
         {
             // Finished loading
             UPMCircleOfInfluencePage newPage = this.CreatePageInstance();
             newPage.RootNode       = rootNode;
             newPage.Invalid        = false;
             newPage.ConfigProvider = ((UPMCircleOfInfluencePage)this.Page).ConfigProvider;
             UPMCircleOfInfluencePage oldPage = (UPMCircleOfInfluencePage)this.Page;
             this.TopLevelElement = newPage;
             if (!oldPage.Invalid && oldPage.RootNode.Invalid)
             {
                 // return from edir
                 newPage.RefreshedNode = newPage.RootNode;
                 this.InformAboutDidChangeTopLevelElement(oldPage, newPage, new List <IIdentifier> {
                     oldPage.RootNode.Identifier
                 }, null);
             }
             else
             {
                 this.InformAboutDidChangeTopLevelElement(oldPage, newPage, null, null);
             }
         }
     }
     else
     {
         // Request Mode Offline and jump To Online Node
         if (result.RowCount == 0 && this.RequestOption == UPRequestOption.Offline)
         {
             // Offline Configured and Online Record
             UPMCircleOfInfluencePage newPage = this.CreatePageInstance();
             newPage.Status = UPMMessageStatus.MessageStatusWithMessageDetails(string.Empty, LocalizedString.TextOfflineNotAvailable);
             UPMCircleOfInfluencePage oldPage = (UPMCircleOfInfluencePage)this.Page;
             this.TopLevelElement = newPage;
             this.InformAboutDidChangeTopLevelElement(oldPage, newPage, null, null);
         }
     }
 }
Esempio n. 6
0
        /// <summary>
        /// Builds the page.
        /// </summary>
        protected override void BuildPage()
        {
            base.BuildPage();
            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;
            string rootTreeNodeName             = this.ViewReference.ContextValueForKey("ConfigName");

            if (!string.IsNullOrEmpty(rootTreeNodeName))
            {
                this.rootTreeNode = configStore.TreeViewByName(rootTreeNodeName);
            }

            UPMCircleOfInfluencePage page = this.CreatePageInstance();

            this.TopLevelElement = page;
            if (this.rootTreeNode == null)
            {
                SimpleIoc.Default.GetInstance <ILogger>().LogError($"No treeView found for configName: {rootTreeNodeName}");
                return;
            }

            // Root FieldGroup
            string rootNodeExpandName = this.rootTreeNode.RootNode.ExpandName;

            this.ExpandSettings = configStore.ExpandByName(rootNodeExpandName) ??
                                  configStore.ExpandByName(this.InfoAreaId);

            List <FieldControl> fieldControler = new List <FieldControl>();
            FieldControl        details        = configStore.FieldControlByNameFromGroup("Details", this.ExpandSettings.FieldGroupName);

            if (details != null)
            {
                fieldControler.Add(details);
            }

            FieldControl miniDetails = configStore.FieldControlByNameFromGroup("MiniDetails", this.ExpandSettings.FieldGroupName);

            if (miniDetails != null)
            {
                fieldControler.Add(miniDetails);
            }

            if (fieldControler.Count > 0)
            {
                this.rootNodeFieldControl = new FieldControl(fieldControler);
            }

            this.ApplyViewConfigOnPage(page);
            page.Invalid = true;
            this.ApplyLoadingStatusOnPage(page);
            this.TopLevelElement = page;
        }
Esempio n. 7
0
 /// <summary>
 /// Updates the page.
 /// </summary>
 /// <param name="element">The element.</param>
 /// <returns></returns>
 protected virtual UPMCircleOfInfluencePage UpdatePage(UPMCircleOfInfluencePage element)
 {
     // Override
     return(null);
 }