Exemplo n.º 1
0
 protected override void OnPreRender(EventArgs e)
 {
     if (this.Visible)
     {
         InitializeState();
         if (!string.IsNullOrEmpty(MarkUsedInfo.Value))
         {
             SetItemAsUsed();
             MarkUsedInfo.Value = string.Empty;
         }
         if (!string.IsNullOrEmpty(ReturnResultAction.Value))
         {
             ReturnResult();
             ReturnResultAction.Value = string.Empty;
             WebPortalPage page = Page as WebPortalPage;
             if (page != null)
             {
                 IPanelRefreshService refresher = page.PageWorkItem.Services.Get <IPanelRefreshService>();
                 if (refresher != null)
                 {
                     refresher.RefreshAll();
                 }
             }
         }
         if (!string.IsNullOrEmpty(currentIndex.Value))
         {
             Literal document = new Literal();
             if (currentIndex.Value.Equals("NoAccess"))
             {
                 document.Text = GetLocalResourceObject("SpeedSearch_Result_NoAccess").ToString();
             }
             else
             {
                 int index = (string.IsNullOrEmpty(CurrentPageIndex.Value)) ? 0 : int.Parse(CurrentPageIndex.Value);
                 whichResultsPage = index;
                 //SpeedSearchWebService.SpeedSearchService ss = new SpeedSearchWebService.SpeedSearchService();
                 //ss.Url = ConfigurationManager.AppSettings.Get("SpeedSearchWebService.SpeedSearchService");
                 SpeedSearchService ss  = new SpeedSearchService();
                 SpeedSearchQuery   ssq = BuildQuery();
                 ssq.DocTextItem = int.Parse(currentIndex.Value);
                 string xml = ss.DoSpeedSearch(ssq.GetAsXml());
                 Results       = SpeedSearchResults.LoadFromXml(xml);
                 document.Text = Results.Items[0].HighlightedDoc;
             }
             currentIndex.Value   = "";
             FirstPage.Visible    = true;
             PreviousPage.Visible = true;
             NextPage.Visible     = true;
             LastPage.Visible     = true;
             //SearchDocumentPanel.ContentTemplateContainer.Controls.Add(document);
         }
     }
     base.OnPreRender(e);
 }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        WebPortalPage p = Page as WebPortalPage;

        if (p != null)
        {
            if (!p.ClientContextService.CurrentContext.ContainsKey(WebHelpUrlFmtKey))
            {
                PageLink linkCtrl = new PageLink
                {
                    LinkType    = enumPageLinkType.HelpFileName,
                    NavigateUrl = "bogustopic",
                    Target      = "help"
                };
                var webHelpLink = linkCtrl.GetWebHelpLink();
                p.ClientContextService.CurrentContext.Add(WebHelpUrlFmtKey, webHelpLink.Url.Replace("bogustopic", "{0}"));
                p.ClientContextService.CurrentContext.Add(WebHelpUrlTargetKey, webHelpLink.Target);
            }
        }
    }
    /// <summary>
    /// Handles the Click event of the cmdAssignImportHistory control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void cmdAssignImportHistory_Click(object sender, EventArgs e)
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }
        WebPortalPage portalPage = Page as WebPortalPage;

        if (portalPage != null)
        {
            IImportHistory importHistory = EntityFactory.Create <IImportHistory>();
            importHistory.Status         = GetLocalResourceObject("importStatus_Processing").ToString();
            importHistory.ProcessedCount = 0;
            importHistory.Save();
            importManager.ImportHistory = importHistory;
            portalPage.ClientContextService.CurrentContext.Remove("ImportHistoryId");
            portalPage.ClientContextService.CurrentContext.Add("ImportHistoryId", importHistory.Id.ToString());
        }
    }
Exemplo n.º 4
0
    /// <summary>
    /// Starts the import process inside its own thread.
    /// </summary>
    public void StartImportProcess()
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }
        try
        {
            SetImportSourceValue();
            AddJob(importManager);
            AddCrossReferenceMananager(importManager);

            WebPortalPage portalPage = Page as WebPortalPage;
            if (portalPage != null)
            {
                IImportHistory importHistory = EntityFactory.Create <IImportHistory>();
                importHistory.Status         = GetLocalResourceObject("importStatus_Processing").ToString();
                importHistory.ProcessedCount = 0;
                importHistory.Save();
                lblHeader.Text               = GetLocalResourceObject("lblHeader_ProcessStarted.Caption").ToString();
                lblImportNumber.Visible      = true;
                lnkImportHistoryCaption.Text = String.Format(" {0}-{1}", importHistory.Alternatekeyprefix, importHistory.Alternatekeysuffix);
                lnkImportHistory.HRef        = String.Format("..\\..\\ImportHistory.aspx?entityid='{0}'&modeid=Detail", importHistory.Id);
                lblImportLeadsWizard.Visible = true;
                importManager.ImportHistory  = importHistory;
                portalPage.ClientContextService.CurrentContext.Remove("ImportHistoryId");
                portalPage.ClientContextService.CurrentContext.Add("ImportHistoryId", importHistory.Id.ToString());
            }
        }
        catch (Exception ex)
        {
            log.Error("The call to StepProcessRequest.StartImportProcess() failed", ex);
        }
    }