Отправляет email-рассылки с помощью сервиса Sendsay

Бюллетень "Lotus Notes CodeStore"

  Все выпуски  

Microsoft Office 2007 documents do not open/save correctly when accessed over the web


Рассылку ведет: Программист на Lotus NotesLotus CoderВыпуск No 262 от 2009-11-25
рассылка о программировании на Lotus Notes/Domino
Обсуждения на форумах, блогах. Примеры программного кода на LotusScript,@formula, Java

рассылка:выпускархивлентаблогсайт

Бюллетень "Lotus Notes CodeStore" Выпуск 13 от 21.04.2008

comp.soft.prog.lotuscodesrore

CodeStore. Примеры кодов

Еще примеры:
Больше кодов на сайтах:

Форумы.Свежи темы и обсуждения

Здравствуйте. Встретилась такая проблема
...
Интересные темы:
Список форумов:

Tips. Советы

If you're like me, you've taken advantage of the extensibility of Lotus Notes by adding widgets, Live Text recognizers, and plug-ins. I love customizing my Notes client with extras that help me get t
OpenNTF.org has announced the availability of three new widgets. The widgets include one to join Sametime Unyte web conferences, one for Flickr, and one for converting text to speech.

Read | Permalink
This article on the Connections wiki takes a deep dive into using the Application Programming Interfaces (APIs) of Lotus Connections 2.5 to integrate with other applications.

Read | Permalink
Brian M O'Curran says moving to Sametime 8.5 can save your company money, real money. He lists a number of other benefits to using Sametime 8.5 and, in case you're unconvinced, he offers to let you try out a Sametime 8.5 Online Meeting.

Read | Permalink

Almar Diehl has posted step-by-step instructions on installing additional dictionaries under Notes 8.5.1. The process has changed from using .DIC files to using an update site database.

Read | Permalink

Generating PDF documents on the fly isn't exactly rocket science and - with the help of tools like iText - is easily done in Java and something I've talked about before.

The trouble is that creating them is a cumbersome and often tedious task if what you want is anything other than a set of plain text paragraphs added in series. Unlike creating HTML everything in PDF-land is of absolute size and position. I find that getting the result you want is often a case of repetitive, pixel by pixel tweaking to get it right. You need a lot of patience.

If you had a complicated document to create with logos and background images then you're in for a rough ride. What would make more sense is to use a GUI tool to author a base template and then just have your code add the text bits where necessary. This is the situation I found myself in recently and after a bit of digging I worked out how to take an existing PDF and add to it. PDF templating if you will.

Creating a Template

First thing to do, assuming you've not already been provided with a template is to create one. Let's look at creating a letter head. I did this in Word, as you can see below and simply pasted in some images, moved them about and added some company details to the footer in an off grey colour.

image

Once I was happy with it I used the File - Save As - PDF menu option to save the file in PDF format.

image  

You can see the resulting PDF below:

image 

What I did with the PDF is attached it to a document in the same Notes database as we're generating the PDFs from. In reality I had been provided with a PDF template by my client's design agency, so that's what I attached. I could skip the bit above about creating a template, but went through it here in case you need help or inspiration.

The idea behind adding it as an attachment to a document is that the client has control over the template and can change it as and when they please. That being another benefit of this approach - if they happened to change the design of the letterhead then I'd have to go back to messing with the code each time. With this approach there should be no need to.

All we need to do now is add the actual content. Here's an example of what the generated PDF looks like once we've done adding to it with our own code:

image

Let's look at how we'd do that.

Adding To The Template

The code below is the Java needed to create a new PDF document, import the existing template and then add our own text atop of it.

//Setup a new PDF Document
Document document = new Document();
ByteArrayOutputStream os = new ByteArrayOutputStream(); PdfWriter writer = PdfWriter.getInstance(document, os); document.open();
document.newPage(); //Get the template PDF as the starting point!
View files = db.getView("files");
lotus.domino.Document filestore = settings.getDocumentByKey("pdf_template.pdf", true); String filename = filestore.getItemValueString("FileName"); EmbeddedObject file = filestore.getAttachment(filesname);
InputStream is = file.getInputStream(); //Here's the key part. Let's turn the template in to
//usable PDF object
PdfReader reader = new PdfReader(is);
PdfImportedPage page = writer.getImportedPage(reader, 1); //Now, add it to the blank PDF document we've opened
PdfContentByte cb = writer.getDirectContent();
cb.addTemplate(page, 0, 0); //Now do the usual addition of text atop the template
document.add( new Paragraph("Here some text added to the template")
);
//Etc, etc //Done!
document.close(); //Tidy up
is.close();
file.recycle(); //Make SURE you do this!!! //Attach the resuling PDF to the Notes document
Stream stream = session.createStream();
stream.write(os.toByteArray()); MIMEEntity m = doc.createMIMEEntity("Files"); MIMEHeader header = m.createHeader("content-disposition");
header.setHeaderVal("attachment;filename=\""+filename+"\""); m.setContentFromBytes(stream, "application/pdf", MIMEEntity.ENC_IDENTITY_BINARY); m.decodeContent();

