List of all Classes in Namespace

199 views
Skip to first unread message

marcel weilacher

unread,
Nov 28, 2003, 3:55:35 AM11/28/03
to x...@info2.kinich.com
Hi -
i want to make a combo box - which includes
all classes in a namespace.
How can i do this ?

Best Regards
Marcel :)


Sukesh Hoogan

unread,
Nov 28, 2003, 4:32:28 AM11/28/03
to x...@info2.kinich.com
1. You can run Summary query of %Dictionary.CompiledClass class or
%Dictionary.ClassDefiniton classes.


--
Regards

Sukesh Hoogan
e-Compact Enterprise Solutions.
Bombay, India
sukesh...@vsnl.com
website : http://personal.vsnl.com/sukesh_hoogan
Reply to the newsgroup only, everybody benefits.

"marcel weilacher" <ma...@nkylab.de> wrote in message
news:3fc70...@info2.kinich.com...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003



marcel weilacher

unread,
Nov 28, 2003, 4:53:45 AM11/28/03
to x...@info2.kinich.com
Hi again Sukesh
sorry - i did not understand what you mean ?
I have tried SELECT * FROM %Dictionary.CompiledClass
in SQL Manager - that doesn`t work...
so i have read the manual - but i haven`t found anything helpful :(

regards Marcel

Peter Cooper

unread,
Nov 28, 2003, 5:52:15 AM11/28/03
to x...@info2.kinich.com
Marcel

Quick and dirty hack

set t=$order(^oddDEF("%~"))
while t'=""
{
write !,t
set t=$order(^oddDEF(t))
}


Peter

On Fri, 28 Nov 2003 10:53:45 +0100, marcel weilacher <ma...@nkylab.de>
wrote:

marcel weilacher

unread,
Nov 28, 2003, 5:57:00 AM11/28/03
to x...@info2.kinich.com
Oh yeah ! Thanx a Lot Peter !
Quick and Dirty - but great Results ;)

more questions about this:
can i use any filter methodes here - to get
eg: - only data with name "sport" - or must i filter
the stings manually in the loop ?

The second thing is no problem - but a filter were my
preferred way :)

Big Thanx !
marcel

Peter Cooper

unread,
Nov 28, 2003, 6:34:56 AM11/28/03
to x...@info2.kinich.com
Write it in the loop

