Is it possible to run a batch file containing a lotus script? Would it also be possible to include a lotus script and then another language for example ksh's? If yes then could you please give me some samples or tutorials on how to do it?
What I need to do is this:
There is already an existing batch file which contains a ksh's that updates the value in an excel files every time it is executed.
What I need to do is include two new functions, first I need to download the excel file from a rich text in a document of lotus notes, then run the functions above written in ksh's after that
I need to re-upload it or update the excel file which is in the lotus notes document. I used lotus script for the added functionality.
I also don't know how to use or create ksh's and batch files. Thanks.
I personally would turn around the logic: why not use a scheduled LotusScript or Java- Agent, detach the file from the richtextitem and then run the ksh from there (e.g. using the Shell- Command of LotusScript)...
That way you can code the stuff you need in the languages that are best for your purpose. You could even attach the ksh to a configuration document and detach it on the fly Or build the ksh completely on the fly (with write commands)... That makes this solution replicate to any number of servers without having to distribute your ksh to each of them...
LotusScript runs only within a scripting host engine provided by IBM Lotus, but LotusScript isn't the only way to access Lotus Notes data.
You haven't said what platform you are running ksh on. You mention that you are operating on Excel files, so if you are running your scripts on Windows it may be possible for you to use the Lotus Notes COM classes. Those classes are almost exactly the same as the back-end classes that you would have available in LotusScript, but I have no idea whether any version of ksh (not to mention whatever version you are using) supports the CreateObject call or any other way to access COM classes.
However, a ksh script can certainly run Java programs, and there are Java classes for Lotus Notes that are (again) almost exactly the same as the back-end classes that you would use in LotusScript. It seems to me that the obvious thing for you to do is write a small Java program to retrieve the file from the Domino server, and another Java program to re-upload it after. Then have your script run the program to do the download, run the commands to modify the Excel data, and then run the program to do the upload.
Related
Using the Domino/Notes API, when importing DXL design elements (for example a LotusScript agent), you have the option to either compile LotusScript code at the time of import, with DXLImporter.setCompileLotusScript(boolean flag), or leave the code uncompiled. If you leave the code uncompiled, then Domino will compile the code before first use. This is all fine with LotusScript.
Reading the API, I see no option for Java code. How can you compile Java code for use after importing from DXL programmatically?
(The question is not how you do it manually (like open every Java design element and save it to force compilation) but how it can be done programmatically)
You're going to need to do something along the lines of what the ODP to NSF compiler does https://frostillic.us/blog/thread.xsp?thread=NSF+ODP+Tooling. For obvious reasons (OSGi dependencies, Java library accessibility, builder processes etc) it's not a trivial task.
I want to know some way to extract the entire script from all design elements, forms, agents, views etc. I know that in MS .NET we use reflection to get the entire code, classes, functions, properties, everything. I wonder if this is also possible using lotus script or any third party tool. In fact, my basic requirements is to search for anything in the entire script in the Lotus Designer using Ctrl+F but that doesn't help, whereas in Visual Studio.NET one can easily search the project or even the entire solution for the specific keyword.
Thanks,
baburman
You can search for every string in database's code in Domino Designer at menu entry
Search / File...
If you still need to export all LotusScript code of a database,
execute menu File / Application / Design Synopsis... or
export database design as DXL
We want to program a pre-commit hook on our linux based svn server which executes some checks on the properties of ms word documents (e.g. author, version, etc.) during their initial check-in.
Is there any way to read out these properties with some e.g. scripting language or C++ code on a linux system?
Depending on what version of Word you're working with, possibly.
The DOCX format is really a ZIP file which contains a number of files (many XML) that make up the Word document. It's based on the Office Open XML format. If you unzip it and look in the docProps directory that's created, core.xml contains several nodes that may be of use to you: dc:creator, cp:lastModifiedBy, cp:revision. Interrogate those with your scripting language/XML library of choice.
Anybody have a good approach to automate the batch creation of custom-formatted Excel workbooks at a regularly scheduled time or after an event occurs (e.g., file created, table loaded)?
To make things even more interesting, let's further assume that the source data is in a relational database or Unix file, and the results need to be e-mailed or transmitted to a Unix web server. Thanks!
In fact this is not a question, but a series of questions. I can see the following distinct questions inside this one (assuming, that you are going to use a scripting language like perl or python or something similar):
The task must be performed
At regular time intervals: use cron
After a predefined event: not much to say here, it depends on what exactly you want.
The data has to be retrieved from:
from the database: use the bindings for your language for the specific database you are using (example: python bindings for sqlite3)
from a file (what is a Unix file anyway?): depending on the format of the file you can get away by using sed/awk or write a parser in your scripting (or otherwise :P) language of choice.
The data has to be massaged into an excel workbook. Well, I am not so sure, what you mean by "custom formatted", but the easiest way to create an excel workbook is, indeed, just dumping it to .csv, but you can go further and actually produce a "pseudo-xls", by using the following template and saving the resulting file as .xls (it actually works):
<table>
<tr>
<td>field0</td>
<td>field1</td>
..
<td>fieldX</td>
</tr>
... ad inf
</table>
The resulting file has to be:
emailed: use the mail command, which usually points to the default mailer on your system (exim, sendmail, postfix)
"transmitted" to a web server, - I am assuming here, that this means "transfered to another machine, so that it can be made accessible via http(s)". In that case you can use ftp, sftp or rsync (my favourite).
Sorry for being extremely non-specific, but it is not easy to deduce what exactly you are trying to achieve from your question.
Excel can read .csv (comma-seperated variable) or .tsv (tab-seperated variable) files. It's 'trivial' to dump your output into a csv (just make sure you escape any commas or tabs in your input), and excel can then read that.
If you want to produce a .xls file, you'll have to find a library in your language of choice that implements handling of .xls files. For instance, if you're using python, there's an entire mailing list devoted to talking about doing this
Is there anyway by which we can read a value from an .xls file using nant scripts.The nant scripts should ask the input from the user and based on the inputs the nant.build should search the .xls file and when it sees the match,it should copy the corresponding mail ID and echo that mail ID to some other file and that echoed value should be placed in the mail section of the cruise control.NET .
Please get back to me for any more clarifications
Thanks
GNR
You should write an NAnt extension. It is relatively easy to do.
See this tutorial here
As an example project see my question here and here.
I'll re-phrase my answer :
"Is there anyway by which we can read a value from an .xls file using nant scripts"
If you are talking about using the 'core' NAnt functionality, which is that funcationality that is provided within the basic installation of NAnt, then I would say "No" or "Not very easily".
You can however extend NAnt using .NET libraries to perform whatever function you want, as long as you can code that function in a .NET language.
So, for you to solve your problems, the steps you need to under-take in my view are :
(a) Write a .NET library with methods that undertake the function(s) you describe
(b) Use the 'extensibility' of NAnt to turn your library in (a) into a custom task you can then call directly from your NAnt script
Obviously, you need to be able to break your problem down so that you can code it for part (a). Once you have done that, part (b) is reasonably trivial, and the tutorial I supplied in the link should easily walk you through this.