Code's boring though. What you want is a demo and a download, no?

A Demo

Here's the demo form. Fill in the fields and submit to see what gets generated. Here's an example of an outputted PDF file.

The working download will be in form of DEXT 20091123, which will be in the Sandbox in the next few minutes.

Click here to post a response

Nathan T Freeman has been waiting for this for a while. Now that he's found the entry in Domino Designer 8.5.1 he's posted the parameters and syntax on the web to make it "easier" for you to find.

Read | Permalink


STRUGGLING WITH EXPORTING NOTES DATA TO SPREADSHEETS? NO MORE!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes!

Try IntelliPRINT NOW!

Gregg Eldred has posted a link to a 30-minute podcast that discusses Google Apps as it pertains to organizations currently using Lotus Domino. Registration at bitpipe.com is required to hear the podcast.

Read | Permalink
Gavin Bollard has been working with IBM support on this but, a fresh set (or dozen sets) of eyes may see something they're missing. It has to do with the names of files attached to documents disappearing when viewed in a web browser.

Read | Permalink
Steve McDonagh discovered, after upgrading to MS Office 2007, that the spelling and grammar checkers behave strangely if the document has been created with a scheduled agent.

Read | Permalink


MARK YOUR CALENDAR FOR IN-DEPTH LOTUS TRAINING, MAY 12-14, 2010, BOSTON
Register by December 31, 2009 to save $350.

Teamstudio and GEDYS IntraWare today announced a newly formed partnership to bring GEDYS CRM product to the UK market for the first time. GEDYS is a leading European supplier of CRM solutions based on the Lotus Notes and Domino platform. The GEDYS IntraWare 7 CRM product line includes a complete suite for customer management, comprising of modules for sales, marketing and helpdesk services. This includes solutions to sales management, methods and activity, electronic customer files, order processing, workflow automation and campaign management. With versions in multiple languages, the scalable modular solution for today's business needs is now available in the UK.

Read | Permalink
Еще советы:
Смотри советы на сайтах:

Блоги. Что обсуждают и пишут

Author: Hans Christian Koch
Tags: Contacts Open Seach
Idea:
The 'Type to Find' feature in the Open menu, should return results from the local addressbook, so that its possible to search for contacts directly from the Open menu.

Author: Vlad Sh
Tags: LotusScript @function
Idea:
REFItemName = "$REF" by default or omit this parameter.

apply to following methods:
Call notesDocument.MakeResponse(document As NotesDocument, [ REFItemName As String ])
Set notesDocumentCollection = notesDocument.Responses( [ REFItemName As String ] )
Command([ComposeWithReference]; server : database ; form ; flags ; [ REFItemName ])
Responses([ REFItemName ])

probably need to take into account:
notesDocument.ParentDocumentUNID
IsResponse

EDITED: MakeResponse or ComposeWithReference can be excluded from this list, but then give a chance to create item type of "Response Reference List", because now it correctly you can create only MakeResponse method.
 

Author: Vlad Sh
Tags: Open Application window
Idea:
I propose to unify the functional window open databases.

Instead of "Browse" button you can proceed to the browsing of local resources using the icon "Up", located to the right of "Look in: On My Computer"]. Also in the expands window (the button "Browse") contains the file extensions that are not databases ...

Below the field "File name:" to append a ComboBox with a list of file types, appropriate databases Lotus] (nsf, ntf, box). 

Author: Vlad Sh
Tags: Open Application window
Idea:
I propose to unify the functional window open databases.
 
Instead of "Browse" button you can proceed to the browsing of local resources using the icon "Up", located to the right of "Look in: On My Computer"]. Also in the expands window (the button "Browse") contains the file extensions that are not databases...
 
Below the field "File name:" to append a ComboBox with a list of file types, appropriate databases Lotus] (nsf, ntf, box).

There are three new simple widgets in the Widget Library project. Widget to Join Sametime Unyte Web Conference Widget for Flickr Widget for Text to ...
Author: Vlad Sh
Tags: user hotkeys
Idea:
Add the Lotus Notes settings for the possibility of the appointment of custom combinations of keys for different actions. Be able to assign hotkeys for the operation of the Lotus Domino Designer. 

Author: Bruce Lill
Tags: XPages
Idea:
 It would help developers to move Notes apps and basic web apps to XPages. It could be a cut & paste convertion that would let the developer to paste in the macro formula and get back the javascript replacement.
 
It would help reduce errors in the conversion process. Especially with the issue of case since Javascript is case sensitive.
 

Author: Vlad Sh
Tags: database properties box
Idea:
I propose to make a window box FileName property database available for copying.
Small cosmetic improvements, but without the bad :)
 

Author: Vlad Sh
Tags: database properties box
Idea:
I propose to make a window box FileName property database available for copying. Small cosmetic improvements, but without the bad :)

Author: Vlad Sh
Tags: PickList DoubleClick Invalid selection
Idea:
It stretches from the time of R5.x and annoys users.
I suggest not show this message and make the reaction to DoubleClick on category by analogy with the usual behavior in a view, - that is opening or closing category. 

