Skip to content

Commit

Permalink
ES analytic was added
Browse files Browse the repository at this point in the history
  • Loading branch information
MakarovS96 committed Jun 17, 2019
1 parent 9d0ee2d commit 8adbeed
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 8 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ services:
restart: always
ports:
- 52774:52773
- 51774:51773
volumes:
- ./src:/usr/src
20 changes: 18 additions & 2 deletions src/cls/BI/ChampPos.cls
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
</level>
</hierarchy>
</dimension>
<dimension name="Group" disabled="false" hasAll="false" allCaption="All Name1" allDisplayName="Name1" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<dimension name="Group" disabled="true" hasAll="false" allCaption="All Name1" allDisplayName="Name1" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<additionalDescription>undefined</additionalDescription>
<hierarchy name="H1" disabled="false" hidden="false">
<level name="GroupName" disabled="false" sourceProperty="GroupClass.Name" list="false" useDisplayValue="true" useAsFilter="true" hidden="false">
Expand All @@ -38,12 +38,18 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
</level>
</hierarchy>
</dimension>
<dimension name="Tags" disabled="false" hasAll="false" allCaption="All Tags" allDisplayName="Tags" type="data" hidden="false" showHierarchies="default">
<dimension name="Tags" disabled="true" hasAll="false" allCaption="All Tags" allDisplayName="Tags" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<hierarchy name="H1" disabled="false" hidden="false">
<level name="Tags" disabled="false" sourceProperty="GroupClass.Tags" list="true" listDelimiter="," useDisplayValue="true" useAsFilter="true" hidden="false">
</level>
</hierarchy>
</dimension>
<dimension name="Language" disabled="false" hasAll="false" allCaption="All Lang" allDisplayName="Lang" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<hierarchy name="H1" disabled="false" hidden="false">
<level name="Language" disabled="false" sourceProperty="Member.Lang" list="false" useDisplayValue="true" useAsFilter="true" hidden="false">
</level>
</hierarchy>
</dimension>
<measure name="Overall" disabled="false" sourceProperty="Overall" aggregate="SUM" type="number" hidden="false" searchable="false">
</measure>
<measure name="CommentVotes" disabled="false" sourceProperty="CommentVotes" aggregate="SUM" type="number" hidden="false" searchable="false">
Expand Down Expand Up @@ -93,5 +99,15 @@ ClassMethod GSContestOrAllDate(date As %Date, groupName As %String) As %String

Parameter DOMAIN;

ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}

}

16 changes: 16 additions & 0 deletions src/cls/BI/Comment.cls
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
</level>
</hierarchy>
</dimension>
<dimension name="Language" disabled="false" hasAll="false" allCaption="All Lang" allDisplayName="Lang" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<hierarchy name="H1" disabled="false" hidden="false">
<level name="Language" disabled="false" sourceProperty="Lang" list="false" useDisplayValue="true" useAsFilter="true" hidden="false">
</level>
</hierarchy>
</dimension>
<measure name="CommentRating" displayName="Comment Rating" disabled="false" sourceProperty="AvgVote" aggregate="SUM" type="number" scale="0" hidden="false" searchable="false">
</measure>
<listing name="New_listing1" disabled="false" listingType="table" fieldList="Link,Post-&gt;Name As Post,AvgVote as Rating,Created,&apos;&lt;a href=&quot;&apos;||$Extract(Author-&gt;Link,7,Length(Author-&gt;Link))||&apos;&quot; target=&quot;_blank&quot; onclick=&quot;var e=event||window.event;e.stopPropagation();e.cancelBubble=true;&quot;&gt;&apos;||Author-&gt;Name||&apos;&lt;/a&gt;&apos; As Author">
Expand Down Expand Up @@ -154,6 +160,16 @@ ClassMethod GetDaysNumber(date, id)
Quit result
}

ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}

Parameter DOMAIN;

}
Expand Down
13 changes: 13 additions & 0 deletions src/cls/BI/CommentCopy.cls
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
<cube xmlns="http://www.intersystems.com/deepsee" name="CommentCopy" displayName="CommentCopy" disabled="false" abstract="false" sourceClass="Community.Comment" buildRestriction="Post-&gt;Deleted = 0" countMeasureName="COMCOUNT" bucketSize="8" bitmapChunkInMemory="false" precompute="0" disableListingGroups="false">
<dimension name="AuthorName" disabled="false" sharesFrom="Post" hasAll="false" allCaption="All AuthorName" allDisplayName="AuthorName" type="data" hidden="false" showHierarchies="default">
</dimension>
<dimension name="Language" disabled="false" sharesFrom="Post" hasAll="false" allCaption="All Language" allDisplayName="Language" type="data" hidden="false" showHierarchies="default">
</dimension>
<measure name="Comments" disabled="false" sourceProperty="Id" aggregate="COUNT" type="number" scale="0" hidden="false" searchable="false">
</measure>
<measure name="Comment points" disabled="false" sourceExpression="((%source.AvgVote)*(%source.VotesAmount))" aggregate="AVG" type="integer" hidden="false" searchable="false">
Expand Down Expand Up @@ -62,6 +64,17 @@ ClassMethod GetGroupName(postId, prop As %String) As %String
Quit result
}