set t=$order(^oddDEF("%~"))
while t'=""
{
if t["sport" {
write !,t
}
set t=$order(^oddDEF(t))
}

do be a bit careful here you have to know what you are doing

^oddDEF contains the uncompiled class definitions
because a compiled class can have lots of thingys inherited from all
over these will not be in ^oddDEF

the sister to this is
^oddCOM
that contains the compiled class definitions


As I said it's quick and dirty
I would NOT,NOT,NOT use this myself in any deployed application -
undocumented, internal, may change in future versions etc etc etc

but for a quick one off maintenance job then I would use this

=========
Sukesh's method would be
kill
set x=##class(%ResultSet).%New("%Dictionary.CompiledClass:Extent")
write x.Execute()
1
for quit:'x.Next() write !,x.GetData(1)

peter


marcel weilacher

unread,
Nov 28, 2003, 6:50:04 AM11/28/03
to x...@info2.kinich.com
Peter
- i try to use Sukesh Version ! Because our
firm wanted to sell this product :)
Cache is making me crazy :) It`s very good and fast - but
complicated *g

Thx for your patience !
regards
Marcel

Herman Slagman

unread,
Nov 28, 2003, 7:04:58 AM11/28/03
to x...@info2.kinich.com
Peter,

> thingys

playing with your thingys again ;-)

Herman



Cristiano José da Silva

unread,
Nov 28, 2003, 7:27:35 AM11/28/03
to x...@info2.kinich.com
Marcel in the csp page add this script:

<csp:query name="query" classname="%Dictionary.CompiledClass"
queryname="Summary">
<Select>
<csp:while counter=queryRow condition=query.Next()>
<option value="#(query.GetData(1))#">#(query.GetData(1))#</option>
</csp:while>
</select>

The combo will have in the attribute value the names of the classes

This line <csp:query name="query" classname="%Dictionary.CompiledClass"
queryname="Summary"> is identical to:
<Script Language="Cache" Runat="Server">
set query =
##class(%ResultSet).%New("%Dictionary.CompiledClass:Summary")
do query.Execute()
</Script>

Cristiano

InterSystems, Brazil

"marcel weilacher" <ma...@nkylab.de> escreveu na mensagem
news:3fc70...@info2.kinich.com...

Peter Cooper

unread,
Nov 28, 2003, 7:33:30 AM11/28/03
to x...@info2.kinich.com
Actually I quite like the term "thingy"
It's has neutral meaning that covers
"some sort of techy thing that I don't have time to fully explain here
- if you want to know the details look it up"

another term would be "stuff"


Whereas if I used a specific term then I would be making an exact
statement that may be inaccurate or incomplete

so in this case
"lots of thingys inherited"

to be precise would be an essay on oo inherintenace with Cache
specific rules, listing all the properties, methods, triggers,
storages, parameters etc etc that could be on ^oddDEF - unless they
are specifically overriden - paying attention to the precedence order
- unless it is the first persistent definition in which case this
defines the extent that is used for the storage...............

"stuff" or "thingys" are good terms given the above defn and allows me
to get the message across without having to write an essay

or at least that's MO

Peter

Peter

marcel weilacher

unread,
Nov 28, 2003, 8:11:14 AM11/28/03
to x...@info2.kinich.com
Thanx Christiano - nice work :)

regards Marcel

marcel weilacher

unread,
Dec 1, 2003, 9:52:45 AM12/1/03
to x...@info2.kinich.com
Hi
i have another question:

How to delete a global via COS or CSP ?

regards Marcel

Jon Diamond

unread,
Dec 1, 2003, 10:16:57 AM12/1/03
to x...@info2.kinich.com
To answer the question - from COS: kill ^global

However, life is more complicated if your global is actually object data
generated by Class storage, since there are almost certain to be several
globals per class.

If you use the object stuff then ONLY kill individual globals if you REALLY,
REALLY know what you're doing.
-----------------------------------
Jon Diamond, Diamond Consulting

"marcel weilacher" <ma...@nkylab.de> wrote in message
news:3fcb5...@info2.kinich.com...

marcel weilacher

unread,
Dec 1, 2003, 10:27:37 AM12/1/03
to x...@info2.kinich.com
Hi Jon

Thanx for your help - i will be careful with it :)

regards Marcel

kevin furze

unread,
Dec 1, 2003, 1:25:44 PM12/1/03
to x...@info2.kinich.com
Marcel,
go to http://www.mgateway.com/extreme1.doc
and take a look at this one, its how to programme mumps (M) or COS
globals and so on. its a great place to start, but like Jon said, if
the data is as a result of Cache classes, then I always prefer to use
the approved class methods to delete data. if you use the approved
methods than ALL associated globals (that's indices, linked data
globals and so on) are totally deleted.

I guess you could also use SQL - so there's a variety of methods
without resorting to the good old fashion "Kill ^globalName


kev

marcel weilacher

unread,
Dec 1, 2003, 5:35:37 PM12/1/03
to x...@info2.kinich.com
Hi kevin
Thanx for the Link !!!
----
if you use the approved
methods than ALL associated globals (that's indices, linked data
globals and so on) are totally deleted.
----

yes - it should be a totally delete ! this function will only be used
when we sell our system ....then parts of them - personal stuff e.g.
should be deleted..

regards Marcel

marcel weilacher

unread,
Dec 4, 2003, 9:00:35 AM12/4/03
to x...@info2.kinich.com
Hi
i have a little problem
i have build the form - in which i can delete my
globals..

and everythings works - only the kill will not kill my global :)
i have checked all of the parameters - they are correct...
i get also a response - "deleting successully" (my own response)
but the global isn`t deleted ...