Author: Vlad Sh
Tags: PickList DoubleClick Invalid selection
Idea:
It stretches from the time of R5.x and annoys users.
I suggest not show this message and make the reaction to DoubleClick on category by analogy with the usual behavior in a view, - that is collapse or expand category.

Author: Vlad Sh
Tags: cannot be found window
Idea:
When the database was moved from a server (often from Local), then when you click on application icon appears the window label "Database dbTitle cannot be found".
I propose to add to this window "Browse" button to choice the database by hand, by analogy with click on shortcuts to a nonexistent file in the operating system. When you click on "Browse" button to display "Open Application ..." window. 

Author: Vlad Sh
Tags: cannot be found window
Idea:
When the database was moved from a server (often from Local), then when you click on application icon appears the window label "Database dbTitle cannot be found".
I propose to add to this window "Browse" button to choice the database by hand, by analogy with click on shortcuts to a nonexistent file in the operating system. When you click on "Browse" button to display "Open Application ..." window. 
 
EDITED:
Alternatively: instead of "Database ... cannot be found" window display a "Open Application ..." window, because recently window has all required functionality:
- can choose a server;
- can choose the database by hand;
- can click the "Cancel" button.
 

Author: Vlad Sh
Tags: workspace tabs files drag and drop Drag & Drop drag-and-drop
Idea:
Propose:
1. Add the ability to drag tabs of workspace.
2. Add support to drag and drop the file (nsf, ntf, box) from browser of the operating system to the workspace (the application's icon should be created automatically).

Author: Vlad Sh
Tags: workspace tabs files drag and drop Drag & Drop drag-and-drop
Idea:
Propose:
1. Add the ability to drag tabs of workspace (edited: find here something like).
2. Add support to drag and drop the file (nsf, ntf, box) from browser of the operating system to the workspace (the application's icon should be created automatically).

We have just added the QuickNote project to OpenNTF. This comes from my article on devWorks a few years ago. In the near future, we plan on releasing the other plugins from that series as well as several others that we have written. Additionally, ...
Author: Vlad Sh
Tags: lotusscript @function Prompt NotesUIWorkspace ChooseDatabase 13
Idea:
Objects of review:
@Prompt( [style] : [NoSort] ; title ; prompt ; defaultChoice ; choiceList ; filetype )
variant = NotesUIWorkspace.Prompt( type%, title$, prompt$ [, default ] [, values ] )
For type=13 propose:
  1. Unify NUIWs.Prompt, adding the missing parameter filetype, so you can specify the type of the database by default (file mask for display).
  2. Parameter title now does not work. Make it to work.
  3. Рarameter default corresponds to the parameter defaultChoice, and in this case is not used. Use this option to specify a directory or file by default.
Format: server : file
file - can be a initial folder for the "Open Application ..." window and files by default.
  • If the file is not empty, then will attempt to open the folder on the specified server, with the file name should be displayed in the field "File name" dialog.
  • If the folder is not found, then an attempt should be made the opening of the parent folder. If the path fully does not exist, then the server must be open, just as it opens now.
4. It would be good to set multipleSelection (for this can be used in this case an unused parameter choiceList/values), and depending on this to display the "Open" button or "Select".  

Author: Vlad Sh
Tags: lotusscript @function Prompt NotesUIWorkspace ChooseDatabase 13
Idea:
Objects of review:
@Prompt( [style] : [NoSort] ; title ; prompt ; defaultChoice ; choiceList ; filetype )
variant = NotesUIWorkspace.Prompt( type%, title$, prompt$ [, default ] [, values ] )
For type=13 propose:
  1. Unify NUIWs.Prompt, adding the missing parameter filetype, so you can specify the type of the database by default (file mask for display).
  2. Parameter title now does not work. Make it to work.
  3. Рarameter default corresponds to the parameter defaultChoice, and in this case is not used. Use this option to specify a directory or file by default.
Format: server : file
file - can be a initial folder for the "Open Application ..." window and files by default.
  • If the file is not empty, then will attempt to open the folder on the specified server, with the file name should be displayed in the field "File name" dialog.
  • If the folder is not found, then an attempt should be made the opening of the parent folder. If the path fully does not exist, then the server must be open, just as it opens now.
4. It would be good to set multipleSelection (for this can be used in this case an unused parameter choiceList/values), and depending on this to display the "Open" button or "Select".  
 
EDITED:
I am aware that a much better solution would be to create a separate method ChooseDatabase; do not understand why the engineers IBM went to add type=13 is in the method Prompt, if the choice of database is essentially (and parameters!) is much closer to the OpenFileDialog, than Prompt ... But something must be done about this, because the ability to customize the displayed window, in my opinion, is culture.

Author: Vlad Sh
Tags: GetDocumentByUNID 4091 err error lotusscript java
Idea:
Generation of this error is useless, it only hinders. Quite enough to return Nothing.
Similar GetDocumentByID method does not generate errors.

Chun Yan Zhang has contributed a new plugin to OpenNTF to open web links in Lotus Notes documents in external browsers. As always you can install this plugin via drag and drop from the Apache catalog. You can download the source code here and read the ...
Еще записи:
Интересные блоги специалистов:

В избранное