Skip to content

Commit

Permalink
move sc to dev, add deepsee class for check source data
Browse files Browse the repository at this point in the history
  • Loading branch information
gevorg95 committed Apr 2, 2018
1 parent 4dbbd12 commit dc53d39
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cls/sc/code.cls → cls/dev/code.cls
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Export different types of modules in different subfolders in UDL (plain) format
/// test.dfi -> /dfi/test.dfi
/// testpkg.test.cls -> /cls/testpkg/test.cls
Class sc.code [ Abstract ]
Class dev.code [ Abstract ]
{

/// export all available code
Expand Down Expand Up @@ -181,7 +181,7 @@ ClassMethod patch(filename = "", commitFrom = "", commitTo = "") As %Status
set:commitTo="" commitTo=1
if (git = 0) {
set:(commitFrom="")||(commitFrom=1) commitFrom=0
set sc = ##class(sc.diff.gitLocal).buildDiff(..workdir(), "HEAD~"_commitTo, "HEAD~"_commitFrom, .items)
set sc = ##class(dev.diff.gitLocal).buildDiff(..workdir(), "HEAD~"_commitTo, "HEAD~"_commitFrom, .items)
return:$$$ISERR(sc) sc
}elseif(git = 1) {
set owner = @gln@("owner")
Expand All @@ -190,7 +190,7 @@ ClassMethod patch(filename = "", commitFrom = "", commitTo = "") As %Status
set password = @gln@("password")
set:commitFrom="" commitFrom=1

set sc = ##class(sc.diff.gitHub).Get(.items, owner, repository, user, password, commitFrom, commitTo)
set sc = ##class(dev.diff.gitHub).Get(.items, owner, repository, user, password, commitFrom, commitTo)
return:$$$ISERR(sc) sc
}

Expand Down
70 changes: 70 additions & 0 deletions cls/dev/deepsee.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Class dev.deepsee
{

ClassMethod checkDataSource(onlyerror As %Boolean = 1)
{
set sc = $$$OK
&sql(DECLARE C1 CURSOR FOR SELECT ID into :id FROM %DeepSee_Dashboard.Definition)
&sql(OPEN C1)
&sql(FETCH C1)
WHILE (SQLCODE = 0)
{
set dashbord = ##class(%DeepSee.Dashboard.Definition).%OpenId(id)


set widgets = dashbord.widgets
for i=1:1:widgets.Count()
{
set widget = widgets.GetAt(i)
set pivotName = widget.dataSource
set sc = ..getMdx(pivotName, .MDX)
set sc = ..checkPivot(MDX)

continue:sc&&onlyerror

w:i=1 dashbord.name,!
w " pivot: ",pivotName," status: "_$select(sc'=1:$System.Status.GetErrorText(sc),1:"OK"),!
}
&sql(FETCH C1)
}
&sql(CLOSE C1)
}

ClassMethod checkPivot(MDX As %String) As %Status
{
set sc = $$$OK
set rs = ##class(%DeepSee.ResultSet).%New()

set sc = rs.%PrepareMDX(MDX)
return:$$$ISERR(sc) sc

set sc = rs.%ExecuteAsynch()
return:$$$ISERR(sc) sc

return sc
}

ClassMethod getMdx(pPivotName As %String, Output MDX) As %Status
{
#dim tPivot As %DeepSee.Dashboard.Pivot
#dim tPivotTable As %DeepSee.Component.pivotTable
set MDX = ""

set tPivot = ##class(%DeepSee.UserLibrary.Utils).%OpenFolderItem(pPivotName,.sc)
return:'$IsObject(tPivot) $$$OK
return:$$$ISERR(sc) sc

set tPivotTable = ##class(%DeepSee.Component.pivotTable).%New()
set sc = tPivot.%CopyToComponent(tPivotTable)
return:$$$ISERR(sc) sc

set rs = tPivotTable.%CreateResultSet(.sc,,,,.MDX) // returns tQueryText - mdx without filters
return:$$$ISERR(sc) sc

set MDX = $TR(MDX,$C(10),"")

return sc
}

}

4 changes: 2 additions & 2 deletions cls/sc/diff/gitHub.cls → cls/dev/diff/gitHub.cls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Class sc.diff.gitHub
Class dev.diff.gitHub
{

ClassMethod Get(Output items, Owner As %String = "", Repository As %String = "", Username As %String = "clminstaller", Password As %String = "clminstaller2016", CommitFrom As %Integer = "", CommitTo As %Integer = "") As %Status
Expand Down Expand Up @@ -66,7 +66,7 @@ ClassMethod GetFileNameForReleaseBySHAs(Request As %Net.HttpRequest, SHAsList, O
set fileName = files.GetAt(j).%data("filename")
set:$L(fileName,".xml")'=1 fileName = $extract(fileName,1,*-4)
continue:..IsCacheFile(fileName)=0
do ##class(sc.diff.utils).ToCacheName(.fileName)
do ##class(dev.diff.utils).ToCacheName(.fileName)
set filesForRelease(fileName) = ""
}
}
Expand Down
2 changes: 1 addition & 1 deletion cls/sc/diff/gitLocal.cls → cls/dev/diff/gitLocal.cls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Class sc.diff.gitLocal
Class dev.diff.gitLocal
{

/// Get diff between two points in repository
Expand Down
2 changes: 1 addition & 1 deletion cls/sc/diff/utils.cls → cls/dev/diff/utils.cls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Class sc.diff.utils
Class dev.diff.utils
{

Parameter TRACKEDEXT As List = {$lb("xml", "cls", "csp", "csr", "mac", "int", "bas", "inc", "gbl", "prj", "obj", "pkg", "gof", "dfi", "pivot", "dashboard")};
Expand Down

0 comments on commit dc53d39

Please sign in to comment.