Author: trong.tran
Date: 2010-03-02 23:55:58 -0500 (Tue, 02 Mar 2010)
New Revision: 1935
Added:
portal/trunk/examples/portlets/webuibasedsamples/
portal/trunk/examples/portlets/webuibasedsamples/pom.xml
portal/trunk/examples/portlets/webuibasedsamples/src/
portal/trunk/examples/portlets/webuibasedsamples/src/main/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/fck/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/fck/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/fck/webui/component/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/fck/webui/component/UIFCKEditorPortlet.java
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UICSInputPortlet.java
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UIDownloadUploadPortlet.java
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet1.java
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet2.java
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPanePortlet.java
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/virtuallist/
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/virtuallist/UIVirtualListPortlet.java
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/suppressions.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/tomcat/
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/tomcat/portlets.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/csinput/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/csinput/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/csinput/webui/configuration.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/downloadupload/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/downloadupload/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/downloadupload/webui/configuration.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/fck/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/fck/FCKPortlet/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/fck/FCKPortlet/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/fck/FCKPortlet/webui/configuration.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/lazytabpane/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/lazytabpane/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/lazytabpane/webui/configuration.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/virtuallist/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/virtuallist/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/virtuallist/webui/configuration.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/web.xml
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UICSInputForm.gtmpl
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UIDownloadUpload.gtmpl
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UILazyTabPaneInputSet.gtmpl
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleResourcesBrowser.gtmpl
Modified:
portal/trunk/examples/portlets/pom.xml
Log:
Add samples to show usage of WebUI based components
Modified: portal/trunk/examples/portlets/pom.xml
===================================================================
--- portal/trunk/examples/portlets/pom.xml 2010-03-03 04:46:56 UTC (rev 1934)
+++ portal/trunk/examples/portlets/pom.xml 2010-03-03 04:55:58 UTC (rev 1935)
@@ -17,6 +17,7 @@
<module>jsfhellouser</module>
<module>jsphellouser</module>
<module>simplesthelloworld</module>
+ <module>webuibasedsamples</module>
</modules>
</project>
Added: portal/trunk/examples/portlets/webuibasedsamples/pom.xml
===================================================================
--- portal/trunk/examples/portlets/webuibasedsamples/pom.xml (rev
0)
+++ portal/trunk/examples/portlets/webuibasedsamples/pom.xml 2010-03-03 04:55:58 UTC (rev
1935)
@@ -0,0 +1,28 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.gatein.portal.examples.portlets</groupId>
+ <artifactId>parent</artifactId>
+ <version>3.0.0-CR02-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gatein-webui-based-samples</artifactId>
+ <packaging>war</packaging>
+
+ <name>GateIn Portal Examples - WebUI based samples</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.webui.portal</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.webui.eXo</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/fck/webui/component/UIFCKEditorPortlet.java
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/fck/webui/component/UIFCKEditorPortlet.java
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/fck/webui/component/UIFCKEditorPortlet.java 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.samples.fck.webui.component;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.wysiwyg.UIFormWYSIWYGInput;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Pham Thanh Tung
+ * thanhtungty(a)gmail.com
+ * Dec 8, 2008
+ */
+
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class
+)
+public class UIFCKEditorPortlet extends UIPortletApplication{
+
+ public UIFCKEditorPortlet() throws Exception {
+ addChild(UIEditor.class, null, null);
+ }
+
+ @ComponentConfig(
+ lifecycle = UIFormLifecycle.class
+ )
+ static public class UIEditor extends UIForm {
+
+ static final public String TEXT_FIELD = "text";
+ public UIEditor() throws Exception {
+ UIFormWYSIWYGInput uiInputFCKEditor = new UIFormWYSIWYGInput(TEXT_FIELD, null,
null);
+ uiInputFCKEditor.setWidth("99%");
+ addUIFormInput(uiInputFCKEditor);
+ }
+ }
+
+}
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UICSInputPortlet.java
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UICSInputPortlet.java
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UICSInputPortlet.java 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.samples.forminput.webui;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.core.model.SelectItemOption;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.ext.UIFormColorPicker;
+import org.exoplatform.webui.form.ext.UIFormComboBox;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Pham Thanh Tung
+ * thanhtungty(a)gmail.com
+ * Apr 14, 2009
+ */
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class
+)
+public class UICSInputPortlet extends UIPortletApplication {
+
+ public UICSInputPortlet() throws Exception {
+ addChild(UITestForm.class, null, null);
+ }
+
+ @ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template =
"app:/groovy/webui/component/UICSInputForm.gtmpl",
+ events = {
+ @EventConfig(listeners = UITestForm.SubmitActionListener.class)
+ }
+ )
+ static public class UITestForm extends UIForm {
+
+ Map<String, String> data = new HashMap<String, String>();
+
+ public UITestForm() throws Exception {
+ ArrayList<SelectItemOption<String>> options = new
ArrayList<SelectItemOption<String>>();
+ options.add(new SelectItemOption<String>("option 1", "option
1"));
+ options.add(new SelectItemOption<String>("option 2", "option
2"));
+ options.add(new SelectItemOption<String>("option 3", "option
3"));
+ options.add(new SelectItemOption<String>("option 4", "option
4"));
+ addUIFormInput(new UIFormComboBox("UICombobox", "UICombobox",
options));
+ addUIFormInput(new UIFormColorPicker("UIColorPicker",
"UIColorPicker", (String) null));
+ }
+ static public class SubmitActionListener extends EventListener<UITestForm> {
+
+ public void execute(Event<UITestForm> event) throws Exception {
+ UITestForm uiForm = event.getSource();
+ UIFormComboBox uiComboBox = uiForm.getChild(UIFormComboBox.class);
+ uiForm.data.put(uiComboBox.getId(), uiComboBox.getValue());
+ UIFormColorPicker uiColorPicker = uiForm.getChild(UIFormColorPicker.class);
+ uiForm.data.put(uiColorPicker.getId(), uiColorPicker.getValue());
+ }
+
+ }
+ }
+}
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UIDownloadUploadPortlet.java
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UIDownloadUploadPortlet.java
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/forminput/webui/UIDownloadUploadPortlet.java 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.samples.forminput.webui;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.exoplatform.download.DownloadResource;
+import org.exoplatform.download.DownloadService;
+import org.exoplatform.download.InputStreamDownloadResource;
+import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.upload.UploadResource;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormUploadInput;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Pham Thanh Tung
+ * thanhtungty(a)gmail.com
+ * Apr 14, 2009
+ */
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class
+)
+public class UIDownloadUploadPortlet extends UIPortletApplication {
+
+ public UIDownloadUploadPortlet() throws Exception {
+ addChild(UIDownloadUpload.class, null, null);
+ }
+
+ @ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template =
"app:/groovy/webui/component/UIDownloadUpload.gtmpl",
+ events = {
+ @EventConfig(listeners =
UIDownloadUpload.SubmitActionListener.class)
+ }
+ )
+ static public class UIDownloadUpload extends UIForm {
+
+ Map<String, String> data = new HashMap<String, String>();
+
+ private String[] downloadLink;
+ private String[] fileName;
+ private String[] inputName;
+
+ public UIDownloadUpload() throws Exception {
+ addUIFormInput(new UIFormUploadInput("name0","value0"));
+ addUIFormInput(new UIFormUploadInput("name1","value1"));
+ addUIFormInput(new UIFormUploadInput("name2","value2"));
+ }
+ public void setDownloadLink(String[] downloadLink) {
+ this.downloadLink = downloadLink;
+ }
+ public String[] getDownloadLink() {
+ return downloadLink;
+ }
+ public void setFileName(String[] fileName) {
+ this.fileName = fileName;
+ }
+ public String[] getFileName() {
+ return fileName;
+ }
+ public void setInputName(String[] inputName) {
+ this.inputName = inputName;
+ }
+ public String[] getInputName() {
+ return inputName;
+ }
+ static public class SubmitActionListener extends EventListener<UIDownloadUpload>
{
+
+ public void execute(Event<UIDownloadUpload> event) throws Exception {
+ UIDownloadUpload uiForm = event.getSource();
+ DownloadService dservice = uiForm.getApplicationComponent(DownloadService.class);
+ String[] downloadLink = new String[3];
+ String[] fileName = new String[3];
+ String[] inputName = new String[3];
+ for (int index = 0; index <=2; index++ ) {
+ UIFormUploadInput input = uiForm.getChildById("name"+index);
+ UploadResource uploadResource = input.getUploadResource() ;
+ if (uploadResource != null) {
+ DownloadResource dresource = new
InputStreamDownloadResource(input.getUploadDataAsStream(), uploadResource.getMimeType());
+ dresource.setDownloadName(uploadResource.getFileName());
+ downloadLink[index] =
dservice.getDownloadLink(dservice.addDownloadResource(dresource));
+ fileName[index] = uploadResource.getFileName();
+ inputName[index] = "name" + index;
+ }
+ }
+
+ uiForm.setDownloadLink(downloadLink);
+ uiForm.setFileName(fileName);
+ uiForm.setInputName(inputName);
+
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent());
+ }
+
+ }
+ }
+}
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet1.java
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet1.java
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet1.java 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.samples.lazytabpane;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.exoplatform.webui.form.validator.ExpressionValidator;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.webui.form.validator.ResourceValidator;
+import org.exoplatform.webui.form.validator.StringLengthValidator;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : tam.nguyen
+ * tamndrok(a)gmail.com
+ * July 21, 2009
+ */
+@ComponentConfig(
+ lifecycle = UIFormLifecycle.class
+)
+public class UILazyTabPaneInputSet1 extends UIForm {
+
+
+ public UILazyTabPaneInputSet1() throws Exception {
+ addUIFormInput(new UIFormStringInput("userName", "userName",
"Name").
+ addValidator(MandatoryValidator.class).
+ addValidator(StringLengthValidator.class, 3, 30).
+ addValidator(ResourceValidator.class).
+ addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{L}._\\-\\d]+$",
"ResourceValidator.msg.Invalid-char"));
+ }
+
+}
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet2.java
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet2.java
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPaneInputSet2.java 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.samples.lazytabpane;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.exoplatform.webui.form.validator.ExpressionValidator;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.webui.form.validator.PasswordStringLengthValidator;
+import org.exoplatform.webui.form.validator.ResourceValidator;
+import org.exoplatform.webui.form.validator.StringLengthValidator;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : tam.nguyen
+ * tamndrok(a)gmail.com
+ * July 21, 2009
+ */
+@ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template =
"app:/groovy/webui/component/UILazyTabPaneInputSet.gtmpl"
+)
+public class UILazyTabPaneInputSet2 extends UIForm {
+
+
+ public UILazyTabPaneInputSet2() throws Exception {
+ addUIFormInput(new UIFormStringInput("newUserName", "userName",
null).
+ addValidator(MandatoryValidator.class).
+ addValidator(StringLengthValidator.class, 3, 30).
+ addValidator(ResourceValidator.class).
+ addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{L}._\\-\\d]+$",
"ResourceValidator.msg.Invalid-char"));
+ addUIFormInput(new UIFormStringInput("newPassword", "password",
null).
+ setType(UIFormStringInput.PASSWORD_TYPE).
+ addValidator(MandatoryValidator.class).
+ addValidator(PasswordStringLengthValidator.class, 6, 30)) ;
+ addUIFormInput(new UIFormStringInput("newConfirmPassword",
"password", null).
+ setType(UIFormStringInput.PASSWORD_TYPE).
+ addValidator(MandatoryValidator.class).
+ addValidator(PasswordStringLengthValidator.class, 6, 30));
+ }
+
+}
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPanePortlet.java
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPanePortlet.java
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/lazytabpane/UILazyTabPanePortlet.java 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.samples.lazytabpane;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.UILazyTabPane;
+import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+
+/**
+ * Created by The eXo Platform SAS Author : tam.nguyen tamndrok(a)gmail.com Aug 2, 2009
+ */
+@ComponentConfig(lifecycle = UIApplicationLifecycle.class)
+public class UILazyTabPanePortlet extends UIPortletApplication {
+
+ public UILazyTabPanePortlet() throws Exception {
+ UILazyTabPane uiLazyTabPane = addChild(UILazyTabPane.class, null, null);
+ uiLazyTabPane.addChild(UILazyTabPaneInputSet1.class, null, null).setRendered(true);
+ uiLazyTabPane.addChild(UILazyTabPaneInputSet2.class, null, null);
+ uiLazyTabPane.setSelectedTab(1);
+ }
+}
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/virtuallist/UIVirtualListPortlet.java
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/virtuallist/UIVirtualListPortlet.java
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/java/org/exoplatform/samples/virtuallist/UIVirtualListPortlet.java 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.samples.virtuallist;
+
+import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.services.resources.ResourceBundleService;
+import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.UIRepeater;
+import org.exoplatform.webui.core.UIVirtualList;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+
+/**
+ * Created by The eXo Platform SAS Author : LiemNC ncliam(a)gmail.com Aug 2, 2009
+ */
+@ComponentConfig(lifecycle = UIApplicationLifecycle.class)
+public class UIVirtualListPortlet extends UIPortletApplication {
+
+ public UIVirtualListPortlet() throws Exception {
+ addChild(UISampleResourcesBrowser.class, null, null);
+ }
+
+ @ComponentConfig(template =
"app:/groovy/webui/component/UISampleResourcesBrowser.gtmpl")
+ static public class UISampleResourcesBrowser extends UIContainer {
+
+ private static String[] RESOURCE_LIST = { "name", "language"
};
+
+ private static String[] RESOURCE_ACTION = { "View", "Delete" };
+
+ public UISampleResourcesBrowser() throws Exception {
+ UIRepeater uiRepeater = createUIComponent(UIRepeater.class, null, null);
+ uiRepeater.configure("id", RESOURCE_LIST, RESOURCE_ACTION);
+
+ UIVirtualList virtualList = addChild(UIVirtualList.class, null, null);
+ virtualList.setPageSize(10);
+ virtualList.setUIComponent(uiRepeater);
+ }
+
+ public String event(String name, String beanId) throws Exception {
+ if (Util.getUIPortal().getName().equals(beanId))
+ return super.url(name, beanId);
+ return super.event(name, beanId);
+ }
+
+ public void loadResources() throws Exception {
+ try {
+ ResourceBundleService resBundleServ =
getApplicationComponent(ResourceBundleService.class);
+ org.exoplatform.services.resources.Query lastQuery_ = new
org.exoplatform.services.resources.Query(null,
+
null);
+ PageList pageList = resBundleServ.findResourceDescriptions(lastQuery_);
+ UIVirtualList virtualList = getChild(UIVirtualList.class);
+ virtualList.dataBind(pageList);
+ } catch (Exception e) {
+ UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty",
null));
+ }
+ }
+ }
+}
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/suppressions.xml
===================================================================
--- portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/suppressions.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/suppressions.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+
+<suppressions>
+ <suppress checks="JavadocMethod" files=".java"/>
+ <suppress checks="JavadocType" files=".java"/>
+ <suppress checks="JavadocVariable" files=".java"/>
+ <suppress checks="JavadocStyle" files=".java"/>
+ <suppress checks="TodoComment" files=".java"/>
+</suppressions>
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/tomcat/portlets.xml
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/tomcat/portlets.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/resources/tomcat/portlets.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,2 @@
+<Context path="/portlets"
docBase="../../../eXoProjects/portal/trunk/sample/portlets/src/main/webapp"
+ debug="0" reloadable="true" />
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/csinput/webui/configuration.xml
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/csinput/webui/configuration.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/csinput/webui/configuration.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,6 @@
+<webui-configuration>
+ <application>
+
<ui-component-root>org.exoplatform.samples.forminput.webui.UICSInputPortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/downloadupload/webui/configuration.xml
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/downloadupload/webui/configuration.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/downloadupload/webui/configuration.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,6 @@
+<webui-configuration>
+ <application>
+
<ui-component-root>org.exoplatform.samples.forminput.webui.UIDownloadUploadPortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/fck/FCKPortlet/webui/configuration.xml
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/fck/FCKPortlet/webui/configuration.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/fck/FCKPortlet/webui/configuration.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,6 @@
+<webui-configuration>
+ <application>
+
<ui-component-root>org.exoplatform.samples.fck.webui.component.UIFCKEditorPortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/lazytabpane/webui/configuration.xml
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/lazytabpane/webui/configuration.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/lazytabpane/webui/configuration.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,6 @@
+<webui-configuration>
+ <application>
+
<ui-component-root>org.exoplatform.samples.lazytabpane.UILazyTabPanePortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/virtuallist/webui/configuration.xml
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/virtuallist/webui/configuration.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/conf/portlet/sample/virtuallist/webui/configuration.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,6 @@
+<webui-configuration>
+ <application>
+
<ui-component-root>org.exoplatform.samples.virtuallist.UIVirtualListPortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/portlet.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/portlet.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+ <portlet>
+ <description xml:lang="EN">Sample FCK Editor
Portlet</description>
+ <portlet-name>SampleFCKPortlet</portlet-name>
+ <display-name>Sample FCK Portlet</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <init-param>
+ <name>webui.configuration</name>
+ <value>/WEB-INF/conf/portlet/sample/fck/FCKPortlet/webui/configuration.xml</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <resource-bundle>locale.portal.webui</resource-bundle>
+ <portlet-info>
+ <title>Sample FCK Editor Portlet</title>
+ <short-title>FCK Editor Portlet</short-title>
+ <keywords>Sample</keywords>
+ </portlet-info>
+ <security-role-ref>
+ <role-name>admin</role-name>
+ <role-link>admin</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <description xml:lang="EN">Sample Lazy Tab Pane
Portlet</description>
+ <portlet-name>LazyTabPanePortlet</portlet-name>
+ <display-name>LazyTabPanePortlet</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <init-param>
+ <name>webui.configuration</name>
+ <value>/WEB-INF/conf/portlet/sample/lazytabpane/webui/configuration.xml</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <resource-bundle>locale.portal.webui</resource-bundle>
+ <portlet-info>
+ <title>Sample Lazy Tab Pane Portlet</title>
+ <short-title>Lazy Tab Pane Portlet</short-title>
+ <keywords>Sample</keywords>
+ </portlet-info>
+ <security-role-ref>
+ <role-name>admin</role-name>
+ <role-link>admin</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <description xml:lang="EN">Sample CS Input Portlet</description>
+ <portlet-name>UICSInputPortlet</portlet-name>
+ <display-name>CS Input Portlet</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <init-param>
+ <name>webui.configuration</name>
+ <value>/WEB-INF/conf/portlet/sample/csinput/webui/configuration.xml</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <resource-bundle>locale.portal.webui</resource-bundle>
+ <portlet-info>
+ <title>CS Input Portlet</title>
+ <short-title>CS Input Portlet</short-title>
+ <keywords>Sample</keywords>
+ </portlet-info>
+ <security-role-ref>
+ <role-name>admin</role-name>
+ <role-link>admin</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <description xml:lang="EN">Sample Virtual List
Portlet</description>
+ <portlet-name>UIVirtualListPortlet</portlet-name>
+ <display-name>Sample Virtual List Portlet</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <init-param>
+ <name>webui.configuration</name>
+ <value>/WEB-INF/conf/portlet/sample/virtuallist/webui/configuration.xml</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <resource-bundle>locale.portal.webui</resource-bundle>
+ <portlet-info>
+ <title>Sample Virtual List Portlet</title>
+ <short-title>Sample Virtual List Portlet</short-title>
+ <keywords>Sample</keywords>
+ </portlet-info>
+ <security-role-ref>
+ <role-name>admin</role-name>
+ <role-link>admin</role-link>
+ </security-role-ref>
+ </portlet>
+
+ <portlet>
+ <description xml:lang="EN">Sample Download Upload
Portlet</description>
+ <portlet-name>UIDownloadUploadPortlet</portlet-name>
+ <display-name>Sample Download Upload Portlet</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <init-param>
+ <name>webui.configuration</name>
+ <value>/WEB-INF/conf/portlet/sample/downloadupload/webui/configuration.xml</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <resource-bundle>locale.portal.webui</resource-bundle>
+ <portlet-info>
+ <title>Sample Download Upload Portlet</title>
+ <short-title>Sample Download Upload Portlet</short-title>
+ <keywords>Sample</keywords>
+ </portlet-info>
+ <security-role-ref>
+ <role-name>admin</role-name>
+ <role-link>admin</role-link>
+ </security-role-ref>
+ </portlet>
+</portlet-app>
Added: portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/WEB-INF/web.xml 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+ <!--If define the Portlet Application name MUST end with .par-->
+ <display-name>samplePortlets</display-name>
+
+ <description>
+ This application is a portlet. It can not be used outside a portal.
+ This web.xml file is mandatory in each .par archive file.
+ </description>
+
+
+ <filter>
+ <filter-name>ResourceRequestFilter</filter-name>
+
<filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>GateInServlet</servlet-name>
+ <servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>GateInServlet</servlet-name>
+ <url-pattern>/gateinservlet</url-pattern>
+ <load-on-startup>0</load-on-startup>
+ </servlet-mapping>
+
+ <security-role>
+ <description>a simple user role</description>
+ <role-name>user</role-name>
+ </security-role>
+
+ <security-role>
+ <description>the admin role</description>
+ <role-name>admin</role-name>
+ </security-role>
+</web-app>
\ No newline at end of file
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UICSInputForm.gtmpl
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UICSInputForm.gtmpl
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UICSInputForm.gtmpl 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,78 @@
+<%
+import java.util.Iterator;
+import java.util.Map.Entry
+String fieldName;
+%>
+<div class="UIForm $uicomponent.id">
+ <%uiform.begin()%>
+ <div class="HorizontalLayout">
+ <div class="FormContainer">
+ <table class="UIFormGrid">
+ <%
+ for(field in uiform.getChildren()) {
+ if(field.isRendered()) {
+ %>
+ <tr>
+ <%fieldName = uicomponent.getLabel(field.getName());%>
+ <%//TODO: Tung.Pham modified
+ //if(!fieldName.equals(uicomponent.getId())) {
+ if(fieldName != null && fieldName.length() > 0 &&
!fieldName.equals(uicomponent.getId())) {
+ %>
+ <td class="FieldLabel">
+ <%/*if(fieldName != null && fieldName.length() > 0)
{*/%>
+ <%=uicomponent.getLabel(field.getName()) %>
+ <%/*}*/%>
+ </td>
+ <td class="FieldComponent"><%
uiform.renderField(field) %></td>
+ <%} else {%>
+ <td class="FieldComponent" colspan="2"><%
uiform.renderField(field) %></td>
+ <%}%>
+ </tr>
+ <%
+ }
+ }
+ %>
+ </table>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <% for(action in uicomponent.getActions()) {
+ String actionLabel = _ctx.appRes(uicomponent.getName() +
".action." + action) ;
+ String link = uicomponent.event(action) ;
+ %>
+ <div onclick="$link" class="ActionButton
LightBlueStyle" onmouseover="this.style.color = '#058ee6'"
onmouseout="this.style.color='black'">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a
href="javascript:void(0);">$actionLabel</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ <%}%>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <%uiform.end()%>
+ <div class="Preferences" style="border: 1px solid #b7b7b7; padding:
10px; margin: 10px; background: #f7f7f7">
+ <table class="UIGrid" style="width: 99%">
+ <tr>
+ <th colspan="2">Results</th>
+ </tr>
+ <%
+ Iterator<Entry<String, String>> itr =
uiform.data.entrySet().iterator();
+ while(itr.hasNext()) {
+ Entry<String, String> entry = itr.next();
+ %>
+ <tr>
+ <td width="30%"><%= entry.getKey() %></td>
+ <td width="30%"><%= entry.getValue() %></td>
+ </tr>
+ <%}%>
+ </table>
+ </div>
+</div>
\ No newline at end of file
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UIDownloadUpload.gtmpl
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UIDownloadUpload.gtmpl
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UIDownloadUpload.gtmpl 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,76 @@
+<%
+String fieldName;
+downloadLink = uicomponent.getDownloadLink();
+fileName = uicomponent.getFileName();
+inputName = uicomponent.getInputName();
+%>
+<div id="UIDownloadUpload">
+ <div class="UIForm $uicomponent.id">
+ <%uiform.begin()%>
+ <div class="HorizontalLayout">
+ <div class="FormContainer">
+ <table class="UIFormGrid">
+ <%
+ for(field in uiform.getChildren()) {
+ if(field.isRendered()) {
+ %>
+ <tr>
+ <%fieldName = uicomponent.getLabel(field.getName());%>
+ <%
+ if(fieldName != null && fieldName.length() > 0 &&
!fieldName.equals(uicomponent.getId())) {
+ %>
+ <td class="FieldLabel">
+ <%/*if(fieldName != null && fieldName.length() > 0)
{*/%>
+ <%=uicomponent.getLabel(field.getName()) %>
+ <%/*}*/%>
+ </td>
+ <td class="FieldComponent"><%
uiform.renderField(field) %></td>
+ <%} else {%>
+ <td class="FieldComponent" colspan="2"><%
uiform.renderField(field) %></td>
+ <%}%>
+ </tr>
+
+ <%
+ }
+ }
+ %>
+ <%if (downloadLink != null){ %>
+ <%for(index=0;index<=2;index++) { %>
+ <%if (downloadLink[index] != null){ %>
+ <tr>
+ <td>
+ Download from [<%= inputName[index] %>] upload input:<a
href="<%= downloadLink[index] %>" style="color:red"><%=
fileName[index] %></a>
+ </td>
+ </tr>
+ <% }
+ }
+ } %>
+ <tr>
+ <td>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+
+ <div onclick="<%=uicomponent.event("Submit")%>"
class="ActionButton LightBlueStyle" onmouseover="this.style.color =
'#058ee6'" onmouseout="this.style.color='black'">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);">Save</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ </div>
+ <%uiform.end()%>
+ </div>
+</div>
\ No newline at end of file
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UILazyTabPaneInputSet.gtmpl
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UILazyTabPaneInputSet.gtmpl
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UILazyTabPaneInputSet.gtmpl 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,38 @@
+<%
+String fieldName;
+%>
+<div class="UIForm $uicomponent.id">
+ <%uiform.begin()%>
+ <div class="HorizontalLayout">
+ <div class="FormContainer">
+ <table class="UIFormGrid">
+ <%
+ for(field in uiform.getChildren()) {
+ if(field.isRendered()) {
+ %>
+ <tr>
+ <%fieldName = uicomponent.getLabel(field.getName());%>
+ <%
+ if(fieldName != null && fieldName.length() > 0 &&
!fieldName.equals(uicomponent.getId())) {
+ %>
+ <td class="FieldLabel">
+ <%/*if(fieldName != null && fieldName.length() > 0)
{*/%>
+ <%=uicomponent.getLabel(field.getName()) %>
+ <%/*}*/%>
+ </td>
+ <td class="FieldComponent"><%
uiform.renderField(field) %></td>
+ <%} else {%>
+ <td class="FieldComponent" colspan="2"><%
uiform.renderField(field) %></td>
+ <%}%>
+ </tr>
+ <%
+ }
+ }
+ %>
+ </table>
+ </div>
+ </div>
+ <%uiform.end()%>
+
+ </div>
+</div>
\ No newline at end of file
Added:
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleResourcesBrowser.gtmpl
===================================================================
---
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleResourcesBrowser.gtmpl
(rev 0)
+++
portal/trunk/examples/portlets/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleResourcesBrowser.gtmpl 2010-03-03
04:55:58 UTC (rev 1935)
@@ -0,0 +1,4 @@
+<div id="<%=uicomponent.getId();%>">
+ <% uicomponent.loadResources();
+ uicomponent.renderChildren(); %>
+</div>
\ No newline at end of file