What is the best way of importing new class files (.CLS) that Git has placed in my Atelier project folder?
I need to be able to do it from the command prompt as I want to script it.
Fred
The tool that compiles source code to another form of executable code.
What is the best way of importing new class files (.CLS) that Git has placed in my Atelier project folder?
I need to be able to do it from the command prompt as I want to script it.
Fred
This is a translation of the following article. Thanks @Evgeny Shvarov for the help in translation.
Let's assume that you wrote a program that shows "Hello World!", for example:
write "Hello, World!"
The program works and everyone is happy.
With time, however, your program becomes more complex, gets more features and you eventually need to show the same string in different languages. Moreover you don't know the number and names of these languages.
The spoiler below contains a description of how the task of multi-language localization is solved in Caché.
I wonder if you could help me? I have a regular cache class that accepts a variable number of arguments in one of the methods. It works fine so I decided to add a method to my web service to make the call to the cache class. I get a compile error on the web service with error#5130.
Here is the cache class
class method GenerateFileFromSQL(file As %String, sql As %String, delimiter As %String = "", args...) As %Status
and here is the web service code that calls it:
ClassMethod GenerateFileFromSQL(file As %String, sql As %String, delimiter As %String = "", args...) As %String [ WebMethod ]
On the back of my recent post on writing bug-less code I wanted to raise a few suggestions (to ISC) that would help prevent certain types of bugs at compile time. I've probably missed a few, but these are the main ones in my mind. Please contribute more suggestions.
Btw, these also serve as potential gotchas for new COS developers.
I have classes A and B, B derived from A, A has method Abc.
From INT of class B I see that compiler copies implementation of Abc to class B, so that Abc exists both in A and B.
As result, when B invokes Abs, B.Abs() is executed instead of A.Abs(). In result debuger is not able to step into Abs and breakpoints in A.Abs never hit.
Why this happens and how can I avoid this?
Update:
OK, now I know the reason: compiler makes the copy if Abc has this line:
s cn=##Expression($$$quote(%classname))
Hi All,I got an error when i compile one class. the error was objects of class are (classname) instantiated in 1 processes.how can i recover the problem. my cache instance is Cache 5.0
Due to a new project I'm getting involved inside %Installer stuff deeper than ever I'd be happy to. Most of it was pretty easy to get, thanks to documentation, articles and SAMPLES example, while I can't dig good solution for one problem. I'm trying to import and compile some classes, willing to ignore two types of errors: 5202 (NothingToCompile) and 5373 (PredecessorClassDoesNotExist - a normal case when SNMP sampling class is compiled for the 1st time, before it was registered).
I've tried the following:
The class %Compiler.UDL.TextServices arrived in 2015.1, bringing us methods for exporting a class in UDL format (i.e. looking just like we're used to seeing it in Studio), and importing a UDL format definition back into a namespace. Some source control tools including our Deltanji are now able to use UDL format, resulting in diffs that are easier to understand.
Hi all!
I'm developing a mini-framework to implement annotations in Cache. I want to support two kind of annotations: metadata and method decorators. I've got stuck trying to implement the second one.
With metadata annotations I can add metadata to any kind of target. A target can be a method/classmethod, parameter, property and class.
For example:
Class cache.TestClass Extends lib.Annotations{/// @Author(UserName = "me")ClassMethod Test(){Write "Test!",!}}Hi All,Can you please any one tell me how to find the last compilation date of routine.
Here you have an easy way to write and execute COS code from your unix scripts. This way one does not need to write routines or even open Studio or Atelier. It can be an option for simple and small actions for instance things like installation tasks or compiling.
See sample bash script (compile.sh) to compile classes:
I'm new to Cache and trying to follow the Using Cache Studio PDF. In section 2.4.3(Adding a Zen form) it tells you insert the following code;
<button caption="Save" o select="zenPage.saveRecord();" />
Unfortunately that code fails compilation. If you try and use the tools there is no o select option nor a select or onselect option. I was wondering if anyone has used this PDF before and knows what the correct attribute should be?
I have the following problem:
So how do I force classes with method generators to recompile when "u" qualifier is present?
Greetings! This article describes yet another simple way of creating installers for the solutions based on InterSystems Caché. The topic covers applications, which can be installed or completely removed from Caché with one action only. If you are still documenting installation instructions that have more than one step to do to install your application — it’s high time you automated this process.
Is there a way to manually compile a class or package without having to save?
Using the perforce integration I did a "Undo Check Out" and the code was revered but not compiled.
CLARIFICATION: From the Atelier UI.
Here's my code (download):
Class Utils.Generators [ Abstract ]
{
ClassMethod B()
{
s ^a = 1
}
ClassMethod A() [ CodeMode = objectgenerator, GenerateAfter = B, PlaceAfter = B ]
{
k ^a
do ..B()
}Now, obviously for it to work I need method B compiled and ready to use before compiling method A().
I test it with the following code:
do $system.OBJ.UnCompile("Utils.Generator")
do $system.OBJ.Compile("Utils.Generator")Yet, I receive the following compilation error:
Hi -
I'm trying to create a method that will automatically create something I can save and use later, which will let me automate data migration from one version of a class to the next.
[SOLVED]
added
>/tmp/compilew.log &>/tmp/compilew.log ; tail /tmp/compilew.log
to redirect the output to the stdout. Somehow the javac has wierd behavior with the output on errors and verbose information.
Hi,
i want the JAVA-Projections and wrappers to compile after Caché created the files. The creation of the files works 100%.
My addition to createProjection in our Projectionclass is following:
So another topic that has been of interest to a number of people since the beta was put up last week is in regard to Studio Hooks and Atelier. This requires a bit of background and then some discussion of how the architecture of Atelier necessitates some changes and then what our current thinking on the subject is.
Is the default language (i.e., $$$DefaultLanguage, which is used as the basis for localization with $$$Text/etc. at compile time) always "en" for new Caché installations, or could it be different? How is this determined? I don't see an option to select a language during Caché installation.
Also, is there a supported/preferred API for setting the default language? Looking at %occMessages.inc, one option would be:
Set $$$DefaultLanguageNode = "en"
But I'd expect there to be a classmethod for this somewhere (and haven't managed to find it yet).
The attached file contains an example of code generation using ObjectGenerators which builds a very simple homemade RuleEngine.
Code generation is an excellent way of increasing performance moving run-time calculations to compile-time.
We could generate code creating routines or implemeting methods using ObjectGenerators. In this example we are using ObjectGenerators.
Update: Rule Engine is now on GitHub https://github.com/intersystems-ib/cache-iat-ruleengine
For starters, let's begin with a very basic code generated method:
Hi!
We need to use a bash script under Linux in order to export a namespace's clases (*.cls), project (*.prj), *.inc and all related stuff (except generated and mapped clases). All these elements must be stored on a XML file.
We need to use a bash script under Linux to import and compile previously exported XML file (from Studio, Management Portal, or Export Script) .
Can anyone help us to develop them?
Thanks in advance!
I am using &html<> to output some CSS to my page (which is a class-based and not a tag-based page), and the selectors contain the '>' character which the compiler chokes on. How can I escape the '>' so it still displays as such in the web page source but doesn't trip up the compiler?
This is for 2012.2 btw.