Solved

Document Library Template

Posted on 2003-12-10
7
1,120 Views
Last Modified: 2010-04-22
Hi,

I've been trying to implement a document library, and decided to use the default template from Lotus Notes.

I tried to organize my files into different folders, something like save saving the fields under different categories. But to my dismay, I find that I cannot directly create the new doc under the folder. I have to go to the "All Documents" view, and pull the file (or link) into the folder. So I thought, this is no good, doing a job twice, so I began exploring category.

I'm happy that I can create sub category (SubCatB) by doing: CategoryA\SubCatB when creating a message. Then I found that this sub-category is being listed as one of my option for categories. But when I create the next document using "SubCatB"(select from the list), this become a new category showing on the screen.

Is there a way that I can edit the template such that the sub category will appear as "CategoryA\SubCatB", so that I can always put the files into the correct categories? Or can I do something to the folder method?

Thanks!

0
Comment
Question by:sata
  • 4
  • 2
7 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 9919091
Create a new view, hidden (i.e. prefix "(").

Use the selection formula as used in the view "ByCategory":
   Formula:
   SELECT !@Contains(@LowerCase(form); "archive")

Create 1 column (only 1 required):
   Field
   Categories

In the columns properties: set sorting to "Ascending" and select "Show multiple values as separate entries". Do NOT categorize!

Save the view (remember or copy the name for later use).

Now open the form "Document". On it you'll find a field "WebCategories" and one called "Categories". In the field properties, 2nd tab, under choises, you'll find a reference to the view "ByCategory". Change that reference to your new viewname.

That's all! Well... you may have to prevent the designer task on the server to overwrite these changes. Either disconnect the database from its original template, or mark the new view and the changed document as "Prohibit design replace or refresh to modify" (properties, from within the list of forms/views).

One additional remark:
Both formulas (in the fields options) use @DbColumn. That formula is limited to a 64kb result.
If your database grows over that limit in time, your only option will be some kind of an error. For the best way to get around that in future... consult the formula "@Picklist"!
0
 
LVL 1

Author Comment

by:sata
ID: 9940615
Hi,

I have tried, but now this view does not display in a tree format. Also, if I create more than 1 document in the same category, the category for selection becomes more than 1.

How can I solve these?

Thanks.
0
 
LVL 13

Accepted Solution

by:
CRAK earned 100 total points
ID: 9947793
You're right.
I think the best way to solve this problem AND to avoide the 64k limit is to use a different separator between categories and subcategories.
If we let the views and the document perform some kind of a translation, it would work just as natural as the original template.
I choose "/" as replacement separator for "\". Be careful not to use "/", unless you intend to place a category separator!

Based on the modifications in my previous comment, categorize the (1st) column view "FullCat", and change its formula to:
   @ReplaceSubstring(Categories; "\\"; "/")

(Categorization will filter duplicate entries and reduce the risk of reaching the 64k limit.)

In form "Document", add a translation formula to WebCategories:
   @Unique(@ReplaceSubstring(WebCategories; "\\"; "/"))

In the field Categories, change the existing translation formula to:
   Tmp := @If(
      @ClientType = "Notes";
      @Trim(@Unique(Categories : WebCategories : NewCats));
      @Trim(@Unique(WebCategories : NewCats)));
   @Unique(@ReplaceSubstring(Tmp; "\\"; "/"))

(This will replace any "\" with a "/" in those fields, so the selected values -when editing- will match the ones presented by the view)
The formula to retrieve the list of choises needs no additional change.

The 1st column in view "ByCategory" should be changed to:
   @ReplaceSubstring(Categories; "/"; "\\")

(That will restore the original "/" for every "\" to allow automatic splitting of categories and subcategories)


You will now be able to enter new subcategories using either "/" or "\". They will automatically be translated to "/" to present them "flat" in the list of choises and translated back to "\" in the category view.

Although existing documents will show both Cat\Subcat and Cat/Subcat in the list of choises (a combination of current values and translations in the list of choises), a conversion of existing documents should not be neccessary! Even if you select both Cat\Subcat and Cat/Subcat on one document, the category field will turn out right: Cat\Subcat will first be translated to Cat/Subcat (causing a duplicate entry), followed by @Unique removing all duplicates in those fields!

Enjoy!  ;-))
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Expert Comment

by:spacediver
ID: 9954396
Hi Crak & sata,

I am new to Lotus Notes and had tried your comment to sata in lotus notes designer.

I hope you don't mind that i had tried your method.  Ü

After trying I was a bit confused where the paragraph you'd mentioned :
Based on the modifications in my previous comment, categorize the (1st) column view "FullCat",
and change its formula to:
   @ReplaceSubstring(Categories; "\\"; "/")

I had problem locating the (1st) column view "FullCat".

Are you refering to the initial formula that you'd mentioned?
SELECT !@Contains(LowerCase(form); "archive")

Do you mean by replacing the formula?

Regards,
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9955510
Sorry about that...
In my 1st comment I wrote about a new hidden view to be created. In the database that I created here to support this question I called it "FullCat" (as alias, "(FullCat)" as front-end name). However, I never suggested to use that name. You're free to change it as you wish of course.

If everything goes well, you should have made following modifications:
- this new view that I called "FullCat",
- two references to this view: the "Choises" formula of the fields "Categories" and "Webcategories" on form "Document"
- translation formulas in these two fields
- the 1 column in view "ByCategory"
0
 
LVL 1

Author Comment

by:sata
ID: 9969696
Hi CRAK,

I used your code, and made some modifications, and now it works! Thanks!
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9976007
;-)
Thanks!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Compling Lotusscript <form name>: LotusScript Error - Syntax Error 14 91
@Mailsend 3 57
Unable to change external email address in Lotus Notes Mailbox 11 76
DNS error assumed 8 58
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question