diff --git a/extlib-des/lwp/product/design/eclipse/plugins/com.ibm.xsp.extlib.designer.tooling/.classpath b/extlib-des/lwp/product/design/eclipse/plugins/com.ibm.xsp.extlib.designer.tooling/.classpath index 07ba088..63fe63a 100644 --- a/extlib-des/lwp/product/design/eclipse/plugins/com.ibm.xsp.extlib.designer.tooling/.classpath +++ b/extlib-des/lwp/product/design/eclipse/plugins/com.ibm.xsp.extlib.designer.tooling/.classpath @@ -1,8 +1,8 @@ - - - - - - - - + + + + + + + + diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/artifacts.jar b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/artifacts.jar new file mode 100644 index 0000000..8a6894a Binary files /dev/null and b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/artifacts.jar differ diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/content.jar b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/content.jar new file mode 100644 index 0000000..36ade53 Binary files /dev/null and b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/content.jar differ diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/features/org.openntf.extlib.designer.tooling.feature_9.0.1.v00_10_201411261321.jar b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/features/org.openntf.extlib.designer.tooling.feature_9.0.1.v00_10_201411261321.jar new file mode 100644 index 0000000..5ea8356 Binary files /dev/null and b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/features/org.openntf.extlib.designer.tooling.feature_9.0.1.v00_10_201411261321.jar differ diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.relational_9.0.1.v00_10_201411261321.jar b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.relational_9.0.1.v00_10_201411261321.jar new file mode 100644 index 0000000..a491aef Binary files /dev/null and b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.relational_9.0.1.v00_10_201411261321.jar differ diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.tooling_9.0.1.v00_10_201411261321.jar b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.tooling_9.0.1.v00_10_201411261321.jar new file mode 100644 index 0000000..5da1946 Binary files /dev/null and b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.tooling_9.0.1.v00_10_201411261321.jar differ diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.xspprops_9.0.1.v00_10_201411261321.jar b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.xspprops_9.0.1.v00_10_201411261321.jar new file mode 100644 index 0000000..8981d9e Binary files /dev/null and b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer.xspprops_9.0.1.v00_10_201411261321.jar differ diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer_9.0.1.v00_10_201411261321.jar b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer_9.0.1.v00_10_201411261321.jar new file mode 100644 index 0000000..ca48fd4 Binary files /dev/null and b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/plugins/com.ibm.xsp.extlib.designer_9.0.1.v00_10_201411261321.jar differ diff --git a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/site.xml b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/site.xml index 031f58c..ceaa033 100644 --- a/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/site.xml +++ b/extlib-des/lwp/product/design/updatesite/com.ibm.xsp.extlib.designer.tooling.updatesite/site.xml @@ -1,7 +1,8 @@ - - - - - - - + + + + + + + + diff --git a/extlib/.gitignore b/extlib/.gitignore index c88ea19..4df3bad 100644 --- a/extlib/.gitignore +++ b/extlib/.gitignore @@ -1 +1,6 @@ -*.copyarea.db \ No newline at end of file +*.copyarea.db +*.eclipse.m2n.core.prefs +*.eclipse.jdt.core.prefs +*.eclipse.core.resouorces.prefs +*/features/* +*/plugins/* \ No newline at end of file diff --git a/extlib/lwp/.project b/extlib/lwp/.project index d2b4ca6..1ee923b 100644 --- a/extlib/lwp/.project +++ b/extlib/lwp/.project @@ -1,17 +1,17 @@ - - - com.ibm.xsp.extlib.parent - - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - - \ No newline at end of file + + + com.ibm.xsp.extlib.parent + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/extlib/lwp/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/build.xml b/extlib/lwp/build.xml index 33b4397..435fa26 100644 --- a/extlib/lwp/build.xml +++ b/extlib/lwp/build.xml @@ -16,7 +16,7 @@ - + diff --git a/extlib/lwp/product/runtime/eclipse/features/.project b/extlib/lwp/product/runtime/eclipse/features/.project index 30ba7a8..2495fb7 100644 --- a/extlib/lwp/product/runtime/eclipse/features/.project +++ b/extlib/lwp/product/runtime/eclipse/features/.project @@ -1,17 +1,17 @@ - - - product.runtime.eclipse.features - - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - - \ No newline at end of file + + + product.runtime.eclipse.features + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/extlib/lwp/product/runtime/eclipse/features/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/features/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/features/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.apache.wink.feature/.project b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.apache.wink.feature/.project index bec8c02..013f898 100644 --- a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.apache.wink.feature/.project +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.apache.wink.feature/.project @@ -10,11 +10,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -22,8 +17,7 @@ - org.eclipse.pde.FeatureNature org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature + org.eclipse.pde.FeatureNature diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.apache.wink.feature/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.apache.wink.feature/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.apache.wink.feature/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.domino.das.feature/.project b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.domino.das.feature/.project index b0f2559..0994c83 100644 --- a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.domino.das.feature/.project +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.domino.das.feature/.project @@ -10,11 +10,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -22,8 +17,7 @@ - org.eclipse.pde.FeatureNature org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature + org.eclipse.pde.FeatureNature diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.domino.das.feature/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.domino.das.feature/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.domino.das.feature/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.gitignore b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.project b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.project index fcc602b..e69d4ea 100644 --- a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.project +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.project @@ -10,11 +10,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -22,8 +17,7 @@ - org.eclipse.pde.FeatureNature org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature + org.eclipse.pde.FeatureNature diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.feature/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.relational.feature/.project b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.relational.feature/.project index 0358992..48c44d3 100644 --- a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.relational.feature/.project +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.relational.feature/.project @@ -10,11 +10,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -22,8 +17,7 @@ - org.eclipse.pde.FeatureNature org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature + org.eclipse.pde.FeatureNature diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.relational.feature/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.relational.feature/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.relational.feature/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.wink.feature/.project b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.wink.feature/.project index 39c8a64..bc20cd7 100644 --- a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.wink.feature/.project +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.wink.feature/.project @@ -10,11 +10,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -22,8 +17,7 @@ - org.eclipse.pde.FeatureNature org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature + org.eclipse.pde.FeatureNature diff --git a/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.wink.feature/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.wink.feature/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/features/org.openntf.extlib.wink.feature/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/.project b/extlib/lwp/product/runtime/eclipse/plugins/.project index 0fe5147..62b7950 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/.project @@ -1,17 +1,17 @@ - - - product.runtime.eclipse.plugins - - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - - \ No newline at end of file + + + product.runtime.eclipse.plugins + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.classpath index 1fa3e68..4d87a86 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.project index f1fba2d..3d4547e 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.project @@ -20,11 +20,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.dbstore/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.classpath index 1fa3e68..9bc33d3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.project index 0595d68..cb7e0cd 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.project @@ -20,11 +20,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.calendar.store/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.classpath index 1fa3e68..e2a51c8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.project index 3ca2ed7..b190f33 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.commons/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.classpath index 1fa3e68..9bc33d3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.project index 3c856e7..7711d3f 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.project @@ -20,12 +20,6 @@ - - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -34,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.das/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.classpath index 1fa3e68..9bc33d3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.project index 9cefd87..f842f19 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services.calendar/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.classpath index 751c8f2..e2a51c8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.project index cc485b8..4a6e5f6 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.project @@ -20,11 +20,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.settings/org.eclipse.jdt.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.settings/org.eclipse.jdt.core.prefs index 4dc46b8..c37e100 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.settings/org.eclipse.jdt.core.prefs +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,9 @@ -#Mon Jul 26 14:46:50 EDT 2010 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +12,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore @@ -65,3 +69,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.domino.services/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.classpath index 1fa3e68..9bc33d3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.project index 3bd4ce1..b9f67b7 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.wink/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.classpath index 1fa3e68..e2a51c8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.project index 45d39e1..2de20af 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/CollectionValuePickerData.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/CollectionValuePickerData.java index f2b91ec..c39b30a 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/CollectionValuePickerData.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/CollectionValuePickerData.java @@ -1,25 +1,5 @@ /** - * (not-IBM-owned-copyright) * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing - * permissions and limitations under the License. - * - * --- - * The first version of this file in this source control project - * was contributed through - * https://github.com/OpenNTF/XPagesExtensionLibrary/pull/14 - * by Paul S Withers (https://github.com/paulswithers) - * It was previously located in the other project: - * https://github.com/OpenNTF/org.openntf.domino */ package com.ibm.xsp.extlib.component.picker.data; @@ -27,6 +7,7 @@ import java.util.LinkedHashMap; import java.util.Map; +import javax.activation.UnsupportedDataTypeException; import javax.faces.context.FacesContext; import javax.faces.el.ValueBinding; @@ -35,9 +16,12 @@ * * CollectionValuePickerData, for use with ValuePicker control */ +@SuppressWarnings("rawtypes") public class CollectionValuePickerData extends MapValuePickerData { - - private Collection collection; + // private static final Logger log_ = + // Logger.getLogger(CollectionValuePickerData.class.getName()); + private static final long serialVersionUID = 1L; + public Collection collection; /** * Constructor @@ -53,7 +37,7 @@ public CollectionValuePickerData() { * @return Collection of values to use in the picker * @since org.openntf.domino.xsp 4.5.0 */ - @SuppressWarnings("unchecked") //$NON-NLS-1$ + @SuppressWarnings("unchecked") public Collection getCollection() { if (collection != null) { return collection; @@ -61,8 +45,14 @@ public Collection getCollection() { ValueBinding vb = getValueBinding("collection"); //$NON-NLS-1$ if (vb != null) { Object vbVal = vb.getValue(getFacesContext()); - if( null != vbVal ){ + if (vbVal instanceof Collection) { return (Collection) vbVal; + } else { + try { + throw new UnsupportedDataTypeException("Value is not a Collection"); + } catch (UnsupportedDataTypeException e) { + e.printStackTrace(); + } } } @@ -80,40 +70,33 @@ public void setCollection(final Collection collection) { this.collection = collection; } - - /** - * Loads the options, converting the Collection to a LinkedHashMap, where - * the key and value are the same - * + /* * (non-Javadoc) * - * @see org.openntf.domino.xsp.helpers.MapValuePickerData#getOptionsMap() - */ - @Override - public Map getOptionsMap() { - Collection computedCollection = getCollection(); - Map opts = new LinkedHashMap(); - for (String e : computedCollection) { - opts.put(e, e); - } - return opts; - } - - /** * @see org.openntf.domino.xsp.helpers.MapValuePickerData#getOptions() - * @deprecated Use {@link #getOptionsMap()} instead */ @Override public Map getOptions() { - // Not supported in the subclass CollectionValuePickerData; only applicable in the superclass MapValuePickerData - throw new UnsupportedOperationException(); + if (options != null) { + return options; + } + setOptions(); + return options; } + /** - * @deprecated + * Loads the options, converting the Collection to a LinkedHashMap, where + * the key and value are the same + * + * @since org.openntf.domino.xsp 4.5.0 */ public void setOptions() { - // Not supported in the subclass CollectionValuePickerData; only applicable in the superclass MapValuePickerData - throw new UnsupportedOperationException(); + Map opts; + opts = new LinkedHashMap(); + for (String e : getCollection()) { + opts.put(e, e); + } + super.setOptions(opts); } /* @@ -123,12 +106,16 @@ public void setOptions() { * org.openntf.domino.xsp.helpers.MapValuePickerData#restoreState(javax. * faces.context.FacesContext, java.lang.Object) */ - @SuppressWarnings({"unchecked","rawtypes"}) //$NON-NLS-1$ //$NON-NLS-2$ + @SuppressWarnings("unchecked") @Override - public void restoreState(final FacesContext context, final Object state) { - Object values[] = (Object[]) state; - super.restoreState(context, values[0]); - collection = (Collection) values[1]; + public void restoreState(final FacesContext _context, final Object _state) { + Object _values[] = (Object[]) _state; + super.restoreState(_context, _values[0]); + options = (Map) _values[1]; + searchType = (String) _values[2]; + caseInsensitive = (Boolean) _values[3]; + searchStyle = (String) _values[4]; + collection = (Collection) _values[5]; } /* @@ -139,11 +126,15 @@ public void restoreState(final FacesContext context, final Object state) { * .context.FacesContext) */ @Override - public Object saveState(final FacesContext context) { - Object values[] = new Object[2]; - values[0] = super.saveState(context); - values[1] = collection; - return values; + public Object saveState(final FacesContext _context) { + Object _values[] = new Object[6]; + _values[0] = super.saveState(_context); + _values[1] = options; + _values[2] = searchType; + _values[3] = caseInsensitive; + _values[4] = searchStyle; + _values[5] = collection; + return _values; } } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/MapValuePickerData.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/MapValuePickerData.java index ff393d6..385131d 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/MapValuePickerData.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/component/picker/data/MapValuePickerData.java @@ -1,56 +1,36 @@ /** - * (not-IBM-owned-copyright) * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing - * permissions and limitations under the License. - * - * --- - * The first version of this file in this source control project - * was contributed through - * https://github.com/OpenNTF/XPagesExtensionLibrary/pull/14 - * by Paul S Withers (https://github.com/paulswithers) - * It was previously located in the other project: - * https://github.com/OpenNTF/org.openntf.domino */ package com.ibm.xsp.extlib.component.picker.data; +import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.regex.Pattern; +import java.util.logging.Logger; +import javax.activation.UnsupportedDataTypeException; import javax.faces.context.FacesContext; import javax.faces.el.ValueBinding; import com.ibm.commons.util.StringUtil; import com.ibm.xsp.complex.ValueBindingObjectImpl; -import com.ibm.xsp.context.FacesContextEx; -import com.ibm.xsp.util.DataPublisher; -import com.ibm.xsp.util.DataPublisher.ShadowedObject; /** * @author Paul Withers * * MapValuePickerData, for use with the ValuePicker control */ -public class MapValuePickerData extends ValueBindingObjectImpl implements IValuePickerData { - - private String searchType; - private String searchRange; - private Boolean caseInsensitive; - private Map options; - private Boolean preventFiltering; +public class MapValuePickerData extends ValueBindingObjectImpl implements IValuePickerData, Serializable { + @SuppressWarnings("unused") + private static final Logger log_ = Logger.getLogger(MapValuePickerData.class.getName()); + private static final long serialVersionUID = 1L; + public String searchType; + public String searchStyle; + public Boolean caseInsensitive; + public Map options; /** * Enum for easy and consistent access to search type options @@ -58,7 +38,7 @@ public class MapValuePickerData extends ValueBindingObjectImpl implements IValue * @since org.openntf.domino.xsp 5.0.0 */ private static enum SearchType { - SEARCH_STARTSWITH("startsWith"), SEARCH_EQUALS("equals"), SEARCH_CONTAINS("contains"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + SEARCH_STARTFROM("startFrom"), SEARCH_MATCH("match"), SEARCH_FTSEARCH("ftSearch"); private final String value_; @@ -73,13 +53,15 @@ public String getValue() { /** * Enum for easy access to the search styles - jumpTo and restrictToSearch + * + * @since org.openntf.domino.xsp 5.0.0 */ - private static enum SearchRange { - SEARCH_RESTRICTTOSEARCH("restrictToSearch"), SEARCH_JUMPTO("jumpTo"); //$NON-NLS-1$ //$NON-NLS-2$ + private static enum SearchStyle { + SEARCH_JUMPTO("jumpTo"), SEARCH_RESTRICTTOSEARCH("restrictToSearch"); private final String value_; - private SearchRange(final String value) { + private SearchStyle(final String value) { value_ = value; } @@ -98,7 +80,7 @@ public MapValuePickerData() { * @return Map of values * @since org.openntf.domino.xsp 4.5.0 */ - @SuppressWarnings("unchecked") //$NON-NLS-1$ + @SuppressWarnings("unchecked") public Map getOptions() { if (options != null) { return options; @@ -106,23 +88,20 @@ public Map getOptions() { ValueBinding vb = getValueBinding("options"); //$NON-NLS-1$ if (vb != null) { Object vbVal = vb.getValue(getFacesContext()); - if( null != vbVal ){ + if (vbVal instanceof Map) { return (Map) vbVal; + } else { + try { + throw new UnsupportedDataTypeException("Value is not a map"); + } catch (UnsupportedDataTypeException e) { + e.printStackTrace(); + } } } return null; } - /** - * By default delegates to {@link #getOptions()}, but available to override in subclasses. - * - * @return Map of values - */ - public Map getOptionsMap() { - return getOptions(); - } - /** * Loads the options for the Value Picker * @@ -164,20 +143,22 @@ public void setSearchType(final String searchType) { } /** - * Gets the search style, from the "searchRange" property + * Gets the search style, from the "searchStyle" property * * @return String search style * @since org.openntf.domino.xsp 5.0.0 */ - public String getSearchRange() { - if (searchRange != null) { - return searchRange; + public String getSearchStyle() { + if (searchStyle != null) { + return searchStyle; } - ValueBinding vb = getValueBinding("searchRange"); //$NON-NLS-1$ + ValueBinding vb = getValueBinding("searchStyle"); //$NON-NLS-1$ if (vb != null) { return (String) vb.getValue(getFacesContext()); + } else { + return SearchStyle.SEARCH_JUMPTO.getValue(); } - return null; + } /** @@ -187,8 +168,8 @@ public String getSearchRange() { * String search style * @since org.openntf.domino.xsp 5.0.0 */ - public void setSearchRange(final String searchStyle) { - this.searchRange = searchStyle; + public void setSearchStyle(final String searchStyle) { + this.searchStyle = searchStyle; } /** @@ -222,39 +203,6 @@ public void setCaseInsensitive(final boolean caseInsensitive) { this.caseInsensitive = caseInsensitive; } - /** - *

- * Return the value of the preventFiltering property. - *

- *

- * Indicate if the list of values should be filtered with the value sent by the browser. - *

- * @designer.publicmethod - */ - public boolean isPreventFiltering() { - if (null != preventFiltering) { - return preventFiltering.booleanValue(); - } - ValueBinding binding = getValueBinding("preventFiltering"); // $NON-NLS-1$ - if (binding != null) { - Boolean result = (Boolean) binding.getValue(getFacesContext()); - if( null != result ){ - return result.booleanValue(); - } - } - return false; - } - /** - *

- * Set the value of the ignoreCase property. - *

- * @designer.publicmethod - */ - public void setPreventFiltering(boolean preventFiltering) { - this.preventFiltering = preventFiltering; - } - - /* * (non-Javadoc) * @@ -323,108 +271,75 @@ public IPickerResult readEntries(final IPickerOptions options) { * @since org.openntf.domino.xsp 4.5.0 */ private LinkedHashMap filteredOptions(final String key, final String startKey, final int start, final int searchIndex) { - - boolean isPreventFiltering = isPreventFiltering(); - String submittedKey = (null != key)? /*typeAhead submitted*/ key - : /*PickerListSearch submitted*/startKey; - LinkedHashMap retVal = new LinkedHashMap(); - - // Note, this pickerData is unusual in that most of them - // do a startsWith filter for typeAheads but this is honoring the searchType option. - if (!isPreventFiltering && StringUtil.isNotEmpty(submittedKey)) { - - // We've got a search key passed in, so search and add all remaining entries - - boolean isCaseInsensitive = isCaseInsensitive(); - // Note, for case insensitive matching, it is not safe to do .toLowerCase - // on the whole string, because of the Turkish dotless-i character. - // Instead use the algorithm described in String.equalsIgnoreCase and - // see http://www.i18nguy.com/unicode/turkish-i18n.html - String computedSearchRange = getSearchRange(); - // note, the org.openntf.domino.xsp implementation defaulted to searchTo, but this defaults to restrictToSearch - SearchRange searchRangeEnum = SearchRange.SEARCH_JUMPTO.getValue().equals(computedSearchRange)? - SearchRange.SEARCH_JUMPTO: /*default*/SearchRange.SEARCH_RESTRICTTOSEARCH; - - String searchType = getSearchType(); - SearchType searchTypeEnum; - if( SearchType.SEARCH_EQUALS.getValue().equals(searchType) ){ - searchTypeEnum = SearchType.SEARCH_EQUALS; - }else if(SearchType.SEARCH_CONTAINS.getValue().equals(searchType)){ - searchTypeEnum = SearchType.SEARCH_CONTAINS; - }else{ // startsWith (or old startsFrom value) - searchTypeEnum = SearchType.SEARCH_STARTSWITH; + String searchType = getSearchType(); + + if (StringUtil.isNotEmpty(key)) { + // We've got a typeahead key passed in, filter to entries beginning + // with that key + String tmpKey = key; + if (isCaseInsensitive()) { + tmpKey = tmpKey.toLowerCase(); } - - boolean doContainsLowerCaseCompare = false; - String keyLowerCase = null; - Pattern keyInsensitivePattern = null; - if( isCaseInsensitive && SearchType.SEARCH_CONTAINS == searchTypeEnum){ - // Note, defaulting to doing the slower Turkish-compliant search, - // but there's an option to use the faster not-Turkish-compliant lowerCase compare. - doContainsLowerCaseCompare = "false".equals( //$NON-NLS-1$ - FacesContextEx.getCurrentInstance().getApplicationEx() - .getProperty("xsp.picker.case_insensitive.locale.aware", /* defaultValue */"true")); //$NON-NLS-1$ //$NON-NLS-2$ - if( doContainsLowerCaseCompare ){ - keyLowerCase = submittedKey.toLowerCase(); - }else{ // default - String escapedKey = Pattern.quote(submittedKey); - keyInsensitivePattern = Pattern.compile(escapedKey, Pattern.CASE_INSENSITIVE); + + Iterator it = getOptions().keySet().iterator(); + while (it.hasNext()) { + String mapKey = it.next(); + String tmpMapKey = mapKey; + if (isCaseInsensitive()) { + tmpMapKey = tmpMapKey.toLowerCase(); + } + if (tmpMapKey.startsWith(tmpKey)) { + retVal.put(mapKey, getOptions().get(mapKey)); } } + } else if (StringUtil.isNotEmpty(startKey)) { + // startKey is actually a search key + // We've got a search key passed in, so search and add all remaining + // entries + String tmpSearchKey = startKey; + if (isCaseInsensitive()) { + tmpSearchKey = tmpSearchKey.toLowerCase(); + } - Map computedOptions = getOptionsMap(); - Iterator it = computedOptions.keySet().iterator(); + Iterator it = getOptions().keySet().iterator(); boolean found = false; while (it.hasNext()) { String mapKey = it.next(); + String tmpMapKey = mapKey; + if (isCaseInsensitive()) { + tmpMapKey = tmpMapKey.toLowerCase(); + } if (found) { - retVal.put(mapKey, computedOptions.get(mapKey)); + retVal.put(mapKey, getOptions().get(mapKey)); found = true; } else { - boolean match; - if (SearchType.SEARCH_EQUALS == searchTypeEnum ) { - match = (!isCaseInsensitive)?StringUtil.equals(mapKey, submittedKey) - : StringUtil.equalsIgnoreCase(mapKey, submittedKey); - } else if (SearchType.SEARCH_CONTAINS == searchTypeEnum ) { - if( !isCaseInsensitive ){ - match = mapKey.contains(submittedKey); - }else if( doContainsLowerCaseCompare ){ - match = mapKey.toLowerCase().contains(keyLowerCase); - }else{ // default case insensitive handling that can match the Turkish dotless-i - match = keyInsensitivePattern.matcher(mapKey).find(); + if (SearchType.SEARCH_MATCH.getValue().equals(searchType)) { + if (StringUtil.equals(tmpMapKey, tmpSearchKey)) { + retVal.put(mapKey, getOptions().get(mapKey)); + if (SearchStyle.SEARCH_JUMPTO.getValue().equals(getSearchStyle())) { + found = true; + } } - } else { // SearchType.SEARCH_STARTFROM == searchTypeEnum - match = (!isCaseInsensitive)? mapKey.startsWith(submittedKey) - : mapKey.regionMatches(/* ignoreCase */true, - 0, submittedKey,0,submittedKey.length()); - } - if (match) { - retVal.put(mapKey, computedOptions.get(mapKey)); - if (SearchRange.SEARCH_JUMPTO == searchRangeEnum ) { - found = true; + } else if (SearchType.SEARCH_FTSEARCH.getValue().equals(searchType)) { + if (tmpMapKey.contains(tmpSearchKey)) { + retVal.put(mapKey, getOptions().get(mapKey)); + if (SearchStyle.SEARCH_JUMPTO.getValue().equals(getSearchStyle())) { + found = true; + } + } + } else { + if (tmpMapKey.startsWith(tmpSearchKey)) { + retVal.put(mapKey, getOptions().get(mapKey)); + if (SearchStyle.SEARCH_JUMPTO.getValue().equals(getSearchStyle())) { + found = true; + } } } } } - } else { // initial display without filtering, or filtering disabled - - List shadowed = null; - DataPublisher dataPublisher = null; - if( isPreventFiltering ){ - // computed options can reference requestScope.startValue to access the submittedKey. - dataPublisher = FacesContextEx.getCurrentInstance().getDataPublisher(); - shadowed = new ArrayList(); - dataPublisher.pushObject(shadowed, "startValue", /*may be null*/submittedKey); //$NON-NLS-1$ - } - try{ - Map computedOptions = getOptionsMap(); - retVal.putAll(computedOptions); - }finally{ - if( isPreventFiltering ){ - dataPublisher.popObjects(shadowed); - } - } + } else { + retVal.putAll(getOptions()); } return retVal; } @@ -443,26 +358,17 @@ private LinkedHashMap filteredOptions(final String key, final St */ @Override public List loadEntries(final Object[] values, final String[] attributes) { - // Note, this is method used by the PickerValidator, - // and is checking against the values, not the keys, so it wouldn't be a caseInsensitive search. - // Initially the list has a null entry for each of the values array, - // and each index value will be replaced with an Entry if some map value - // is found that matches that value. - int length = (null == values)? 0 : values.length; - List entries = new ArrayList(length); + List entries = new ArrayList(); if (null != values) { - Map computedOptions = getOptionsMap(); for (int i = 0; i < values.length; i++) { String checkStr = values[i].toString(); - entries.add(i, null); if (StringUtil.isNotEmpty(checkStr)) { - Iterator it = computedOptions.keySet().iterator(); + Iterator it = getOptions().keySet().iterator(); while (it.hasNext()) { String mapKey = it.next(); - String mapValue = computedOptions.get(mapKey); - if (StringUtil.equals(checkStr, mapValue)) { - entries.set(i, new SimplePickerResult.Entry(mapValue, mapKey)); - break; // found for this value, continue the for loop to find for next value + if (StringUtil.equals(checkStr, getOptions().get(mapKey))) { + entries.add(new SimplePickerResult.Entry(getOptions().get(mapKey), mapKey)); + break; } } } @@ -478,16 +384,15 @@ public List loadEntries(final Object[] values, final String[] attr * com.ibm.xsp.complex.ValueBindingObjectImpl#restoreState(javax.faces.context * .FacesContext, java.lang.Object) */ - @SuppressWarnings("unchecked") //$NON-NLS-1$ + @SuppressWarnings("unchecked") @Override - public void restoreState(final FacesContext context, final Object state) { - Object values[] = (Object[]) state; - super.restoreState(context, values[0]); - options = (Map) values[1]; - searchType = (String) values[2]; - caseInsensitive = (Boolean) values[3]; - searchRange = (String) values[4]; - preventFiltering = (Boolean) values[5]; + public void restoreState(final FacesContext _context, final Object _state) { + Object _values[] = (Object[]) _state; + super.restoreState(_context, _values[0]); + options = (Map) _values[1]; + searchType = (String) _values[2]; + caseInsensitive = (Boolean) _values[3]; + searchStyle = (String) _values[4]; } /* @@ -498,15 +403,14 @@ public void restoreState(final FacesContext context, final Object state) { * .FacesContext) */ @Override - public Object saveState(final FacesContext context) { - Object values[] = new Object[6]; - values[0] = super.saveState(context); - values[1] = options; - values[2] = searchType; - values[3] = caseInsensitive; - values[4] = searchRange; - values[5] = preventFiltering; - return values; + public Object saveState(final FacesContext _context) { + Object _values[] = new Object[5]; + _values[0] = super.saveState(_context); + _values[1] = options; + _values[2] = searchType; + _values[3] = caseInsensitive; + _values[4] = searchStyle; + return _values; } } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker.xsp-config b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker.xsp-config index bd75abd..f02ade1 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker.xsp-config +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker.xsp-config @@ -1,7 +1,7 @@ - + @@ -402,52 +402,57 @@ pickerValidator + - %complex-type.mapValuePicker.descr% - %complex-type.mapValuePicker.name% + %complex-type.mapPicker.descr% + %complex-type.mapPicker.name% com.ibm.xsp.extlib.component.picker.data.MapValuePickerData com.ibm.xsp.extlib.component.picker.data.MapValuePickerData - %property.options.descr% - %property.options.name% + %property.map.complex-type.mapPicker.descr% + %property.map.complex-type.mapPicker.name% options java.util.Map - true - false com.ibm.workplace.designer.ide.xfaces.internal.editors.MethodBindingEditor - + %property.searchType.descr% %property.searchType.name% searchType java.lang.String + + not-localizable + com.ibm.workplace.designer.property.editors.comboParameterEditor - startsWith - equals - contains - + startFrom + match + ftSearch + - - %property.searchRange.descr% - %property.searchRange.name% - searchRange + + %property.searchStyle.descr% + %property.searchStyle.name% + searchStyle java.lang.String + + not-localizable + com.ibm.workplace.designer.property.editors.comboParameterEditor jumpTo restrictToSearch - + @@ -456,84 +461,80 @@ %property.caseInsensitive.name% caseInsensitive boolean - - - %property.preventFiltering.descr% - %property.preventFiltering.name% - preventFiltering - boolean + com.ibm.xsp.extlib.component.picker.data.IValuePickerData - 9.0.1.v00_12 mapValuePicker - - %complex-type.collectionValuePicker.descr% - %complex-type.collectionValuePicker.name% + + + + + %complex-type.collectionPicker.descr% + %complex-type.collectionPicker.name% com.ibm.xsp.extlib.component.picker.data.CollectionValuePickerData com.ibm.xsp.extlib.component.picker.data.CollectionValuePickerData - %property.collection.descr% - %property.collection.name% + %property.collection.complex-type.collectionPicker.descr% + %property.collection.complex-type.collectionPicker.name% collection java.util.Collection - true - false com.ibm.workplace.designer.ide.xfaces.internal.editors.MethodBindingEditor - + %property.searchType.descr% %property.searchType.name% searchType java.lang.String + + not-localizable + com.ibm.workplace.designer.property.editors.comboParameterEditor - startsWith - equals - contains - + startFrom + match + ftSearch + - - %property.searchRange.descr% - %property.searchRange.name% - searchRange + + %property.searchStyle.descr% + %property.searchStyle.name% + searchStyle java.lang.String + + not-localizable + com.ibm.workplace.designer.property.editors.comboParameterEditor jumpTo restrictToSearch - + - - %property.preventFiltering.descr% - %property.preventFiltering.name% - preventFiltering - boolean - %property.caseInsensitive.descr% %property.caseInsensitive.name% caseInsensitive boolean + com.ibm.xsp.extlib.component.picker.data.IValuePickerData - 9.0.1.v00_12 collectionValuePicker - + + \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker_en.properties b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker_en.properties index edd4455..a302f99 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker_en.properties +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-picker_en.properties @@ -1,6 +1,6 @@ # ***************************************************************** # /* -# * Copyright IBM Corp. 2010, 2015 +# * Copyright IBM Corp. 2010, 2013 # * # * Licensed under the Apache License, Version 2.0 (the "License"); # * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ # * permissions and limitations under the License. # */ # ***************************************************************** - # DO NOT EDIT. THIS FILE IS GENERATED. # NLS_ENCODING=UNICODE # NLS_MARKUP=IBMNJDK2 @@ -80,22 +79,16 @@ property.dataProvider.validator.com.ibm.xsp.extlib.validator.PickerValidator.des property.for.validator.com.ibm.xsp.extlib.validator.PickerValidator.name= Data Picker ID # The "id" should not be translated, it refers to the id Identifier property property.for.validator.com.ibm.xsp.extlib.validator.PickerValidator.descr= Points to the ID of a data picker control (value or name picker) -complex-type.mapValuePicker.name= Map Picker Data Provider -# "java.util.Map<String,String>" should not be translated -complex-type.mapValuePicker.descr= A Value Picker Data Provider that takes its content from a java.util.Map. The map has multiple entries, each containing a text label key and a text data value. The key is the label that is displayed to the user, and the data value is saved in the document field if the entry is selected. -property.options.name= Options Map -# "java.util.Map" and "LinkedHashMap" should not be translated -property.options.descr= The map containing the data, an implementation of java.util.Map (e.g. LinkedHashMap). The map keys are labels. The values are data. -property.searchType.name= Search Type -# "startsWith" "equals" and "contains" should not be translated -property.searchType.descr= Defines the type of comparison used when searching for entries whose label matches a submitted search value. The options are "startsWith", which selects entries that begin with the search value, "equals", which selects entries that are the same as the search value or that are considered the same when doing a case insensitive comparison, and "contains", which selects entries that contain the search value within entry label. The default is "startsWith". -property.searchRange.name= Search Results Range -property.searchRange.descr= Defines the range of search results to be displayed. The default is "restrictToSearch", showing only those entries that match the search criteria. The other option is "jumpTo", which shows the first entry that matches the search criteria and all remaining entries, even where the remaining entries do not match the search criteria. -property.preventFiltering.name= Prevent Filtering -property.preventFiltering.descr= Prevents the filtering of the list of values using the value submitted by the browser. The default value is false. -complex-type.collectionValuePicker.name= Collection Picker Data Provider -# Do not translate "java.util.Collection", "List", "Set", "Vector" -complex-type.collectionValuePicker.descr= A Value Picker Data Provider that takes its content from a java.util.Collection object which contains multiple items, e.g. List, Set, Vector. Each item is a text value that is used as both the label displayed to the user and as the data value that is saved to a document field. -property.collection.name= Collection -# Do not translate "java.util.Collection", "java.util.TreeSet" or "java.util.ArrayList" -property.collection.descr= The java.util.Collection object containing the multiple items to be shown in the Value Picker dialog. For example the object might be a java.util.TreeSet or java.util.ArrayList. + +complex-type.mapPicker.name= Map Picker Data Provider +complex-type.mapPicker.descr= Map Picker Data Provider that takes its content from a Map +property.map.complex-type.mapPicker.name= Map +property.map.complex-type.mapPicker.descr= Map for the MapPicker, implementation of Map (e.g. LinkedHashMap) +property.caseInsensitive.name= Case Insensitive Key +property.caseInsensitive.descr= Specifies if the key being used should be treated as case insensitive +property.searchStyle.name= Style of Search +property.searchStyle.descr= Define the style of search to be used. The default is "jumpTo", working like the Extension Library picker searches - jumping to the first entry matching the search type and showing all remaining entries. The alternative is "restrictToSearch", so showing only those entries that match the search criteria. +complex-type.collectionPicker.name= Collection Picker Data Provider +complex-type.collectionPicker.descr= Collection Picker Data Provider that takes its content from a List, Set, Vector etc +property.collection.complex-type.collectionPicker.name= Collection +property.collection.complex-type.collectionPicker.descr= Collection for the CollectionPicker, implementation of Set or List (e.g. TreeSet or ArrayList) \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.classpath index 1fa3e68..e2a51c8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.project index 9d271f9..7cb05a8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder -
- - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.core/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.classpath index 1fa3e68..e2a51c8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.project index f8dd2f5..5da2733 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.project @@ -20,11 +20,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.settings/org.eclipse.jdt.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.settings/org.eclipse.jdt.core.prefs index a3b1b50..c37e100 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.settings/org.eclipse.jdt.core.prefs +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,9 @@ -#Mon Jul 26 14:47:44 EDT 2010 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +12,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore @@ -65,3 +69,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/AbstractDominoViewPickerData.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/AbstractDominoViewPickerData.java index 177e2aa..5f41525 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/AbstractDominoViewPickerData.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/AbstractDominoViewPickerData.java @@ -30,272 +30,284 @@ import com.ibm.commons.util.StringUtil; import com.ibm.xsp.FacesExceptionEx; import com.ibm.xsp.complex.ValueBindingObjectImpl; -import com.ibm.xsp.context.FacesContextEx; import com.ibm.xsp.model.domino.DominoUtils; import com.ibm.xsp.model.domino.wrapped.DominoViewEntry; - /** * Abstract data provider for a picker that reads the data from a Domino view. *

- * This class does not preclude how the + * This class does not preclude how the *

*/ public abstract class AbstractDominoViewPickerData extends ValueBindingObjectImpl implements IPickerData { - public static final String SEARCH_STARTFROM = "startFrom"; // default //$NON-NLS-1$ - public static final String SEARCH_MATCH = "match"; //$NON-NLS-1$ - public static final String SEARCH_FTSEARCH = "ftSearch"; //$NON-NLS-1$ - - public AbstractDominoViewPickerData() { - } - - protected abstract EntryMetaData createEntryMetaData(IPickerOptions options) throws NotesException; - - public String getSearchType() { - return null; - } - - - // ==================================================================== - // Data access implementation - // ==================================================================== - - public abstract static class EntryMetaData { - private View view; - private IPickerOptions options; - protected EntryMetaData(IPickerOptions options) throws NotesException { - this.options = options; - this.view = openView(); - } - public View getView() { - return view; - } - public IPickerOptions getOptions() { - return options; - } - protected int findSortColumnIndex(Vector vc) throws NotesException { - int fc = -1; - // Find the first sorted column - int nc = vc.size(); - for(int i=0; i vc, String name) throws NotesException { - int nc = vc.size(); - // Look for a programmatic name first - for(int i=0; i columnValues = ve.getColumnValues(); - - // Read the value - this.value = readValue(ve, columnValues); - - // Read the label - this.label = readLabel(ve, columnValues); - - // Read the extra attributes - this.attributes = readAttributes(ve, columnValues); - } - public EntryMetaData getMetaData() { - return metaData; - } - public Object getValue() { - return value; - } - public Object getLabel() { - return label; - } - public int getAttributeCount() { - return 0; - } - public String getAttributeName(int index) { - return null; - } - public Object getAttributeValue(int index) { - return attributes[index]; - } - protected abstract Object readValue(ViewEntry ve, Vector columnValues) throws NotesException; - protected abstract Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException; - protected abstract Object[] readAttributes(ViewEntry ve, Vector columnValues) throws NotesException; - } - public static class Result implements IPickerResult { - private List entries; - private int count; - protected Result(List entries, int count) { - this.entries = entries; - this.count = count; - } - public List getEntries() { - return entries; - } - public int getTotalCount() { - return count; - } - } - - public boolean hasCapability(int capability) { - if(capability==CAPABILITY_MULTIPLESOURCES) { - return false; - } - return true; - } - - public IPickerResult readEntries(IPickerOptions options) { - try { - EntryMetaData meta = createEntryMetaData(options); - View view = meta.getView(); - view.setAutoUpdate(false); - try { - ArrayList entries = new ArrayList(); - - int start = options.getStart(); - int count = options.getCount(); - String key = options.getKey(); - String _startKey = options.getStartKey(); - if(StringUtil.isNotEmpty(_startKey)) { - key = _startKey; - } - - String searchType = getSearchType(); - if(StringUtil.isEmpty(searchType)) { - searchType = SEARCH_STARTFROM; - } - - if(StringUtil.equals(searchType, SEARCH_MATCH)) { - ViewEntryCollection vc; - if (!StringUtil.isEmpty(key)) { - vc = view.getAllEntriesByKey(key); - } else { - // key is empty, default to return all, but check option - String optionName = "xsp.extlib.dominoViewPicker.searchMatch.emptyKey.all"; //$NON-NLS-1$ - String optionValue = FacesContextEx.getCurrentInstance().getProperty(optionName); - if( "false".equals(optionValue) ){ //$NON-NLS-1$ - // when explicitly set to "false" then revert to the old pre-901v14 behavior, - // match to empty key, returns none. [Change for SPR#MKEE9ZKDJR, and for - // GitPR#14,PartD3: https://github.com/OpenNTF/XPagesExtensionLibrary/pull/14 ] - vc = view.getAllEntriesByKey(key); - }else{ // default - vc = view.getAllEntries(); - } - } - ViewEntry ve = start>0 ? vc.getNthEntry(start) : vc.getFirstEntry(); - for(int i=0; i0 ? vc.getNthEntry(start) : vc.getFirstEntry(); - for(int i=0; i0) { - if(nav.skip(start)!=start) { - // ok not all of them are skipped, stop the process - count = 0; - } - } - for(int i=0; i loadEntries(Object[] ids, String[] attributeNames) { - try { - EntryMetaData meta = createEntryMetaData(null); - View view = meta.getView(); - view.setAutoUpdate(false); - try { - // TODO: use the options here? - ArrayList entries = new ArrayList(ids.length); - for(int i=0; i vc) throws NotesException { + int fc = -1; + // Find the first sorted column + int nc = vc.size(); + for (int i = 0; i < nc; i++) { + ViewColumn c = vc.get(i); + if (c.isSorted()) { + return i; + } + if (fc < 0 && c.getColumnValuesIndex() != DominoViewEntry.VC_NOT_PRESENT) { + fc = i; + } + } + // Else, return the first column + return fc; + } + + protected int findColumnIndex(Vector vc, String name) throws NotesException { + int nc = vc.size(); + // Look for a programmatic name first + for (int i = 0; i < nc; i++) { + if (StringUtil.equalsIgnoreCase(vc.get(i).getItemName(), name)) { + return i; + } + } + // Then default to the title + for (int i = 0; i < nc; i++) { + if (StringUtil.equalsIgnoreCase(vc.get(i).getTitle(), name)) { + return i; + } + } + return -1; + } + + protected abstract View openView() throws NotesException; + + protected abstract Entry createEntry(ViewEntry ve) throws NotesException; + } + + public abstract static class Entry implements IPickerEntry { + private EntryMetaData metaData; + private Object value; + private Object label; + private Object[] attributes; + + @SuppressWarnings("unchecked") + // $NON-NLS-1$ + protected Entry(EntryMetaData metaData, ViewEntry ve) throws NotesException { + this.metaData = metaData; + // Read the values from the view entry + Vector columnValues = ve.getColumnValues(); + + // Read the value + this.value = readValue(ve, columnValues); + + // Read the label + this.label = readLabel(ve, columnValues); + + // Read the extra attributes + this.attributes = readAttributes(ve, columnValues); + } + + public EntryMetaData getMetaData() { + return metaData; + } + + public Object getValue() { + return value; + } + + public Object getLabel() { + return label; + } + + public int getAttributeCount() { + return 0; + } + + public String getAttributeName(int index) { + return null; + } + + public Object getAttributeValue(int index) { + return attributes[index]; + } + + protected abstract Object readValue(ViewEntry ve, Vector columnValues) throws NotesException; + + protected abstract Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException; + + protected abstract Object[] readAttributes(ViewEntry ve, Vector columnValues) throws NotesException; + } + + public static class Result implements IPickerResult { + private List entries; + private int count; + + protected Result(List entries, int count) { + this.entries = entries; + this.count = count; + } + + public List getEntries() { + return entries; + } + + public int getTotalCount() { + return count; + } + } + + public boolean hasCapability(int capability) { + if (capability == CAPABILITY_MULTIPLESOURCES) { + return false; + } + return true; + } + + public IPickerResult readEntries(IPickerOptions options) { + try { + EntryMetaData meta = createEntryMetaData(options); + View view = meta.getView(); + view.setAutoUpdate(false); + try { + ArrayList entries = new ArrayList(); + + int start = options.getStart(); + int count = options.getCount(); + String key = options.getKey(); + String _startKey = options.getStartKey(); + if (StringUtil.isNotEmpty(_startKey)) { + key = _startKey; + } + + String searchType = getSearchType(); + if (StringUtil.isEmpty(searchType)) { + searchType = SEARCH_STARTFROM; + } + + if (StringUtil.equals(searchType, SEARCH_MATCH)) { + ViewEntryCollection vc; + if (!StringUtil.isEmpty(key)) { + vc = view.getAllEntriesByKey(key); + } else { + vc = view.getAllEntries(); + } + ViewEntry ve = start > 0 ? vc.getNthEntry(start) : vc.getFirstEntry(); + for (int i = 0; i < count && ve != null; i++) { + entries.add(meta.createEntry(ve)); + ve = vc.getNextEntry(ve); + } + int nEntries = vc.getCount(); + return new Result(entries, nEntries); + } + if (StringUtil.equals(searchType, SEARCH_FTSEARCH)) { + applyFTSearch(options, view, key); + ViewEntryCollection vc = view.getAllEntries(); + ViewEntry ve = start > 0 ? vc.getNthEntry(start) : vc.getFirstEntry(); + for (int i = 0; i < count && ve != null; i++) { + entries.add(meta.createEntry(ve)); + ve = vc.getNextEntry(ve); + } + int nEntries = vc.getCount(); + return new Result(entries, nEntries); + } else { + ViewNavigator nav = view.createViewNav(); + try { + ViewEntry ve = null; + if (key != null) { + int searchOptions = DominoUtils.FIND_GREATER_THAN | DominoUtils.FIND_EQUAL | DominoUtils.FIND_PARTIAL + | DominoUtils.FIND_CASE_INSENSITIVE; + ve = DominoUtils.getViewEntryByKeyWithOptions(view, key, searchOptions); + } else { + ve = nav.getCurrent(); + } + if (start > 0) { + if (nav.skip(start) != start) { + // ok not all of them are skipped, stop the + // process + count = 0; + } + } + for (int i = 0; i < count && ve != null; i++) { + entries.add(meta.createEntry(ve)); + ve = nav.getNext(ve); + } + + int nEntries = -1; + return new Result(entries, nEntries); + } finally { + nav.recycle(); + } + } + } finally { + // Recycle the view? + } + } catch (Exception ex) { + Platform.getInstance().log(ex); + // Swallow the exception for the end user and return an empty picker + return new EmptyPickerResult(); + } + } + + protected void applyFTSearch(IPickerOptions options, View view, String key) throws NotesException { + if (StringUtil.isNotEmpty(key)) { + view.FTSearch(key); + } + } + + public List loadEntries(Object[] ids, String[] attributeNames) { + try { + EntryMetaData meta = createEntryMetaData(null); + View view = meta.getView(); + view.setAutoUpdate(false); + try { + // TODO: use the options here? + ArrayList entries = new ArrayList(ids.length); + for (int i = 0; i < ids.length; i++) { + ViewEntry ve = view.getEntryByKey(ids[i], true); + if (ve != null) { + Entry e = meta.createEntry(ve); + entries.add(e); + } else { + entries.add(null); + } + // ve.recycle(); + } + return entries; + } finally { + // Recycle the view? + } + } catch (NotesException ex) { + throw new FacesExceptionEx(ex, "Error while loading entry"); // $NLX-AbstractDominoViewPickerData.Errorwhileloadingentry-1$ + } + } } \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/DominoNABNamePickerData.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/DominoNABNamePickerData.java index 22788cf..b488000 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/DominoNABNamePickerData.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/DominoNABNamePickerData.java @@ -1,5 +1,5 @@ /* - * © Copyright IBM Corp. 2010, 2015 + * © Copyright IBM Corp. 2010 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import java.io.Serializable; import java.util.ArrayList; -import java.util.Locale; import java.util.Map; import java.util.Vector; @@ -34,667 +33,767 @@ import com.ibm.commons.util.StringUtil; import com.ibm.xsp.FacesExceptionEx; import com.ibm.xsp.acl.NoAccessSignal; -import com.ibm.xsp.context.FacesContextEx; -import com.ibm.xsp.extlib.domino.ExtlibDominoLogger; import com.ibm.xsp.extlib.util.ExtLibUtil; import com.ibm.xsp.model.domino.DominoUtils; -import com.ibm.xsp.component.UIViewRootEx; - - /** * Data provider for a name picker using the Domino NAB. */ public class DominoNABNamePickerData extends AbstractDominoViewPickerData implements INamePickerData { - public static final String NAB_ALL = "all"; // $NON-NLS-1$ - public static final String NAB_ALLPUBLIC = "all-public"; // $NON-NLS-1$ - public static final String NAB_ALLPRIVATE = "all-private"; // $NON-NLS-1$ - public static final String NAB_FIRST = "first"; // $NON-NLS-1$ - public static final String NAB_FIRSTPUBLIC = "first-public"; // $NON-NLS-1$ - public static final String NAB_DATABASENAME = "db-name"; // $NON-NLS-1$ - - private String addressBookSel; - private String addressBookDb; - private String nameList; - private Boolean people; - private Boolean groups; - private String searchType; - private String valueNameFormat; - - public DominoNABNamePickerData() { - } - - public String getAddressBookSel() { - if (null != this.addressBookSel) { - return this.addressBookSel; - } - ValueBinding _vb = getValueBinding("addressBookSel"); //$NON-NLS-1$ - if (_vb != null) { - return (java.lang.String) _vb.getValue(getFacesContext()); - } - return null; - } - - public void setAddressBookSel(String addressBookSel) { - this.addressBookSel = addressBookSel; - } - - public String getAddressBookDb() { - if (null != this.addressBookDb) { - return this.addressBookDb; - } - ValueBinding _vb = getValueBinding("addressBookDb"); //$NON-NLS-1$ - if (_vb != null) { - return (java.lang.String) _vb.getValue(getFacesContext()); - } - return null; - } - - public void setAddressBookDb(String addressBookDb) { - this.addressBookDb = addressBookDb; - } - - public String getNameList() { - if (null != this.nameList) { - return this.nameList; - } - ValueBinding _vb = getValueBinding("nameList"); //$NON-NLS-1$ - if (_vb != null) { - return (java.lang.String) _vb.getValue(getFacesContext()); - } - return null; - } - - public void setNameList(String nameList) { - this.nameList = nameList; - } - - public boolean isPeople() { - if (null != this.people) { - return this.people; - } - ValueBinding _vb = getValueBinding("people"); //$NON-NLS-1$ - if (_vb != null) { - Object obj = _vb.getValue(getFacesContext()); - if( obj instanceof Boolean ){// non-null - return (Boolean) obj; - } - } - return true; - } - public void setPeople(boolean people) { - this.people = people; - } - - public boolean isGroups() { - if (null != this.groups) { - return this.groups; - } - ValueBinding _vb = getValueBinding("groups"); //$NON-NLS-1$ - if (_vb != null) { - Object obj = _vb.getValue(getFacesContext()); - if( obj instanceof Boolean ){// non-null - return (Boolean) obj; - } - } - return true; - } - public void setGroups(boolean groups) { - this.groups = groups; - } - - @Override - public String getSearchType() { - if (searchType != null) { - return searchType; - } - ValueBinding vb = getValueBinding("searchType"); //$NON-NLS-1$ - if (vb != null) { - return (String) vb.getValue(getFacesContext()); - } - - return null; - } - - public void setSearchType(String searchType) { - this.searchType = searchType; - } - - /** - * Gets the format a name should be returned as. - * - * @return String specific format - */ - public String getValueNameFormat() { - if (null != this.valueNameFormat) { - return this.valueNameFormat; - } - ValueBinding _vb = getValueBinding("valueNameFormat"); //$NON-NLS-1$ - if (_vb != null) { - return (String) _vb.getValue(getFacesContext()); - } - return null; - } - /** - * Loads the value name format (String) - * - * @param valueNameFormat - * String - * @author withersp - */ - public void setValueNameFormat(String valueNameFormat) { - this.valueNameFormat = valueNameFormat; - } - @Override - public Object saveState(FacesContext context) { - Object[] state = new Object[8]; - state[0] = super.saveState(context); - state[1] = addressBookSel; - state[2] = addressBookDb; - state[3] = nameList; - state[4] = people; - state[5] = groups; - state[6] = valueNameFormat; - state[7] = searchType; - return state; - } - - @Override - public void restoreState(FacesContext context, Object value) { - Object[] state = (Object[])value; - super.restoreState(context, state[0]); - this.addressBookSel = (String)state[1]; - this.addressBookDb = (String)state[2]; - this.nameList = (String)state[3]; - this.people = (Boolean)state[4]; - this.groups = (Boolean)state[5]; - this.valueNameFormat = (String) state[6]; - this.searchType = (String) state[7]; - } - - private static enum NameFormat { - ABBREVIATED, COMMON, CANONICAL, UNFORMATTED - } - private NameFormat parseNameFormat(String nameFormatStr){ - if( null != nameFormatStr && nameFormatStr.length() > 0 ){ - // from returnNameFormat="common" to COMMON (only 4 possible values, don't care about locale) - String upper = nameFormatStr.toUpperCase(Locale.US); - try{ - NameFormat specified = NameFormat.valueOf(upper); - return specified; - }catch(IllegalArgumentException ex){ - // unknown string in XPage source default to unformatted, - // not usually log (traceDebug is disabled by default). - if( ExtlibDominoLogger.DOMINO.isTraceDebugEnabled() ){ - String debugMsg = "Unknown property value for valueNameFormat=\"{0}\" on the tag xe:dominoNABNamePicker in the XPage {1}."; //$NON-NLS-1$ - String pageName = ""; //$NON-NLS-1$ - FacesContextEx context = FacesContextEx.getCurrentInstance(); - UIViewRootEx viewRoot = (null == context)? null : (UIViewRootEx)context.getViewRoot(); - String viewPageName = (null == viewRoot)? null : viewRoot.getPageName(); - if( null != viewPageName){ - pageName = viewPageName; - } - debugMsg = StringUtil.format(debugMsg, nameFormatStr, pageName); - ExtlibDominoLogger.DOMINO.traceDebugp(this, "parseNameFormat", ex, debugMsg); //$NON-NLS-1$ - } - } - } - return NameFormat.UNFORMATTED; - } - private static String formatName(String baseName, NameFormat format) throws NotesException { - // optionally reformat the name, as contributed in #14 subpart D1: - // https://github.com/OpenNTF/XPagesExtensionLibrary/pull/14 - if( StringUtil.isEmpty(baseName) ){ - // don't format empty string - return baseName; - } - if (NameFormat.UNFORMATTED == format) { - return baseName; - } else { - Session sess = ExtLibUtil.getCurrentSession(); - Name nm = sess.createName(baseName); // throws NotesException - switch(format){ - case ABBREVIATED: return nm.getAbbreviated(); - case CANONICAL: return nm.getCanonical(); - case COMMON: return nm.getCommon(); - default: return baseName; // won't happen - } - } - } - - - // ==================================================================== - // Data access implementation - // ==================================================================== - - private static class NABDb implements Serializable { // Serializable because it goes to a scope - private static final long serialVersionUID = 1L; - String name; - String title; - boolean publicNab; - boolean privateNab; - NABDb(Database db) throws NotesException { - this(db.getFilePath(),db.getTitle()); - this.publicNab = db.isPublicAddressBook(); - this.privateNab = db.isPrivateAddressBook(); - } - NABDb(String name, String title) throws NotesException { - this.name = name; - this.title = title; - if(StringUtil.isEmpty(title)) { - this.title = name; - } - } - } - - // Compose the list of all the address books, once for ever... - // Beyond the cache, this guarantees that the NAB are always retrieved - // in the same order. - // The list has to be cached at the session level, as different users can - // have different ACLs for the databases. - private static final String KEY_NABS = "extlib.pickers.domino.nabs"; //$NON-NLS-1$ - private NABDb[] getSessionAddressBooks() throws NotesException { - Map sc = ExtLibUtil.getSessionScope(); - NABDb[] addressBooks = sc!=null ? (NABDb[])sc.get(KEY_NABS) : null; - if(addressBooks==null) { - // Try with the current user - Session session = ExtLibUtil.getCurrentSession(); - addressBooks = getSessionAddressBooks(session); - if(addressBooks!=null && addressBooks.length>0) { - if(sc!=null) { - sc.put(KEY_NABS, addressBooks); - } - } else { - // No NAB is avail - we don't throw a signal from here as it forces authentication - // as soon as the page is displayed (the control asks for the NAB when rendering) - //throw new NoAccessSignal(); - } - } - return addressBooks; - } - private static NABDb[] getSessionAddressBooks(Session session) throws NotesException { - if(session!=null) { // Unit tests - ArrayList nabs = new ArrayList(); - Vector vc = session.getAddressBooks(); - if(vc!=null) { - for(int i=0; i labels = new ArrayList(); - if(StringUtil.isEmpty(sel) || sel.equals(NAB_ALL)) { - for(int i=0; i0) { - labels.add(sessNabs[0].title); - } - } else if(sel.equals(NAB_FIRSTPUBLIC)) { - for(int i=0; i0) { - if(StringUtil.isEmpty(sel) || sel.equals(NAB_ALL)) { - return DominoUtils.openDatabaseByName(sessNabs[source].name); - } else if(sel.equals(NAB_ALLPUBLIC)) { - int cpt = 0; - for(int i=0; i0) { - return DominoUtils.openDatabaseByName(sessNabs[0].name); - } - } else if(sel.equals(NAB_FIRST)) { - for(int i=0; i columnValues) throws NotesException { - return null; - } - } - - - ////////////////////////////////////////////////////////////////////// - // People - public class _EntryMetaDataPeople extends _EntryMetaData { - protected _EntryMetaDataPeople(IPickerOptions options) throws NotesException { - super(options); - } - @Override - protected String getViewName() { - return "($VIMPeople)"; // $NON-NLS-1$ - } - @Override - protected Entry createEntry(ViewEntry ve) throws NotesException { - return new _EntryPeople(this,ve); - } - } - public static class _EntryPeople extends _Entry { - protected _EntryPeople(EntryMetaData metaData, ViewEntry ve) throws NotesException { - super(metaData,ve); - } - @Override - protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { - String value = (String) columnValues.get(0); - NameFormat format = getMetaData().nameFormatEnum; - return formatName(value, format); - } - @Override - protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { - String first = (String)columnValues.get(1); - String mid = (String)columnValues.get(2); - String last = (String)columnValues.get(3); - StringBuilder b = new StringBuilder(); - if(StringUtil.isNotEmpty(first)) { - b.append(first); - } - if(StringUtil.isNotEmpty(mid)) { - if(b.length()>0) { - b.append(" "); - } - b.append(mid); - } - if(StringUtil.isNotEmpty(last)) { - if(b.length()>0) { - b.append(" "); - } - b.append(last); - } - - return b.toString(); - } - } - public class _EntryMetaDataPeopleByLastName extends _EntryMetaData { - protected _EntryMetaDataPeopleByLastName(IPickerOptions options) throws NotesException { - super(options); - } - @Override - protected String getViewName() { - return "($VIMPeopleByLastName)"; // $NON-NLS-1$ - } - @Override - protected Entry createEntry(ViewEntry ve) throws NotesException { - return new _EntryPeopleByLastName(this,ve); - } - } - public static class _EntryPeopleByLastName extends _Entry { - protected _EntryPeopleByLastName(EntryMetaData metaData, ViewEntry ve) throws NotesException { - super(metaData,ve); - } - @Override - protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { - String value = (String) columnValues.get(1); - NameFormat format = getMetaData().nameFormatEnum; - return formatName(value, format); - } - @Override - protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { - String first = (String)columnValues.get(2); - String mid = (String)columnValues.get(3); - String last = (String)columnValues.get(0); - StringBuilder b = new StringBuilder(); - if(StringUtil.isNotEmpty(last)) { - b.append(last); - } - if(StringUtil.isNotEmpty(first)) { - if(b.length()>0) { - b.append(" "); - } - b.append(first); - } - if(StringUtil.isNotEmpty(mid)) { - if(b.length()>0) { - b.append(" "); - } - b.append(mid); - } - - return b.toString(); - } - } - - - ////////////////////////////////////////////////////////////////////// - // Groups - public class _EntryMetaDataGroup extends _EntryMetaData { - protected _EntryMetaDataGroup(IPickerOptions options) throws NotesException { - super(options); - } - @Override - protected String getViewName() { - return "($VIMGroups)"; // $NON-NLS-1$ - } - @Override - protected Entry createEntry(ViewEntry ve) throws NotesException { - return new _EntryGroup(this,ve); - } - } - public static class _EntryGroup extends _Entry { - protected _EntryGroup(EntryMetaData metaData, ViewEntry ve) throws NotesException { - super(metaData,ve); - } - @Override - protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { - return columnValues.get(0); - } - @Override - protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { - return columnValues.get(0); - } - } - - ////////////////////////////////////////////////////////////////////// - // People and groups - public class _EntryMetaDataPeopleAndGroup extends _EntryMetaData { - protected _EntryMetaDataPeopleAndGroup(IPickerOptions options) throws NotesException { - super(options); - } - @Override - protected String getViewName() { - return "($VIMPeopleAndGroups)"; // $NON-NLS-1$ - } - @Override - protected Entry createEntry(ViewEntry ve) throws NotesException { - return new _EntryPeopleAndGroup(this,ve); - } - } - public static class _EntryPeopleAndGroup extends _Entry { - protected _EntryPeopleAndGroup(EntryMetaData metaData, ViewEntry ve) throws NotesException { - super(metaData,ve); - } - @Override - protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { - // optionally reformat the name, as contributed in #14 subpart D1: - // https://github.com/OpenNTF/XPagesExtensionLibrary/pull/14 + public static final String NAB_ALL = "all"; // $NON-NLS-1$ + public static final String NAB_ALLPUBLIC = "all-public"; // $NON-NLS-1$ + public static final String NAB_ALLPRIVATE = "all-private"; // $NON-NLS-1$ + public static final String NAB_FIRST = "first"; // $NON-NLS-1$ + public static final String NAB_FIRSTPUBLIC = "first-public"; // $NON-NLS-1$ + public static final String NAB_DATABASENAME = "db-name"; // $NON-NLS-1$ + + public String searchType; + + private static enum NameFormat { + ABBREVIATED("Abbreviated"), COMMON("Common"), CANONICAL("Canonical"); + + private final String value_; + + private NameFormat(String value) { + value_ = value; + } + + public String getValue() { + return value_; + } + } + + private String addressBookSel; + private String addressBookDb; + private String nameList; + private Boolean people; + private Boolean groups; + private String returnNameFormat; + private NameFormat returnNameFormatAsNameFormat; + + public DominoNABNamePickerData() { + } + + public String getAddressBookSel() { + if (null != this.addressBookSel) { + return this.addressBookSel; + } + ValueBinding _vb = getValueBinding("addressBookSel"); //$NON-NLS-1$ + if (_vb != null) { + return (java.lang.String) _vb.getValue(getFacesContext()); + } + return null; + } + + public void setAddressBookSel(String addressBookSel) { + this.addressBookSel = addressBookSel; + } + + public String getAddressBookDb() { + if (null != this.addressBookDb) { + return this.addressBookDb; + } + ValueBinding _vb = getValueBinding("addressBookDb"); //$NON-NLS-1$ + if (_vb != null) { + return (java.lang.String) _vb.getValue(getFacesContext()); + } + return null; + } + + public void setAddressBookDb(String addressBookDb) { + this.addressBookDb = addressBookDb; + } + + public String getNameList() { + if (null != this.nameList) { + return this.nameList; + } + ValueBinding _vb = getValueBinding("nameList"); //$NON-NLS-1$ + if (_vb != null) { + return (java.lang.String) _vb.getValue(getFacesContext()); + } + return null; + } + + public void setNameList(String nameList) { + this.nameList = nameList; + } + + public boolean isPeople() { + if (null != this.people) { + return this.people; + } + ValueBinding _vb = getValueBinding("people"); //$NON-NLS-1$ + if (_vb != null) { + Object obj = _vb.getValue(getFacesContext()); + if (obj instanceof Boolean) {// non-null + return (Boolean) obj; + } + } + return true; + } + + public void setPeople(boolean people) { + this.people = people; + } + + public boolean isGroups() { + if (null != this.groups) { + return this.groups; + } + ValueBinding _vb = getValueBinding("groups"); //$NON-NLS-1$ + if (_vb != null) { + Object obj = _vb.getValue(getFacesContext()); + if (obj instanceof Boolean) {// non-null + return (Boolean) obj; + } + } + return true; + } + + public void setGroups(boolean groups) { + this.groups = groups; + } + + /** + * Gets the format a name should be returned as, using returnNameFormat + * property and set enum + * + * @return String name in specific format + * @since org.openntf.domino.xsp 5.0.0 + */ + public String getReturnNameFormat() { + if (null != this.returnNameFormat) { + if (null == this.returnNameFormatAsNameFormat) { + for (NameFormat nameFormat : NameFormat.values()) { + if (this.returnNameFormat.equals(nameFormat.getValue())) { + setReturnNameFormatAsNameFormat(nameFormat); + } + } + } + return this.returnNameFormat; + } + ValueBinding _vb = getValueBinding("returnNameFormat"); //$NON-NLS-1$ + if (_vb != null) { + Object obj = _vb.getValue(getFacesContext()); + if (obj instanceof String) { + String passedVal = (String) _vb.getValue(getFacesContext()); + for (NameFormat nameFormat : NameFormat.values()) { + if (passedVal.equals(nameFormat.name())) { + setReturnNameFormatAsNameFormat(nameFormat); + } + } + return passedVal; + } + } + return null; + } + + /** + * Loads the return name format (String) + * + * @param returnNameFormat + * String + * @author withersp + */ + public void setReturnNameFormat(final String returnNameFormat) { + this.returnNameFormat = returnNameFormat; + } + + /** + * Gets the return name format (Enum) + * + * @return NameFormat returnNameFormatAsNameFormat + * @author withersp + */ + public NameFormat getReturnNameFormatAsNameFormat() { + return returnNameFormatAsNameFormat; + } + + /** + * Loads the return name format (Enum) + * + * @param returnNameFormatAsNameFormat + * @author withersp + */ + public void setReturnNameFormatAsNameFormat(NameFormat returnNameFormatAsNameFormat) { + this.returnNameFormatAsNameFormat = returnNameFormatAsNameFormat; + } + + @Override + public Object saveState(FacesContext context) { + Object[] state = new Object[8]; + state[0] = super.saveState(context); + state[1] = addressBookSel; + state[2] = addressBookDb; + state[3] = nameList; + state[4] = people; + state[5] = groups; + state[6] = returnNameFormat; + state[7] = searchType; + return state; + } + + @Override + public void restoreState(FacesContext context, Object value) { + Object[] state = (Object[]) value; + super.restoreState(context, state[0]); + this.addressBookSel = (String) state[1]; + this.addressBookDb = (String) state[2]; + this.nameList = (String) state[3]; + this.people = (Boolean) state[4]; + this.groups = (Boolean) state[5]; + this.returnNameFormat = (String) state[6]; + this.searchType = (String) state[7]; + } + + // ==================================================================== + // Data access implementation + // ==================================================================== + + private static class NABDb implements Serializable { // Serializable because + // it goes to a + // scope + private static final long serialVersionUID = 1L; + String name; + String title; + boolean publicNab; + boolean privateNab; + + NABDb(Database db) throws NotesException { + this(db.getFilePath(), db.getTitle()); + this.publicNab = db.isPublicAddressBook(); + this.privateNab = db.isPrivateAddressBook(); + } + + NABDb(String name, String title) throws NotesException { + this.name = name; + this.title = title; + if (StringUtil.isEmpty(title)) { + this.title = name; + } + } + } + + // Compose the list of all the address books, once for ever... + // Beyond the cache, this guarantees that the NAB are always retrieved + // in the same order. + // The list has to be cached at the session level, as different users can + // have different ACLs for the databases. + private static final String KEY_NABS = "extlib.pickers.domino.nabs"; //$NON-NLS-1$ + + private NABDb[] getSessionAddressBooks() throws NotesException { + Map sc = ExtLibUtil.getSessionScope(); + NABDb[] addressBooks = sc != null ? (NABDb[]) sc.get(KEY_NABS) : null; + if (addressBooks == null) { + // Try with the current user + Session session = ExtLibUtil.getCurrentSession(); + addressBooks = getSessionAddressBooks(session); + if (addressBooks != null && addressBooks.length > 0) { + if (sc != null) { + sc.put(KEY_NABS, addressBooks); + } + } else { + // No NAB is avail - we don't throw a signal from here as it + // forces authentication + // as soon as the page is displayed (the control asks for the + // NAB when rendering) + // throw new NoAccessSignal(); + } + } + return addressBooks; + } + + private static NABDb[] getSessionAddressBooks(Session session) throws NotesException { + if (session != null) { // Unit tests + ArrayList nabs = new ArrayList(); + Vector vc = session.getAddressBooks(); + if (vc != null) { + for (int i = 0; i < vc.size(); i++) { + Database db = (Database) vc.get(i); + try { + db.open(); + try { + NABDb nab = new NABDb(db); + nabs.add(nab); + } finally { + db.recycle(); + } + } catch (NotesException ex) { + // Opening the database can fail if the user doesn't + // sufficient + // rights. In this vase, we simply ignore this NAB and + // continue + // with the next one. + } + } + } + return nabs.toArray(new NABDb[nabs.size()]); + } + return null; + } + + public String[] getSourceLabels() { + try { + String sel = getAddressBookSel(); + + NABDb[] sessNabs = getSessionAddressBooks(); + ArrayList labels = new ArrayList(); + if (StringUtil.isEmpty(sel) || sel.equals(NAB_ALL)) { + for (int i = 0; i < sessNabs.length; i++) { + labels.add(sessNabs[i].title); + } + } else if (sel.equals(NAB_ALLPUBLIC)) { + for (int i = 0; i < sessNabs.length; i++) { + if (sessNabs[i].publicNab) { + labels.add(sessNabs[i].title); + } + } + } else if (sel.equals(NAB_ALLPRIVATE)) { + for (int i = 0; i < sessNabs.length; i++) { + if (sessNabs[i].privateNab) { + labels.add(sessNabs[i].title); + } + } + } else if (sel.equals(NAB_FIRST)) { + if (sessNabs.length > 0) { + labels.add(sessNabs[0].title); + } + } else if (sel.equals(NAB_FIRSTPUBLIC)) { + for (int i = 0; i < sessNabs.length; i++) { + if (sessNabs[i].publicNab) { + labels.add(sessNabs[i].title); + break; + } + } + } else if (sel.equals(NAB_DATABASENAME)) { + Database db = DominoUtils.openDatabaseByName(getAddressBookDb()); + return new String[] { db.getTitle() }; + } else { + throw new FacesExceptionEx(null, "Unknown address book selection type {0}", sel); // $NLX-DominoNABNamePickerData.Unknownaddressbookselectiontype0-1$ + } + + return labels.toArray(new String[labels.size()]); + } catch (NotesException ex) { + throw new FacesExceptionEx(ex, "Error while retrieving the provider source labels"); // $NLX-DominoNABNamePickerData.Errorwhileretrievingtheproviderso-1$ + } + } + + @Override + protected EntryMetaData createEntryMetaData(IPickerOptions options) throws NotesException { + getReturnNameFormat(); + String list = getNameList(); + if (StringUtil.isEmpty(list)) { + boolean people = isPeople(); + boolean groups = isGroups(); + if (people && groups) { + list = "peopleAndGroups"; // $NON-NLS-1$ + } else if (people) { + list = "people"; // $NON-NLS-1$ + } else if (groups) { + list = "groups"; // $NON-NLS-1$ + } + } + if (StringUtil.isNotEmpty(list)) { + if (list.equals("peopleAndGroups")) { // $NON-NLS-1$ + return new _EntryMetaDataPeopleAndGroup(options, getReturnNameFormatAsNameFormat()); + } else if (list.equals("peopleByLastName")) { // $NON-NLS-1$ + return new _EntryMetaDataPeopleByLastName(options, getReturnNameFormatAsNameFormat()); + } else if (list.equals("people")) { // $NON-NLS-1$ + return new _EntryMetaDataPeople(options, getReturnNameFormatAsNameFormat()); + } else if (list.equals("groups")) { // $NON-NLS-1$ + return new _EntryMetaDataGroup(options); + } + } + return null; + } + + public abstract class _EntryMetaData extends EntryMetaData { + protected _EntryMetaData(IPickerOptions options) throws NotesException { + super(options); + } + + protected abstract String getViewName(); + + protected NameFormat returnNameFormatType; + + @Override + protected View openView() throws NotesException { + // Find the database + Database nabDb = findNAB(); + if (nabDb == null) { + throw new FacesExceptionEx(null, "Not able to find a valid address book for the name picker"); // $NLX-DominoNABNamePickerData.Notabletofindavalidaddressbookfor-1$ + } + // Find the view + String viewName = getViewName(); + if (StringUtil.isEmpty(viewName)) { + throw new FacesExceptionEx(null, "Not able to find a view in the address book that matches the selection criterias"); // $NLX-DominoNABNamePickerData.Notabletofindaviewintheaddressboo-1$ + } + + View view = nabDb.getView(viewName); + return view; + } + + protected Database findNAB() throws NotesException { + String sel = getAddressBookSel(); + + // Assume the first one for now - should be extended in the future + IPickerOptions o = getOptions(); + int source = o != null ? o.getSource() : 0; + + NABDb[] sessNabs = getSessionAddressBooks(); + if (sessNabs != null && sessNabs.length > 0) { + if (StringUtil.isEmpty(sel) || sel.equals(NAB_ALL)) { + return DominoUtils.openDatabaseByName(sessNabs[source].name); + } else if (sel.equals(NAB_ALLPUBLIC)) { + int cpt = 0; + for (int i = 0; i < sessNabs.length; i++) { + if (sessNabs[i].publicNab) { + if (source == cpt++) { + return DominoUtils.openDatabaseByName(sessNabs[i].name); + } + } + } + } else if (sel.equals(NAB_ALLPRIVATE)) { + int cpt = 0; + for (int i = 0; i < sessNabs.length; i++) { + if (sessNabs[i].privateNab) { + if (source == cpt++) { + return DominoUtils.openDatabaseByName(sessNabs[i].name); + } + } + } + } else if (sel.equals(NAB_FIRST)) { + if (sessNabs.length > 0) { + return DominoUtils.openDatabaseByName(sessNabs[0].name); + } + } else if (sel.equals(NAB_FIRST)) { + for (int i = 0; i < sessNabs.length; i++) { + if (sessNabs[i].publicNab) { + return DominoUtils.openDatabaseByName(sessNabs[i].name); + } + } + } else if (sel.equals(NAB_DATABASENAME)) { + return DominoUtils.openDatabaseByName(getAddressBookDb()); + } else { + throw new FacesExceptionEx(null, "Unknown address book selection type {0}", sel); // $NLX-DominoNABNamePickerData.Unknownaddressbookselectiontype0.1-1$ + } + } else { + // If no NAB is avail, request authentication + // We force the authetication here, but it does not work outside + // of basic authentication + // Moreover, the page is not refreshed afterwards to show the + // new user. + throw new NoAccessSignal(); + } + + return null; + } + + public NameFormat getReturnNameFormatType() { + return returnNameFormatType; + } + + public void setReturnNameFormatType(NameFormat returnNameFormatType) { + this.returnNameFormatType = returnNameFormatType; + } + + } + + public static abstract class _Entry extends Entry { + // private Object[] attributes; + protected _Entry(EntryMetaData metaData, ViewEntry ve) throws NotesException { + super(metaData, ve); + } + + @Override + public _EntryMetaData getMetaData() { + return (_EntryMetaData) super.getMetaData(); + } + + @Override + protected Object[] readAttributes(ViewEntry ve, Vector columnValues) throws NotesException { + return null; + } + } + + // //////////////////////////////////////////////////////////////////// + // People + public class _EntryMetaDataPeople extends _EntryMetaData { + protected _EntryMetaDataPeople(IPickerOptions options) throws NotesException { + super(options); + } + + protected _EntryMetaDataPeople(IPickerOptions options, NameFormat nameFormat) throws NotesException { + super(options); + setReturnNameFormatType(nameFormat); + } + + @Override + protected String getViewName() { + return "($VIMPeople)"; // $NON-NLS-1$ + } + + @Override + protected Entry createEntry(ViewEntry ve) throws NotesException { + return new _EntryPeople(this, ve); + } + } + + public static class _EntryPeople extends _Entry { + protected _EntryPeople(EntryMetaData metaData, ViewEntry ve) throws NotesException { + super(metaData, ve); + } + + @Override + protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { + NameFormat format = getMetaData().getReturnNameFormatType(); + if (null == format) { + return columnValues.get(0); + } else { + String baseName = (String) columnValues.get(0); + Session sess = ExtLibUtil.getCurrentSession(); + Name nm = sess.createName(baseName); + if (format.equals(NameFormat.ABBREVIATED)) { + return nm.getAbbreviated(); + } else if (format.equals(NameFormat.CANONICAL)) { + return nm.getCanonical(); + } else if (format.equals(NameFormat.COMMON)) { + return nm.getCommon(); + } else { + return baseName; + } + } + } + + @Override + protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { + String first = (String) columnValues.get(1); + String mid = (String) columnValues.get(2); + String last = (String) columnValues.get(3); + StringBuilder b = new StringBuilder(); + if (StringUtil.isNotEmpty(first)) { + b.append(first); + } + if (StringUtil.isNotEmpty(mid)) { + if (b.length() > 0) { + b.append(" "); + } + b.append(mid); + } + if (StringUtil.isNotEmpty(last)) { + if (b.length() > 0) { + b.append(" "); + } + b.append(last); + } + + return b.toString(); + } + } + + public class _EntryMetaDataPeopleByLastName extends _EntryMetaData { + protected _EntryMetaDataPeopleByLastName(IPickerOptions options) throws NotesException { + super(options); + } + + protected _EntryMetaDataPeopleByLastName(IPickerOptions options, NameFormat nameFormat) throws NotesException { + super(options); + setReturnNameFormatType(returnNameFormatType); + } + + @Override + protected String getViewName() { + return "($VIMPeopleByLastName)"; // $NON-NLS-1$ + } + + @Override + protected Entry createEntry(ViewEntry ve) throws NotesException { + return new _EntryPeopleByLastName(this, ve); + } + } + + public static class _EntryPeopleByLastName extends _Entry { + protected _EntryPeopleByLastName(EntryMetaData metaData, ViewEntry ve) throws NotesException { + super(metaData, ve); + } + + @Override + protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { + NameFormat format = getMetaData().getReturnNameFormatType(); + if (null == format) { + return columnValues.get(1); + } else { + String baseName = (String) columnValues.get(1); + Session sess = ExtLibUtil.getCurrentSession(); + Name nm = sess.createName(baseName); + if (format.equals(NameFormat.ABBREVIATED)) { + return nm.getAbbreviated(); + } else if (format.equals(NameFormat.CANONICAL)) { + return nm.getCanonical(); + } else if (format.equals(NameFormat.COMMON)) { + return nm.getCommon(); + } else { + return baseName; + } + } + } + + @Override + protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { + String first = (String) columnValues.get(2); + String mid = (String) columnValues.get(3); + String last = (String) columnValues.get(0); + StringBuilder b = new StringBuilder(); + if (StringUtil.isNotEmpty(last)) { + b.append(last); + } + if (StringUtil.isNotEmpty(first)) { + if (b.length() > 0) { + b.append(" "); + } + b.append(first); + } + if (StringUtil.isNotEmpty(mid)) { + if (b.length() > 0) { + b.append(" "); + } + b.append(mid); + } + + return b.toString(); + } + } + + // //////////////////////////////////////////////////////////////////// + // Groups + public class _EntryMetaDataGroup extends _EntryMetaData { + protected _EntryMetaDataGroup(IPickerOptions options) throws NotesException { + super(options); + } + + @Override + protected String getViewName() { + return "($VIMGroups)"; // $NON-NLS-1$ + } + + @Override + protected Entry createEntry(ViewEntry ve) throws NotesException { + return new _EntryGroup(this, ve); + } + } + + public static class _EntryGroup extends _Entry { + protected _EntryGroup(EntryMetaData metaData, ViewEntry ve) throws NotesException { + super(metaData, ve); + } + + @Override + protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { + return columnValues.get(0); + } + + @Override + protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { + return columnValues.get(0); + } + } + + // //////////////////////////////////////////////////////////////////// + // People and groups + public class _EntryMetaDataPeopleAndGroup extends _EntryMetaData { + protected _EntryMetaDataPeopleAndGroup(IPickerOptions options) throws NotesException { + super(options); + } + + protected _EntryMetaDataPeopleAndGroup(IPickerOptions options, NameFormat nameFormat) throws NotesException { + super(options); + setReturnNameFormatType(nameFormat); + } + + @Override + protected String getViewName() { + return "($VIMPeopleAndGroups)"; // $NON-NLS-1$ + } + + @Override + protected Entry createEntry(ViewEntry ve) throws NotesException { + return new _EntryPeopleAndGroup(this, ve); + } + } + + public static class _EntryPeopleAndGroup extends _Entry { + protected _EntryPeopleAndGroup(EntryMetaData metaData, ViewEntry ve) throws NotesException { + super(metaData, ve); + } + + @Override + protected Object readValue(ViewEntry ve, Vector columnValues) throws NotesException { + NameFormat format = getMetaData().getReturnNameFormatType(); if ("G".equals(columnValues.get(0))) { // Groups are never canonical, only have a basic value - return columnValues.get(1); + return columnValues.get(1); } else { - String value = (String) columnValues.get(1); - NameFormat format = getMetaData().nameFormatEnum; - return formatName(value, format); + if (null == format) { + return columnValues.get(1); + } else { + String baseName = (String) columnValues.get(1); + Session sess = ExtLibUtil.getCurrentSession(); + Name nm = sess.createName(baseName); + if (format.equals(NameFormat.ABBREVIATED)) { + return nm.getAbbreviated(); + } else if (format.equals(NameFormat.CANONICAL)) { + return nm.getCanonical(); + } else if (format.equals(NameFormat.COMMON)) { + return nm.getCommon(); + } else { + return baseName; + } + } + } + } + + @Override + protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { + String first = (String) columnValues.get(2); + String mid = (String) columnValues.get(3); + String last = (String) columnValues.get(4); + StringBuilder b = new StringBuilder(); + if (StringUtil.isNotEmpty(first)) { + b.append(first); + } + if (StringUtil.isNotEmpty(mid)) { + if (b.length() > 0) { + b.append(" "); + } + b.append(mid); } - } - @Override - protected Object readLabel(ViewEntry ve, Vector columnValues) throws NotesException { - String first = (String)columnValues.get(2); - String mid = (String)columnValues.get(3); - String last = (String)columnValues.get(4); - StringBuilder b = new StringBuilder(); - if(StringUtil.isNotEmpty(first)) { - b.append(first); - } - if(StringUtil.isNotEmpty(mid)) { - if(b.length()>0) { - b.append(" "); - } - b.append(mid); - } - if(StringUtil.isNotEmpty(last)) { - if(b.length()>0) { - b.append(" "); - } - b.append(last); - } - - return b.toString(); - } - } + if (StringUtil.isNotEmpty(last)) { + if (b.length() > 0) { + b.append(" "); + } + b.append(last); + } + + return b.toString(); + } + } + + @Override + public String getSearchType() { + if (searchType != null) { + return searchType; + } + ValueBinding vb = getValueBinding("searchType"); //$NON-NLS-1$ + if (vb != null) { + return (String) vb.getValue(getFacesContext()); + } + + return null; + } + + public void setSearchType(String searchType) { + this.searchType = searchType; + } } \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker.xsp-config b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker.xsp-config index aecf125..5de8e84 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker.xsp-config +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker.xsp-config @@ -144,19 +144,17 @@ - %property.valueNameFormat.descr% - %property.valueNameFormat.name% - valueNameFormat + %property.returnNameFormat.descr% + %property.returnNameFormat.name% + returnNameFormat java.lang.String - 9.0.1.v00_14 com.ibm.workplace.designer.property.editors.comboParameterEditor - abbreviated - common - canonical - unformatted + Abbreviated + Common + Canonical @@ -167,7 +165,7 @@ searchType java.lang.String - 9.0.1.v00_14 + 8.5.32003 not-localizable diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker_en.properties b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker_en.properties index d0bdc7c..c1ff868 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker_en.properties +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/extlib-domino-picker_en.properties @@ -41,6 +41,8 @@ property.people.name= Include People property.people.descr= Specifies whether or not to include people entries. Default is true. Only used when the "nameList" property is absent. property.groups.name= Include Groups # "nameList" should not be translated +property.returnNameFormat.name= Name Format for value property +property.returnNameFormat.descr= Specifies the format for the value property passed back to the field. Names, Authors and Readers fields should receive Canonical format to function properly. Dojo List Text Box can display the label instead of the value, but some formats, e.g. Common, may match multiple labels. Some formats may also be blank for some people / groups, e.g. OrgUnit1. property.groups.descr= Specifies whether or not to include group entries. Default is true. Only used when the "nameList" property is absent. property.valueNameFormat.name= Value Name Format # These should not be translated: "unformatted", "abbreviated", "canonical", "common". diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/raw-extlib-domino-picker.xsp-config b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/raw-extlib-domino-picker.xsp-config index f69a4dd..5426b9f 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/raw-extlib-domino-picker.xsp-config +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/config/raw-extlib-domino-picker.xsp-config @@ -48,7 +48,6 @@ - Define the type of search to be applied. The options are "match", meaning the search value is matched to a key or keys in the view, "ftSearch" meaning the value is found in a full text search of the entry and "startFrom", the default search type, which matches the value as a key and then returns that entry and all subsequent entries. Type of Search @@ -171,32 +170,30 @@ - - Specifies the format to use for the name values. The names have a label which is displayed in the dialog, and a value which is saved as data when the dialog closes. When the property is absent or set to "unformatted" then the exact value from the Domino view will be used, without any change to the format. The other options will change the value to the specified format: "abbreviated" uses the abbreviated format, e.g. "Alan Jones/Sales/Acme", "canonical" uses the canonical format, e.g. "cn=Alan Jones,ou=Sales,o=Acme", and "common" uses the common format, e.g. "Alan Jones". - Value Name Format - valueNameFormat + %property.returnNameFormat.descr% + %property.returnNameFormat.name% + returnNameFormat java.lang.String - 9.0.1.v00_14 + 9.0.12015 com.ibm.workplace.designer.property.editors.comboParameterEditor - abbreviated - common - canonical - unformatted + Abbreviated + Common + Canonical - - %property.searchType.descr% - %property.searchType.name% + + Define the type of search to be applied. The options are "match", meaning the search value is matched to a key or keys in the view, "ftSearch" meaning the value is found in a full text search of the entry and "startFrom", the default search type, which matches the value as a key and then returns that entry and all subsequent entries. + Type of Search searchType java.lang.String - 9.0.1.v00_14 + 9.0.12015 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.classpath index 1fa3e68..e2a51c8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.project index 089f990..903add4 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.project @@ -21,11 +21,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -34,7 +29,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.settings/org.eclipse.jdt.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.settings/org.eclipse.jdt.core.prefs index 3ce6d17..c86b4b8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.settings/org.eclipse.jdt.core.prefs +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,15 @@ -#Mon Jul 26 14:48:17 EDT 2010 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,19 +18,24 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled @@ -30,21 +44,33 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore @@ -63,5 +89,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference= org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.classpath index 1fa3e68..9bc33d3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.project index f4b694a..7037e50 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.project @@ -20,11 +20,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.settings/org.eclipse.jdt.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.settings/org.eclipse.jdt.core.prefs index b426d5f..a4dae3e 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.settings/org.eclipse.jdt.core.prefs +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.settings/org.eclipse.jdt.core.prefs @@ -1,67 +1,72 @@ -#Thu Dec 23 14:59:38 EST 2010 -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.classpath index 1fa3e68..9bc33d3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.project index 134cdab..1c62508 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/javascript/JdbcFunctions.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/javascript/JdbcFunctions.java index 635c989..d2c137e 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/javascript/JdbcFunctions.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/javascript/JdbcFunctions.java @@ -1,16 +1,16 @@ /* - * © Copyright IBM Corp. 2010, 2015 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * © Copyright IBM Corp. 2010 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.ibm.xsp.extlib.relational.javascript; @@ -48,498 +48,550 @@ /** * Extended Notes/Domino formula language for JDBC *

- * This class implements a set of new functions available to the JavaScript interpreter. - * They become available to Domino Designer in the category "@JDBC". + * This class implements a set of new functions available to the JavaScript + * interpreter. They become available to Domino Designer in the category + * "@JDBC". *

*/ public class JdbcFunctions extends FBSDefaultObject { - // Functions IDs - private static final int FCT_GETCONNECTION = 1; - private static final int FCT_DBCOLUMN = 2; - - private static final int FCT_EXECUTEQUERY = 3; - private static final int FCT_INSERT = 4; - private static final int FCT_UPDATE = 5; - private static final int FCT_DELETE = 6; - - // ============================= CODE COMPLETION ========================== - // - // Even though JavaScript is an untyped language, the XPages JavaScript - // interpreter can make use of symbolic information defining the - // objects/functions exposed. This is particularly used by Domino Designer - // to provide the code completion facility and help the user writing code. - // - // Each function expose by a library can then have one or multiple - // "prototypes", defining its parameters and the returned value type. To - // make this definition as efficient as possible, the parameter definition - // is compacted within a string, where all the parameters are defined - // within parenthesis followed by the returned value type. - // A parameter is defined by its name, followed by a colon and its type. - // Generally, the type is defined by a single character (see bellow) or a - // full Java class name. The returned type is defined right after the - // closing parameter parenthesis. - // - // Here is, for example, the definition of the "@Date" function which can - // take 3 different set of parameters: - // "(time:Y):Y", - // "(years:Imonths:Idays:I):Y", - // "(years:Imonths:Idays:Ihours:Iminutes:Iseconds:I):Y"); - // - // List of types - // V void - // C char - // B byte - // S short - // I int - // J long - // F float - // D double - // Z boolean - // T string - // Y date/time - // W any (variant) - // N multiple (...) - // L; object - // ex: - // (entries:[Lcom.ibm.xsp.extlib.MyClass;):V - // - // ========================================================================= - - public JdbcFunctions(JSContext jsContext) { - - super(jsContext, null, false); - - addFunction(FCT_GETCONNECTION, "@JdbcGetConnection", "(data:T):Ljava.sql.Connection;"); // $NON-NLS-1$ $NON-NLS-2$ - addFunction(FCT_DBCOLUMN, "@JdbcDbColumn", "(connection:Wtable:Tcolumn:T):A", "(connection:Wtable:Tcolumn:Twhere:T):A", "(connection:Wtable:Tcolumn:Twhere:TorderBy:T):A","(connection:Wtable:Tcolumn:Twhere:TorderBy:Tparams:A):A"); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ $NON-NLS-4$ $NON-NLS-5$ - addFunction(FCT_EXECUTEQUERY, "@JdbcExecuteQuery", "(connection:Wsql:T):Ljava.sql.ResultSet;", "(connection:Wsql:Tparams:A):Ljava.sql.ResultSet;"); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ - addFunction(FCT_INSERT, "@JdbcInsert", "(connection:Wtable:Tvalues:W):I", "(connection:Wtable:Tvalues:WcolumnNames:A):I", "(connection:Wtable:Tvalues:WcolumnNames:AcolToUpperCase:Z):I"); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ $NON-NLS-4$ - addFunction(FCT_UPDATE, "@JdbcUpdate", "(connection:Wtable:Tvalues:W):I", "(connection:Wtable:Tvalues:Wwhere:T):I", "(connection:Wtable:Tvalues:Wwhere:Tparams:A):I", "(connection:Wtable:Tvalues:Wwhere:Tparams:AcolToUpperCase:Z):I"); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ $NON-NLS-4$ $NON-NLS-5$ - addFunction(FCT_DELETE, "@JdbcDelete", "(connection:Wtable:Twhere:T):I", "(connection:Wtable:Twhere:Tparams:A):I"); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ - } - - private void addFunction(int index, String functionName, String... params) { - createMethod(functionName, FBSObject.P_NODELETE | FBSObject.P_READONLY, - new NotesFunction(getJSContext(), index, functionName, - params)); - } - - @Override - public boolean hasInstance(FBSValue v) { - return v instanceof FBSGlobalObject; - } - - @Override - public boolean isJavaNative() { - return false; - } - - - // ================================================================================= - // Functions implementation - // For optimization reasons, there is one NotesFunction instance per function, - // instead of one class (this avoids loading to many classes). To then distinguish - // the actual function, it uses an index member. - // ================================================================================= - - public static class NotesFunction extends BuiltinFunction { - - private String functionName; - private int index; - private String[] params; - - NotesFunction(JSContext jsContext, int index, - String functionName, String[] params) { - - super(jsContext); - this.functionName = functionName; - this.index = index; - this.params = params; - } - - /** - * Index of the function. - *

- * There must be one instanceof this class per index. - *

- */ - public int getIndex() { - return this.index; - } - - /** - * Return the list of the function parameters. - *

- * Note that this list is not used at runtime, at least for now, but - * consumed by Designer code completion.
- * A function can expose multiple parameter sets. - *

- */ - @Override - protected String[] getCallParameters() { - return this.params; - } - - /** - * Function name, as exposed by Designer and use at runtime. - *

- * This function is exposed in the JavaScript global namespace, so you - * should be careful to avoid any name conflict. - *

- */ - @Override - public String getFunctionName() { - return this.functionName; - } - - /** - * Actual code execution. - *

- * The JS runtime calls this method when the method is executed within - * a JavaScript formula. - *

- * @param context the JavaScript execution context (global variables, function...) - * @param args the arguments passed to the function - * @params _this the "this" object when the method is called as a "this" member - */ - @Override - public FBSValue call(IExecutionContext context, FBSValueVector args, - FBSObject _this) throws JavaScriptException { - - try { - // Else execute the formulas - switch (index) { - - case FCT_GETCONNECTION: { - if(args.size()>=1) { - String name = args.get(0).stringValue(); - return FBSUtility.wrap(context.getJSContext(), JdbcUtil.createNamedConnection(FacesContext.getCurrentInstance(),name)); - } - } break; - - case FCT_DBCOLUMN: { - if(args.size()>=3) { - Connection c = getConnection(args.get(0)); - String tbName = args.get(1).stringValue(); - String colName = args.get(2).stringValue(); - String where = args.size() > 3 && !args.get(3).isNull() ? args.get(3).stringValue() : null; - String orderBy = args.size() > 4 && !args.get(4).isNull()? args.get(4).stringValue() : null; - FBSValue params = args.size() > 5 && !args.get(5).isNull()? args.get(5) : null; - - String sql = StringUtil.format("SELECT {0} FROM {1}",colName,tbName); // $NON-NLS-1$ - if(StringUtil.isNotEmpty(where)) { - sql = sql + " WHERE " + where; // $NON-NLS-1$ - } - if(StringUtil.isNotEmpty(orderBy)) { - sql = sql + " ORDER BY " + orderBy; // $NON-NLS-1$ - } - PreparedStatement st = c.prepareStatement(sql); - try { - initParameters(st, params); - ResultSet rs = st.executeQuery(); - try { - ArrayObject result = new ArrayObject(getJSContext()); - while(rs.next()) { - Object value = rs.getObject(1); - result.addArrayValue(FBSUtility.wrap(context.getJSContext(),value)); - } - // Make the result similar to @DbColumn - if(result.getArrayLength()==0) { - return FBSUndefined.undefinedValue; - } else if(result.getArrayLength()==1) { - return result.get(0); - } else { - return result; - } - } finally { - rs.close(); - } - } finally { - st.close(); - } - } - } break; - - case FCT_EXECUTEQUERY: { - if(args.size()>=2) { - Connection c = getConnection(args.get(0)); - String sql = args.get(1).stringValue(); - FBSValue params = args.size() > 2 && !args.get(2).isNull()? args.get(2) : null; - - PreparedStatement st = c.prepareStatement(sql); - initParameters(st, params); - ResultSet rs = st.executeQuery(); - return FBSUtility.wrap(context.getJSContext(),rs); - } - } break; - - case FCT_INSERT: { - final FBSValue retVal_ = doInsert(args, context); - if (null != retVal_) { - return retVal_; - } - } break; - - case FCT_UPDATE: { - final FBSValue retVal_ = doUpdate(args, context); - if (null != retVal_) { - return retVal_; - } - } break; - - case FCT_DELETE: { - if(args.size()>=2) { - Connection c = getConnection(args.get(0)); - String tbName = args.get(1).stringValue(); - String where = args.size() > 2 && !args.get(2).isNull()? args.get(2).stringValue() : null; - FBSValue params = args.size() > 3 && !args.get(3).isNull()? args.get(3) : null; - - StringBuilder b = new StringBuilder(); - b.append("DELETE FROM "); // $NON-NLS-1$ - JdbcUtil.appendTableName(b, tbName); - if(StringUtil.isNotEmpty(where)) { - b.append(" WHERE "); // $NON-NLS-1$ - b.append(where); - } - String sql = b.toString(); - PreparedStatement st = c.prepareStatement(sql); - try { - if(params!=null) { - initParameters(st, params); - } - int count = st.executeUpdate(); - return FBSUtility.wrap(context.getJSContext(),count); - } finally { - st.close(); - } - } - } break; - - default: { - throw new InterpretException(null, StringUtil.format( - "Internal error: unknown function \'{0}\'", functionName)); // $NLX-JdbcFunctions.Internalerrorunknownfunction0-1$ - } - - } - - // } catch (InterpretException e) { - // throw e; - // } catch (NotesException e) { - // // This case covers where a call to session.evaluate() throws a NotesException - // // We want to continue rendering the page but allow @IsError to pick up on this issue - // // so we return @Error (NaN / FBSUndefined.undefinedValue) - // return FBSUndefined.undefinedValue; - } catch (Exception e) { - throw new InterpretException(e, StringUtil.format( - "Error while executing function \'{0}\'", functionName)); // $NLX-JdbcFunctions.Errorwhileexecutingfunction0-1$ - } - throw new InterpretException(null, StringUtil.format( - "Cannot evaluate function \'{0}\'", functionName)); // $NLX-JdbcFunctions.Cannotevaluatefunction0-1$ - } - } - - // ============================================================================ - // Utilities - // ============================================================================ - - protected static Connection getConnection(FBSValue connection) throws SQLException, InterpretException { - FBSValue _c = connection; - if(_c.isString()) { - return JdbcUtil.createNamedConnection(FacesContext.getCurrentInstance(),_c.stringValue()); - } else { - return (Connection)_c.toJavaObject(Connection.class); - } - } - - protected static void initParameters(PreparedStatement st, FBSValue params) throws SQLException, InterpretException { - initParameters(st, params, 0); - } - protected static void initParameters(PreparedStatement st, FBSValue params, int offset) throws SQLException, InterpretException { - if(params!=null) { - int count = params.getArrayLength(); - for(int i=0; i namedValues; - List values; - // Calculate the parameters - // If it is an array, then the insert/update will correspond to * - // If it is a map, then the entry will be the column name/values - SQLValues(FBSValue params) throws SQLException, InterpretException { - if(params instanceof ObjectObject) { - FBSDefaultObject o = (FBSDefaultObject)params; - namedValues = new HashMap(); - for(Iterator it=o.getPropertyIterator(); it.hasNext(); ) { - JSProperty p = it.next(); - String name = p.getPropertyName(); - Object value = p.getValue().toJavaObject(); - namedValues.put(name, value); - } - } else if(params instanceof ArrayObject) { - ArrayObject o = (ArrayObject)params; - int n = o .getArrayLength(); - values = new ArrayList(n); - for(int i=0; i(n); - for(int i=0; i initInsertValues(StringBuilder b, FBSValue params, Boolean colToUpperCase) throws SQLException, InterpretException { - SQLValues sqlValues = new SQLValues(params); - // In case of an array - if (sqlValues.values != null) { - return sqlValues.values; - } - if (sqlValues.namedValues != null) { - boolean first = true; - sqlValues.values = new ArrayList(sqlValues.namedValues.size()); - b.append(" ("); - for (Map.Entry e : sqlValues.namedValues.entrySet()) { - if (!first) { - b.append(','); - } else { - first = false; - } - JdbcUtil.appendColumnName(b, e.getKey(), colToUpperCase); - sqlValues.values.add(e.getValue()); - } - b.append(')'); - return sqlValues.values; - } - - throw new SQLException("No valid values passed to the INSERT statement"); // $NLX-JdbcFunctions.Novalidvaluespassedtothe0statemen-1$ - } - - protected static List initUpdateValues(StringBuilder b, FBSValue params, Boolean colToUpperCase) throws SQLException, InterpretException { - SQLValues sqlValues = new SQLValues(params); - if (sqlValues.namedValues != null) { - boolean first = true; - sqlValues.values = new ArrayList(sqlValues.namedValues.size()); - b.append(" SET "); // $NON-NLS-1$ - for (Map.Entry e : sqlValues.namedValues.entrySet()) { - if (!first) { - b.append(','); - } else { - first = false; - } - JdbcUtil.appendColumnName(b, e.getKey(), colToUpperCase); - b.append("=?"); - sqlValues.values.add(e.getValue()); - } - return sqlValues.values; - } - - throw new SQLException("No valid values passed to the UPDATE statement"); // $NLX-JdbcFunctions.Novalidvaluespassedtothe0statemen.1-1$ - } - - protected static FBSValue doInsert(FBSValueVector args, IExecutionContext context) throws SQLException, InterpretException { - if (args.size() >= 2) { - Connection c = getConnection(args.get(0)); - String tbName = args.get(1).stringValue(); - FBSValue values = args.get(2); - FBSValue idColumnNames = args.size() > 3 && !args.get(3).isNull() ? args.get(3) : null; - Boolean colToUpperCase = args.size() > 4 && !args.get(4).isNull() ? args.get(4).booleanValue() : null; - - StringBuilder b = new StringBuilder(); - b.append("INSERT INTO "); // $NON-NLS-1$ - JdbcUtil.appendTableName(b, tbName); - List v = initInsertValues(b, values, colToUpperCase); - b.append(" VALUES("); // $NON-NLS-1$ - for (int i = 0; i < v.size(); i++) { - if (i != 0) { - b.append(','); - } - b.append('?'); - } - b.append(")"); - String sql = b.toString(); - PreparedStatement st = null; - if (idColumnNames == null) { - st = c.prepareStatement(sql); - } else { - List vNames = initInsertValues(null, idColumnNames, colToUpperCase); - String[] columnNames = new String[vNames.size()]; - for (int i = 0; i < vNames.size(); i++) { - columnNames[i] = (String) vNames.get(i); - } - st = c.prepareStatement(sql, columnNames); - } - try { - for (int i = 0; i < v.size(); i++) { - st.setObject(i + 1, v.get(i)); - } - int count = st.executeUpdate(); - if (idColumnNames != null) { - ResultSet rs = st.getGeneratedKeys(); - if (rs.next()) { - Object value = rs.getBigDecimal(1); - return FBSUtility.wrap(context.getJSContext(), value); - } - } - return FBSUtility.wrap(context.getJSContext(), count); - } finally { - st.close(); - } - } - return null; - } - - public static FBSValue doUpdate(FBSValueVector args, IExecutionContext context) throws SQLException, InterpretException { - if (args.size() >= 3) { - Connection c = getConnection(args.get(0)); - String tbName = args.get(1).stringValue(); - FBSValue values = args.get(2); - String where = args.size() > 3 && !args.get(3).isNull() ? args.get(3).stringValue() : null; - FBSValue params = args.size() > 4 && !args.get(4).isNull() ? args.get(4) : null; - Boolean colToUpperCase = args.size() > 5 && !args.get(5).isNull() ? args.get(5).booleanValue() : true; - - StringBuilder b = new StringBuilder(); - b.append("UPDATE "); // $NON-NLS-1$ - JdbcUtil.appendTableName(b, tbName); - List v = initUpdateValues(b, values, colToUpperCase); - if (StringUtil.isNotEmpty(where)) { - b.append(" WHERE "); // $NON-NLS-1$ - b.append(where); - } - String sql = b.toString(); - PreparedStatement st = c.prepareStatement(sql); - try { - for (int i = 0; i < v.size(); i++) { - st.setObject(i + 1, v.get(i)); - } - if (params != null) { - initParameters(st, params, v.size()); - } - int count = st.executeUpdate(); - return FBSUtility.wrap(context.getJSContext(), count); - } finally { - st.close(); - } - } - return null; - } + // Functions IDs + private static final int FCT_GETCONNECTION = 1; + private static final int FCT_DBCOLUMN = 2; + + private static final int FCT_EXECUTEQUERY = 3; + private static final int FCT_INSERT = 4; + private static final int FCT_UPDATE = 5; + private static final int FCT_DELETE = 6; + private static final int FCT_INSERT_EXT = 7; + private static final int FCT_UPDATE_EXT = 8; + + // ============================= CODE COMPLETION ========================== + // + // Even though JavaScript is an untyped language, the XPages JavaScript + // interpreter can make use of symbolic information defining the + // objects/functions exposed. This is particularly used by Domino Designer + // to provide the code completion facility and help the user writing code. + // + // Each function expose by a library can then have one or multiple + // "prototypes", defining its parameters and the returned value type. To + // make this definition as efficient as possible, the parameter definition + // is compacted within a string, where all the parameters are defined + // within parenthesis followed by the returned value type. + // A parameter is defined by its name, followed by a colon and its type. + // Generally, the type is defined by a single character (see bellow) or a + // full Java class name. The returned type is defined right after the + // closing parameter parenthesis. + // + // Here is, for example, the definition of the "@Date" function which can + // take 3 different set of parameters: + // "(time:Y):Y", + // "(years:Imonths:Idays:I):Y", + // "(years:Imonths:Idays:Ihours:Iminutes:Iseconds:I):Y"); + // + // List of types + // V void + // C char + // B byte + // S short + // I int + // J long + // F float + // D double + // Z boolean + // T string + // Y date/time + // W any (variant) + // N multiple (...) + // L; object + // ex: + // (entries:[Lcom.ibm.xsp.extlib.MyClass;):V + // + // ========================================================================= + + public JdbcFunctions(JSContext jsContext) { + + super(jsContext, null, false); + + addFunction(FCT_GETCONNECTION, "@JdbcGetConnection", "(data:T):Ljava.sql.Connection;"); // $NON-NLS-1$ + // $NON-NLS-2$ + addFunction(FCT_DBCOLUMN, "@JdbcDbColumn", "(connection:Wtable:Tcolumn:T):A", "(connection:Wtable:Tcolumn:Twhere:T):A", + "(connection:Wtable:Tcolumn:Twhere:TorderBy:T):A", "(connection:Wtable:Tcolumn:Twhere:TorderBy:Tparams:A):A"); // $NON-NLS-1$ + // $NON-NLS-2$ + // $NON-NLS-3$ + // $NON-NLS-4$ + // $NON-NLS-5$ + addFunction(FCT_EXECUTEQUERY, "@JdbcExecuteQuery", "(connection:Wsql:T):Ljava.sql.ResultSet;", + "(connection:Wsql:Tparams:A):Ljava.sql.ResultSet;"); // $NON-NLS-1$ + // $NON-NLS-2$ + // $NON-NLS-3$ + addFunction(FCT_INSERT, "@JdbcInsert", "(connection:Wtable:Tvalues:W):I", "(connection:Wtable:Tvalues:WcolumnNames:A):I"); // $NON-NLS-1$ + // $NON-NLS-2$ + // $NON-NLS-3$ + addFunction(FCT_UPDATE, "@JdbcUpdate", "(connection:Wtable:Tvalues:W):I", "(connection:Wtable:Tvalues:Wwhere:T):I", + "(connection:Wtable:Tvalues:Wwhere:Tparams:A):I"); // $NON-NLS-1$ + // $NON-NLS-2$ + // $NON-NLS-3$ + // $NON-NLS-4$ + addFunction(FCT_DELETE, "@JdbcDelete", "(connection:Wtable:Twhere:T):I", "(connection:Wtable:Twhere:Tparams:A):I"); // $NON-NLS-1$ + // $NON-NLS-2$ + // $NON-NLS-3$ + addFunction(FCT_INSERT_EXT, "@JdbcInsertExt", "(connection:Wtable:Tvalues:W):I", "(connection:Wtable:Tvalues:WcolumnNames:A):I"); + addFunction(FCT_UPDATE_EXT, "@JdbcUpdateExt", "(connection:Wtable:Tvalues:W):I", "(connection:Wtable:Tvalues:Wwhere:T):I", + "(connection:Wtable:Tvalues:Wwhere:Tparams:A):I"); + } + + private void addFunction(int index, String functionName, String... params) { + createMethod(functionName, FBSObject.P_NODELETE | FBSObject.P_READONLY, new NotesFunction(getJSContext(), index, functionName, + params)); + } + + @Override + public boolean hasInstance(FBSValue v) { + return v instanceof FBSGlobalObject; + } + + @Override + public boolean isJavaNative() { + return false; + } + + // ================================================================================= + // Functions implementation + // For optimization reasons, there is one NotesFunction instance per + // function, + // instead of one class (this avoids loading to many classes). To then + // distinguish + // the actual function, it uses an index member. + // ================================================================================= + + public static class NotesFunction extends BuiltinFunction { + + private String functionName; + private int index; + private String[] params; + + NotesFunction(JSContext jsContext, int index, String functionName, String[] params) { + + super(jsContext); + this.functionName = functionName; + this.index = index; + this.params = params; + } + + /** + * Index of the function. + *

+ * There must be one instanceof this class per index. + *

+ */ + public int getIndex() { + return this.index; + } + + /** + * Return the list of the function parameters. + *

+ * Note that this list is not used at runtime, at least for now, but + * consumed by Designer code completion.
+ * A function can expose multiple parameter sets. + *

+ */ + @Override + protected String[] getCallParameters() { + return this.params; + } + + /** + * Function name, as exposed by Designer and use at runtime. + *

+ * This function is exposed in the JavaScript global namespace, so you + * should be careful to avoid any name conflict. + *

+ */ + @Override + public String getFunctionName() { + return this.functionName; + } + + /** + * Actual code execution. + *

+ * The JS runtime calls this method when the method is executed within a + * JavaScript formula. + *

+ * + * @param context + * the JavaScript execution context (global variables, + * function...) + * @param args + * the arguments passed to the function + * @params _this the "this" object when the method is called as a "this" + * member + */ + @Override + public FBSValue call(IExecutionContext context, FBSValueVector args, FBSObject _this) throws JavaScriptException { + + try { + // Else execute the formulas + switch (index) { + + case FCT_GETCONNECTION: { + if (args.size() >= 1) { + String name = args.get(0).stringValue(); + return FBSUtility.wrap(context.getJSContext(), + JdbcUtil.createNamedConnection(FacesContext.getCurrentInstance(), name)); + } + } + break; + + case FCT_DBCOLUMN: { + if (args.size() >= 3) { + Connection c = getConnection(args.get(0)); + String tbName = args.get(1).stringValue(); + String colName = args.get(2).stringValue(); + String where = args.size() > 3 && !args.get(3).isNull() ? args.get(3).stringValue() : null; + String orderBy = args.size() > 4 && !args.get(4).isNull() ? args.get(4).stringValue() : null; + FBSValue params = args.size() > 5 && !args.get(5).isNull() ? args.get(5) : null; + + String sql = StringUtil.format("SELECT {0} FROM {1}", colName, tbName); // $NON-NLS-1$ + if (StringUtil.isNotEmpty(where)) { + sql = sql + " WHERE " + where; // $NON-NLS-1$ + } + if (StringUtil.isNotEmpty(orderBy)) { + sql = sql + " ORDER BY " + orderBy; // $NON-NLS-1$ + } + PreparedStatement st = c.prepareStatement(sql); + try { + initParameters(st, params); + ResultSet rs = st.executeQuery(); + try { + ArrayObject result = new ArrayObject(getJSContext()); + while (rs.next()) { + Object value = rs.getObject(1); + result.addArrayValue(FBSUtility.wrap(context.getJSContext(), value)); + } + // Make the result similar to @DbColumn + if (result.getArrayLength() == 0) { + return FBSUndefined.undefinedValue; + } else if (result.getArrayLength() == 1) { + return result.get(0); + } else { + return result; + } + } finally { + rs.close(); + } + } finally { + st.close(); + } + } + } + break; + + case FCT_EXECUTEQUERY: { + if (args.size() >= 2) { + Connection c = getConnection(args.get(0)); + String sql = args.get(1).stringValue(); + FBSValue params = args.size() > 2 && !args.get(2).isNull() ? args.get(2) : null; + + PreparedStatement st = c.prepareStatement(sql); + initParameters(st, params); + ResultSet rs = st.executeQuery(); + return FBSUtility.wrap(context.getJSContext(), rs); + } + } + break; + + case FCT_INSERT: { + FBSValue retVal_ = doInsert(args, context, true); + if (null != retVal_) { + return retVal_; + } + } + break; + + case FCT_INSERT_EXT: { + FBSValue retVal_ = doInsert(args, context, false); + if (null != retVal_) { + return retVal_; + } + } + break; + + case FCT_UPDATE: { + FBSValue retVal_ = doUpdate(args, context, true); + if (null != retVal_) { + return retVal_; + } + } + break; + + case FCT_UPDATE_EXT: { + FBSValue retVal_ = doUpdate(args, context, false); + if (null != retVal_) { + return retVal_; + } + } + break; + + case FCT_DELETE: { + if (args.size() >= 2) { + Connection c = getConnection(args.get(0)); + String tbName = args.get(1).stringValue(); + String where = args.size() >= 2 && !args.get(2).isNull() ? args.get(2).stringValue() : null; + FBSValue params = args.size() >= 3 && !args.get(3).isNull() ? args.get(3) : null; + + StringBuilder b = new StringBuilder(); + b.append("DELETE FROM "); // $NON-NLS-1$ + JdbcUtil.appendTableName(b, tbName); + if (StringUtil.isNotEmpty(where)) { + b.append(" WHERE "); // $NON-NLS-1$ + b.append(where); + } + String sql = b.toString(); + PreparedStatement st = c.prepareStatement(sql); + try { + if (params != null) { + initParameters(st, params); + } + int count = st.executeUpdate(); + return FBSUtility.wrap(context.getJSContext(), count); + } finally { + st.close(); + } + } + } + break; + + default: { + throw new InterpretException(null, StringUtil.format("Internal error: unknown function \'{0}\'", functionName)); // $NLX-JdbcFunctions.Internalerrorunknownfunction0-1$ + } + + } + + // } catch (InterpretException e) { + // throw e; + // } catch (NotesException e) { + // // This case covers where a call to session.evaluate() throws + // a NotesException + // // We want to continue rendering the page but allow @IsError + // to pick up on this issue + // // so we return @Error (NaN / FBSUndefined.undefinedValue) + // return FBSUndefined.undefinedValue; + } catch (Exception e) { + throw new InterpretException(e, StringUtil.format("Error while executing function \'{0}\'", functionName)); // $NLX-JdbcFunctions.Errorwhileexecutingfunction0-1$ + } + throw new InterpretException(null, StringUtil.format("Cannot evaluate function \'{0}\'", functionName)); // $NLX-JdbcFunctions.Cannotevaluatefunction0-1$ + } + } + + // ============================================================================ + // Utilities + // ============================================================================ + + protected static Connection getConnection(FBSValue connection) throws SQLException, InterpretException { + FBSValue _c = connection; + if (_c.isString()) { + return JdbcUtil.createNamedConnection(FacesContext.getCurrentInstance(), _c.stringValue()); + } else { + return (Connection) _c.toJavaObject(Connection.class); + } + } + + protected static void initParameters(PreparedStatement st, FBSValue params) throws SQLException, InterpretException { + initParameters(st, params, 0); + } + + protected static void initParameters(PreparedStatement st, FBSValue params, int offset) throws SQLException, InterpretException { + if (params != null) { + int count = params.getArrayLength(); + for (int i = 0; i < count; i++) { + FBSValue v = params.getArrayValue(i); + Object o = v.toJavaObject(); + st.setObject(i + offset + 1, o); + } + } + } + + private static class SQLValues { + Map namedValues; + List values; + + // Calculate the parameters + // If it is an array, then the insert/update will correspond to * + // If it is a map, then the entry will be the column name/values + SQLValues(FBSValue params) throws SQLException, InterpretException { + if (params instanceof ObjectObject) { + FBSDefaultObject o = (FBSDefaultObject) params; + namedValues = new HashMap(); + for (Iterator it = o.getPropertyIterator(); it.hasNext();) { + JSProperty p = it.next(); + String name = p.getPropertyName(); + Object value = p.getValue().toJavaObject(); + namedValues.put(name, value); + } + } else if (params instanceof ArrayObject) { + ArrayObject o = (ArrayObject) params; + int n = o.getArrayLength(); + values = new ArrayList(n); + for (int i = 0; i < n; i++) { + FBSValue v = o.getArrayValue(i); + values.add(v.toJavaObject()); + } + } else { + Object o = params.toJavaObject(); + if (o != null) { + if (o instanceof Map) { + namedValues = (Map) o; + } else if (o.getClass().isArray()) { + int n = Array.getLength(o); + values = new ArrayList(n); + for (int i = 0; i < n; i++) { + values.add(Array.get(o, i)); + } + } else if (o instanceof List) { + values = (List) o; + } + } + } + } + } + + protected static List initInsertValues(StringBuilder b, FBSValue params, Boolean uCase) throws SQLException, InterpretException { + SQLValues sqlValues = new SQLValues(params); + // In case of an array + if (sqlValues.values != null) { + return sqlValues.values; + } + if (sqlValues.namedValues != null) { + boolean first = true; + sqlValues.values = new ArrayList(sqlValues.namedValues.size()); + b.append(" ("); + for (Map.Entry e : sqlValues.namedValues.entrySet()) { + if (!first) { + b.append(','); + } else { + first = false; + } + JdbcUtil.appendColumnName(b, e.getKey(), uCase); + sqlValues.values.add(e.getValue()); + } + b.append(')'); + return sqlValues.values; + } + + throw new SQLException(StringUtil.format("No valid values passed to the {0} statement", "INSERT")); // $NLX-JdbcFunctions.Novalidvaluespassedtothe0statemen-1$ + // $NON-NLS-2$ + } + + protected static List initUpdateValues(StringBuilder b, FBSValue params, Boolean uCase) throws SQLException, InterpretException { + SQLValues sqlValues = new SQLValues(params); + if (sqlValues.namedValues != null) { + boolean first = true; + sqlValues.values = new ArrayList(sqlValues.namedValues.size()); + b.append(" SET "); // $NON-NLS-1$ + for (Map.Entry e : sqlValues.namedValues.entrySet()) { + if (!first) { + b.append(','); + } else { + first = false; + } + JdbcUtil.appendColumnName(b, e.getKey(), uCase); + b.append("=?"); + sqlValues.values.add(e.getValue()); + } + return sqlValues.values; + } + + throw new SQLException(StringUtil.format("No valid values passed to the {0} statement", "UPDATE")); // $NLX-JdbcFunctions.Novalidvaluespassedtothe0statemen.1-1$ + // $NON-NLS-2$ + } + + protected static FBSValue doInsert(FBSValueVector args, IExecutionContext context, Boolean uCase) throws SQLException, + InterpretException { + if (args.size() >= 2) { + Connection c = getConnection(args.get(0)); + String tbName = args.get(1).stringValue(); + FBSValue values = args.get(2); + FBSValue idColumnNames = args.size() > 3 && !args.get(3).isNull() ? args.get(3) : null; + ; + + StringBuilder b = new StringBuilder(); + b.append("INSERT INTO "); // $NON-NLS-1$ + JdbcUtil.appendTableName(b, tbName); + List v = initInsertValues(b, values, uCase); + b.append(" VALUES("); // $NON-NLS-1$ + for (int i = 0; i < v.size(); i++) { + if (i != 0) { + b.append(','); + } + b.append('?'); + } + b.append(")"); + String sql = b.toString(); + PreparedStatement st = null; + if (idColumnNames == null) { + st = c.prepareStatement(sql); + } else { + List vNames = initInsertValues(null, idColumnNames, uCase); + String[] columnNames = new String[vNames.size()]; + for (int i = 0; i < vNames.size(); i++) { + columnNames[i] = (String) vNames.get(i); + } + st = c.prepareStatement(sql, columnNames); + } + try { + for (int i = 0; i < v.size(); i++) { + st.setObject(i + 1, v.get(i)); + } + int count = st.executeUpdate(); + if (idColumnNames != null) { + ResultSet rs = st.getGeneratedKeys(); + if (rs.next()) { + Object value = rs.getBigDecimal(1); + return FBSUtility.wrap(context.getJSContext(), value); + } + } + return FBSUtility.wrap(context.getJSContext(), count); + } finally { + st.close(); + } + } + return null; + } + + public static FBSValue doUpdate(FBSValueVector args, IExecutionContext context, Boolean uCase) throws SQLException, InterpretException { + if (args.size() >= 3) { + Connection c = getConnection(args.get(0)); + String tbName = args.get(1).stringValue(); + FBSValue values = args.get(2); + String where = args.size() >= 3 && !args.get(3).isNull() ? args.get(3).stringValue() : null; + FBSValue params = args.size() >= 4 && !args.get(4).isNull() ? args.get(4) : null; + + StringBuilder b = new StringBuilder(); + b.append("UPDATE "); // $NON-NLS-1$ + JdbcUtil.appendTableName(b, tbName); + List v = initUpdateValues(b, values, uCase); + if (StringUtil.isNotEmpty(where)) { + b.append(" WHERE "); // $NON-NLS-1$ + b.append(where); + } + String sql = b.toString(); + PreparedStatement st = c.prepareStatement(sql); + try { + for (int i = 0; i < v.size(); i++) { + st.setObject(i + 1, v.get(i)); + } + if (params != null) { + initParameters(st, params, v.size()); + } + int count = st.executeUpdate(); + return FBSUtility.wrap(context.getJSContext(), count); + } finally { + st.close(); + } + } + return null; + } } \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/util/JdbcUtil.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/util/JdbcUtil.java index c27001e..215c9d8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/util/JdbcUtil.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.relational/src/com/ibm/xsp/extlib/relational/util/JdbcUtil.java @@ -1,16 +1,16 @@ /* - * © Copyright IBM Corp. 2010, 2015 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * © Copyright IBM Corp. 2010 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing * permissions and limitations under the License. */ @@ -42,229 +42,232 @@ public class JdbcUtil { - public static String JDBC_ROOT = "/WEB-INF/jdbc"; // $NON-NLS-1$ + public static String JDBC_ROOT = "/WEB-INF/jdbc"; // $NON-NLS-1$ - // ======================================================================== - // Access to JDBC Connections - // ======================================================================== + // ======================================================================== + // Access to JDBC Connections + // ======================================================================== - /** - * Create a JDBC connection from a URL. The connection is actually created - * and added to a FacesContextListener - */ - public static Connection createConnectionFromUrl(FacesContext context, String connectionUrl) throws SQLException { - if (StringUtil.isNotEmpty(connectionUrl)) { - return DriverManager.getConnection(connectionUrl); - } - return null; - } + /** + * Create a JDBC connection from a URL. The connection is actually created + * and added to a FacesContextListener + */ + public static Connection createConnectionFromUrl(FacesContext context, String connectionUrl) throws SQLException { + if (StringUtil.isNotEmpty(connectionUrl)) { + return DriverManager.getConnection(connectionUrl); + } + return null; + } - /** - * Create a JDBC connection. The connection is actually created and added to - * a FacesContextListener - */ - public static Connection getConnection(FacesContext context, String name) throws SQLException { - return createNamedConnection(context, name); - } + /** + * Create a JDBC connection. The connection is actually created and added to + * a FacesContextListener + */ + public static Connection getConnection(FacesContext context, String name) throws SQLException { + return createNamedConnection(context, name); + } - /** - * Create a JDBC connection. The connection is actually created and added to - * a FacesContextListener - */ - public static Connection createNamedConnection(FacesContext context, String name) throws SQLException { - try { - String jndiName = name; - if (!jndiName.startsWith("java:")) { // $NON-NLS-1$ - jndiName = JndiRegistry.getJNDIBindName(name); - } - final InitialContext ctx = new InitialContext(); - final DataSource ds = (DataSource) ctx.lookup(jndiName); - if (ds != null) { - return ds.getConnection(); - } - return null; - } catch (final NamingException ex) { - throw (SQLException) new SQLException().initCause(ex); - } - } + /** + * Create a JDBC connection. The connection is actually created and added to + * a FacesContextListener + */ + public static Connection createNamedConnection(FacesContext context, String name) throws SQLException { + try { + String jndiName = name; + if (!jndiName.startsWith("java:")) { // $NON-NLS-1$ + jndiName = JndiRegistry.getJNDIBindName(name); + } + InitialContext ctx = new InitialContext(); + DataSource ds = (DataSource) ctx.lookup(jndiName); + if (ds != null) { + return ds.getConnection(); + } + return null; + } catch (NamingException ex) { + throw (SQLException) new SQLException().initCause(ex); + } + } - /** - * Get a connection from a connection manager. - * - * @param context - * @param name - * @param shared - * @return - * @throws SQLException - */ - public static Connection createManagedConnection(FacesContext context, UIComponent from, String name) throws SQLException { - if (from == null) { - from = context.getViewRoot(); - } - final IJdbcConnectionManager manager = findConnectionManager(context, from, name); - if (manager == null) { - throw new FacesExceptionEx(null, StringUtil.format("Unknown ConnectionManager {0}", name)); // $NLX-JdbcUtil.Unknown01-1$ - } - return manager.getConnection(); - } + /** + * Get a connection from a connection manager. + * + * @param context + * @param name + * @param shared + * @return + * @throws SQLException + */ + public static Connection createManagedConnection(FacesContext context, UIComponent from, String name) throws SQLException { + if (from == null) { + from = context.getViewRoot(); + } + IJdbcConnectionManager manager = findConnectionManager(context, from, name); + if (manager == null) { + throw new FacesExceptionEx(null, StringUtil.format("Unknown {0} {1}", "ConnectionManager", name)); // $NLX-JdbcUtil.Unknown01-1$ + // $NON-NLS-2$ + } + return manager.getConnection(); + } - /** - * Find a connection manager by name - * - * @param context - * @param name - * @param shared - * @return - * @throws SQLException - */ - public static IJdbcConnectionManager findConnectionManager(FacesContext context, UIComponent from, String name) throws SQLException { - final UIComponent c = FacesUtil.getComponentFor(from, name); - if (c != null) { - return (IJdbcConnectionManager) c; - } - return null; - } + /** + * Find a connection manager by name + * + * @param context + * @param name + * @param shared + * @return + * @throws SQLException + */ + public static IJdbcConnectionManager findConnectionManager(FacesContext context, UIComponent from, String name) throws SQLException { + UIComponent c = FacesUtil.getComponentFor(from, name); + if (c != null) { + return (IJdbcConnectionManager) c; + } + return null; + } - /** - * Check if table had been created. - */ - public static boolean tableExists(Connection c, String schema) throws SQLException { - return tableExists(c, schema, new String[] { "TABLE" }); // $NON-NLS-1$ - } + /** + * Check if table had been created. + */ + public static boolean tableExists(Connection c, String schema) throws SQLException { + return tableExists(c, schema, new String[] { "TABLE" }); // $NON-NLS-1$ + } - public static boolean tableExists(Connection c, String schema, String[] types) throws SQLException { - final ResultSet tables = c.getMetaData().getTables(null, schema, null, types); - try { - if (tables.next()) { - return true; - } else { - return false; - } - } finally { - tables.close(); - } - } + public static boolean tableExists(Connection c, String schema, String[] types) throws SQLException { + ResultSet tables = c.getMetaData().getTables(null, schema, null, types); //$NON-NLS-1$ + try { + if (tables.next()) { + return true; + } else { + return false; + } + } finally { + tables.close(); + } + } - /** - * Check if a table exists. - */ - public static boolean tableExists(Connection c, String schema, String tableName) throws SQLException { - return tableExists(c, schema, tableName, new String[] { "TABLE" }); // $NON-NLS-1$ - } + /** + * Check if a table exists. + */ + public static boolean tableExists(Connection c, String schema, String tableName) throws SQLException { + return tableExists(c, schema, tableName, new String[] { "TABLE" }); // $NON-NLS-1$ + } - public static boolean tableExists(Connection c, String schema, String tableName, String[] types) throws SQLException { - final ResultSet tables = c.getMetaData().getTables(null, schema, tableName, types); - try { - if (tables.next()) { - return true; - } else { - return false; - } - } finally { - tables.close(); - } - } + public static boolean tableExists(Connection c, String schema, String tableName, String[] types) throws SQLException { + ResultSet tables = c.getMetaData().getTables(null, schema, tableName, types); //$NON-NLS-1$ + try { + if (tables.next()) { + return true; + } else { + return false; + } + } finally { + tables.close(); + } + } - /** - * Get the list of tables - */ - public static List listTables(Connection c, String schema, String tableName) throws SQLException { - return listTables(c, schema, tableName, new String[] { "TABLE" }); // $NON-NLS-1$ - } + /** + * Get the list of tables + */ + public static List listTables(Connection c, String schema, String tableName) throws SQLException { + return listTables(c, schema, tableName, new String[] { "TABLE" }); // $NON-NLS-1$ + } - public static List listTables(Connection c, String schema, String tableName, String[] types) throws SQLException { - final ResultSet tables = c.getMetaData().getTables(null, schema, tableName, types); - try { - final ArrayList l = new ArrayList(); - while (tables.next()) { - final String sc = tables.getString("TABLE_SCHEM"); // $NON-NLS-1$ - final String tb = tables.getString("TABLE_NAME"); // $NON-NLS-1$ - if (StringUtil.isEmpty(sc)) { - l.add(tb); - } else { - l.add(StringUtil.format("{0}.{1}", sc, tb)); // $NON-NLS-1$ - } - } - return l; - } finally { - tables.close(); - } - } + public static List listTables(Connection c, String schema, String tableName, String[] types) throws SQLException { + ResultSet tables = c.getMetaData().getTables(null, schema, tableName, types); //$NON-NLS-1$ + try { + ArrayList l = new ArrayList(); + while (tables.next()) { + String sc = tables.getString("TABLE_SCHEM"); // $NON-NLS-1$ + String tb = tables.getString("TABLE_NAME"); // $NON-NLS-1$ + if (StringUtil.isEmpty(sc)) { + l.add(tb); + } else { + l.add(StringUtil.format("{0}.{1}", sc, tb)); + } + } + return l; + } finally { + tables.close(); + } + } - /** - * Read a SQL file from the resources. - */ - public static String readSqlFile(String fileName) { - if (StringUtil.isNotEmpty(fileName)) { - final Application app = Application.get(); - final VFSObjectCache c = app.getVFSCache(); - String fullPath = JDBC_ROOT + VFS.SEPARATOR + fileName; - if (!fullPath.endsWith(".sql")) { // $NON-NLS-1$ - fullPath = fullPath + ".sql"; // $NON-NLS-1$ - } - final String updatedFilePath = fullPath; - try { - return (String) c.get(fullPath, new VFSObjectCache.ObjectLoader() { - @Override - public Object loadObject(VFSFile file) throws VFSException { - if (file.exists()) { - try { - final String s = file.loadAsString(); - return s; - } catch (final Exception ex) { - throw new VFSException(ex, StringUtil.format("Error while reading SQL Query file {0}", updatedFilePath)); // $NLX-JdbcUtil.ErrorwhilereadingSQLQueryfile0-1$[[{0} is like "/WEB-INF/jdbc/query.sql"]] - } - } - throw new VFSException(null, StringUtil.format("SQL Query file {0} does not exist", updatedFilePath)); // $NLX-JdbcUtil.0file1doesnotexist-1$[[{0} is like "/WEB-INF/jdbc/query.sql"]] - } - }); - } catch (final VFSException ex) { - throw new FacesExceptionEx(ex, StringUtil.format("Error while loading SQL Query file {0}", updatedFilePath)); // $NLX-JdbcUtil.Errorwhileloading0queryfile1-1$[[{0} is like "/WEB-INF/jdbc/query.sql"]] - } - } - return null; - } + /** + * Read a SQL file from the resources. + */ + public static String readSqlFile(String fileName) { + if (StringUtil.isNotEmpty(fileName)) { + Application app = Application.get(); + VFSObjectCache c = app.getVFSCache(); + try { + String fullPath = JDBC_ROOT + VFS.SEPARATOR + fileName; + if (!fullPath.endsWith(".sql")) { // $NON-NLS-1$ + fullPath = fullPath + ".sql"; // $NON-NLS-1$ + } + return (String) c.get(fullPath, new VFSObjectCache.ObjectLoader() { // $NON-NLS-1$ + public Object loadObject(VFSFile file) throws VFSException { + if (file.exists()) { + try { + String s = file.loadAsString(); + return s; + } catch (Exception ex) { + throw new VFSException(ex, StringUtil.format("Error while reading {0} Query {1}", "SQL", file)); // $NLX-JdbcUtil.Errorwhilereading0Query1-1$ + // $NON-NLS-2$ + } + } + throw new VFSException(null, StringUtil.format("{0) file {1} does not exist", "SQL Query", file)); // $NLX-JdbcUtil.0file1doesnotexist-1$ + // $NON-NLS-2$ + } + }); + } catch (VFSException ex) { + throw new FacesExceptionEx(ex, StringUtil.format("Error while loading {0} query file {1}", "SQL", fileName)); // $NLX-JdbcUtil.Errorwhileloading0queryfile1-1$ + // $NON-NLS-2$ + } + } + return null; + } - // ======================================================================== - // SQL construction methods - // ======================================================================== + // ======================================================================== + // SQL construction methods + // ======================================================================== - public static void appendTableName(StringBuilder b, String tbName) { - b.append(tbName); - } + public static void appendTableName(StringBuilder b, String tbName) { + b.append(tbName); + } - public static void appendColumnName(StringBuilder b, String colName) { - appendColumnName(b, colName, true); - } + public static void appendColumnName(StringBuilder b, String colName) { + appendColumnName(b, colName, true); + } - public static void appendColumnName(StringBuilder b, String colName, Boolean colToUpperCase) { - if (colToUpperCase != null && colToUpperCase) { - colName = colName.toUpperCase(); - } - b.append(colName); - } + public static void appendColumnName(StringBuilder b, String colName, Boolean uCase) { + if (uCase) { + colName = colName.toUpperCase(); + } + b.append(colName); + } - // ======================================================================== - // Count query - // ======================================================================== + // ======================================================================== + // Count query + // ======================================================================== - public static String getCountQuery(String q) throws SQLException { - // This function transforms a query into another query that actually - // counts the number - // of entry. It actually replaced the selection of the columns by a - // count(*) - // The query must be of the form - // SELECT xxxx FROM - // Note that it might not be optimal is all the cases. Also, the - // replacement is currently - // done using basic string replacement, while a more robust code should - // actually fully - // parse the SQL. - final int sel = StringUtil.indexOfIgnoreCase(q, "select", 0); // $NON-NLS-1$ - final int from = StringUtil.indexOfIgnoreCase(q, "from", 0); // $NON-NLS-1$ - if (sel < 0 || from < sel) { - throw new SQLException(StringUtil.format("Unable to create a \"count\" query for the SQL statement:\n{0}", q)); // $NLX-JdbcUtil.Unabletocreateacountqueryforthe01-1$[[{0} is some SQL code, like: SELECT * FROM employees;]] - } - return q.substring(0, sel + 6) + " count(*) " + q.substring(from); // $NON-NLS-1$ - } + public static String getCountQuery(String q) throws SQLException { + // This function transforms a query into another query that actually + // counts the number + // of entry. It actually replaced the selection of the columns by a + // count(*) + // The query must be of the form + // SELECT xxxx FROM + // Note that it might not be optimal is all the cases. Also, the + // replacement is currently + // done using basic string replacement, while a more robust code should + // actually fully + // parse the SQL. + int sel = StringUtil.indexOfIgnoreCase(q, "select", 0); // $NON-NLS-1$ + int from = StringUtil.indexOfIgnoreCase(q, "from", 0); // $NON-NLS-1$ + if (sel < 0 || from < sel) { + throw new SQLException(StringUtil.format("Unable to create a 'count' query for the {0} {1}", "SQL", q)); // $NLX-JdbcUtil.Unabletocreateacountqueryforthe01-1$ + // $NON-NLS-2$ + } + return q.substring(0, sel + 6) + " count(*) " + q.substring(from); // $NON-NLS-1$ + } } \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.classpath index 751c8f2..9bc33d3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.project index e7902ba..6f98921 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.project @@ -20,11 +20,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.settings/org.eclipse.jdt.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.settings/org.eclipse.jdt.core.prefs index d86463f..a4dae3e 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.settings/org.eclipse.jdt.core.prefs +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,9 @@ -#Mon Jul 26 14:46:50 EDT 2010 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +12,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore @@ -65,3 +69,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.classpath index ad32c83..4d87a86 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.project b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.project index bbd1a8f..03ecc0e 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.classpath index df7e154..56c549d 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.project b/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.project index 39ee9a5..d3b125f 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.project @@ -31,4 +31,4 @@ org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature - \ No newline at end of file + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/net.fortuna.ical4j/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.classpath index eade01b..6c617f8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.classpath @@ -1,9 +1,9 @@ - - - - - - - - - + + + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.project b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.project index 38dba93..1ddcac1 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.common.dbcp/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.classpath index d8706b3..f653b74 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.project b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.project index 9d780ea..e0188a5 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.project @@ -20,11 +20,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.james.mime4j/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.classpath b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.classpath index 70d2c9a..28da9cb 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.classpath +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.classpath @@ -1,18 +1,17 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.project b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.project index 9bac5a1..0a9965d 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.project +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.project @@ -19,11 +19,6 @@ org.eclipse.pde.SchemaBuilder - - - org.maven.ide.eclipse.maven2Builder - - org.eclipse.m2e.core.maven2Builder @@ -33,7 +28,6 @@ org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/eclipse/plugins/org.apache.wink/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/extlib/lwp/product/runtime/updatesite/org.openntf.extlib.updatesite/.project b/extlib/lwp/product/runtime/updatesite/org.openntf.extlib.updatesite/.project index f3eb1b4..0916be6 100644 --- a/extlib/lwp/product/runtime/updatesite/org.openntf.extlib.updatesite/.project +++ b/extlib/lwp/product/runtime/updatesite/org.openntf.extlib.updatesite/.project @@ -10,11 +10,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder @@ -22,8 +17,7 @@ - org.eclipse.pde.UpdateSiteNature org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature + org.eclipse.pde.UpdateSiteNature diff --git a/extlib/lwp/product/runtime/updatesite/org.openntf.extlib.updatesite/.settings/org.eclipse.m2e.core.prefs b/extlib/lwp/product/runtime/updatesite/org.openntf.extlib.updatesite/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/extlib/lwp/product/runtime/updatesite/org.openntf.extlib.updatesite/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1