/*
ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}
*/
Parameter DOMAIN;

}
Expand Down
16 changes: 16 additions & 0 deletions src/cls/BI/Member.cls
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
</level>
</hierarchy>
</dimension>
<dimension name="Language" disabled="false" hasAll="false" allCaption="All Lang" allDisplayName="Lang" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<hierarchy name="H1" disabled="false" hidden="false">
<level name="Language" disabled="false" sourceProperty="Lang" list="false" useDisplayValue="true" useAsFilter="true" hidden="false">
</level>
</hierarchy>
</dimension>
<measure name="MembersAmountBeforeDate" disabled="true" sourceExpression="%cube.GetMembersAmountBeforeDate(%source.Created)" aggregate="MAX" type="integer" hidden="false" searchable="false">
</measure>
<measure name="Views" disabled="true" sourceExpression="%cube.GetViewsOfAuthor(%source.%ID)" aggregate="SUM" type="number" hidden="false" searchable="false">
Expand Down Expand Up @@ -116,6 +122,16 @@ ClassMethod GetViewsOfAuthor(authorId) As %Integer
Quit result
}

ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}

Parameter DOMAIN;

}
Expand Down
11 changes: 11 additions & 0 deletions src/cls/BI/PC.cls
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ XData SubjectArea [ XMLNamespace = "http://www.intersystems.com/deepsee/subjecta
</subjectArea>
}

/*
ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}
*/
Parameter DOMAIN;

}
Expand Down
16 changes: 16 additions & 0 deletions src/cls/BI/Post.cls
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
</level>
</hierarchy>
</dimension>
<dimension name="Language" disabled="false" hasAll="false" allCaption="All Lang" allDisplayName="Lang" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<hierarchy name="H1" disabled="false" hidden="false">
<level name="Language" disabled="false" sourceProperty="Lang" list="false" useDisplayValue="true" useAsFilter="true" hidden="false">
</level>
</hierarchy>
</dimension>
<measure name="CommentsAmount" disabled="false" sourceProperty="CommentsAmount" aggregate="SUM" type="number" hidden="false" searchable="false">
</measure>
<measure name="Posts" disabled="false" sourceProperty="%ID" aggregate="COUNT" type="number" hidden="false" searchable="false" formatString="#">
Expand Down Expand Up @@ -243,6 +249,16 @@ ClassMethod GetDaysNumber(date, id)
Quit result
}

ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}

Parameter DOMAIN;

}
Expand Down
19 changes: 17 additions & 2 deletions src/cls/BI/ViewsHistory.cls
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
</level>
</hierarchy>
</dimension>
<dimension name="Language" disabled="false" hasAll="false" allCaption="All Lang" allDisplayName="Lang" type="data" calendar="gregorian" iKnowType="entity" hidden="false" showHierarchies="default">
<hierarchy name="H1" disabled="false" hidden="false">
<level name="Language" disabled="false" sourceProperty="Lang" list="false" useDisplayValue="true" useAsFilter="true" hidden="false">
</level>
</hierarchy>
</dimension>
<measure name="ViewsH" disabled="false" sourceProperty="Views" aggregate="SUM" type="number" hidden="false" searchable="false" formatString="#">
</measure>
<measure name="Delta" disabled="false" sourceProperty="Delta" aggregate="SUM" type="number" hidden="false" searchable="false" formatString="#,#">
Expand All @@ -70,15 +76,24 @@ XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
</measure>
<calculatedMember name="ViewsAVG" disabled="false" dimension="Measures" valueExpression="Measures.VIewsH/Measures.%Count" hidden="false">
</calculatedMember>
<calculatedMember name="ViewsMonthlyAVGRT" disabled="false" dimension="Measures" valueExpression="AGGREGATE([DateDimension].[H2].[MonthYear].CurrentMember.LASTCHILD,MEASURES.ViewsAVG)
" formatString="#" hidden="false">
<calculatedMember name="ViewsMonthlyAVGRT" disabled="false" dimension="Measures" valueExpression="AGGREGATE([DateDimension].[H2].[MonthYear].CurrentMember.LASTCHILD,MEASURES.ViewsAVG) " formatString="#" hidden="false">
</calculatedMember>
<listing name="New_listing1" disabled="false" listingType="table" fieldList="Post-&gt;Link,Post-&gt;Name,Post-&gt;Created,Post-&gt;Views">
<additionalDescription>undefined</additionalDescription>
</listing>
</cube>
}

ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}