Here is the surce - just cut & paste ...i have commented out the kill
command - so you can`t do any bad things....

[code]
<HTML>
<HEAD>
<TITLE> Cache Server Page </TITLE>
</HEAD>
<BODY>

<SCRIPT LANGUAGE="JAVASCRIPT">
function loadNew(pName)
{
window.location.href="test.csp?Global="+pName;
}

function remove(pName)
{
window.location.href="test.csp?Global="+pName+"&KILL=TRUE";
}
</SCRIPT>


<TABLE>
<TR>
<TD>
<FIELDSET><legend>Global zum löschen auswählen<legend>
<csp:query name="query" classname="%Dictionary.CompiledClass"
queryname="Summary">
<Select>
<csp:while counter=queryRow condition=query.Next()>
<option value="#(query.GetData(1))#"onClick="loadNew(this.value)">
#(query.GetData(1))#
</option>
</csp:while>
</select>
<br><br>
<SCRIPT LANGUAGE="CACHE" RUNAT="SERVER">
w (%request.Get("Global"))

if ($D(%request.Data("Global",1)))
{
w "&nbsp;&nbsp;<input type='button' value='LÖSCHEN?'
onClick=remove('"_(%request.Get("Global"))_"')>"
}

if ($D(%request.Data("Global",1)) && ($D(%request.Data("KILL",1))))
{
w "&nbsp;<FONT COLOR=#FF0000>wurde gelöscht</FONT>"
//kill ^%request.Get("Global")
}
</SCRIPT>

</FIELDSET>
</TD>
</TR>

<TR>
<TD>
<br><br><br>
<FIELDSET><legend>Mehrere Globals löschen<legend>
IN ARBEIT
</FIELDSET>
</TD>
</TR>
</TABLE>

</BODY>
</HTML>
[/code]



John Murray

unread,
Dec 4, 2003, 9:33:46 AM12/4/03
to x...@info2.kinich.com
Marcel,

> //kill ^%request.Get("Global")

Try:

kill @%request.Data("Global",1)

You need the indirection to say "kill the variable named in
%request.Data("Global",1)

I'm assuming you include the ^-prefix in the value of Global passed from the
browser. If not, add it at the Cache end:

kill @("^"_%request.Data("Global",1))

But as a general rule, use of indirection (or Xecute) in the server-side
methods of a CSP page presents a huge security risk.

HTH

John Murray
George James Software
www.georgejames.com

"marcel weilacher" <ma...@nkylab.de> wrote in message
news:3fcf3...@info2.kinich.com...

marcel weilacher

unread,
Dec 4, 2003, 9:45:17 AM12/4/03
to x...@info2.kinich.com
Hi John
i had tried - like in your description
but with

kill @("^"_%request.Data("Global",1))

i get no error....but my global isn`t deleted

regards Marcel

Peter Cooper

unread,
Dec 4, 2003, 10:56:30 AM12/4/03
to x...@info2.kinich.com
marcel

worth while checking to see what's actually in
%request.Data("Global",1)

use serenji or quick and dirty...
set ^fred($zh)=$g(%request.Data("Global",1))

and then exmamine ^fred to see whats going on


Peter




marcel weilacher

unread,
Dec 5, 2003, 2:55:26 AM12/5/03
to x...@info2.kinich.com
Hi Peter
i have treid the following

set ^fred($zh)=$g(%request.Data("Global",1))
kill ^fred

But the global isn`t deleted ???

Or have i misunderstood you ?

regards marcel

Peter Cooper

unread,
Dec 5, 2003, 5:22:17 AM12/5/03
to x...@info2.kinich.com
Marcel

>Hi Peter
>i have treid the following
>

^fred is a scratch global - it's the one I use to keep debugging stuff
the idea is that I am writing to ^fred the values passed into the CSP
page so that I can examine them from the command line

$zh=number of seconds/milliseconds since the system started

>set ^fred($zh)=$g(%request.Data("Global",1))
this is in the CSP page - it writes the content on %request to a
global fred


or you could do the whole contents of %request with
merge ^fred($zh)=%request.Data

why are you doing this - you have just deleted the data that you want
to look at
>kill ^fred


you then go to the command line in the right namespace and

do ^%G
Global>fred

you should see something like

^fred(101.0001)=nnnnnnnn
^fred(102.0121)=nnnnnnn
one entry for each page call

and from this you can see what is actually getting into the CSP page

Peter
Reply all
Reply to author
Forward
0 new messages