Author: julien_viet
Date: 2010-07-12 16:51:34 -0400 (Mon, 12 Jul 2010)
New Revision: 3615
Removed:
portal/trunk/component/xml-parser/
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
portal/trunk/component/pom.xml
portal/trunk/component/web/pom.xml
portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/HtmlValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java
Log:
GTNPORTAL-1350: Remove XML parser module
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2010-07-12
20:51:34 UTC (rev 3615)
@@ -554,8 +554,19 @@
{
try
{
- long date =
Long.parseLong(attrs.get(USER_LAST_LOGIN_TIME).getValue().toString());
- user.setLastLoginTime(new Date(date));
+ Long lastLoginMillis = null;
+ Attribute lastLoginAttr = attrs.get(USER_LAST_LOGIN_TIME);
+ if (lastLoginAttr != null)
+ {
+ Object lastLoginValue = lastLoginAttr.getValue();
+ if (lastLoginValue != null) {
+ lastLoginMillis = Long.parseLong(lastLoginValue.toString());
+ }
+ }
+ if (lastLoginMillis != null)
+ {
+ user.setLastLoginTime(new Date(lastLoginMillis));
+ }
}
catch (NumberFormatException e)
{
Modified: portal/trunk/component/pom.xml
===================================================================
--- portal/trunk/component/pom.xml 2010-07-12 20:43:36 UTC (rev 3614)
+++ portal/trunk/component/pom.xml 2010-07-12 20:51:34 UTC (rev 3615)
@@ -38,7 +38,6 @@
<module>test</module>
<module>common</module>
<module>pc</module>
- <module>xml-parser</module>
<module>wsrp</module>
<module>resources</module>
<module>application-registry</module>
Modified: portal/trunk/component/web/pom.xml
===================================================================
--- portal/trunk/component/web/pom.xml 2010-07-12 20:43:36 UTC (rev 3614)
+++ portal/trunk/component/web/pom.xml 2010-07-12 20:51:34 UTC (rev 3615)
@@ -58,10 +58,6 @@
<artifactId>exo.portal.component.resources</artifactId>
</dependency>
<dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component.xml-parser</artifactId>
- </dependency>
- <dependency>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
</dependency>
Modified:
portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java
===================================================================
---
portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java 2010-07-12
20:51:34 UTC (rev 3615)
@@ -19,7 +19,7 @@
package org.exoplatform.upload;
-import org.exoplatform.services.html.refs.RefsDecoder;
+import org.exoplatform.upload.toremove.RefsDecoder;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
Modified: portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
---
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2010-07-12
20:51:34 UTC (rev 3615)
@@ -89,14 +89,8 @@
.addDependency(new Project("org.gatein.wsrp", "wsrp-consumer",
"jar", wsrpVersion))
.addDependency(new Project("org.gatein.wsrp",
"wsrp-integration-api", "jar", wsrpVersion));
- module.component.xmlParser =
- new Project("org.exoplatform.portal",
"exo.portal.component.xml-parser", "jar", module.version).
- //addDependency(new Project("commons-httpclient",
"commons-httpclient", "jar", "3.0")).
- addDependency(new Project("commons-codec", "commons-codec",
"jar", "1.3"));
-
module.component.scripting =
new Project("org.exoplatform.portal",
"exo.portal.component.scripting", "jar", module.version).
- addDependency(module.component.xmlParser).
addDependency(new Project("rhino", "js", "jar",
rhinoVersion)).
addDependency(new Project("org.codehaus.groovy", "groovy-all",
"jar", groovyVersion));
@@ -201,6 +195,7 @@
module.eXoGadgetServer =
new Project("org.exoplatform.portal", "exo.portal.gadgets-server",
"war", module.version).
addDependency(new Project("commons-io", "commons-io",
"jar", "1.4")).
+ addDependency(new Project("commons-codec", "commons-codec",
"jar", "1.3")).
addDependency(new Project("net.oauth", "core", "jar",
"20080621")).
addDependency(new Project("com.google.collections",
"google-collections", "jar", "1.0-rc2")).
addDependency(new Project("com.google.code.guice", "guice",
"jar", "2.0")).
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java 2010-07-12
20:51:34 UTC (rev 3615)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.application.portlet;
+import org.exoplatform.commons.utils.WriterPrinter;
import org.exoplatform.services.resources.Orientation;
import org.exoplatform.web.application.URLBuilder;
import org.exoplatform.webui.application.WebuiApplication;
@@ -76,8 +77,7 @@
{
request_ = req;
response_ = res;
-// writer_ = HtmlValidator.DEBUG_MODE ? new WriterPrinter(new HtmlValidator(writer))
: new WriterPrinter(writer);
- writer_ = writer;
+ writer_ = new WriterPrinter(writer);
windowId_ = req.getWindowID();
}
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/HtmlValidator.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/HtmlValidator.java 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/HtmlValidator.java 2010-07-12
20:51:34 UTC (rev 3615)
@@ -1,94 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.webui.core.lifecycle;
-
-import org.exoplatform.services.common.util.Stack;
-import org.exoplatform.services.html.tidy.HTMLTidy;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-
-/**
- * Created by The eXo Platform SAS
- * May 10, 2007
- */
-public class HtmlValidator extends Writer
-{
-
- public static final boolean DEBUG_MODE = false;
-
- private Writer finalWriter_;
-
- private HTMLTidy tidy_;
-
- private StringBuilder content_;
-
- private Stack<Integer> queue;
-
- public HtmlValidator(Writer w)
- {
- finalWriter_ = w;
- tidy_ = new HTMLTidy();
- content_ = new StringBuilder();
- queue = new Stack<Integer>();
- }
-
- public void close() throws IOException
- {
- finalWriter_.close();
- }
-
- public void flush() throws IOException
- {
- finalWriter_.flush();
- }
-
- public void startComponent()
- {
- queue.push(content_.length());
- }
-
- @Override
- public void write(char[] buf, int offset, int len) throws IOException
- {
- finalWriter_.write(buf, offset, len);
- content_.append(buf, offset, len);
- }
-
- public void endComponent() throws Exception
- {
- Integer start = queue.pop();
- String chunk = content_.substring(start);
- content_.delete(start, content_.length() - 1);
-
- List<String> messages = tidy_.check(chunk.toCharArray());
- if (messages.size() < 1)
- return;
- StringBuilder builder = new StringBuilder();
-
- for (String ele : messages)
- {
- builder.append(ele).append('\n');
- }
- throw new Exception(builder.toString());
- }
-
-}
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2010-07-12
20:51:34 UTC (rev 3615)
@@ -124,17 +124,7 @@
try
{
- if (bcontext.getWriter() instanceof HtmlValidator)
- {
- HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
- validator.startComponent();
- }
service.merge(template, bcontext);
- if (bcontext.getWriter() instanceof HtmlValidator)
- {
- HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
- validator.endComponent();
- }
}
catch (NullPointerException e)
{
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-07-12
20:51:34 UTC (rev 3615)
@@ -21,7 +21,6 @@
import org.exoplatform.Constants;
import org.exoplatform.commons.utils.PortalPrinter;
-import org.exoplatform.commons.utils.WriterPrinter;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
@@ -37,7 +36,6 @@
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.core.lifecycle.HtmlValidator;
import org.gatein.common.http.QueryStringParser;
import org.w3c.dom.Element;
@@ -356,17 +354,7 @@
{
if (writer_ == null)
{
- PortalPrinter printer = new PortalPrinter(response_.getOutputStream(), true,
30000);
-
- //
- if (HtmlValidator.DEBUG_MODE)
- {
- writer_ = new WriterPrinter(new HtmlValidator(printer));
- }
- else
- {
- writer_ = printer;
- }
+ writer_ = new PortalPrinter(response_.getOutputStream(), true, 30000);
}
return writer_;
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java 2010-07-12
20:43:36 UTC (rev 3614)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java 2010-07-12
20:51:34 UTC (rev 3615)
@@ -106,6 +106,7 @@
}
catch (IOException ioexc)
{
+ ioexc.printStackTrace();
return "{}";
}
return result;