Parameter DOMAIN;

}
Expand Down
15 changes: 14 additions & 1 deletion src/cls/BI/ViewsHistoryCopy.cls
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
///
Class BI.ViewsHistoryCopy Extends %DeepSee.CubeDefinition [ DependsOn = History.Views, ProcedureBlock ]
Class BI.ViewsHistoryCopy Extends %DeepSee.CubeDefinition [ DependsOn = (History.Views, BI.Post), ProcedureBlock ]
{

/// Cube definition from Architect.
XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
{
<cube xmlns="http://www.intersystems.com/deepsee" name="ViewsHistoryCopy" displayName="ViewsHistoryCopy" disabled="false" abstract="false" sourceClass="History.Views" countMeasureName="ViewsCount" bucketSize="8" bitmapChunkInMemory="false" precompute="0" disableListingGroups="false">
<dimension name="Language" disabled="false" sharesFrom="Post" hasAll="false" allCaption="All Language" allDisplayName="Language" type="data" hidden="false" showHierarchies="default">
</dimension>
<measure name="ViewsH" disabled="false" sourceProperty="Views" aggregate="SUM" type="number" hidden="false" searchable="false">
</measure>
</cube>
}

/*
ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
{
if ($username = "esdevcom") {
//if ($username = "UnknownUser") {
quit "[Language].[H1].[Language].[es]"
} else {
quit "[Language].[H1].[Language].[en]"
}
}
*/
Parameter DOMAIN;

}
Expand Down
9 changes: 9 additions & 0 deletions src/cls/Community/Comment.cls
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Index TextHashIndex On TextHash;

Property AcceptedAnswerTS As %TimeStamp;

/// This is fake property, please don't use it in DeepSee
Property Lang As %String [ Calculated, SqlComputeCode = {set {*} = ##class(Community.Post).%OpenId({Post}).Lang}, SqlComputed ];

Storage Default
{
<Data name="CommentDefaultData">
Expand Down Expand Up @@ -89,6 +92,12 @@ Storage Default
<Value name="14">
<Value>AcceptedAnswerTS</Value>
</Value>
<Value name="15">
<Value>Language</Value>
</Value>
<Value name="16">
<Value>Lang</Value>
</Value>
</Data>
<DataLocation>^Community.CommentD</DataLocation>
<DefaultData>CommentDefaultData</DefaultData>
Expand Down
5 changes: 5 additions & 0 deletions src/cls/Community/Member.cls
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Index Link On Link [ Unique ];

Property Hash As %String;

Property Lang As %String;

Relationship Posts As Community.Post [ Cardinality = many, Inverse = Author ];

Relationship Comments As Community.Comment [ Cardinality = many, Inverse = Author ];
Expand Down Expand Up @@ -69,6 +71,9 @@ Storage Default
<Value name="11">
<Value>Hash</Value>
</Value>
<Value name="12">
<Value>Lang</Value>
</Value>
</Data>
<DataLocation>^Community.Public.MemberD</DataLocation>
<DefaultData>MemberDefaultData</DefaultData>
Expand Down
13 changes: 13 additions & 0 deletions src/cls/Community/Post.cls
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ Property SubsCount As %Integer;

Property HasCorrectAnswer As %Boolean;

Property FavsCount As %Integer;

Property AcceptedAnswerTS As %TimeStamp;

Property Lang As %String;

ClassMethod GetCommentsAmount(id) As %Integer
{
set result = 0
Expand Down Expand Up @@ -131,6 +135,15 @@ Storage Default
<Value name="21">
<Value>AcceptedAnswerTS</Value>
</Value>
<Value name="22">
<Value>FavsCount</Value>
</Value>
<Value name="23">
<Value>Language</Value>
</Value>
<Value name="24">
<Value>Lang</Value>
</Value>
</Data>
<DataLocation>^Community.PostD</DataLocation>
<DefaultData>PostDefaultData</DefaultData>
Expand Down
6 changes: 3 additions & 3 deletions src/cls/History/ChampionshipPositions.cls
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Relationship Member As Community.Member [ Cardinality = one, Inverse = Positions

Index Member On Member;

Relationship GroupClass As Community.Group [ Cardinality = one, Inverse = Positions, OnDelete = cascade ];
// Relationship GroupClass As Community.Group [ Cardinality = one, Inverse = Positions, OnDelete = cascade ];

Index GroupClass On GroupClass;
// Index GroupClass On GroupClass;

Property CommentVotes As %Integer;

Expand All @@ -31,7 +31,7 @@ Property Overall As %Integer [ Calculated, SqlComputeCode = { set {*} = {Comment

Property Added As %Date;

Index MemberAndAddedAndGroup On (Member, Added, GroupClass);
Index MemberAndAdded On (Member, Added);

Storage Default
{
Expand Down
9 changes: 9 additions & 0 deletions src/cls/History/Views.cls
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Property Delta As %Integer;

Index DateOfDataAndPost On (DateOfData, Post) [ Unique ];

/// This is fake property, please don't use it in DeepSee
Property Lang As %String [ Calculated, SqlComputeCode = {set {*} = ##class(Community.Post).%OpenId({Post}).Lang}, SqlComputed ];

ClassMethod InsertHistoryViews() As %Status
{
set sc = $$$OK
Expand Down Expand Up @@ -113,6 +116,12 @@ Storage Default
<Value name="5">
<Value>Delta</Value>
</Value>
<Value name="6">
<Value>Language</Value>
</Value>
<Value name="7">
<Value>Lang</Value>
</Value>
</Data>
<DataLocation>^History.ViewsD</DataLocation>
<DefaultData>ViewsDefaultData</DefaultData>
Expand Down

0 comments on commit 8adbeed

Please sign in to comment.