Move bundle of classes in a different package

3 views
Skip to first unread message

Neerav Verma

unread,
Nov 18, 2009, 4:30:38 PM11/18/09
to Ensemble-in...@googlegroups.com
By mistake we made hundreds of classes in a wrong package
Now we need to move them to a different package

In java you just rename the base package and all is well but  here only way I know how to do is CopyClass one by one

Is there an efficient way to do it ?

Thank You,

Neerav Verma
http://www.linkedin.com/in/vneerav
------------------------------------------------------
Joan Crawford  - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend."

Benjamin Spead

unread,
Nov 18, 2009, 4:32:44 PM11/18/09
to ensemble-in...@googlegroups.com

You might be able to programmatically change them using %Dictionary.ClassDefinition.  I have not tried this myself, although I have altered other properties through %Dictionary….

 


--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

Ted Peck

unread,
Nov 18, 2009, 4:40:32 PM11/18/09
to ensemble-in...@googlegroups.com
What I would do is export them all to an XML project file, do a global-replace in there, and then re-import after deleting the internal ones.
 
You could also write a COS routine to rename them but I think this is simpler.
----- Original Message -----
Sent: Wednesday, November 18, 2009 4:30 PM
Subject: [InterSystems-EnsHlth] Move bundle of classes in a different package

--

Michael Hall

unread,
Nov 18, 2009, 4:39:05 PM11/18/09
to ensemble-in...@googlegroups.com
I just export to xml and do a global replace...


Mike Hall



On 11/18/09 2:30 PM, "Neerav Verma" <vne...@gmail.com> wrote:

By mistake we made hundreds of classes in a wrong package
Now we need to move them to a different package

In java you just rename the base package and all is well but  here only way I know how to do is CopyClass one by one

Is there an efficient way to do it ?

Thank You,

Neerav Verma
http://www.linkedin.com/in/vneerav
------------------------------------------------------
Joan Crawford <http://www.brainyquote.com/quotes/authors/j/joan_crawford.html>   - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend."

Neerav Verma

unread,
Nov 18, 2009, 4:41:20 PM11/18/09
to ensemble-in...@googlegroups.com
OMG you guys saved me hours of work

Thank You So Much,


Neerav Verma
http://www.linkedin.com/in/vneerav
------------------------------------------------------
Ogden Nash  - "The trouble with a kitten is that when it grows up, it's always a cat."

--

Ted Peck

unread,
Nov 18, 2009, 5:00:01 PM11/18/09
to ensemble-in...@googlegroups.com
You have to watch out if they are persistent classes because you'll probably want to also change the storage locations to match your new package/class names.
----- Original Message -----

Andy

unread,
Nov 18, 2009, 11:52:19 PM11/18/09
to InterSystems: Ensemble in Healthcare
When I have done this, I export the package using do
$System.OBJ.ExportPackage("PackageName","filename.xml")

open the XML file with notepad and globally change the

<Class name="XXXX.Classname"> to <Class name="YYYY.Classname">

save and then just import and compile.

Then just delete the old

Andy

On Nov 19, 7:32 am, Benjamin Spead <Benjamin.Sp...@intersystems.com>
wrote:
> You might be able to programmatically change them using %Dictionary.ClassDefinition.  I have not tried this myself, although I have altered other properties through %Dictionary....
>
> ________________________________
> From: n...@weconnect.us [mailto:n...@weconnect.us] On Behalf Of Neerav Verma
> Sent: Wednesday, November 18, 2009 4:31 PM
> To: Ensemble-in...@googlegroups.com
> Subject: [InterSystems-EnsHlth] Move bundle of classes in a different package
>
> By mistake we made hundreds of classes in a wrong package
> Now we need to move them to a different package
>
> In java you just rename the base package and all is well but  here only way I know how to do is CopyClass one by one
>
> Is there an efficient way to do it ?
>
> Thank You,
>
> Neerav Vermahttp://www.linkedin.com/in/vneerav
> ------------------------------------------------------
> Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html>  - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend."
Reply all
Reply to author
Forward
0 new messages