Skip to content

Commit 0f40b79

Browse files
authored
Merge pull request #54 from psteiwer/dev-eventviewer
Dev eventviewer
2 parents 0e69066 + 0c5af22 commit 0f40b79

3 files changed

Lines changed: 100 additions & 38 deletions

File tree

PivotSubscriptions/EventLog.cls

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ ClassMethod LogEvent(pType, pUser, pPivot, pDayOfWeek, pHour, pMinute, pFormat,
4848
Set tEventLog.Format=pFormat
4949
Set tEventLog.Emails=pEmails
5050

51+
If pType="tableError" {
52+
Set tEventLog.Status=$$$OK
53+
Set tEventLog.EndTime=$zdt($h,3,1)
54+
}
55+
5156
Set tSC=tEventLog.%Save()
5257
Set pEvent=tEventLog
5358

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Class PivotSubscriptions.UI.EventLogViewer Extends PivotSubscriptions.UI.Template
2+
{
3+
4+
/// Displayed name of this page.
5+
Parameter PAGENAME = "Event Log Viewer";
6+
7+
/// This XML block defines the contents of this pane.
8+
XData contentPane [ XMLNamespace = "http://www.intersystems.com/zen" ]
9+
{
10+
<pane xmlns="http://www.intersystems.com/zen">
11+
<hgroup valign="top" >
12+
<spacer width="20" />
13+
<vgroup valign="top" >
14+
<spacer height="20" />
15+
<tableNavigatorBar id="tableNavigator" tablePaneId="tablePane" showPageSize="true" />
16+
<tablePane id="tablePane"
17+
cellSpacing="2"
18+
fixedHeaders="false"
19+
queryClass="PivotSubscriptions.UI.EventLogViewer"
20+
queryName="GetEvents"
21+
useSnapshot="true"
22+
showQuery="false"
23+
showZebra="true"
24+
showRowNumbers="false"
25+
pageSize="100"
26+
maxRows="1000"
27+
>
28+
</tablePane>
29+
</vgroup>
30+
</hgroup>
31+
</pane>
32+
}
33+
34+
/// Get the (localized) title string for the page.
35+
Method %OnGetTitle() As %String [ Internal ]
36+
{
37+
Quit $$$Text("Event Log Viewer","PivotSubscriptions")
38+
}
39+
40+
/// Get the (localized) name of the page.
41+
Method %OnGetPageName() As %String [ Internal ]
42+
{
43+
Quit $$$Text("Event Log Viewer","PivotSubscriptions")
44+
}
45+
46+
Query GetEvents() As %SQLQuery
47+
{
48+
SELECT StartTime,EndTime,EventType,Name,Pivot,UserName,DayOfWeek,Format,"Hour","Minute",Emails,Status
49+
FROM PivotSubscriptions.EventLog
50+
ORDER BY ID DESC
51+
}
52+
53+
}

PivotSubscriptions/UI/Template.cls

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
1-
Class PivotSubscriptions.UI.Template Extends %DeepSee.UI.standardPage
2-
{
3-
4-
Parameter DOMAIN = "PivotSubscriptions";
5-
6-
/// Get information to display in the ribbon bar.
7-
Method OnGetRibbonInfo(Output pDisplay As %Boolean, Output pViewIcons As %List, Output pSortOptions As %List, Output pSearchBox As %Boolean, Output pRibbonTitle As %String, Output pCommands As %List) As %Status
8-
{
9-
Set pDisplay=1
10-
Set pSearchBox=0
11-
Set pRibbonTitle=$$$Text(..#PAGENAME)
12-
13-
Set pCommands($I(pCommands))=$LB("subscriptionManager",$$$Text("Subscription Manager"),$$$Text("Manage Pivot Subscriptions"),"zenPage.navigate('subscriptionManager');")
14-
Set pCommands($I(pCommands))=$LB("pivotList",$$$Text("Pivot List"),$$$Text("View All Pivot Tables"),"zenPage.navigate('pivotList');")
15-
Set pCommands($I(pCommands))=$LB("configurationPage",$$$Text("Configuration Page"),$$$Text("Configure Settings"),"zenPage.navigate('configurationPage');")
16-
17-
Quit $$$OK
18-
}
19-
20-
ClientMethod navigate(pageName) [ Language = javascript ]
21-
{
22-
var location=""
23-
if (pageName=='subscriptionManager') {
24-
location="./PivotSubscriptions.UI.SubscriptionManager.zen"
25-
} else if (pageName=='pivotList') {
26-
location="./PivotSubscriptions.UI.PivotList.zen"
27-
} else if (pageName=='configurationPage') {
28-
location="./PivotSubscriptions.UI.ConfigurationPage.zen"
29-
} else {
30-
// Invalid page name
31-
}
32-
33-
if (location!="") {
34-
window.location.href=location;
35-
}
36-
}
37-
38-
}
1+
Class PivotSubscriptions.UI.Template Extends %DeepSee.UI.standardPage
2+
{
3+
4+
Parameter DOMAIN = "PivotSubscriptions";
5+
6+
/// Get information to display in the ribbon bar.
7+
Method OnGetRibbonInfo(Output pDisplay As %Boolean, Output pViewIcons As %List, Output pSortOptions As %List, Output pSearchBox As %Boolean, Output pRibbonTitle As %String, Output pCommands As %List) As %Status
8+
{
9+
Set pDisplay=1
10+
Set pSearchBox=0
11+
Set pRibbonTitle=$$$Text(..#PAGENAME)
12+
13+
Set pCommands($I(pCommands))=$LB("subscriptionManager",$$$Text("Subscription Manager"),$$$Text("Manage Pivot Subscriptions"),"zenPage.navigate('subscriptionManager');")
14+
Set pCommands($I(pCommands))=$LB("pivotList",$$$Text("Pivot List"),$$$Text("View All Pivot Tables"),"zenPage.navigate('pivotList');")
15+
// Check for additional permissions?
16+
Set pCommands($I(pCommands))=$LB("configurationPage",$$$Text("Configuration Page"),$$$Text("Configure Settings"),"zenPage.navigate('configurationPage');")
17+
Set pCommands($I(pCommands))=$LB("eventLogViewer",$$$Text("Event Log Viewer"),$$$Text("Event Log Viewer"),"zenPage.navigate('eventLogViewer');")
18+
19+
Quit $$$OK
20+
}
21+
22+
ClientMethod navigate(pageName) [ Language = javascript ]
23+
{
24+
var location=""
25+
if (pageName=='subscriptionManager') {
26+
location="./PivotSubscriptions.UI.SubscriptionManager.zen"
27+
} else if (pageName=='pivotList') {
28+
location="./PivotSubscriptions.UI.PivotList.zen"
29+
} else if (pageName=='configurationPage') {
30+
location="./PivotSubscriptions.UI.ConfigurationPage.zen"
31+
} else if (pageName='eventLogViewer') {
32+
location="./PivotSubscriptions.UI.EventLogViewer.zen"
33+
} else {
34+
// Invalid page name
35+
}
36+
37+
if (location!="") {
38+
window.location.href=location;
39+
}
40+
}
41+
42+
}

0 commit comments

Comments
 (0)