In the ReadMe for 7.0.2, the documentation states:
New elements for Shared Columns, Shared File Resources, and Shared Stylesheet Resources have been added.
Which is all nice in good. But the NotesNoteCollection object wasn't updated to allow us to select these specific design elements. So how do I export a view and all of its shared columns using NotesDXLExporter?
1. Jeff Gilfelt08/26/2008 02:11:48 PM
Homepage: http://www.jeffgilfelt.com
Glad I am not the only one who has been burnt by this. If I recall correctly, I had to export all design notes, then iterate through them and compare the $Flags item with the appropriate value from the C API documentation in order to get what I wanted. This renders one of my apps painfully slow if the target database has many design elements. Very frustrating, but I am surprised when *anything* works as expected with DXL. Such a cool idea, so poorly executed.
2. Michael Sobczak08/26/2008 02:27:22 PM
Homepage: http://www.punkdbynotes.com
Hi Jeff,
I was using Martin Vereecken's Viewnify tool and found that the NotesDXLImporter object effectively breaks views that contains shared columns. I thought I could fix this by exporting the shared view columns with the view DXL, but found this wasn't possible. No NotesNoteCollection.SelectSharedColumns--ugh!
I posted this comment to Martin to see if he's found the same behavior:
{ Link }
3. Sumeet08/26/2008 03:42:17 PM
DXLExporter exports all shared columns within its view as a <sharedcolumnref> element which carries the attributes of the sharedcolumn. On import DXLImporter is smart to verify first if a sharedcolumn referenced does exist in the database. If it doesn't then the column properties existing in the exported DXL are used. It this behavior is not working for you in V702 I can almost guarantee this has been fixed in V703. But I like to learn why would your initial implemention did not work in V702. - Thanks Sumeet.
4. Kevin Pettitt08/26/2008 03:49:00 PM
Homepage: http://www.lotusguru.com
You should be able to use the NoteNoteCollection's SelectionFormula property to get a handle on those particular elements, even if the formula is something like @Contains($Flags; "^") which I believe it would be for Shared Columns.
You could also use a tool like Ytria's ViewEZ to "Unshare" those columns, and then also use the tool to copy and move columns around in lots of views very quickly (so the time saving goal of shared columns is achieved without the headache of actually using them).
5. Michael Sobczak08/26/2008 03:55:20 PM
Homepage: http://www.punkdbynotes.com
@ 3: I'm using 7.0.3. Maybe 7.0.4 is the answer?
@4: checking to see if $Flags contains a "^"? Wow. Never would have thought of that! Thanks, Kevin!
6. Kevin Pettitt08/26/2008 04:25:21 PM
Homepage: http://www.lotusguru.com
@5 - puzzling out what flags pertain to which design elements is a fun exercise, but I built on others' work when I created the (DESIGN - Elements by Type) view in SuperNTF (Yes, I have a regular view showing all design elements - using the $FormulaClass hack). I need to blog this at some point. The column formula which contains all the juicy bits is as follows:
etype := @If(
@Contains($Flags; "sj"); "Script Library - JAVA";
@Contains($Flags; "s"); "Script Library - LS";
@Contains($Flags; "h"); "Script Library - JS";
@Contains($Flags; "t"); "Database Script";
@Contains($Flags; "m"); "Outline";
@Contains($Flags; "k"); "Data Connection Resource";
@Contains($Flags; "U"); "Subform";
@Contains($Flags; "#"); "Frameset";
@Contains($Flags; "i"); "Image Resource";
@Contains($Flags; "W"); "Page";
@Contains($Flags; "@"); "Applet";
@Contains($Flags; "="); "Shared Style Sheet";
@Contains($Flags; "{"); "Web Service";
@Contains($Flags; "^"); "Shared Column";
@Contains($Flags; "g"); "Shared File";
@Contains($Flags; "y"); "Shared Actions";
@Contains($Flags; "F"); "Folder";
@Contains($Flags; "G"); "Navigator";
@Contains($Flags; "Y" : "d" : "T"); "View";
@Contains($Flags; "c"); "View - Calendar";
@Contains($Flags; "o"); "View - Spofu Desktop Stored";
@Contains($Flags; "f"); "Agent";
@Contains($Flags; "C" : "D"); "Form";
@Contains($Flags; "V"); " - Private";
"");
etype1 := @If(
etype = "";
@If(@IsAvailable($FIELDS); @If( $Fields=$Title;"Shared Field";"Form");
@IsAvailable($$FORMSCRIPT); "Form";
@IsAvailable($VIEWFORMAT); "View";
"*UNKNOWN*" + " (flags: " + $Flags + ")");
etype = "Agent";
@If(@Contains($Flags; "J"); etype + " - Java";
@Contains($Flags; "L"); etype + " - LS";
etype + " - Formula");
etype);
etype2 := @If(
@Contains(etype1; "Agent");
@If($AssistTrigger = "1"; etype1 + " - Scheduled";
@Contains($Flags; "u"); etype1 + " - Run As User";
etype1);
etype1);
etype2
7. Michael Sobczak08/26/2008 04:32:16 PM
Homepage: http://www.punkdbynotes.com
You definitely have a right to use the Lotus Guru moniker. As for me, I'm still earning my Lord Lotus stripes!
8. Jeff Gilfelt08/26/2008 04:49:09 PM
Homepage: http://www.jeffgilfelt.com
NotesNoteCollection.SelectionFormula + $Flags = brilliant!
Thanks Kevin. Looks like I have some code to rewrite...
Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | |||