Solved

Creating views (lots) in DB without using Designer

Posted on 2004-07-30
15
237 Views
Last Modified: 2013-12-18
Hi,
I have a template DB. Very often, I have to create databases with this template and add views. There is 4 types of view and I have to create usually 20 of each just by changing their name, alias, one column name and one columns sort style. I want to automate this or I will be crazy soon.
Do you know a way to do it in VB.Net using Com objects? Do you know another way to do it easier?

Thank you,
Koray.
0
Comment
Question by:koray_uygun
  • 6
  • 3
  • 2
  • +3
15 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 11675104
As per I know this is not possible.

Let us see if Sjef/Tom/RR have any other plans. (They are still here)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11675144
There's only one way: use the Notes API calls. But can you explain why you cannot standardize your views?? There are lots of intelligent things you can do with views, so they will work for everybody. Perfection is a great thing, but when it costs too much money: DON'T! My users get 80% of what they want, for 20% of the costs. I think that's a fair deal.

What is the purpose of the database, what are the views, and why do you have to add or change a lot?
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 11675256
You can, in R6.

If you have Notes version 6 or up, there are the necessary classes to manipulate views.

In R5, you can also copy views from 1 database to another, but you can't change them using standard Lotusscript.

cheers,

Tom
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11675831
I think along the lines of Jeff here. Notes API would be the solution. But yes, it will be worth the effort if you can negotiate the exisiting design to accomodate such flexibility.

What you may do is: you may have some additional flags in your documents (you will have to run agents on your existing docuemtns to make them usable as per the new design) and use those flags to conditionally select different field values from the documents.

@If(@IsAvailable(FLAG1);FIELD1;FIELD2)

If you use the flag to store multipls values, it can even act as a multipoint switch.

@If(FLAG1="Value1";FIELD1;FLAG1="Value2";FIELD2;FIELD3)

And now your views can select different field values from the document conditionally.

One problem. This doesn't help you modify your view column titles. If that is your need too, you must use an alternative solution.



0
 

Author Comment

by:koray_uygun
ID: 11675929
I'll explain the reason.
- Each database is used in a different department.
- The users create documents in their department's database.
- The subjects of the documents changes from dept. to dept.
- Each view's content depends on the title of one of it's column name, this way each subject is displayed in the appropriate view. This is the reason why the views columns are different in each DB.
- The reason why the aliases must be different is because, every person that access the DB has a specific role and the access to the view depends on it's alias.
- The reason why there is 4 times more views than necessary is that, the principal view has 3 columns that can be sorted but if you simply sort, you will lose the categorisation so when you click on the column, it is another view where this column is in first place that is open.

This database strategy has been created long long time ago. I know that this strategy sucks but I will work on that as a consultant for 2 months so I can't change all the strategy. But if I can find a way to do it easily, my clients will adopt it.

So, Sjef, how do I use API? I know only VB.net and Lotus Languages. I heard that Lotus has a tool named DXL (Domino XML something) that can do this but you have to know Java...

Thank you for your help.
Koray.
0
 

Author Comment

by:koray_uygun
ID: 11675958
Sorry, I do not look for a way to change the strategy but a way to go along with it for now by being able to automate as much as possible the creation of views.
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 11676172
Have you got R6 ?  This is pretty important here (if you have it, you can also try the DXL stuff)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11676302
If you have only 2 months to complete your job, you'll have to do this the pragmatic way. Notes API is too complex to be learnt at short notice, so forget that one. Tom is right, with R6 you can design views using LotusScript, althought there are some restrictions. If you have a fairly standard view, you'll have no problem. If you have can copy some standard view and adapt it to the needs of the department using LotusScript, this might even be easier.

IF you had the time THEN I would suggest you to add some fields to each document. These fields should be filled with the values that should appear in the columns. Depending on the department, different values could be put into the column-value fields, so your view can be fixed for the column-data is in the hidden column-value fields.

I think it can be done using only ONE template database. In a month. The other month is required to write a conversion agent that automatically adds the column-value fields to the documents, if the recipe for the database is stored in a Configuration document (a Profile Document would be ideal).
0
 

Author Comment

by:koray_uygun
ID: 11676489
I have seen in the Notes.net forum that it is may be possible to use Notes api with lotus script. Any idea?
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 11677386
W H A T   V E R S I O N    O F   N O T E S   H A V E   Y O U  GOT ?
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 250 total points
ID: 11678885
I dont; care if you only have R5.  Get a copy of Notes6 JUST TO CREATE THE VIEWS.  You can't write a really simple script, as Bozzie keeps pushing.

And yes, DXL also does this, but DXL is only present full force in R6 (there is a DXL for R5 but it is truly underwhelming).  So yo would need R6 either way.

Here's some example code you could use in R6:

Dim targetDB as new notesDatabase ( "" , "whatever")
dim view as notesView
Set view = targetDatabase.getView("some template view name")
call view.setAliases("additional alias") 'or: view.aliases(ubound(view.aliases))="replacemeht alias"
view.columns(3).formula = {@If(Check1 = "somevalue"; ValueField1; ValueField2)}
view.selectionFormula = {SELECT ExecName="John Doe"}
0
 

Author Comment

by:koray_uygun
ID: 11691448
Sorry, I use 5.13 but I have installed V6 too just for this. Ok, qwaletee, i will try this code.
Thanks,
Koray.
0
 

Author Comment

by:koray_uygun
ID: 11692727
Thank you very much qwaletee!! That works fine. One last question, this db created and modified with R6, will it be a problem if I use It with R5 or do I have to do something to make it compatible? (I will not use R6 specific design elements)
0
 

Author Comment

by:koray_uygun
ID: 11692740
Sorry Bozzie, I should have shared the points between you and qwaletee but I have seen this possibility too late. Thank you too.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11697899
Unless you use something that only works in R6, you can design something using R6 for an R5 or even R4 client.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

860 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