예제 #1
0
    //protected void btnReturnResult_Click(object sender, EventArgs e)
    private void ReturnResult()
    {
        InitializeState();
        int index = (string.IsNullOrEmpty(CurrentPageIndex.Value)) ? 0 : int.Parse(CurrentPageIndex.Value);

        if (string.IsNullOrEmpty(currentIndex.Value))
        {
            return;
        }
        whichResultsPage = index;
        SpeedSearchService ss  = new SpeedSearchService();
        SpeedSearchQuery   ssq = BuildQuery();

        ssq.DocTextItem = int.Parse(currentIndex.Value) + 1000000;
        string xml = ss.DoSpeedSearch(ssq.GetAsXml());

        Results = SpeedSearchResults.LoadFromXml(xml);

        _ResultEntity = (EntityBase)m_EntityContextService.GetEntity();
        if (!string.IsNullOrEmpty(_ChildPropertyName))
        {
            PropertyDescriptor child = TypeDescriptor.GetProperties(_ResultEntity.GetType())[_ChildPropertyName];
            _ResultEntity = (EntityBase)child.GetValue(_ResultEntity);
        }
        PropertyDescriptor resultProp = TypeDescriptor.GetProperties(_ResultEntity.GetType())[_ResultProperty];

        resultProp.SetValue(_ResultEntity, Results.Items[0].HighlightedDoc);

        DialogService.CloseEventHappened(null, null);
    }
예제 #2
0
    public void DoSearch()
    {
        currentIndex.Value = "";
        _state             = new SpeedSearchState
        {
            SearchText    = SearchRequest.Text,
            SearchTypeIdx = SearchType.SelectedIndex,
            Root          = SearchFlags.Items[0].Selected,
            Thesaurus     = SearchFlags.Items[1].Selected,
            SoundsLike    = SearchFlags.Items[2].Selected,
            MaxResults    = int.Parse(MaxResults.SelectedValue)
        };
        var ss  = new SpeedSearchService();
        var ssq = BuildQuery();

        Session[ClientID + "_SearchQry"] = ssq.GetAsXml();
        string xml = ss.DoSpeedSearch(ssq).GetAsXml();

        Session[ClientID] = xml;

        InitResults(xml);
        if (!_context.IsConfigurationTypeRegistered(typeof(SpeedSearchState)))
        {
            _context.RegisterConfigurationType(typeof(SpeedSearchState));
        }
        _context.WriteConfiguration(_state);
    }
예제 #3
0
    private void ReturnResult()
    {
        InitializeState();
        var index = (string.IsNullOrEmpty(CurrentPageIndex.Value)) ? 0 : int.Parse(CurrentPageIndex.Value);

        if (string.IsNullOrEmpty(currentIndex.Value))
        {
            return;
        }
        _whichResultsPage = index;
        var ss  = new SpeedSearchService();
        var ssq = BuildQuery();

        ssq.DocTextItem = int.Parse(currentIndex.Value) + 1000000;
        _results        = ss.DoSpeedSearch(ssq);

        _resultEntity = (EntityBase)_mEntityContextService.GetEntity();
        if (!string.IsNullOrEmpty(_childPropertyName))
        {
            var child = TypeDescriptor.GetProperties(_resultEntity.GetType())[_childPropertyName];
            _resultEntity = (EntityBase)child.GetValue(_resultEntity);
        }
        var resultProp = TypeDescriptor.GetProperties(_resultEntity.GetType())[_resultProperty];

        resultProp.SetValue(_resultEntity, _results.Items[0].HighlightedDoc);

        DialogService.CloseEventHappened(null, null);
    }
예제 #4
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);
 }
예제 #5
0
 protected override void OnPreRender(EventArgs e)
 {
     if (Visible)
     {
         InitializeState();
         if (!string.IsNullOrEmpty(MarkUsedInfo.Value))
         {
             SetItemAsUsed();
             MarkUsedInfo.Value = string.Empty;
         }
         if (!string.IsNullOrEmpty(ReturnResultAction.Value))
         {
             ReturnResult();
             ReturnResultAction.Value = string.Empty;
             var page = Page as WebPortalPage;
             if (page != null)
             {
                 var refresher = page.PageWorkItem.Services.Get <IPanelRefreshService>();
                 if (refresher != null)
                 {
                     refresher.RefreshAll();
                 }
             }
         }
         if (!string.IsNullOrEmpty(currentIndex.Value))
         {
             var document = new Literal();
             if (currentIndex.Value.Equals("NoAccess"))
             {
                 document.Text = GetLocalResourceObject("SpeedSearch_Result_NoAccess").ToString();
             }
             else
             {
                 var index = (string.IsNullOrEmpty(CurrentPageIndex.Value)) ? 0 : int.Parse(CurrentPageIndex.Value);
                 _whichResultsPage = index;
                 var ss  = new SpeedSearchService();
                 var ssq = BuildQuery();
                 ssq.DocTextItem = int.Parse(currentIndex.Value);
                 _results        = ss.DoSpeedSearch(ssq);
                 document.Text   = _results.Items[0].HighlightedDoc;
             }
             currentIndex.Value   = "";
             FirstPage.Visible    = true;
             PreviousPage.Visible = true;
             NextPage.Visible     = true;
             LastPage.Visible     = true;
         }
     }
     base.OnPreRender(e);
 }
