Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesRichTextItem
Set db = s.CurrentDatabase
files = ws.OpenFileDialog(True,"Выберите файлы для отправки",,"c:\")
If Isempty( files) Then
Exit Sub
End If
Stop
Set doc = New NotesDocument( db )
doc.Form = "Memo"
doc.SendTo = "Имя группы получатей" 'имя группы должно присутствовать в АК пользователя
doc.Subject = "Тема письма"
Set body = New NotesRichTextItem(doc, "Body")
Call body.AppendText("_:::. Смотрите прикрепленные файлы .:::_")
Call body.AddNewLine(2)
For i = 0 To Ubound (files)
Call body.EmbedObject(EMBED_ATTACHMENT, "", files(i))
Next
Call doc.Send( False )
31 января 2010 г.
27 января 2010 г.
"Опись имущества" Notes.ini
Бродя по интернету в поисках нужной информации, наткнулся на любопытный ресурс, который довольно подробно отражает настройки файла конфигурации notes.ini
Эта статья будет полезна как при настройке клиента, и безусловно при настройке сервера
Эта статья будет полезна как при настройке клиента, и безусловно при настройке сервера
Ярлыки:
notes.ini
25 января 2010 г.
Работа с массивом
Возникла необходимость создать массив с нужными мне указателями ...
Set view_characters = db.Getview("characters_teplo")
Dim nav As NotesViewNavigator
Dim entry As NotesViewEntry
Dim vecoll As NotesViewEntryCollection
Dim docArray(),q
'uin = uidoc.Document.Universalid
Set vecoll = view_characters.Getallentriesbykey(uin)
Set entry = vecoll.Getfirstentry()
Stop
q = 0
ReDim docArray(vecoll.Count-1,1)
While Not (entry Is Nothing)
If (entry.IsDocument) Then
docArray(q,0) = entry.Columnvalues(1)
Set docArray(q,1) = entry.Document
End If
q=q+1
Set entry = vecoll.GetNextEntry(entry)
Wend
В конечном итоге получается массив
("указатель1")("документ1")
("указатель2")("документ2")
Set view_characters = db.Getview("characters_teplo")
Dim nav As NotesViewNavigator
Dim entry As NotesViewEntry
Dim vecoll As NotesViewEntryCollection
Dim docArray(),q
'uin = uidoc.Document.Universalid
Set vecoll = view_characters.Getallentriesbykey(uin)
Set entry = vecoll.Getfirstentry()
Stop
q = 0
ReDim docArray(vecoll.Count-1,1)
While Not (entry Is Nothing)
If (entry.IsDocument) Then
docArray(q,0) = entry.Columnvalues(1)
Set docArray(q,1) = entry.Document
End If
q=q+1
Set entry = vecoll.GetNextEntry(entry)
Wend
В конечном итоге получается массив
("указатель1")("документ1")
("указатель2")("документ2")
Ярлыки:
array,
lotus script
22 января 2010 г.
Просмотр свойств индексирования БД Lotus

import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db = agentContext.getCurrentDatabase();
int options = Database.FTINDEX_ALL_BREAKS +
Database.FTINDEX_CASE_SENSITIVE;
if (db.isFTIndexed())
{
db.createFTIndex(options, true);
System.out.println("Параметры индекса");
System.out.println(Database.FTINDEX_ALL_BREAKS);
System.out.println(Database.FTINDEX_CASE_SENSITIVE);
System.out.println(Database.FTINDEX_ALL_BREAKS);
System.out.println(Database.FTINDEX_ATTACHED_BIN_FILES);
System.out.println(Database.FTINDEX_ATTACHED_FILES);
System.out.println(Database.FTINDEX_ENCRYPTED_FIELDS);
}
else
{
db.createFTIndex(options, false);
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
21 января 2010 г.
Lotus Notes 8.5.1 Rus
Ярлыки:
Lotus Notes 8.5.1
18 января 2010 г.
Проба пера - FTP connect
import org.apache.commons.net.ftp.*;
import java.util.Vector;
import java.io.*;
import java.net.UnknownHostException;
public boolean connectAndLogin (String host, String userName, String password)
throws IOException, UnknownHostException, FTPConnectionClosedException {
boolean success = false;
connect(host);
int reply = getReplyCode();
if (FTPReply.isPositiveCompletion(reply))
success = login(userName, password);
if (!success)
disconnect();
return success;
}
public void setPassiveMode(boolean setPassive) {
if (setPassive)
enterLocalPassiveMode();
else
enterLocalActiveMode();
}
public boolean ascii () throws IOException {
return setFileType(FTP.ASCII_FILE_TYPE);
}
public boolean binary () throws IOException {
return setFileType(FTP.BINARY_FILE_TYPE);
}
public boolean downloadFile (String serverFile, String localFile)
throws IOException, FTPConnectionClosedException {
FileOutputStream out = new FileOutputStream(localFile);
boolean result = retrieveFile(serverFile, out);
out.close();
return result;
}
public boolean uploadFile (String localFile, String serverFile)
throws IOException, FTPConnectionClosedException {
FileInputStream in = new FileInputStream(localFile);
boolean result = storeFile(serverFile, in);
in.close();
return result;
}
public Vector listFileNames ()
throws IOException, FTPConnectionClosedException {
FTPFile[] files = listFiles();
Vector v = new Vector();
for (int i = 0; i < files.length; i++) {
if (!files[i].isDirectory())
v.addElement(files[i].getName());
}
return v;
}
public String listFileNamesString ()
throws IOException, FTPConnectionClosedException {
return vectorToString(listFileNames(), "\n");
}
public Vector listSubdirNames ()
throws IOException, FTPConnectionClosedException {
FTPFile[] files = listFiles();
Vector v = new Vector();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory())
v.addElement(files[i].getName());
}
return v;
}
/** Создать новую директорию */
public int mkd(String dir) throws IOException {
return sendCommand(FTPCommand.MKD, dir);
}
/** Удалить файл */
public int deletfile (String file) throws IOException {
return sendCommand(FTPCommand.DELE, file);
}
/** Удалить директорию */
public int rmdir(String dir) throws IOException {
return sendCommand(FTPCommand.RMD, dir);
}
/** текущая директория */
public int pwd() throws IOException {
return sendCommand(FTPCommand.PWD);
}
/** сменить директория */
public int сwd(String dir) throws IOException {
return sendCommand(FTPCommand.CWD, dir);
}
public String listSubdirNamesString ()
throws IOException, FTPConnectionClosedException {
return vectorToString(listSubdirNames(), "\n");
}
private String vectorToString (Vector v, String delim) { StringBuffer sb = new StringBuffer();
String s = "";
for (int i = 0; i < v.size(); i++) {
sb.append(s).append((String)v.elementAt(i));
s = delim;
}
return sb.toString();
}
}
import java.util.Vector;
import java.io.*;
import java.net.UnknownHostException;
public boolean connectAndLogin (String host, String userName, String password)
throws IOException, UnknownHostException, FTPConnectionClosedException {
boolean success = false;
connect(host);
int reply = getReplyCode();
if (FTPReply.isPositiveCompletion(reply))
success = login(userName, password);
if (!success)
disconnect();
return success;
}
public void setPassiveMode(boolean setPassive) {
if (setPassive)
enterLocalPassiveMode();
else
enterLocalActiveMode();
}
public boolean ascii () throws IOException {
return setFileType(FTP.ASCII_FILE_TYPE);
}
public boolean binary () throws IOException {
return setFileType(FTP.BINARY_FILE_TYPE);
}
public boolean downloadFile (String serverFile, String localFile)
throws IOException, FTPConnectionClosedException {
FileOutputStream out = new FileOutputStream(localFile);
boolean result = retrieveFile(serverFile, out);
out.close();
return result;
}
public boolean uploadFile (String localFile, String serverFile)
throws IOException, FTPConnectionClosedException {
FileInputStream in = new FileInputStream(localFile);
boolean result = storeFile(serverFile, in);
in.close();
return result;
}
public Vector listFileNames ()
throws IOException, FTPConnectionClosedException {
FTPFile[] files = listFiles();
Vector v = new Vector();
for (int i = 0; i < files.length; i++) {
if (!files[i].isDirectory())
v.addElement(files[i].getName());
}
return v;
}
public String listFileNamesString ()
throws IOException, FTPConnectionClosedException {
return vectorToString(listFileNames(), "\n");
}
public Vector listSubdirNames ()
throws IOException, FTPConnectionClosedException {
FTPFile[] files = listFiles();
Vector v = new Vector();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory())
v.addElement(files[i].getName());
}
return v;
}
/** Создать новую директорию */
public int mkd(String dir) throws IOException {
return sendCommand(FTPCommand.MKD, dir);
}
/** Удалить файл */
public int deletfile (String file) throws IOException {
return sendCommand(FTPCommand.DELE, file);
}
/** Удалить директорию */
public int rmdir(String dir) throws IOException {
return sendCommand(FTPCommand.RMD, dir);
}
/** текущая директория */
public int pwd() throws IOException {
return sendCommand(FTPCommand.PWD);
}
/** сменить директория */
public int сwd(String dir) throws IOException {
return sendCommand(FTPCommand.CWD, dir);
}
public String listSubdirNamesString ()
throws IOException, FTPConnectionClosedException {
return vectorToString(listSubdirNames(), "\n");
}
private String vectorToString (Vector v, String delim) { StringBuffer sb = new StringBuffer();
String s = "";
for (int i = 0; i < v.size(); i++) {
sb.append(s).append((String)v.elementAt(i));
s = delim;
}
return sb.toString();
}
}
Ярлыки:
Class,
connection,
java code
Подписаться на:
Сообщения (Atom)