-
Notifications
You must be signed in to change notification settings - Fork 8
/
Publish.aspx
42 lines (40 loc) · 1.61 KB
/
Publish.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Text.RegularExpressions" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="log4net" %>
<%@ Import Namespace="Sitecore.Data.Engines" %>
<%@ Import Namespace="Sitecore.Data.Proxies" %>
<%@ Import Namespace="Sitecore.SecurityModel" %>
<%@ Import Namespace="Sitecore.Update" %>
<%@ Import Namespace="Sitecore.Update.Installer" %>
<%@ Import Namespace="Sitecore.Update.Installer.Exceptions" %>
<%@ Import Namespace="Sitecore.Data.Managers" %>
<%@ Import Namespace="Sitecore.Data" %>
<%@ Import Namespace="Sitecore.Publishing" %>
<%@ Language=C# %>
<HTML>
<script runat="server" language="C#">
public void Page_Load(object sender, EventArgs e)
{
Sitecore.Context.SetActiveSite("shell");
using (new SecurityDisabler())
{
DateTime publishDate = DateTime.Now;
Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master");
Sitecore.Data.Database web = Sitecore.Configuration.Factory.GetDatabase("web");
PublishManager.Republish(Sitecore.Client.ContentDatabase, new Database[] { web }, LanguageManager.GetLanguages(master).ToArray(), Sitecore.Context.Language);
}
}
protected String GetTime()
{
return DateTime.Now.ToString("t");
}
</script>
<body>
<form id="MyForm" runat="server">
<div>This page publishes Master database.</div>
Current server time is <% =GetTime()%>
</form>
</body>
</HTML>