Short tip: Getting the protocol name from a request in a servlet

This is a very simple and little function that gets the name of the protocol used when accessing the servlet. Great if you want to construct a URL… /** * Returns the protocol name (http/https etc) *that the request was made with. * * @author Johan Känngård, http://dev.kanngard.net * @param request the request that should […]

Short tip: What is Lsi_Info?

Lsi_Info is a built-in function in LotusScript that has some goodies: Lsi_info(1) ‘ Current line number (in the LS source) Lsi_info(2) ‘ The current function or sub Lsi_Info(3) ‘ The current module Lsi_Info(6) ‘ The version of LotusScript running Lsi_Info(9) ‘ Current language (en for english) Lsi_Info(12) ‘ The name of the function that called […]

Short tip: @ReplaceSubString in Java

/** * Replaces a subset of a string with another string. * This function is case sensitive. * * Example: * <code><pre> * String result = replaceSubString(”Johan Känngård”, * ”Johan”, ”Nisse”); * System.out.println(result); * </pre></code> * prints the string ”Nisse Känngård” to the console * * @author Johan Känngård, http://dev.kanngard.net * @param s – The […]

Show design elements in a view

I found an interesting old article at Dominopower, that explains how to modify a view to get design elements to show up in it. Unfortunately, the link to example database seems to be broken, so I will share what I have found out here. Why would I want a view to show design elements? It […]

Deploy a servlet that is not a direct subclass of HttpServlet

When trying to subclass anything but HttpServlet and deploying the servlet to the server, the error below is written to the log. That is because a servlet´s direct super class must be the javax.servlet.http.HttpServlet class. If it was possible to subclass your own class, you could create your own ”standard servlet” that all your other […]

Access resources in a Java agent

If you want to access resources in a JAR-file or other resource (added with ”Edit project”) from a Java agent, you can not use the following code: URL resourceURL = this.getClass().getResource(resource); logger.debug(”resourceURL: ” + resourceURL); The getResource() method always return null. Instead, you have to use the getResourceAsStream() like this: String resource = ”/org/apache/log4j/xml/log4j.dtd”; InputStream […]

Collection of SmartIcon formulas

The following formulas are very useful in SmartIcons, so you don´t have to create an agent in every database for them. To get the NoteID of the selected document: @Prompt([OKCANCELEDIT]; ”NoteID”; ”NoteID”; @Text(@NoteID)); To get the UNID of the selected document: @Prompt([OKCANCELEDIT]; ”UNID”; ”Unique ID”; @Text(@DocumentUniqueID)); To run the opened agent: @Command([ToolsRunMacro]; $Title); To set […]

What is the $fields in design documents?

Updated 2003-01-08 with information from Donna Dixon. Thanks! Field Possible values Used by Description $ACTIONS ? ? ? $AssistAction – Agent, Script Library The source of a LotusScript agent. Lines are terminated by a chr(10). In a Java library, contains the names of the JARs. $AssistAction_Ex – Agent The compiled code of a LotusScript agent. […]