Skip to content

Commit

Permalink
Core: IndexBrowser cleanup and SuperFlexi RebuildIndex fixes #83
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephMDavis committed Jan 21, 2019
1 parent 14c13ac commit 8babb70
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 125 deletions.
46 changes: 29 additions & 17 deletions SuperFlexiUI/Components/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ModuleConfiguration
private static readonly ILog log = LogManager.GetLogger(typeof(ModuleConfiguration));
private Module module;
private Hashtable settings;
private SiteSettings siteSettings;
private int siteId = -1;

FileSystemProvider fsProvider;
Expand All @@ -34,23 +35,12 @@ public class ModuleConfiguration


#region contstructors
public ModuleConfiguration()
public ModuleConfiguration()
{ }

public ModuleConfiguration(Module module, bool reloadDefinitionFromDisk = false)
{
fsProvider = FileSystemManager.Providers[WebConfigSettings.FileSystemProvider];
if (fsProvider == null)
{
log.Error("File System Provider Could Not Be Loaded.");
return;
}
fileSystem = fsProvider.GetFileSystem();
if (fileSystem == null)
{
log.Error("File System Could Not Be Loaded.");
return;
}


if (module != null)
{
Expand All @@ -59,13 +49,35 @@ public ModuleConfiguration(Module module, bool reloadDefinitionFromDisk = false)
featureGuid = module.FeatureGuid;
settings = ModuleSettings.GetModuleSettings(module.ModuleId);

if (siteId < 1)
{
siteId = CacheHelper.GetCurrentSiteSettings().SiteId;
}
if (siteId < 1)
{
if (siteSettings == null)
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
}
}

fsProvider = FileSystemManager.Providers[WebConfigSettings.FileSystemProvider];
if (fsProvider == null)
{
log.Error("File System Provider Could Not Be Loaded.");
return;
}
fileSystem = fsProvider.GetFileSystem(siteId);
if (fileSystem == null)
{
log.Error("File System Could Not Be Loaded.");
return;
}

LoadSettings(settings, reloadDefinitionFromDisk);
}
}

public ModuleConfiguration(Module module, int siteId, bool reloadDefinitionFromDisk = false)
{
siteSettings = new SiteSettings(siteId);
}
#endregion
#region public methods
/// <summary>
Expand Down
113 changes: 98 additions & 15 deletions Web/Admin/IndexBrowser.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,48 @@

<asp:Content ContentPlaceHolderID="leftContent" ID="MPLeftPane" runat="server" />
<asp:Content ContentPlaceHolderID="mainContent" ID="MPContent" runat="server">
<style type="text/css">
.label-v-center {
vertical-align: middle;
margin: 0;
}
button.ui-datepicker-trigger {
padding: 0 10px 10px;
font-weight: 700;
}
.label-width-small {
width: auto;
}
.input-group-separated > * {
margin: 0 10px;
flex: 1 1 auto;
}
.input-group-separated {
display: flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
}
.input-as-text {
border: 0 none;
box-shadow: 0 0;
padding: 0 !important;
margin: 10px;
font-weight: 700;
width: auto !important;
float: right !important;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('.date-picker').addClass('input-as-text');
});
</script>
<portal:AdminCrumbContainer ID="pnlAdminCrumbs" runat="server" CssClass="breadcrumbs">
<asp:HyperLink ID="lnkAdminMenu" runat="server" NavigateUrl="~/Admin/AdminMenu.aspx" />
<portal:AdminCrumbSeparator ID="litLinkSeparator1" runat="server" Text="&nbsp;&gt;" EnableViewState="false" />
Expand All @@ -14,19 +56,60 @@
<portal:OuterBodyPanel ID="pnlOuterBody" runat="server">
<portal:InnerBodyPanel ID="pnlInnerBody" runat="server" CssClass="modulecontent">

<div>
<asp:DropDownList ID="ddFeatureList" runat="server" CssClass="searchfeatures"></asp:DropDownList>
<mp:SiteLabel runat="server" EnableViewState="false" ConfigKey="AdminIndexBrowserModifiedBetween" />
<portal:jDatePicker ID="beginDate" runat="server" />
<mp:SiteLabel runat="server" EnableViewState="false" ConfigKey="and" />

<portal:jDatePicker ID="endDate" runat="server" />
<asp:Button ID="btnGo" runat="server" Text="GO" OnClick="btnGo_Click" />
<a href='<%= SiteRoot %>/Admin/IndexBrowser.aspx'><%= Resources.Resource.AdminIndexBrowserClearFilter %></a>
</div>
<div>
<portal:mojoButton ID="btnRebuildSearchIndex" runat="server" OnClick="btnRebuildSearchIndex_Click" />

<div class="row">
<div class="col-md-2">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"><%= Resources.Resource.AdminIndexBrowserFilterContentType %></h3>
</div>
<div class="panel-body">
<div class="form-inline">
<div class="form-group">
<div class="input-group">
<asp:DropDownList ID="ddFeatureList" runat="server" CssClass="searchfeatures"></asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"><%= Resources.Resource.AdminIndexBrowserFilterDate %></h3>
</div>
<div class="panel-body">
<div class="form-inline">
<div class="form-group">
<div class="input-group input-group-sm input-group-separated">
<mp:SiteLabel runat="server" EnableViewState="false" ConfigKey="AdminIndexBrowserModifiedBetween" CssClass="label-v-center settinglabel label-width-small" />
<portal:jDatePicker ID="beginDate" runat="server" />
<mp:SiteLabel runat="server" EnableViewState="false" ConfigKey="and" CssClass="label-v-center settinglabel label-width-small" />
<portal:jDatePicker ID="endDate" runat="server" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"><%= Resources.Resource.AdminIndexBrowserActionsHeading %></h3>
</div>
<div class="panel-body">
<div class="form-inline">
<div class="form-group">
<div class="input-group input-group-separated input-group-btn">
<portal:mojoButton ID="btnGo" runat="server" SkinID="SuccessButton" />
<a href='<%= SiteRoot %>/Admin/IndexBrowser.aspx' class="btn btn-warning"><%= Resources.Resource.AdminIndexBrowserClearFilter %></a>
<portal:mojoButton ID="btnRebuildSearchIndex" runat="server" SkinID="DangerButton" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<portal:mojoLabel ID="lblMessage" runat="server" />
Expand All @@ -35,13 +118,13 @@

<asp:Panel ID="pnlSearchResults" runat="server" CssClass="settingrow searchresults">
<portal:mojoCutePager ID="pgrTop" runat="server" Visible="false" />
<asp:Repeater ID="rptResults" runat="server" EnableViewState="true" OnItemCommand="rptResults_ItemCommand">
<asp:Repeater ID="rptResults" runat="server" EnableViewState="true" OnItemCommand="rptResults_ItemCommand" OnItemDataBound="rptResults_ItemDataBound">
<ItemTemplate>
<div class="result">
<h3>
<asp:HyperLink ID="Hyperlink1" runat="server" EnableViewState="false"
NavigateUrl='<%# BuildUrl((mojoPortal.SearchIndex.IndexItem)Container.DataItem) %>'
Text='<%# FormatLinkText(Eval("PageName").ToString(), Eval("ModuleTitle").ToString(), Eval("Title").ToString()) %>' />
Text='<%# FormatItemTitle(Eval("PageName").ToString(), Eval("ModuleTitle").ToString(), Eval("Title").ToString(), ">") %>' />
</h3>
<div class="row">
<div class="col-md-3">
Expand Down

0 comments on commit 8babb70

Please sign in to comment.