gatein SVN: r6571 - portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-05-27 00:40:37 -0400 (Fri, 27 May 2011)
New Revision: 6571
Modified:
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
Log:
GTNPORTAL-1905: Use Stax to parse PortalConfig 's configuration
Modified: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-05-27 02:16:32 UTC (rev 6570)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-05-27 04:40:37 UTC (rev 6571)
@@ -35,6 +35,7 @@
import org.exoplatform.portal.config.stax.PageNavigationStAXParser;
import org.exoplatform.portal.config.stax.PageSetStAXParser;
import org.exoplatform.portal.config.stax.PageStAXParser;
+import org.exoplatform.portal.config.stax.PortalConfigStAXParser;
import org.exoplatform.portal.config.stax.StAXElement;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
@@ -337,6 +338,7 @@
}
}
+ @Deprecated
public void initPortletPreferencesDB(NewPortalConfig config) throws Exception
{
for (String owner : config.getPredefinedOwner())
@@ -353,9 +355,9 @@
try
{
String type = config.getOwnerType();
- PortalConfig pconfig = getConfig(config, owner, type, PortalConfig.class);
+ StaxNavigator<StAXElement> staxNavigator = buildStAXNavigator(config, owner, type);
- if (pconfig == null)
+ if (staxNavigator == null)
{
// Ensure that the PortalConfig has been defined
// The PortalConfig could be empty if the related PortalConfigListener
@@ -371,11 +373,12 @@
return;
}
- // We use that owner value because it may have been fixed for group names
- owner = pconfig.getName();
+ PortalConfig pconfig = new PortalConfigStAXParser(staxNavigator).parseXML();
+ String fixedOwnerName = fixOwnerName(type, owner);
+ pconfig.setType(type);
+ pconfig.setName(fixedOwnerName);
- //
- PortalConfig currentPortalConfig = dataStorage_.getPortalConfig(type, owner);
+ PortalConfig currentPortalConfig = dataStorage_.getPortalConfig(type, fixedOwnerName);
if (currentPortalConfig == null)
{
dataStorage_.create(pconfig);
@@ -406,19 +409,19 @@
}
String ownerType = config.getOwnerType();
+ String fixedOnwerId = fixOwnerName(ownerType, owner);
ArrayList<Page> list = pageSet.getPages();
for (Page page : list)
{
page.setOwnerType(ownerType);
- page.setOwnerId(owner);
+ page.setOwnerId(fixedOnwerId);
dataStorage_.create(page);
}
}
public void createPageNavigation(NewPortalConfig config, String owner) throws Exception
{
- //PageNavigation navigation = getConfig(config, owner, "navigation", PageNavigation.class);
- StaxNavigator<StAXElement> staxNavigator = buildStAXNavigator(config, owner, "navigation.xml");
+ StaxNavigator<StAXElement> staxNavigator = buildStAXNavigator(config, owner, "navigation");
if (staxNavigator == null)
{
return;
@@ -427,12 +430,13 @@
PageNavigation navigation = new PageNavigationStAXParser(staxNavigator).parseXML();
if(navigation.getOwnerType() == null)
{
- navigation.setOwnerType(config.getOwnerType());
+ navigation.setOwnerType(config.getOwnerType());
}
if(navigation.getOwnerId() == null)
{
- navigation.setOwnerId(owner);
+ //Call to fixOwnerName to fix '/' trouble
+ navigation.setOwnerId(fixOwnerName(navigation.getOwnerType(), owner));
}
PageNavigation currentNavigation = dataStorage_.getPageNavigation(navigation.getOwner());
@@ -455,6 +459,7 @@
}
}
+ @Deprecated
public void createPortletPreferences(NewPortalConfig config, String owner) throws Exception
{
PortletPreferencesSet portletSet = getConfig(config, owner, "portlet-preferences", PortletPreferencesSet.class);
@@ -469,6 +474,7 @@
}
}
+
private final Pattern OWNER_PATTERN = Pattern.compile("@owner@");
/**
@@ -549,7 +555,6 @@
{
String ownerType = config.getOwnerType();
-
String pathToConfigFile;
if(owner.charAt(0) == '/')
@@ -563,6 +568,20 @@
String xml = getDefaultConfig(config.getTemplateLocation(), pathToConfigFile);
+ if (xml == null)
+ {
+ boolean isTemplate = (config.getTemplateName() != null && config.getTemplateName().trim().length() > 0);
+ if (isTemplate)
+ {
+ pathToConfigFile = "/" + ownerType + "/template/" + config.getTemplateName() + "/" + fileName + ".xml";
+ xml = getDefaultConfig(config.getTemplateLocation(), pathToConfigFile);
+ if (xml != null)
+ {
+ xml = OWNER_PATTERN.matcher(xml).replaceAll(owner);
+ }
+ }
+ }
+
if(xml == null)
{
return null;
14 years, 4 months
gatein SVN: r6570 - portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-05-26 22:16:32 -0400 (Thu, 26 May 2011)
New Revision: 6570
Modified:
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
Log:
GTNPORTAL-1905: Integrate Stax for PageNavigation object
Modified: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-05-26 20:54:46 UTC (rev 6569)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-05-27 02:16:32 UTC (rev 6570)
@@ -32,6 +32,7 @@
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.Page.PageSet;
+import org.exoplatform.portal.config.stax.PageNavigationStAXParser;
import org.exoplatform.portal.config.stax.PageSetStAXParser;
import org.exoplatform.portal.config.stax.PageStAXParser;
import org.exoplatform.portal.config.stax.StAXElement;
@@ -416,11 +417,24 @@
public void createPageNavigation(NewPortalConfig config, String owner) throws Exception
{
- PageNavigation navigation = getConfig(config, owner, "navigation", PageNavigation.class);
- if (navigation == null)
+ //PageNavigation navigation = getConfig(config, owner, "navigation", PageNavigation.class);
+ StaxNavigator<StAXElement> staxNavigator = buildStAXNavigator(config, owner, "navigation.xml");
+ if (staxNavigator == null)
{
return;
}
+
+ PageNavigation navigation = new PageNavigationStAXParser(staxNavigator).parseXML();
+ if(navigation.getOwnerType() == null)
+ {
+ navigation.setOwnerType(config.getOwnerType());
+ }
+
+ if(navigation.getOwnerId() == null)
+ {
+ navigation.setOwnerId(owner);
+ }
+
PageNavigation currentNavigation = dataStorage_.getPageNavigation(navigation.getOwner());
if (currentNavigation == null)
{
14 years, 4 months
gatein SVN: r6569 - epp/portal/branches/EPP-5-1-tmp/distribution.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-05-26 16:54:46 -0400 (Thu, 26 May 2011)
New Revision: 6569
Modified:
epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml
Log:
move
Modified: epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml 2011-05-26 13:15:55 UTC (rev 6568)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml 2011-05-26 20:54:46 UTC (rev 6569)
@@ -17,6 +17,7 @@
<properties>
<eap.version>5.1.0</eap.version>
<eap.dir>jboss-eap-5.1</eap.dir>
+ <epp.dir>jboss-epp-5.1.1</epp.dir>
</properties>
<modules>
@@ -129,6 +130,21 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <id>ant-final</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <move file="${eap.dir}" toFile="${epp.dir}"/>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
\ No newline at end of file
14 years, 4 months
gatein SVN: r6568 - epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-05-26 09:15:55 -0400 (Thu, 26 May 2011)
New Revision: 6568
Modified:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
Log:
- JBEPP-961: do not attempt to work with the RegistrationPolicy if none has been set.
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2011-05-26 13:15:07 UTC (rev 6567)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2011-05-26 13:15:55 UTC (rev 6568)
@@ -80,15 +80,20 @@
setRegistrationRequired(registrationRequirements.isRegistrationRequired());
setRegistrationRequiredForFullDescription(registrationRequirements.isRegistrationRequiredForFullDescription());
RegistrationPolicy policy = registrationRequirements.getPolicy();
- setPolicyClassName(policy.getClassName());
- RegistrationPolicy unwrap = RegistrationPolicyWrapper.unwrap(policy);
- if (unwrap instanceof DefaultRegistrationPolicy)
+ if(policy != null)
{
- DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)unwrap;
- setValidatorClassName(drp.getValidator().getClass().getName());
+ setPolicyClassName(policy.getClassName());
+
+ RegistrationPolicy unwrap = RegistrationPolicyWrapper.unwrap(policy);
+ if (unwrap instanceof DefaultRegistrationPolicy)
+ {
+ DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)unwrap;
+ setValidatorClassName(drp.getValidator().getClass().getName());
+ }
}
+
// first clear persisted properties
List<RegistrationPropertyDescriptionMapping> rpdms = getRegistrationPropertyDescriptions();
rpdms.clear();
14 years, 4 months
gatein SVN: r6567 - in components/wsrp/trunk: jcr-impl/src/test/java/org/gatein/wsrp and 3 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-05-26 09:15:07 -0400 (Thu, 26 May 2011)
New Revision: 6567
Added:
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/producer/
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/producer/config/
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/producer/config/JCRProducerConfigurationServiceTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/JAXBProducerConfigurationTestCase.java
Modified:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
Log:
- GTNWSRP-232: do not attempt to work with the RegistrationPolicy if it is null!
- Added test cases.
Modified: components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java
===================================================================
--- components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java 2011-05-26 11:45:08 UTC (rev 6566)
+++ components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java 2011-05-26 13:15:07 UTC (rev 6567)
@@ -81,13 +81,16 @@
setRegistrationRequired(registrationRequirements.isRegistrationRequired());
setRegistrationRequiredForFullDescription(registrationRequirements.isRegistrationRequiredForFullDescription());
RegistrationPolicy policy = registrationRequirements.getPolicy();
- setPolicyClassName(policy.getClassName());
+ if (policy != null)
+ {
+ setPolicyClassName(policy.getClassName());
- RegistrationPolicy unwrap = RegistrationPolicyWrapper.unwrap(policy);
- if (unwrap instanceof DefaultRegistrationPolicy)
- {
- DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)unwrap;
- setValidatorClassName(drp.getValidator().getClass().getName());
+ RegistrationPolicy unwrap = RegistrationPolicyWrapper.unwrap(policy);
+ if (unwrap instanceof DefaultRegistrationPolicy)
+ {
+ DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)unwrap;
+ setValidatorClassName(drp.getValidator().getClass().getName());
+ }
}
// first clear persisted properties
Added: components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/producer/config/JCRProducerConfigurationServiceTestCase.java
===================================================================
--- components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/producer/config/JCRProducerConfigurationServiceTestCase.java (rev 0)
+++ components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/producer/config/JCRProducerConfigurationServiceTestCase.java 2011-05-26 13:15:07 UTC (rev 6567)
@@ -0,0 +1,63 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.gatein.wsrp.producer.config;
+
+import org.chromattic.api.ChromatticBuilder;
+import org.gatein.wsrp.jcr.BaseChromatticPersister;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JCRProducerConfigurationServiceTestCase extends ProducerConfigurationTestCase
+{
+ private JCRProducerConfigurationService service;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ String workspaceName = "/wsrp-jcr-test" + Math.round(Math.abs(100000 * Math.random()));
+ BaseChromatticPersister persister = new BaseChromatticPersister(workspaceName)
+ {
+ @Override
+ protected void setBuilderOptions(ChromatticBuilder builder)
+ {
+ builder.setOptionValue(ChromatticBuilder.ROOT_NODE_PATH, workspaceName);
+ builder.setOptionValue(ChromatticBuilder.ROOT_NODE_TYPE, "nt:unstructured");
+ builder.setOptionValue(ChromatticBuilder.CREATE_ROOT_NODE, true);
+ }
+ };
+ persister.initializeBuilderFor(JCRProducerConfigurationService.mappingClasses);
+ service = new JCRProducerConfigurationService(persister);
+ }
+
+ @Override
+ protected ProducerConfiguration getProducerConfiguration(URL location) throws Exception
+ {
+ service.setDefaultConfigurationIS(location.openStream());
+ service.loadConfiguration();
+ return service.getConfiguration();
+ }
+}
Added: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/JAXBProducerConfigurationTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/JAXBProducerConfigurationTestCase.java (rev 0)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/JAXBProducerConfigurationTestCase.java 2011-05-26 13:15:07 UTC (rev 6567)
@@ -0,0 +1,57 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.gatein.wsrp.producer.config;
+
+import org.gatein.wsrp.producer.config.impl.xml.ProducerConfigurationFactory;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JAXBProducerConfigurationTestCase extends ProducerConfigurationTestCase
+{
+ private Unmarshaller unmarshaller;
+ private ObjectModelFactory factory;
+
+ protected void setUp() throws Exception
+ {
+ unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ factory = new ProducerConfigurationFactory();
+ unmarshaller.setEntityResolver(new TestEntityResolver());
+ }
+
+ protected ProducerConfiguration getProducerConfiguration(URL location) throws JBossXBException, IOException
+ {
+ Object o = unmarshaller.unmarshal(location.openStream(), factory, null);
+ assertNotNull(o);
+ assertTrue(o instanceof ProducerConfiguration);
+ return (ProducerConfiguration)o;
+ }
+}
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2011-05-26 11:45:08 UTC (rev 6566)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2011-05-26 13:15:07 UTC (rev 6567)
@@ -31,15 +31,10 @@
import org.gatein.registration.policies.RegistrationPropertyValidator;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.producer.config.impl.ProducerConfigurationImpl;
-import org.gatein.wsrp.producer.config.impl.xml.ProducerConfigurationFactory;
import org.gatein.wsrp.producer.config.impl.xml.ProducerConfigurationProvider;
import org.gatein.wsrp.registration.LocalizedString;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.ObjectModelProvider;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.XercesXsMarshaller;
import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
import org.xml.sax.SAXException;
@@ -64,10 +59,8 @@
* @version $Revision: 10408 $
* @since 2.6
*/
-public class ProducerConfigurationTestCase extends TestCase
+public abstract class ProducerConfigurationTestCase extends TestCase
{
- private Unmarshaller unmarshaller;
- private ObjectModelFactory factory;
private static DefaultSchemaResolver RESOLVER;
@@ -79,13 +72,6 @@
RESOLVER.addSchemaLocation("http://www.gatein.org/xml/ns/gatein_wsrp_producer_1_0", "xsd/gatein_wsrp_producer_1_0.xsd");
}
- protected void setUp() throws Exception
- {
- unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- factory = new ProducerConfigurationFactory();
- unmarshaller.setEntityResolver(new org.gatein.wsrp.producer.config.TestEntityResolver());
- }
-
public void testCustomPolicyUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration = getProducerConfiguration("custom-policy.xml");
@@ -203,13 +189,13 @@
}
}
- public void testUseStrictMode() throws IOException, JBossXBException
+ public void testUseStrictMode() throws Exception
{
ProducerConfiguration producerConfiguration = getProducerConfiguration("strict-mode.xml");
assertFalse(producerConfiguration.isUsingStrictMode());
}
- public void testChangeListeners() throws IOException, JBossXBException
+ public void testChangeListeners() throws Exception
{
ProducerConfiguration producerConfiguration = getProducerConfiguration("minimal.xml");
assertTrue(producerConfiguration.isUsingStrictMode());
@@ -227,7 +213,7 @@
assertTrue(listener.called);
}
- public void testSaveAndReload() throws IOException, ParserConfigurationException, SAXException, JBossXBException
+ public void testSaveAndReload() throws Exception
{
ProducerConfiguration configuration = new ProducerConfigurationImpl();
configuration.setUsingStrictMode(false);
@@ -255,7 +241,7 @@
writeConfigToFile(configuration, tmp);
- configuration = getProducerConfiguration(tmp.toURL());
+ configuration = getProducerConfiguration(tmp.toURI().toURL());
assertFalse(configuration.isUsingStrictMode());
@@ -315,7 +301,7 @@
configFile.close();
}
- private ProducerConfiguration getProducerConfiguration(String fileName) throws JBossXBException, IOException
+ protected ProducerConfiguration getProducerConfiguration(String fileName) throws Exception
{
URL location = Thread.currentThread().getContextClassLoader().getResource(fileName);
assertNotNull(location);
@@ -324,13 +310,7 @@
return getProducerConfiguration(location);
}
- private ProducerConfiguration getProducerConfiguration(URL location) throws JBossXBException, IOException
- {
- Object o = unmarshaller.unmarshal(location.openStream(), factory, null);
- assertNotNull(o);
- assertTrue(o instanceof ProducerConfiguration);
- return (ProducerConfiguration)o;
- }
+ protected abstract ProducerConfiguration getProducerConfiguration(URL location) throws Exception;
private void checkRegistrationProperty(ProducerRegistrationRequirements requirements, int index)
{
14 years, 4 months
gatein SVN: r6566 - in portal/branches/stax-integration/component/portal/src: test/java/org/exoplatform/portal/stax and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-05-26 07:45:08 -0400 (Thu, 26 May 2011)
New Revision: 6566
Added:
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNavigationStAXParser.java
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNodeStAXParser.java
portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNavigation.java
portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNode.java
portal/branches/stax-integration/component/portal/src/test/resources/stax/navigation.xml
portal/branches/stax-integration/component/portal/src/test/resources/stax/node.xml
Modified:
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/AbstractStAXParserFactory.java
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/StAXElement.java
Log:
GTNPORTAL-1905: Add parser for PageNode, PageNavigation and relevant JUnit tests
Modified: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/AbstractStAXParserFactory.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/AbstractStAXParserFactory.java 2011-05-26 09:55:07 UTC (rev 6565)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/AbstractStAXParserFactory.java 2011-05-26 11:45:08 UTC (rev 6566)
@@ -45,6 +45,11 @@
return (AbstractStAXParser<T>) new GadgetWindowStAXParer(elementNavigator);
case container:
return (AbstractStAXParser<T>) new ContainerStAXParser(elementNavigator);
+ case node:
+ return (AbstractStAXParser<T>) new PageNodeStAXParser(elementNavigator);
+ case node_navigation:
+ return (AbstractStAXParser<T>) new PageNavigationStAXParser(elementNavigator);
+
default:
throw new IllegalArgumentException("StAXElement " + element + " is not associated with any subclass of ModelObject");
}
Added: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNavigationStAXParser.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNavigationStAXParser.java (rev 0)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNavigationStAXParser.java 2011-05-26 11:45:08 UTC (rev 6566)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2011 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.portal.config.stax;
+
+import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+import org.staxnav.StaxNavException;
+import org.staxnav.StaxNavigator;
+
+/**
+ * @author <a href="hoang281283(a)gmail.com">Minh Hoang TO</a>
+ * @date 5/24/11
+ */
+public class PageNavigationStAXParser extends AbstractStAXParser<PageNavigation>
+{
+
+ public PageNavigationStAXParser(StaxNavigator<StAXElement> elementNavigator) throws IllegalArgumentException
+ {
+ super(elementNavigator);
+ }
+
+ @Override
+ public PageNavigation parseXML() throws StaxNavException
+ {
+ PageNavigation pageNavigation = new PageNavigation();
+ pageNavigation.setOwnerType(getContent(elementNavigator, StAXElement.owner_type));
+ pageNavigation.setOwnerId(getContent(elementNavigator, StAXElement.owner_id));
+
+ String priority = getContent(elementNavigator, StAXElement.priority);
+ if (priority != null)
+ {
+ pageNavigation.setPriority(Integer.parseInt(priority));
+ }
+
+ elementNavigator.next(StAXElement.page_nodes);
+ elementNavigator.next(StAXElement.node);
+
+ StAXElement tempElement = elementNavigator.getName();
+
+ while (tempElement == StAXElement.node)
+ {
+ AbstractStAXParser<ModelObject> pageNodeParser = AbstractStAXParserFactory.getParser(StAXElement.node, elementNavigator.fork());
+ PageNode childNode = (PageNode)pageNodeParser.parseXML();
+ pageNavigation.addNode(childNode);
+
+ tempElement = elementNavigator.getName();
+ }
+
+ return pageNavigation;
+ }
+
+ @Override
+ public boolean isOptional(StAXElement staxElement)
+ {
+ return true;
+ }
+}
Added: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNodeStAXParser.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNodeStAXParser.java (rev 0)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageNodeStAXParser.java 2011-05-26 11:45:08 UTC (rev 6566)
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2011 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.portal.config.stax;
+
+import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.mop.Visibility;
+import org.staxnav.StaxNavException;
+import org.staxnav.StaxNavigator;
+import java.util.Date;
+
+/**
+ * @author <a href="hoang281283(a)gmail.com">Minh Hoang TO</a>
+ * @date 5/24/11
+ */
+public class PageNodeStAXParser extends AbstractStAXParser<PageNode>
+{
+ public PageNodeStAXParser(StaxNavigator<StAXElement> elementNavigator) throws IllegalArgumentException
+ {
+ super(elementNavigator);
+ }
+
+ @Override
+ public PageNode parseXML() throws StaxNavException
+ {
+ PageNode pageNode = new PageNode();
+
+ pageNode.setUri(getContent(elementNavigator, StAXElement.uri));
+ pageNode.setName(getContent(elementNavigator, StAXElement.name));
+ pageNode.setLabel(getContent(elementNavigator, StAXElement.label));
+ pageNode.setIcon(getContent(elementNavigator, StAXElement.icon));
+
+ elementNavigator.next(StAXElement.start_publication_date);
+ elementNavigator.next(StAXElement.end_publication_date);
+
+ String visibilityContent = getContent(elementNavigator, StAXElement.visibility);
+ Visibility visibility;
+ if(visibilityContent == null)
+ {
+ visibility = Visibility.DISPLAYED;
+ }
+ else
+ {
+ visibility = Visibility.valueOf(visibilityContent);
+ }
+
+ pageNode.setVisibility(visibility);
+
+ pageNode.setPageReference(getContent(elementNavigator, StAXElement.page_reference));
+
+ elementNavigator.next(StAXElement.node);
+
+ StAXElement tempElement = elementNavigator.getName();
+ while(tempElement == StAXElement.node)
+ {
+ AbstractStAXParser<ModelObject> pageNodeParser = AbstractStAXParserFactory.getParser(StAXElement.node, elementNavigator.fork());
+ PageNode childNode = (PageNode)pageNodeParser.parseXML();
+ pageNode.getChildren().add(childNode);
+
+ tempElement = elementNavigator.getName();
+ }
+
+ return pageNode;
+ }
+
+ @Override
+ public boolean isOptional(StAXElement staxElement)
+ {
+ switch (staxElement)
+ {
+ case label:
+ case icon:
+ case start_publication_date:
+ case end_publication_date:
+ case visibility:
+ case page_reference:
+ return true;
+ default:
+ return false;
+ }
+ }
+}
Modified: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/StAXElement.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/StAXElement.java 2011-05-26 09:55:07 UTC (rev 6565)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/StAXElement.java 2011-05-26 11:45:08 UTC (rev 6566)
@@ -94,6 +94,30 @@
entry,
+ node_navigation,
+
+ owner_type,
+
+ owner_id,
+
+ priority,
+
+ page_nodes,
+
+ node,
+
+ uri,
+
+ label,
+
+ start_publication_date,
+
+ end_publication_date,
+
+ visibility,
+
+ page_reference,
+
NO_SUCH_ELEMENT
}
Added: portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNavigation.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNavigation.java (rev 0)
+++ portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNavigation.java 2011-05-26 11:45:08 UTC (rev 6566)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2011 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.portal.stax;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.stax.PageNavigationStAXParser;
+import org.exoplatform.portal.config.stax.StAXElement;
+import org.exoplatform.portal.mop.Visibility;
+import org.staxnav.StaxNavigator;
+import java.util.List;
+
+/**
+ * @author <a href="hoang281283(a)gmail.com">Minh Hoang TO</a>
+ * @date 5/26/11
+ */
+public class TestParsingPageNavigation extends AbstractStaxTestCase
+{
+
+ private StaxNavigator<StAXElement> elementNavigator;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ elementNavigator = createNavigator("/stax/navigation.xml");
+ }
+
+ public void testPageNavigation()
+ {
+ PageNavigationStAXParser parser = new PageNavigationStAXParser(elementNavigator);
+
+ PageNavigation navigation = parser.parseXML();
+
+ assertEquals("portal", navigation.getOwnerType());
+ assertEquals("classic", navigation.getOwnerId());
+
+ assertEquals(1, navigation.getPriority());
+
+ List<PageNode> nodes = navigation.getNodes();
+
+ PageNode pageNode = nodes.get(0);
+
+ assertEquals("home", pageNode.getUri());
+ assertEquals("home", pageNode.getName());
+ assertEquals("#{portal.classic.home}", pageNode.getLabel());
+ assertEquals(Visibility.DISPLAYED, pageNode.getVisibility());
+ assertEquals("portal::classic::homepage", pageNode.getPageReference());
+
+ pageNode = nodes.get(1);
+
+ assertEquals("sitemap", pageNode.getUri());
+ assertEquals("sitemap", pageNode.getName());
+ assertEquals("#{portal.classic.sitemap}", pageNode.getLabel());
+ assertEquals(Visibility.HIDDEN, pageNode.getVisibility());
+ assertEquals("portal::classic::sitemap", pageNode.getPageReference());
+
+ pageNode = nodes.get(2);
+
+ assertEquals("notfound", pageNode.getUri());
+ assertEquals("notfound", pageNode.getName());
+ assertEquals("NotFound", pageNode.getLabel());
+ assertEquals(Visibility.SYSTEM, pageNode.getVisibility());
+ assertNull(pageNode.getPageReference());
+ }
+}
Added: portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNode.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNode.java (rev 0)
+++ portal/branches/stax-integration/component/portal/src/test/java/org/exoplatform/portal/stax/TestParsingPageNode.java 2011-05-26 11:45:08 UTC (rev 6566)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2011 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.portal.stax;
+
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.stax.PageNodeStAXParser;
+import org.exoplatform.portal.config.stax.StAXElement;
+import org.exoplatform.portal.mop.Visibility;
+import org.staxnav.StaxNavigator;
+
+/**
+ * @author <a href="hoang281283(a)gmail.com">Minh Hoang TO</a>
+ * @date 5/25/11
+ */
+public class TestParsingPageNode extends AbstractStaxTestCase
+{
+
+ private StaxNavigator<StAXElement> elementNavigator;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ elementNavigator = createNavigator("/stax/node.xml");
+ }
+
+ public void testPageNode()
+ {
+ PageNodeStAXParser parser = new PageNodeStAXParser(elementNavigator);
+
+ PageNode pageNode = parser.parseXML();
+
+ assertNotNull(pageNode);
+ assertEquals("sitemap", pageNode.getUri());
+ assertEquals("sitemap", pageNode.getName());
+ assertEquals("#{portal.classic.sitemap}", pageNode.getLabel());
+ assertEquals(Visibility.HIDDEN, pageNode.getVisibility());
+ assertEquals("portal::classic::sitemap", pageNode.getPageReference());
+ }
+}
Added: portal/branches/stax-integration/component/portal/src/test/resources/stax/navigation.xml
===================================================================
--- portal/branches/stax-integration/component/portal/src/test/resources/stax/navigation.xml (rev 0)
+++ portal/branches/stax-integration/component/portal/src/test/resources/stax/navigation.xml 2011-05-26 11:45:08 UTC (rev 6566)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_1 http://www.gatein.org/xml/ns/gatein_objects_1_1"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_1">
+
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>portal::classic::homepage</page-reference>
+ </node>
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{portal.classic.sitemap}</label>
+ <visibility>HIDDEN</visibility>
+ <page-reference>portal::classic::sitemap</page-reference>
+ </node>
+
+ <!-- NOT FOUND node -->
+ <node>
+ <uri>notfound</uri>
+ <name>notfound</name>
+ <label>NotFound</label>
+ <visibility>SYSTEM</visibility>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/branches/stax-integration/component/portal/src/test/resources/stax/node.xml
===================================================================
--- portal/branches/stax-integration/component/portal/src/test/resources/stax/node.xml (rev 0)
+++ portal/branches/stax-integration/component/portal/src/test/resources/stax/node.xml 2011-05-26 11:45:08 UTC (rev 6566)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{portal.classic.sitemap}</label>
+ <visibility>HIDDEN</visibility>
+ <page-reference>portal::classic::sitemap</page-reference>
+</node>
14 years, 4 months
gatein SVN: r6565 - in portal/branches/stax-integration: component/portal and 3 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-05-26 05:55:07 -0400 (Thu, 26 May 2011)
New Revision: 6565
Modified:
portal/branches/stax-integration/component/portal/pom.xml
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageSetStAXParser.java
portal/branches/stax-integration/packaging/tomcat/pkg/pom.xml
portal/branches/stax-integration/pom.xml
Log:
GTNPORTAL-1905: Init page using Stax
Modified: portal/branches/stax-integration/component/portal/pom.xml
===================================================================
--- portal/branches/stax-integration/component/portal/pom.xml 2011-05-26 03:27:48 UTC (rev 6564)
+++ portal/branches/stax-integration/component/portal/pom.xml 2011-05-26 09:55:07 UTC (rev 6565)
@@ -116,7 +116,6 @@
<dependency>
<groupId>org.staxnav</groupId>
<artifactId>staxnav.core</artifactId>
- <version>0.9.1-SNAPSHOT</version>
</dependency>
</dependencies>
Modified: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-05-26 03:27:48 UTC (rev 6564)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-05-26 09:55:07 UTC (rev 6565)
@@ -32,19 +32,28 @@
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.Page.PageSet;
+import org.exoplatform.portal.config.stax.PageSetStAXParser;
+import org.exoplatform.portal.config.stax.PageStAXParser;
+import org.exoplatform.portal.config.stax.StAXElement;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
import org.jibx.runtime.*;
import org.jibx.runtime.impl.UnmarshallingContext;
+import org.staxnav.Naming;
+import org.staxnav.StaxNavigator;
+import org.staxnav.StaxNavigatorImpl;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.StringReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
/**
* Created by The eXo Platform SARL Author : Tuan Nguyen
@@ -383,14 +392,24 @@
public void createPage(NewPortalConfig config, String owner) throws Exception
{
- PageSet pageSet = getConfig(config, owner, "pages", PageSet.class);
+ StaxNavigator<StAXElement> staxNavigator = buildStAXNavigator(config, owner, "pages");
+ if(staxNavigator == null)
+ {
+ return;
+ }
+
+ PageSet pageSet = new PageSetStAXParser(staxNavigator).parseXML();
if (pageSet == null)
{
return;
}
+
+ String ownerType = config.getOwnerType();
ArrayList<Page> list = pageSet.getPages();
for (Page page : list)
{
+ page.setOwnerType(ownerType);
+ page.setOwnerId(owner);
dataStorage_.create(page);
}
}
@@ -503,6 +522,46 @@
return null;
}
+ /**
+ * Build a StaxNavigator object from configuration file
+ *
+ * @param config
+ * @param owner
+ * @param fileName
+ * @return
+ * @throws Exception
+ */
+ private StaxNavigator<StAXElement> buildStAXNavigator(NewPortalConfig config, String owner, String fileName) throws Exception
+ {
+
+ String ownerType = config.getOwnerType();
+
+ String pathToConfigFile;
+
+ if(owner.charAt(0) == '/')
+ {
+ pathToConfigFile = "/" + ownerType + owner + "/" + fileName + ".xml";
+ }
+ else
+ {
+ pathToConfigFile = "/" + ownerType + "/" + owner + "/" + fileName + ".xml";
+ }
+
+ String xml = getDefaultConfig(config.getTemplateLocation(), pathToConfigFile);
+
+ if(xml == null)
+ {
+ return null;
+ }
+ else
+ {
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ XMLStreamReader streamReader = inputFactory.createXMLStreamReader(new StringReader(xml));
+
+ return new StaxNavigatorImpl<StAXElement>(new Naming.Enumerated.Simple<StAXElement>(StAXElement.class, StAXElement.NO_SUCH_ELEMENT), streamReader);
+ }
+ }
+
private String getDefaultConfig(String location, String path) throws Exception
{
String s = location + path;
Modified: portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageSetStAXParser.java
===================================================================
--- portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageSetStAXParser.java 2011-05-26 03:27:48 UTC (rev 6564)
+++ portal/branches/stax-integration/component/portal/src/main/java/org/exoplatform/portal/config/stax/PageSetStAXParser.java 2011-05-26 09:55:07 UTC (rev 6565)
@@ -45,10 +45,16 @@
Page.PageSet pageSet = new Page.PageSet();
- for(StaxNavigator<StAXElement> pageElementNavigator : elementNavigator.fork(StAXElement.page))
+ elementNavigator.next(StAXElement.page);
+
+ StAXElement tempElement = elementNavigator.getName();
+ while(tempElement == StAXElement.page)
{
- PageStAXParser pageStAXParser = new PageStAXParser(pageElementNavigator);
+ //Call to fork() make the elementNavigator navigate to sibling of current entry
+ PageStAXParser pageStAXParser = new PageStAXParser(elementNavigator.fork());
pageSet.getPages().add(pageStAXParser.parseXML());
+
+ tempElement = elementNavigator.getName();
}
return pageSet;
Modified: portal/branches/stax-integration/packaging/tomcat/pkg/pom.xml
===================================================================
--- portal/branches/stax-integration/packaging/tomcat/pkg/pom.xml 2011-05-26 03:27:48 UTC (rev 6564)
+++ portal/branches/stax-integration/packaging/tomcat/pkg/pom.xml 2011-05-26 09:55:07 UTC (rev 6565)
@@ -350,6 +350,12 @@
<artifactId>mop-spi</artifactId>
</dependency>
+ <!-- Staxnav -->
+ <dependency>
+ <groupId>org.staxnav</groupId>
+ <artifactId>staxnav.core</artifactId>
+ </dependency>
+
<!-- GateIn Captcha -->
<dependency>
<groupId>org.gatein.captcha</groupId>
Modified: portal/branches/stax-integration/pom.xml
===================================================================
--- portal/branches/stax-integration/pom.xml 2011-05-26 03:27:48 UTC (rev 6564)
+++ portal/branches/stax-integration/pom.xml 2011-05-26 09:55:07 UTC (rev 6565)
@@ -52,6 +52,7 @@
<org.gatein.mop.version>1.1.0-Beta01</org.gatein.mop.version>
<version.chromattic>1.1.0-beta2</version.chromattic>
<version.reflext>1.1.0-beta12</version.reflext>
+ <org.staxnav.version>0.9.1-SNAPSHOT</org.staxnav.version>
<jcip.version>1.0</jcip.version>
<!-- ************** -->
@@ -638,6 +639,13 @@
<version>${version.chromattic}</version>
</dependency>
+ <!-- Staxnav -->
+ <dependency>
+ <groupId>org.staxnav</groupId>
+ <artifactId>staxnav.core</artifactId>
+ <version>${org.staxnav.version}</version>
+ </dependency>
+
<!-- Picketlink -->
<dependency>
<groupId>org.picketlink.idm</groupId>
14 years, 4 months
gatein SVN: r6564 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-05-25 23:27:48 -0400 (Wed, 25 May 2011)
New Revision: 6564
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
Log:
GTNPORTAL-1903: Possible NPE in org.exoplatform.portal.webui.util.Util.getPortalRequestContext()
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-05-25 23:18:25 UTC (rev 6563)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-05-26 03:27:48 UTC (rev 6564)
@@ -48,6 +48,10 @@
static public PortalRequestContext getPortalRequestContext()
{
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ if(context == null)
+ {
+ return null;
+ }
if (!(context instanceof PortalRequestContext))
{
context = (WebuiRequestContext)context.getParentAppRequestContext();
14 years, 4 months
gatein SVN: r6563 - in epp/portal/branches/EPP-5-1-tmp/distribution: portletbridge and 7 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-05-25 19:18:25 -0400 (Wed, 25 May 2011)
New Revision: 6563
Added:
epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/
epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/pom.xml
epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/src/
epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/src/assemble.xml
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/pom.xml
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/assemble.xml
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-ds.xml
epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-sample-portal-ds.xml
Modified:
epp/portal/branches/EPP-5-1-tmp/distribution/
epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml
epp/portal/branches/EPP-5-1-tmp/distribution/src/assemble.xml
Log:
Distribution Modules
Property changes on: epp/portal/branches/EPP-5-1-tmp/distribution
___________________________________________________________________
Added: svn:ignore
+ target
Modified: epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml 2011-05-25 14:13:43 UTC (rev 6562)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/pom.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -11,13 +11,12 @@
</parent>
<artifactId>distribution</artifactId>
-
<packaging>pom</packaging>
-
<name>Distribution</name>
<properties>
<eap.version>5.1.0</eap.version>
+ <eap.dir>jboss-eap-5.1</eap.dir>
</properties>
<modules>
@@ -56,7 +55,16 @@
<artifactId>exo.portal.portlet.dashboard</artifactId>
<version>5.1.1-epp-CR01-SNAPSHOT</version>
<type>war</type>
- </dependency>
+ </dependency>
+<dependency>
+ <groupId>org.exoplatform.portal.distribution</groupId>
+ <artifactId>portletbridge</artifactId>
+ <version>5.1.1-epp-CR01-SNAPSHOT</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+</dependency>
+
+ <!-- EAP overlay -->
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-eap</artifactId>
@@ -68,7 +76,7 @@
<build>
<plugins>
- <plugin>
+<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
@@ -83,7 +91,6 @@
<executions>
<execution>
<id>unpack-zips</id>
-<!-- <phase>generate-resources</phase>-->
<phase>package</phase>
<goals>
<goal>unpack</goal>
@@ -101,7 +108,7 @@
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>-->
Added: epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/pom.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/pom.xml (rev 0)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/pom.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -0,0 +1,96 @@
+
+<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.exoplatform.portal</groupId>
+ <artifactId>distribution</artifactId>
+ <version>5.1.1-epp-CR01-SNAPSHOT</version>
+
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.parent</artifactId>
+ <version>5.1.1-epp-CR01-SNAPSHOT</version>
+ </parent>-->
+ <artifactId>portletbridge</artifactId>
+ <packaging>pom</packaging>
+ <name>Distribution portletbridge</name>
+
+ <groupId>org.exoplatform.portal.distribution</groupId>
+ <version>5.1.1-epp-CR01-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.portletbridge</groupId>
+ <artifactId>portletbridge-impl</artifactId>
+ <version>2.1.0.GA.EPP51</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portletbridge</groupId>
+ <artifactId>portletbridge-api</artifactId>
+ <version>2.1.0.GA.EPP51</version>
+ <type>jar</type>
+ </dependency>
+
+ <!-- Examples -->
+
+<!--
+{"http://download.devel.redhat.com/brewroot/repos/jboss-epp-5-build/307402/...
+org/jboss/portletbridge/examples/seam/booking/seamBooking-ear/2.1.0.GA.EPP51/"
+:"seamBooking-ear-2.1.0.GA.EPP51.ear"},
+
+{"http://download.devel.redhat.com/brewroot/repos/jboss-epp-5-build/307402/...
+org/jboss/portal/examples/JSFRIPortlet/2.1.0.GA.EPP51/"
+: "JSFRIPortlet-2.1.0.GA.EPP51.war"},
+
+{"http://download.devel.redhat.com/brewroot/repos/jboss-epp-5-build/307402/...
+org/jboss/portal/examples/richFacesPortlet/2.1.0.GA.EPP51/"
+:"richFacesPortlet-2.1.0.GA.EPP51.war"}
+-->
+
+ <dependency>
+ <groupId>org.jboss.portletbridge.examples.seam.booking</groupId>
+ <artifactId>seamBooking-ear</artifactId>
+ <version>2.1.0.GA.EPP51</version>
+ <type>ear</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.examples</groupId>
+ <artifactId>JSFRIPortlet</artifactId>
+ <version>2.1.0.GA.EPP51</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.examples</groupId>
+ <artifactId>richFacesPortlet</artifactId>
+ <version>2.1.0.GA.EPP51</version>
+ <type>war</type>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>distro-portalbridge-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assemble.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
Copied: epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/src/assemble.xml (from rev 6544, epp/portal/branches/EPP-5-1-tmp/distribution/src/assemble.xml)
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/src/assemble.xml (rev 0)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/portletbridge/src/assemble.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -0,0 +1,29 @@
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>*:jar</include>
+ </includes>
+ <outputDirectory></outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ </dependencySet>
+ <dependencySet>
+ <includes>
+ <include>*:ear</include>
+ <include>*:war</include>
+ </includes>
+ <outputDirectory>examples/</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping>
+ </dependencySet>
+ </dependencySets>
+</assembly>
\ No newline at end of file
Added: epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/pom.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/pom.xml (rev 0)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/pom.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -0,0 +1,45 @@
+
+<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.exoplatform.portal</groupId>
+ <artifactId>distribution</artifactId>
+ <version>5.1.1-epp-CR01-SNAPSHOT</version>
+
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.parent</artifactId>
+ <version>5.1.1-epp-CR01-SNAPSHOT</version>
+ </parent>-->
+ <artifactId>serverAddon</artifactId>
+ <packaging>pom</packaging>
+ <name>Distribution portletbridge</name>
+
+ <groupId>org.exoplatform.portal.deploy</groupId>
+ <version>5.1.1-epp-CR01-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>distro-portalbridge-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assemble.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
Added: epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/assemble.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/assemble.xml (rev 0)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/assemble.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -0,0 +1,18 @@
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/resources/</directory>
+ <outputDirectory>.</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
Added: epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-ds.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-ds.xml (rev 0)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-ds.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<datasources>
+ <no-tx-datasource>
+ <jndi-name>gatein-idm</jndi-name>
+ <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}gatein${/}hypersonic${/}gatein-idm-localDB</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+ </no-tx-datasource>
+
+ <no-tx-datasource>
+ <jndi-name>gatein-jcr</jndi-name>
+ <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}gatein${/}hypersonic${/}gatein-jcr-localDB</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+ </no-tx-datasource>
+</datasources>
Added: epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-sample-portal-ds.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-sample-portal-ds.xml (rev 0)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/serverAddon/src/main/resources/deploy/gatein-sample-portal-ds.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<datasources>
+ <no-tx-datasource>
+ <jndi-name>gatein-jcr_sample-portal</jndi-name>
+ <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}sample-portal-localDB</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+ </no-tx-datasource>
+
+ <no-tx-datasource>
+ <jndi-name>gatein-idm_sample-portal</jndi-name>
+ <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}sample-portal-idm-localDB</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+ </no-tx-datasource>
+
+</datasources>
Modified: epp/portal/branches/EPP-5-1-tmp/distribution/src/assemble.xml
===================================================================
--- epp/portal/branches/EPP-5-1-tmp/distribution/src/assemble.xml 2011-05-25 14:13:43 UTC (rev 6562)
+++ epp/portal/branches/EPP-5-1-tmp/distribution/src/assemble.xml 2011-05-25 23:18:25 UTC (rev 6563)
@@ -14,12 +14,22 @@
<destName>xml/aaa.xml</destName>
</file>
</files>-->
+ <files>
+ <file>
+ <source>../component/common/src/main/java/conf/configuration-jboss.properties</source>
+ <outputDirectory>${eap.dir}/jboss-as/server/default/conf/gatein</outputDirectory>
+ </file>
+ <file>
+ <source>../component/common/src/main/java/conf/configuration.xml</source>
+ <outputDirectory>${eap.dir}/jboss-as/server/default/conf/gatein</outputDirectory>
+ </file>
+ </files>
<dependencySets>
<dependencySet>
<includes>
<include>*:exo.portal.packaging.jboss-as.ear:ear</include>
</includes>
- <outputDirectory>jboss-as/server/default/deploy/gatein.ear</outputDirectory>
+ <outputDirectory>${eap.dir}/jboss-as/server/default/deploy/gatein.ear</outputDirectory>
<outputFileNameMapping>gatein.ear</outputFileNameMapping>
<unpack>true</unpack>
</dependencySet>
@@ -30,40 +40,54 @@
<excludes>
<exclude>*:exo.portal.packaging.jboss-as.ear:ear</exclude>
</excludes>
- <outputDirectory>jboss-as/server/default/deploy</outputDirectory>
+ <outputDirectory>${eap.dir}/jboss-as/server/default/deploy</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
</dependencySet>
<dependencySet>
<includes>
<include>*:jar</include>
</includes>
- <outputDirectory>jboss-as/server/default/deploy</outputDirectory>
+ <outputDirectory>${eap.dir}/jboss-as/server/default/deploy</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
</dependencySet>
-<!-- <dependencySet>
+ <dependencySet>
<includes>
+ <include>*.distribution:*:zip</include>
+ </includes>
+ <outputDirectory>${eap.dir}/${artifact.artifactId}</outputDirectory>
+ <unpack>true</unpack>
+ </dependencySet>
+
+ <dependencySet>
+ <includes>
<include>*:zip</include>
</includes>
<outputDirectory></outputDirectory>
<unpack>true</unpack>
- </dependencySet>-->
+ </dependencySet>
+
</dependencySets>
- <files>
- <file>
- <source>../component/common/src/main/java/conf/configuration-jboss.properties</source>
- <outputDirectory>jboss-as/server/default/conf/gatein</outputDirectory>
- </file>
- <file>
- <source>../component/common/src/main/java/conf/configuration.xml</source>
- <outputDirectory>jboss-as/server/default/conf/gatein</outputDirectory>
- </file>
- </files>
- <fileSets>
+
+
+ <!-- EAP overlay -->
+
+
+<!-- <fileSets>
<fileSet>
- <directory>${project.build.directory}/work/jboss-eap-5.1</directory>
+ <directory>${project.build.directory}/work/${eap.dir}</directory>
<outputDirectory></outputDirectory>
</fileSet>
+ <fileSet>
+ <file>${project.build.directory}/work/${eap.dir}/jboss-as/server/all/lib/jcip-annotations.jar</file>
+ <outputDirectory>/jboss-as/server/default/lib/</outputDirectory>
+ </fileSet>
</fileSets>
+ -->
+<!-- // the workaround JBEPP-167, is valid until JBAS-6437 is fixed
+ Log.info "Applying the workaround JBEPP-167"
+ new AntBuilder().copy(file:config.epp5.working.path + "/" + config.epp5.directory + "/jboss-as/server/all/lib/jcip-annotations.jar",
+ tofile:config.epp5.working.path + "/" + config.epp5.directory + "/jboss-as/server/default/lib/jcip-annotations.jar")-->
+
<!-- <moduleSets>
<moduleSet>
14 years, 4 months
gatein SVN: r6562 - epp/portal/branches/EPP_5_1_RH_Branch/component/web/server/src/main/java/org/exoplatform/upload.
by do-not-reply@jboss.org
Author: theute
Date: 2011-05-25 10:13:43 -0400 (Wed, 25 May 2011)
New Revision: 6562
Modified:
epp/portal/branches/EPP_5_1_RH_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
Log:
JBEPP-957: Upload file limit not calculated correctly
Modified: epp/portal/branches/EPP_5_1_RH_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
===================================================================
--- epp/portal/branches/EPP_5_1_RH_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2011-05-25 13:22:33 UTC (rev 6561)
+++ epp/portal/branches/EPP_5_1_RH_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2011-05-25 14:13:43 UTC (rev 6562)
@@ -259,7 +259,7 @@
limitMB = uploadLimitsMB_.get(upResource.getUploadId()).intValue();
}
- int estimatedSizeMB = (int)((contentLength / 1024) / 1024);
+ double estimatedSizeMB = (contentLength / 1024) / 1024;
if (limitMB > 0 && estimatedSizeMB > limitMB)
{ // a limit set to 0 means unlimited
if (log.isDebugEnabled())
14 years, 4 months