예제 #6
0
    public void DoSearch()
    {
        currentIndex.Value   = "";
        _State               = new SpeedSearchState();
        _State.SearchText    = SearchRequest.Text;
        _State.SearchTypeIdx = SearchType.SelectedIndex;
        _State.Root          = SearchFlags.Items[0].Selected;
        _State.Thesaurus     = SearchFlags.Items[1].Selected;
        _State.SoundsLike    = SearchFlags.Items[2].Selected;
        _State.MaxResults    = int.Parse(MaxResults.SelectedValue);
        //SpeedSearchWebService.SpeedSearchService ss = new SpeedSearchWebService.SpeedSearchService();
        //ss.Url = ConfigurationManager.AppSettings.Get("SpeedSearchWebService.SpeedSearchService");
        SpeedSearchService ss  = new SpeedSearchService();
        SpeedSearchQuery   ssq = BuildQuery();

        if (Session[ClientID + "_SearchQry"] != null)
        {
            Session[ClientID + "_SearchQry"] = ssq.GetAsXml();
        }
        else
        {
            Session[ClientID + "_SearchQry"] = ssq.GetAsXml();
        }
        string xml = ss.DoSpeedSearch(ssq.GetAsXml());

        if (Session[ClientID] != null)
        {
            Session[ClientID] = xml;
        }
        else
        {
            Session[ClientID] = xml;
        }
        initResults(xml);
        if (!_Context.IsConfigurationTypeRegistered(typeof(SpeedSearchState)))
        {
            _Context.RegisterConfigurationType(typeof(SpeedSearchState));
        }
        _Context.WriteConfiguration(_State);
    }
    public void DoSearch()
    {
        currentIndex.Value = "";
        _State = new SpeedSearchState();
        _State.SearchText = SearchRequest.Text;
        _State.SearchTypeIdx = SearchType.SelectedIndex;
        _State.Root = SearchFlags.Items[0].Selected;
        _State.Thesaurus = SearchFlags.Items[1].Selected;
        _State.SoundsLike = SearchFlags.Items[2].Selected;
        _State.MaxResults = int.Parse(MaxResults.SelectedValue);
        SpeedSearchService ss = new SpeedSearchService();
        SpeedSearchQuery ssq = BuildQuery();

        Session[ClientID + "_SearchQry"] = ssq.GetAsXml();
        string xml = ss.DoSpeedSearch(ssq.GetAsXml());
        Session[ClientID] = xml;

        initResults(xml);
        if (!_Context.IsConfigurationTypeRegistered(typeof(SpeedSearchState)))
        {
            _Context.RegisterConfigurationType(typeof(SpeedSearchState));
        }
        _Context.WriteConfiguration(_State);
    }
 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);
 }
    //protected void btnReturnResult_Click(object sender, EventArgs e)
    private void ReturnResult()
    {
        InitializeState();
        int index = (string.IsNullOrEmpty(CurrentPageIndex.Value)) ? 0 : int.Parse(CurrentPageIndex.Value);
        if (string.IsNullOrEmpty(currentIndex.Value)) return;
        whichResultsPage = index;
        SpeedSearchService ss = new SpeedSearchService();
        SpeedSearchQuery ssq = BuildQuery();
        ssq.DocTextItem = int.Parse(currentIndex.Value) + 1000000;
        string xml = ss.DoSpeedSearch(ssq.GetAsXml());
        Results = SpeedSearchResults.LoadFromXml(xml);

        _ResultEntity = (EntityBase)m_EntityContextService.GetEntity();
        if (!string.IsNullOrEmpty(_ChildPropertyName))
        {
            PropertyDescriptor child = TypeDescriptor.GetProperties(_ResultEntity.GetType())[_ChildPropertyName];
            _ResultEntity = (EntityBase)child.GetValue(_ResultEntity);
        }
        PropertyDescriptor resultProp = TypeDescriptor.GetProperties(_ResultEntity.GetType())[_ResultProperty];
        resultProp.SetValue(_ResultEntity, Results.Items[0].HighlightedDoc);

        DialogService.CloseEventHappened(null, null);
    }