Document Library Template

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!

LVL 1
sataAsked:
Who is Participating?
 
CRAKCommented:
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
 
CRAKCommented:
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
 
sataAuthor Commented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
spacediverCommented:
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
 
CRAKCommented:
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
 
sataAuthor Commented:
Hi CRAK,

I used your code, and made some modifications, and now it works! Thanks!
0
 
CRAKCommented:
;-)
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.