JBoss Tools SVN: r20944 - in branches/hibernatetools-multiversion/hibernatetools: plugins/org.hibernate.eclipse/src/org/hibernate/console and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-19 14:06:20 -0400 (Fri, 19 Mar 2010)
New Revision: 20944
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/util/CollectionPropertySource.java
Removed:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionPropertySource.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigStubFactory.java
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath 2010-03-19 18:06:20 UTC (rev 20944)
@@ -28,7 +28,7 @@
<classpathentry exported="true" kind="lib" path="lib/hibernate/hibernate-jmx.jar" sourcepath="D:/Temp/_hibernate/hibernate-jmx-3.3.2.GA-sources.jar "/>
<classpathentry exported="true" kind="lib" path="lib/hibernate/commons-collections-3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/hibernate/slf4j-api-1.5.8.jar" sourcepath="D:/Temp/_hibernate/slf4j-api-1.5.8-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/cglib-2.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate/cglib-2.2.jar" sourcepath="D:/Temp/_hibernate/cglib-src-2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/annotations/hibernate-commons-annotations.jar" sourcepath="D:/Temp/_hibernate/hibernate-commons-annotations-3.1.0.GA-sources.jar "/>
<classpathentry exported="true" kind="lib" path="lib/annotations/ejb3-persistence.jar"/>
<classpathentry exported="true" kind="lib" path="lib/hibernate/c3p0-0.9.1.jar"/>
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -22,60 +22,33 @@
package org.hibernate.console;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.sql.Connection;
-import java.sql.Driver;
-import java.sql.DriverManager;
-import java.sql.SQLException;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
-import org.dom4j.DocumentException;
-import org.dom4j.Node;
-import org.dom4j.io.DOMWriter;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.osgi.util.NLS;
import org.hibernate.HibernateException;
-import org.hibernate.MappingException;
import org.hibernate.cfg.Environment;
-import org.hibernate.cfg.NamingStrategy;
import org.hibernate.cfg.Settings;
import org.hibernate.console.execution.DefaultExecutionContext;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.execution.ExecutionContextHolder;
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
-import org.hibernate.console.stubs.ConfigStubFactory;
+import org.hibernate.console.stubs.ConfigurationStubFactory;
import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.console.stubs.SessionStub;
import org.hibernate.console.stubs.SessionStubFactory;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.resolver.DialectFactory;
-import org.hibernate.tool.ide.completion.HQLCodeAssist;
import org.hibernate.tool.ide.completion.IHQLCodeAssist;
-import org.hibernate.util.ConfigHelper;
-import org.hibernate.util.ReflectHelper;
-import org.hibernate.util.StringHelper;
-import org.hibernate.util.XMLHelper;
-import org.w3c.dom.Document;
import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
public class ConsoleConfiguration implements ExecutionContextHolder {
@@ -98,7 +71,10 @@
}
public Object execute(Command c) {
- return executionContext.execute(c);
+ if (executionContext != null) {
+ return executionContext.execute(c);
+ }
+ return null;
}
/**
@@ -108,15 +84,12 @@
public void reset() {
// reseting state
closeSessionFactory();
- if (executionContext != null) {
- executionContext.execute(new ExecutionContext.Command() {
-
- public Object execute() {
- configStub.cleanUp();
- return null;
- }
- });
- }
+ execute(new ExecutionContext.Command() {
+ public Object execute() {
+ configStub.cleanUp();
+ return null;
+ }
+ });
configStub = null;
cleanUpClassLoader();
fireConfigurationReset();
@@ -150,7 +123,7 @@
executionContext = new DefaultExecutionContext(getName(), classLoader);
ConfigurationStub result = (ConfigurationStub) executionContext.execute(new ExecutionContext.Command() {
public Object execute() {
- ConfigStubFactory csf = new ConfigStubFactory(prefs);
+ ConfigurationStubFactory csf = new ConfigurationStubFactory(prefs);
return csf.createConfiguration(cfg, includeMappings);
}
});
@@ -169,7 +142,7 @@
if (profile == null) {
return null;
}
- ConfigStubFactory.refreshProfile(profile);
+ ConfigurationStubFactory.refreshProfile(profile);
//
Properties cpProperties = profile.getProperties(profile.getProviderId());
String driverJarPath = cpProperties.getProperty("jarList"); //$NON-NLS-1$
@@ -249,6 +222,7 @@
}
protected ClassLoader getParentClassLoader() {
+ //return Thread.currentThread().getContextClassLoader().getParent();
return Thread.currentThread().getContextClassLoader();
}
public ConfigurationStub getConfiguration() {
@@ -300,7 +274,7 @@
public QueryPage executeHQLQuery(final String hql, final QueryInputModel model) {
- return (QueryPage) executionContext.execute(new ExecutionContext.Command() {
+ return (QueryPage)execute(new ExecutionContext.Command() {
public Object execute() {
SessionStub sessionStub = getSessionStubFactory().openSession();
@@ -316,7 +290,7 @@
}
public QueryPage executeBSHQuery(final String queryString, final QueryInputModel model) {
- return (QueryPage) executionContext.execute(new ExecutionContext.Command() {
+ return (QueryPage)execute(new ExecutionContext.Command() {
public Object execute() {
SessionStub sessionStub = getSessionStubFactory().openSession();
@@ -380,8 +354,8 @@
public String generateSQL(final String query) {
String res = ""; //$NON-NLS-1$
- if (sessionStubFactory != null && executionContext != null) {
- res = (String)executionContext.execute(new ExecutionContext.Command() {
+ if (sessionStubFactory != null) {
+ res = (String)execute(new ExecutionContext.Command() {
public Object execute() {
return sessionStubFactory.generateSQL(query);
}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionPropertySource.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionPropertySource.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionPropertySource.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.hibernate.console.stubs;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class CollectionPropertySource implements IPropertySource {
-
- private Collection<?> collection;
-
- IPropertyDescriptor[] descriptors = null;
-
- Map<Object, Object> values = new WeakHashMap<Object, Object>();
-
- public CollectionPropertySource(Collection<?> propertyValue) {
- collection = propertyValue;
- }
-
- public Object getEditableValue() {
- return null;
- }
-
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (descriptors == null) {
- PropertyDescriptor[] properties = new PropertyDescriptor[collection.size()];
- for (int i = 0; i < properties.length; i++) {
- properties[i] = new PropertyDescriptor(Integer.valueOf(i), "#" + i); //$NON-NLS-1$
- }
- descriptors = properties;
- }
- return descriptors;
- }
-
- public Object getPropertyValue(Object id) {
- Object value = values.get(id);
- if (value == null) {
- Integer i = (Integer) id;
- Iterator<?> iterator = collection.iterator();
- int base = 0;
-
- while (iterator.hasNext()) {
-
- value = iterator.next();
-
- if (base == i.intValue()) {
- values.put(id, value);
- return value;
- } else {
- value = null;
- }
- base++;
- }
- }
-
- return value;
- }
-
- public boolean isPropertySet(Object id) {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void resetPropertyValue(Object id) {
- // TODO Auto-generated method stub
-
- }
-
- public void setPropertyValue(Object id, Object value) {
-
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigStubFactory.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigStubFactory.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -1,414 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.dom4j.DocumentException;
-import org.dom4j.Node;
-import org.dom4j.io.DOMWriter;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.osgi.util.NLS;
-import org.hibernate.HibernateException;
-import org.hibernate.MappingException;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.hibernate.cfg.JDBCMetaDataConfiguration;
-import org.hibernate.cfg.NamingStrategy;
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.HibernateConsoleRuntimeException;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.resolver.DialectFactory;
-import org.hibernate.util.ConfigHelper;
-import org.hibernate.util.ReflectHelper;
-import org.hibernate.util.StringHelper;
-import org.hibernate.util.XMLHelper;
-import org.w3c.dom.Document;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-public class ConfigStubFactory {
-
- private ConsoleConfigurationPreferences prefs = null;
-
- public ConfigStubFactory(ConsoleConfigurationPreferences prefs) {
- this.prefs = prefs;
- }
-
- public ConfigurationStub createConfiguration() {
- ConfigurationStub res = new ConfigurationStub(new Configuration());
- return res;
- }
-
- public ConfigurationStubJDBCMetaData createConfigurationJDBCMetaData() {
- ConfigurationStubJDBCMetaData res = new ConfigurationStubJDBCMetaData(new JDBCMetaDataConfiguration());
- return res;
- }
-
- public ConfigurationStub createConfiguration(ConfigurationStub cfg, boolean includeMappings) {
- Configuration localCfg = cfg == null ? null : cfg.getConfiguration();
- Properties properties = prefs.getProperties();
- if (properties != null) {
- // to fix: JBIDE-5839 - setup this property: false is default value
- // to make hibernate tools diff hibernate versions compatible
- if (properties.getProperty("hibernate.search.autoregister_listeners") == null) { //$NON-NLS-1$
- properties.setProperty("hibernate.search.autoregister_listeners", "false"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // in case the transaction manager is empty then we need to inject a faketm since
- // hibernate will still try and instantiate it.
- String str = properties.getProperty("hibernate.transaction.manager_lookup_class"); //$NON-NLS-1$
- if (str != null && StringHelper.isEmpty(str)) {
- properties
- .setProperty(
- "hibernate.transaction.manager_lookup_class", "org.hibernate.console.FakeTransactionManagerLookup"); //$NON-NLS-1$ //$NON-NLS-2$
- // properties.setProperty( "hibernate.transaction.factory_class", "");
- }
- }
- if (localCfg == null) {
- localCfg = buildConfiguration(properties, includeMappings);
- } else {
- // Properties origProperties = cfg.getProperties();
- // origProperties.putAll(properties);
- // cfg.setProperties(origProperties);
- // TODO: this is actually only for jdbc reveng...
- // localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
- }
- // non-running databases + i havent been needed until now...
- // TODO: jpa configuration ?
- if (includeMappings) {
- File[] mappingFiles = prefs.getMappingFiles();
- for (int i = 0; i < mappingFiles.length; i++) {
- File hbm = mappingFiles[i];
- localCfg = localCfg.addFile(hbm);
- }
- }
- // TODO: HBX-
- localCfg.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); //$NON-NLS-1$//$NON-NLS-2$
- localCfg.setProperty(Environment.HBM2DDL_AUTO, "false"); //$NON-NLS-1$
- ConfigurationStub res = new ConfigurationStub(localCfg);
- // here both setProperties and configxml have had their chance to tell which databasedriver
- // is needed.
- res.registerFakeDriver(localCfg.getProperty(Environment.DRIVER));
- // autoConfigureDialect(localCfg); Disabled for now since it causes very looong timeouts for
- return res;
- }
-
- @SuppressWarnings("unchecked")
- private Configuration buildAnnotationConfiguration() throws ClassNotFoundException,
- InstantiationException, IllegalAccessException {
- Class<Configuration> clazz = ReflectHelper
- .classForName("org.hibernate.cfg.AnnotationConfiguration"); //$NON-NLS-1$
- Configuration newInstance = clazz.newInstance();
- return newInstance;
- }
-
- private Configuration buildJPAConfiguration(String persistenceUnit, Properties properties,
- String entityResolver, boolean includeMappings) {
- if (StringHelper.isEmpty(persistenceUnit)) {
- persistenceUnit = null;
- }
- try {
- Map<Object, Object> overrides = new HashMap<Object, Object>();
- if (properties != null) {
- overrides.putAll(properties);
- }
- if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
- overrides.put("hibernate.ejb.naming_strategy", prefs.getNamingStrategy()); //$NON-NLS-1$
- }
- if (StringHelper.isNotEmpty(prefs.getDialectName())) {
- overrides.put("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
- }
- if (!includeMappings) {
- overrides.put("hibernate.archive.autodetection", "none"); //$NON-NLS-1$//$NON-NLS-2$
- }
- Class<?> clazz = ReflectHelper.classForName(
- "org.hibernate.ejb.Ejb3Configuration", ConsoleConfiguration.class); //$NON-NLS-1$
- Object ejb3cfg = clazz.newInstance();
-
- if (StringHelper.isNotEmpty(entityResolver)) {
- Class<?> resolver = ReflectHelper.classForName(entityResolver, this.getClass());
- Object object = resolver.newInstance();
- Method method = clazz.getMethod(
- "setEntityResolver", new Class[] { EntityResolver.class });//$NON-NLS-1$
- method.invoke(ejb3cfg, new Object[] { object });
- }
-
- Method method = clazz.getMethod("configure", new Class[] { String.class, Map.class }); //$NON-NLS-1$
- if (method.invoke(ejb3cfg, new Object[] { persistenceUnit, overrides }) == null) {
- String out = NLS.bind(
- ConsoleMessages.ConsoleConfiguration_persistence_unit_not_found,
- persistenceUnit);
- throw new HibernateConsoleRuntimeException(out);
- }
-
- method = clazz.getMethod("getHibernateConfiguration", new Class[0]);//$NON-NLS-1$
- Configuration invoke = (Configuration) method.invoke(ejb3cfg, (Object[]) null);
- invoke = configureConnectionProfile(invoke);
-
- return invoke;
- } catch (HibernateConsoleRuntimeException he) {
- throw he;
- } catch (Exception e) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_create_jpa_based_configuration,
- e);
- }
- }
-
- private Configuration buildConfiguration(Properties properties, boolean includeMappings) {
- Configuration localCfg = null;
- if (prefs.getConfigurationMode().equals(ConfigurationMode.ANNOTATIONS)) {
- try {
- localCfg = buildAnnotationConfiguration();
- localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
- } catch (HibernateConsoleRuntimeException he) {
- throw he;
- } catch (Exception e) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_load_annotationconfiguration,
- e);
- }
- } else if (prefs.getConfigurationMode().equals(ConfigurationMode.JPA)) {
- try {
- localCfg = buildJPAConfiguration(prefs.getPersistenceUnitName(), properties, prefs
- .getEntityResolverName(), includeMappings);
- } catch (HibernateConsoleRuntimeException he) {
- throw he;
- } catch (Exception e) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_load_jpa_configuration, e);
- }
- } else {
- localCfg = new Configuration();
- localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
- }
- return localCfg;
- }
-
- private Configuration configureStandardConfiguration(final boolean includeMappings,
- Configuration localCfg, Properties properties) {
- if (properties != null) {
- localCfg = localCfg.setProperties(properties);
- }
- EntityResolver entityResolver = XMLHelper.DEFAULT_DTD_RESOLVER;
- if (StringHelper.isNotEmpty(prefs.getEntityResolverName())) {
- try {
- entityResolver = (EntityResolver) ReflectHelper.classForName(
- prefs.getEntityResolverName()).newInstance();
- } catch (Exception c) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_configure_entity_resolver
- + prefs.getEntityResolverName(), c);
- }
- }
- localCfg.setEntityResolver(entityResolver);
- if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
- try {
- NamingStrategy ns = (NamingStrategy) ReflectHelper.classForName(
- prefs.getNamingStrategy()).newInstance();
- localCfg.setNamingStrategy(ns);
- } catch (Exception c) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_configure_naming_strategy
- + prefs.getNamingStrategy(), c);
- }
- }
- localCfg = loadConfigurationXML(localCfg, includeMappings, entityResolver);
- localCfg = configureConnectionProfile(localCfg);
-
- // replace dialect if it is set in preferences
- if (StringHelper.isNotEmpty(prefs.getDialectName())) {
- localCfg.setProperty("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
- }
-
- return localCfg;
- }
-
- @SuppressWarnings("unchecked")
- private Configuration loadConfigurationXML(Configuration localCfg, boolean includeMappings,
- EntityResolver entityResolver) {
- File configXMLFile = prefs.getConfigXMLFile();
- if (!includeMappings) {
- org.dom4j.Document doc;
- XMLHelper xmlHelper = new XMLHelper();
- InputStream stream = null;
- String resourceName = "<unknown>"; //$NON-NLS-1$
- if (configXMLFile != null) {
- resourceName = configXMLFile.toString();
- try {
- stream = new FileInputStream(configXMLFile);
- } catch (FileNotFoundException e1) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_access + configXMLFile,
- e1);
- }
- } else {
- resourceName = "/hibernate.cfg.xml"; //$NON-NLS-1$
- if (checkHibernateResoureExistence(resourceName)) {
- stream = ConfigHelper.getResourceAsStream(resourceName); // simulate hibernate's
- // default look up
- } else {
- return localCfg;
- }
- }
-
- try {
- List<Throwable> errors = new ArrayList<Throwable>();
-
- doc = xmlHelper.createSAXReader(resourceName, errors, entityResolver).read(
- new InputSource(stream));
- if (errors.size() != 0) {
- throw new MappingException(
- ConsoleMessages.ConsoleConfiguration_invalid_configuration, errors
- .get(0));
- }
-
- List<Node> list = doc.getRootElement()
- .element("session-factory").elements("mapping"); //$NON-NLS-1$ //$NON-NLS-2$
- for (Node element : list) {
- element.getParent().remove(element);
- }
-
- DOMWriter dw = new DOMWriter();
- Document document = dw.write(doc);
- return localCfg.configure(document);
-
- } catch (DocumentException e) {
- throw new HibernateException(
- ConsoleMessages.ConsoleConfiguration_could_not_parse_configuration
- + resourceName, e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException ioe) {
- // log.warn( "could not close input stream for: " + resourceName, ioe );
- }
- }
- } else {
- if (configXMLFile != null) {
- return localCfg.configure(configXMLFile);
- } else {
- Configuration resultCfg = localCfg;
- if (checkHibernateResoureExistence("/hibernate.cfg.xml")) { //$NON-NLS-1$
- resultCfg = localCfg.configure();
- }
- return resultCfg;
- }
- }
- }
-
- private boolean checkHibernateResoureExistence(String resource) {
- InputStream is = null;
- try {
- is = ConfigHelper.getResourceAsStream(resource);
- } catch (HibernateException e) {
- // just ignore
- } finally {
- try {
- if (is != null)
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- return (is != null);
- }
-
- private Configuration configureConnectionProfile(Configuration localCfg) {
- String connectionProfile = prefs.getConnectionProfileName();
- if (connectionProfile == null) {
- return localCfg;
- }
- IConnectionProfile profile = ProfileManager.getInstance().getProfileByName(
- connectionProfile);
- if (profile != null) {
- refreshProfile(profile);
- //
- final Properties invokeProperties = localCfg.getProperties();
- // set this property to null!
- invokeProperties.remove(Environment.DATASOURCE);
- localCfg.setProperties(invokeProperties);
- Properties cpProperties = profile.getProperties(profile.getProviderId());
- // seems we should not setup dialect here
- // String dialect =
- // "org.hibernate.dialect.HSQLDialect";//cpProperties.getProperty("org.eclipse.datatools.connectivity.db.driverClass");
- // invoke.setProperty(Environment.DIALECT, dialect);
- String driver = cpProperties
- .getProperty("org.eclipse.datatools.connectivity.db.driverClass"); //$NON-NLS-1$
- localCfg.setProperty(Environment.DRIVER, driver);
- // TODO:
- @SuppressWarnings("unused")
- String driverJarPath = cpProperties.getProperty("jarList"); //$NON-NLS-1$
- String url = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.URL"); //$NON-NLS-1$
- // url += "/";// +
- // cpProperties.getProperty("org.eclipse.datatools.connectivity.db.databaseName");
- localCfg.setProperty(Environment.URL, url);
- String user = cpProperties
- .getProperty("org.eclipse.datatools.connectivity.db.username"); //$NON-NLS-1$
- if (null != user && user.length() > 0) {
- localCfg.setProperty(Environment.USER, user);
- }
- String pass = cpProperties
- .getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
- if (null != pass && pass.length() > 0) {
- localCfg.setProperty(Environment.PASS, pass);
- }
- } else {
- String out = NLS.bind(
- ConsoleMessages.ConsoleConfiguration_connection_profile_not_found,
- connectionProfile);
- throw new HibernateConsoleRuntimeException(out);
- }
- return localCfg;
- }
-
- @SuppressWarnings("unused")
- private void autoConfigureDialect(Configuration localCfg) {
- if (localCfg.getProperty(Environment.DIALECT) == null) {
- String url = localCfg.getProperty(Environment.URL);
- String user = localCfg.getProperty(Environment.USER);
- String pass = localCfg.getProperty(Environment.PASS);
- Connection connection = null;
- try {
- connection = DriverManager.getConnection(url, user, pass);
- // SQL Dialect:
- Dialect dialect = DialectFactory.buildDialect(localCfg.getProperties(), connection);
- localCfg.setProperty(Environment.DIALECT, dialect.toString());
- } catch (SQLException e) {
- // can't determine dialect
- }
- if (connection != null) {
- try {
- connection.close();
- } catch (SQLException e) {
- // ignore
- }
- }
- }
- }
-
- public static void refreshProfile(IConnectionProfile profile) {
- // refresh profile (refresh jpa connection):
- // get fresh information about current db structure and update error markers
- if (profile.getConnectionState() == IConnectionProfile.CONNECTED_STATE) {
- profile.disconnect(null);
- }
- profile.connect(null);
- }
-}
Copied: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java (from rev 20919, branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigStubFactory.java)
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -0,0 +1,415 @@
+package org.hibernate.console.stubs;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.dom4j.DocumentException;
+import org.dom4j.Node;
+import org.dom4j.io.DOMWriter;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.HibernateException;
+import org.hibernate.MappingException;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.cfg.JDBCMetaDataConfiguration;
+import org.hibernate.cfg.NamingStrategy;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.ConsoleMessages;
+import org.hibernate.console.HibernateConsoleRuntimeException;
+import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.resolver.DialectFactory;
+import org.hibernate.util.ConfigHelper;
+import org.hibernate.util.ReflectHelper;
+import org.hibernate.util.StringHelper;
+import org.hibernate.util.XMLHelper;
+import org.w3c.dom.Document;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+public class ConfigurationStubFactory {
+
+ private ConsoleConfigurationPreferences prefs = null;
+
+ public ConfigurationStubFactory(ConsoleConfigurationPreferences prefs) {
+ this.prefs = prefs;
+ }
+
+ public ConfigurationStub createConfiguration() {
+ ConfigurationStub res = new ConfigurationStub(new Configuration());
+ return res;
+ }
+
+ public ConfigurationStubJDBCMetaData createConfigurationJDBCMetaData() {
+ ConfigurationStubJDBCMetaData res = new ConfigurationStubJDBCMetaData(new JDBCMetaDataConfiguration());
+ return res;
+ }
+
+ public ConfigurationStub createConfiguration(ConfigurationStub cfg, boolean includeMappings) {
+ Configuration localCfg = cfg == null ? null : cfg.getConfiguration();
+ Properties properties = prefs.getProperties();
+ if (properties != null) {
+ // to fix: JBIDE-5839 - setup this property: false is default value
+ // to make hibernate tools diff hibernate versions compatible
+ if (properties.getProperty("hibernate.search.autoregister_listeners") == null) { //$NON-NLS-1$
+ properties.setProperty("hibernate.search.autoregister_listeners", "false"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ // in case the transaction manager is empty then we need to inject a faketm since
+ // hibernate will still try and instantiate it.
+ String str = properties.getProperty("hibernate.transaction.manager_lookup_class"); //$NON-NLS-1$
+ if (str != null && StringHelper.isEmpty(str)) {
+ properties
+ .setProperty(
+ "hibernate.transaction.manager_lookup_class", "org.hibernate.console.FakeTransactionManagerLookup"); //$NON-NLS-1$ //$NON-NLS-2$
+ // properties.setProperty( "hibernate.transaction.factory_class", "");
+ }
+ }
+ if (localCfg == null) {
+ localCfg = buildConfiguration(properties, includeMappings);
+ } else {
+ // Properties origProperties = cfg.getProperties();
+ // origProperties.putAll(properties);
+ // cfg.setProperties(origProperties);
+ // TODO: this is actually only for jdbc reveng...
+ // localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
+ }
+ // non-running databases + i havent been needed until now...
+ // TODO: jpa configuration ?
+ if (includeMappings) {
+ File[] mappingFiles = prefs.getMappingFiles();
+ for (int i = 0; i < mappingFiles.length; i++) {
+ File hbm = mappingFiles[i];
+ localCfg = localCfg.addFile(hbm);
+ }
+ }
+ // TODO: HBX-
+ localCfg.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); //$NON-NLS-1$//$NON-NLS-2$
+ localCfg.setProperty(Environment.HBM2DDL_AUTO, "false"); //$NON-NLS-1$
+ ConfigurationStub res = new ConfigurationStub(localCfg);
+ // here both setProperties and configxml have had their chance to tell which databasedriver
+ // is needed.
+ res.registerFakeDriver(localCfg.getProperty(Environment.DRIVER));
+ // autoConfigureDialect(localCfg); Disabled for now since it causes very looong timeouts for
+ return res;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Configuration buildAnnotationConfiguration() throws ClassNotFoundException,
+ InstantiationException, IllegalAccessException {
+ Class<Configuration> clazz = ReflectHelper
+ .classForName("org.hibernate.cfg.AnnotationConfiguration"); //$NON-NLS-1$
+ Configuration newInstance = clazz.newInstance();
+ return newInstance;
+ }
+
+ private Configuration buildJPAConfiguration(String persistenceUnit, Properties properties,
+ String entityResolver, boolean includeMappings) {
+ if (StringHelper.isEmpty(persistenceUnit)) {
+ persistenceUnit = null;
+ }
+ try {
+ Map<Object, Object> overrides = new HashMap<Object, Object>();
+ if (properties != null) {
+ overrides.putAll(properties);
+ }
+ if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
+ overrides.put("hibernate.ejb.naming_strategy", prefs.getNamingStrategy()); //$NON-NLS-1$
+ }
+ if (StringHelper.isNotEmpty(prefs.getDialectName())) {
+ overrides.put("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
+ }
+ if (!includeMappings) {
+ overrides.put("hibernate.archive.autodetection", "none"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ Class<?> clazz = ReflectHelper.classForName(
+ "org.hibernate.ejb.Ejb3Configuration", ConsoleConfiguration.class); //$NON-NLS-1$
+ Object ejb3cfg = clazz.newInstance();
+
+ if (StringHelper.isNotEmpty(entityResolver)) {
+ Class<?> resolver = ReflectHelper.classForName(entityResolver, this.getClass());
+ Object object = resolver.newInstance();
+ Method method = clazz.getMethod(
+ "setEntityResolver", new Class[] { EntityResolver.class });//$NON-NLS-1$
+ method.invoke(ejb3cfg, new Object[] { object });
+ }
+
+ Method method = clazz.getMethod("configure", new Class[] { String.class, Map.class }); //$NON-NLS-1$
+ if (method.invoke(ejb3cfg, new Object[] { persistenceUnit, overrides }) == null) {
+ String out = NLS.bind(
+ ConsoleMessages.ConsoleConfiguration_persistence_unit_not_found,
+ persistenceUnit);
+ throw new HibernateConsoleRuntimeException(out);
+ }
+
+ method = clazz.getMethod("getHibernateConfiguration", new Class[0]);//$NON-NLS-1$
+ Object obj = method.invoke(ejb3cfg, (Object[]) null);
+ Configuration invoke = (Configuration)obj;
+ invoke = configureConnectionProfile(invoke);
+
+ return invoke;
+ } catch (HibernateConsoleRuntimeException he) {
+ throw he;
+ } catch (Exception e) {
+ throw new HibernateConsoleRuntimeException(
+ ConsoleMessages.ConsoleConfiguration_could_not_create_jpa_based_configuration,
+ e);
+ }
+ }
+
+ private Configuration buildConfiguration(Properties properties, boolean includeMappings) {
+ Configuration localCfg = null;
+ if (prefs.getConfigurationMode().equals(ConfigurationMode.ANNOTATIONS)) {
+ try {
+ localCfg = buildAnnotationConfiguration();
+ localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
+ } catch (HibernateConsoleRuntimeException he) {
+ throw he;
+ } catch (Exception e) {
+ throw new HibernateConsoleRuntimeException(
+ ConsoleMessages.ConsoleConfiguration_could_not_load_annotationconfiguration,
+ e);
+ }
+ } else if (prefs.getConfigurationMode().equals(ConfigurationMode.JPA)) {
+ try {
+ localCfg = buildJPAConfiguration(prefs.getPersistenceUnitName(), properties, prefs
+ .getEntityResolverName(), includeMappings);
+ } catch (HibernateConsoleRuntimeException he) {
+ throw he;
+ } catch (Exception e) {
+ throw new HibernateConsoleRuntimeException(
+ ConsoleMessages.ConsoleConfiguration_could_not_load_jpa_configuration, e);
+ }
+ } else {
+ localCfg = new Configuration();
+ localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
+ }
+ return localCfg;
+ }
+
+ private Configuration configureStandardConfiguration(final boolean includeMappings,
+ Configuration localCfg, Properties properties) {
+ if (properties != null) {
+ localCfg = localCfg.setProperties(properties);
+ }
+ EntityResolver entityResolver = XMLHelper.DEFAULT_DTD_RESOLVER;
+ if (StringHelper.isNotEmpty(prefs.getEntityResolverName())) {
+ try {
+ entityResolver = (EntityResolver) ReflectHelper.classForName(
+ prefs.getEntityResolverName()).newInstance();
+ } catch (Exception c) {
+ throw new HibernateConsoleRuntimeException(
+ ConsoleMessages.ConsoleConfiguration_could_not_configure_entity_resolver
+ + prefs.getEntityResolverName(), c);
+ }
+ }
+ localCfg.setEntityResolver(entityResolver);
+ if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
+ try {
+ NamingStrategy ns = (NamingStrategy) ReflectHelper.classForName(
+ prefs.getNamingStrategy()).newInstance();
+ localCfg.setNamingStrategy(ns);
+ } catch (Exception c) {
+ throw new HibernateConsoleRuntimeException(
+ ConsoleMessages.ConsoleConfiguration_could_not_configure_naming_strategy
+ + prefs.getNamingStrategy(), c);
+ }
+ }
+ localCfg = loadConfigurationXML(localCfg, includeMappings, entityResolver);
+ localCfg = configureConnectionProfile(localCfg);
+
+ // replace dialect if it is set in preferences
+ if (StringHelper.isNotEmpty(prefs.getDialectName())) {
+ localCfg.setProperty("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
+ }
+
+ return localCfg;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Configuration loadConfigurationXML(Configuration localCfg, boolean includeMappings,
+ EntityResolver entityResolver) {
+ File configXMLFile = prefs.getConfigXMLFile();
+ if (!includeMappings) {
+ org.dom4j.Document doc;
+ XMLHelper xmlHelper = new XMLHelper();
+ InputStream stream = null;
+ String resourceName = "<unknown>"; //$NON-NLS-1$
+ if (configXMLFile != null) {
+ resourceName = configXMLFile.toString();
+ try {
+ stream = new FileInputStream(configXMLFile);
+ } catch (FileNotFoundException e1) {
+ throw new HibernateConsoleRuntimeException(
+ ConsoleMessages.ConsoleConfiguration_could_not_access + configXMLFile,
+ e1);
+ }
+ } else {
+ resourceName = "/hibernate.cfg.xml"; //$NON-NLS-1$
+ if (checkHibernateResoureExistence(resourceName)) {
+ stream = ConfigHelper.getResourceAsStream(resourceName); // simulate hibernate's
+ // default look up
+ } else {
+ return localCfg;
+ }
+ }
+
+ try {
+ List<Throwable> errors = new ArrayList<Throwable>();
+
+ doc = xmlHelper.createSAXReader(resourceName, errors, entityResolver).read(
+ new InputSource(stream));
+ if (errors.size() != 0) {
+ throw new MappingException(
+ ConsoleMessages.ConsoleConfiguration_invalid_configuration, errors
+ .get(0));
+ }
+
+ List<Node> list = doc.getRootElement()
+ .element("session-factory").elements("mapping"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (Node element : list) {
+ element.getParent().remove(element);
+ }
+
+ DOMWriter dw = new DOMWriter();
+ Document document = dw.write(doc);
+ return localCfg.configure(document);
+
+ } catch (DocumentException e) {
+ throw new HibernateException(
+ ConsoleMessages.ConsoleConfiguration_could_not_parse_configuration
+ + resourceName, e);
+ } finally {
+ try {
+ if (stream != null)
+ stream.close();
+ } catch (IOException ioe) {
+ // log.warn( "could not close input stream for: " + resourceName, ioe );
+ }
+ }
+ } else {
+ if (configXMLFile != null) {
+ return localCfg.configure(configXMLFile);
+ } else {
+ Configuration resultCfg = localCfg;
+ if (checkHibernateResoureExistence("/hibernate.cfg.xml")) { //$NON-NLS-1$
+ resultCfg = localCfg.configure();
+ }
+ return resultCfg;
+ }
+ }
+ }
+
+ private boolean checkHibernateResoureExistence(String resource) {
+ InputStream is = null;
+ try {
+ is = ConfigHelper.getResourceAsStream(resource);
+ } catch (HibernateException e) {
+ // just ignore
+ } finally {
+ try {
+ if (is != null)
+ is.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ return (is != null);
+ }
+
+ private Configuration configureConnectionProfile(Configuration localCfg) {
+ String connectionProfile = prefs.getConnectionProfileName();
+ if (connectionProfile == null) {
+ return localCfg;
+ }
+ IConnectionProfile profile = ProfileManager.getInstance().getProfileByName(
+ connectionProfile);
+ if (profile != null) {
+ refreshProfile(profile);
+ //
+ final Properties invokeProperties = localCfg.getProperties();
+ // set this property to null!
+ invokeProperties.remove(Environment.DATASOURCE);
+ localCfg.setProperties(invokeProperties);
+ Properties cpProperties = profile.getProperties(profile.getProviderId());
+ // seems we should not setup dialect here
+ // String dialect =
+ // "org.hibernate.dialect.HSQLDialect";//cpProperties.getProperty("org.eclipse.datatools.connectivity.db.driverClass");
+ // invoke.setProperty(Environment.DIALECT, dialect);
+ String driver = cpProperties
+ .getProperty("org.eclipse.datatools.connectivity.db.driverClass"); //$NON-NLS-1$
+ localCfg.setProperty(Environment.DRIVER, driver);
+ // TODO:
+ @SuppressWarnings("unused")
+ String driverJarPath = cpProperties.getProperty("jarList"); //$NON-NLS-1$
+ String url = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.URL"); //$NON-NLS-1$
+ // url += "/";// +
+ // cpProperties.getProperty("org.eclipse.datatools.connectivity.db.databaseName");
+ localCfg.setProperty(Environment.URL, url);
+ String user = cpProperties
+ .getProperty("org.eclipse.datatools.connectivity.db.username"); //$NON-NLS-1$
+ if (null != user && user.length() > 0) {
+ localCfg.setProperty(Environment.USER, user);
+ }
+ String pass = cpProperties
+ .getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
+ if (null != pass && pass.length() > 0) {
+ localCfg.setProperty(Environment.PASS, pass);
+ }
+ } else {
+ String out = NLS.bind(
+ ConsoleMessages.ConsoleConfiguration_connection_profile_not_found,
+ connectionProfile);
+ throw new HibernateConsoleRuntimeException(out);
+ }
+ return localCfg;
+ }
+
+ @SuppressWarnings("unused")
+ private void autoConfigureDialect(Configuration localCfg) {
+ if (localCfg.getProperty(Environment.DIALECT) == null) {
+ String url = localCfg.getProperty(Environment.URL);
+ String user = localCfg.getProperty(Environment.USER);
+ String pass = localCfg.getProperty(Environment.PASS);
+ Connection connection = null;
+ try {
+ connection = DriverManager.getConnection(url, user, pass);
+ // SQL Dialect:
+ Dialect dialect = DialectFactory.buildDialect(localCfg.getProperties(), connection);
+ localCfg.setProperty(Environment.DIALECT, dialect.toString());
+ } catch (SQLException e) {
+ // can't determine dialect
+ }
+ if (connection != null) {
+ try {
+ connection.close();
+ } catch (SQLException e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ public static void refreshProfile(IConnectionProfile profile) {
+ // refresh profile (refresh jpa connection):
+ // get fresh information about current db structure and update error markers
+ if (profile.getConnectionState() == IConnectionProfile.CONNECTED_STATE) {
+ profile.disconnect(null);
+ }
+ profile.connect(null);
+ }
+}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -21,6 +21,7 @@
import org.hibernate.console.QueryInputModel;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.execution.ExecutionContext.Command;
+import org.hibernate.console.util.CollectionPropertySource;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.metadata.CollectionMetadata;
Copied: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/util/CollectionPropertySource.java (from rev 20919, branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionPropertySource.java)
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/util/CollectionPropertySource.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/util/CollectionPropertySource.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.hibernate.console.util;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class CollectionPropertySource implements IPropertySource {
+
+ private Collection<?> collection;
+
+ IPropertyDescriptor[] descriptors = null;
+
+ Map<Object, Object> values = new WeakHashMap<Object, Object>();
+
+ public CollectionPropertySource(Collection<?> propertyValue) {
+ collection = propertyValue;
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (descriptors == null) {
+ PropertyDescriptor[] properties = new PropertyDescriptor[collection.size()];
+ for (int i = 0; i < properties.length; i++) {
+ properties[i] = new PropertyDescriptor(Integer.valueOf(i), "#" + i); //$NON-NLS-1$
+ }
+ descriptors = properties;
+ }
+ return descriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object value = values.get(id);
+ if (value == null) {
+ Integer i = (Integer) id;
+ Iterator<?> iterator = collection.iterator();
+ int base = 0;
+
+ while (iterator.hasNext()) {
+
+ value = iterator.next();
+
+ if (base == i.intValue()) {
+ values.put(id, value);
+ return value;
+ } else {
+ value = null;
+ }
+ base++;
+ }
+ }
+
+ return value;
+ }
+
+ public boolean isPropertySet(Object id) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+
+ }
+
+}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -535,7 +535,7 @@
return file;
}
final ConsoleConfiguration cc2 = consoleConfig;
- List<String> documentPaths = (List<String>)consoleConfig.getExecutionContext().execute(new ExecutionContext.Command() {
+ List<String> documentPaths = (List<String>)consoleConfig.execute(new ExecutionContext.Command() {
public Object execute() {
return OpenMappingUtilsEjb3.enumDocuments(cc2);
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -26,7 +26,6 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -38,15 +37,7 @@
//String sfError = null;
if(ccfg.getConfiguration()==null) {
ccfg.build();
- ccfg.execute( new ExecutionContext.Command() {
-
- public Object execute() {
- if(ccfg.hasConfiguration()) {
- ccfg.getConfiguration().buildMappings();
- }
- return ccfg;
- }
- } );
+ ccfg.buildMappings();
}
/*if(ccfg.getSessionFactory()==null) { // initialize later?
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -104,7 +104,7 @@
protected void readDatabaseSchema(final IProgressMonitor monitor, final DefaultDatabaseCollector db, ConsoleConfiguration consoleConfiguration, final ReverseEngineeringStrategy strategy) {
final ConfigurationStub configuration = consoleConfiguration.buildWith(null, false);
- consoleConfiguration.getExecutionContext().execute(new ExecutionContext.Command() {
+ consoleConfiguration.execute(new ExecutionContext.Command() {
public Object execute() {
Settings settings = configuration.buildSettings();
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -148,7 +148,6 @@
final ConsoleConfiguration cfg0 = cfg;
SessionStub sessionStub = (SessionStub)cfg.execute(new Command() {
public Object execute() {
- // vitali TODO: openSession should be executed in context - all other no!
SessionStub sessionStub = cfg0.getSessionStubFactory().openSession();
return sessionStub;
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -422,18 +422,18 @@
if (queryPage == null || !getPinToOneResTab()) {
queryPage = cfg.executeHQLQuery(getQueryString(), getQueryInputModel().getCopyForQuery());
} else {
+ KnownConfigurations.getInstance().getQueryPageModel().remove(queryPage);
final ConsoleConfiguration cfg0 = cfg;
- cfg.execute(new Command() {
+ SessionStub sessionStub = (SessionStub)cfg.execute(new Command() {
public Object execute() {
- KnownConfigurations.getInstance().getQueryPageModel().remove(queryPage);
SessionStub sessionStub = cfg0.getSessionStubFactory().openSession();
- queryPage.setModel(getQueryInputModel().getCopyForQuery());
- queryPage.setQueryString(getQueryString());
- queryPage.setSessionStub(sessionStub);
- KnownConfigurations.getInstance().getQueryPageModel().add(queryPage);
- return null;
+ return sessionStub;
}
});
+ queryPage.setModel(getQueryInputModel().getCopyForQuery());
+ queryPage.setQueryString(getQueryString());
+ queryPage.setSessionStub(sessionStub);
+ KnownConfigurations.getInstance().getQueryPageModel().add(queryPage);
}
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -18,7 +18,6 @@
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -43,15 +42,7 @@
if(consoleConfiguration.getConfiguration()==null) {
try {
consoleConfiguration.build();
- consoleConfiguration.execute( new ExecutionContext.Command() {
-
- public Object execute() {
- if(consoleConfiguration.hasConfiguration()) {
- consoleConfiguration.getConfiguration().buildMappings();
- }
- return consoleConfiguration;
- }
- } );
+ consoleConfiguration.buildMappings();
} catch (HibernateException he) {
HibernateConsolePlugin.getDefault().showError(HibernateConsolePlugin.getShell(), HibernateConsoleMessages.LoadConsoleCFGCompletionProposal_could_not_load_configuration + ' ' + consoleConfiguration.getName(), he);
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -59,7 +59,6 @@
import org.eclipse.osgi.util.NLS;
import org.eclipse.text.edits.TextEdit;
import org.hibernate.HibernateException;
-import org.hibernate.cfg.JDBCMetaDataConfiguration;
import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
import org.hibernate.cfg.reveng.OverrideRepository;
import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
@@ -68,7 +67,7 @@
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.execution.ExecutionContext.Command;
-import org.hibernate.console.stubs.ConfigStubFactory;
+import org.hibernate.console.stubs.ConfigurationStubFactory;
import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.console.stubs.ConfigurationStubJDBCMetaData;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -274,7 +273,7 @@
}
// vitali: TODO: use execution context
- ConfigStubFactory configStubFactory = new ConfigStubFactory(null);
+ ConfigurationStubFactory configStubFactory = new ConfigurationStubFactory(null);
final ConfigurationStubJDBCMetaData cfg = configStubFactory.createConfigurationJDBCMetaData();
Properties properties = configuration.getProperties();
cfg.setProperties( properties );
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -41,7 +41,7 @@
import org.eclipse.jdt.core.dom.WildcardType;
import org.hibernate.FetchMode;
import org.hibernate.cfg.Mappings;
-import org.hibernate.console.stubs.ConfigStubFactory;
+import org.hibernate.console.stubs.ConfigurationStubFactory;
import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
@@ -147,7 +147,7 @@
// vitali: TODO: should get ConsoleConfig in association with JavaProject
// and create Configuration in execution context of it!
- ConfigStubFactory configStubFactory = new ConfigStubFactory(null);
+ ConfigurationStubFactory configStubFactory = new ConfigurationStubFactory(null);
ConfigurationStub config = configStubFactory.createConfiguration();
Mappings mappings = config.createMappings();
Collection<PersistentClass> classesCollection = createHierarhyStructure(project, processor.getRootClasses());
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2010-03-19 17:49:46 UTC (rev 20943)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2010-03-19 18:06:20 UTC (rev 20944)
@@ -27,7 +27,6 @@
import org.eclipse.osgi.util.NLS;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
@@ -75,15 +74,7 @@
consCFG.reset();
consCFG.build();
assertTrue(consCFG.hasConfiguration());
- consCFG.execute( new ExecutionContext.Command() {
-
- public Object execute() {
- if(consCFG.hasConfiguration()) {
- consCFG.getConfiguration().buildMappings();
- }
- return consCFG;
- }
- } );
+ consCFG.buildMappings();
ConfigurationStub config = consCFG.getConfiguration();
//delete old hbm files
14 years, 7 months
JBoss Tools SVN: r20943 - in trunk: cdi/tests/org.jboss.tools.cdi.core.test/META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-03-19 13:49:46 -0400 (Fri, 19 Mar 2010)
New Revision: 20943
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties
trunk/tests/features/org.jboss.tools.all.test.feature/feature.xml
Log:
fix for CDI test errors:
1. Manifests for cdi.core.test and cdi.ui.test were adjusted to use them as unpacked
2. all.tests feature was updated to unpack cdi.core.test and cdi.ui.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2010-03-19 17:29:20 UTC (rev 20942)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2010-03-19 17:49:46 UTC (rev 20943)
@@ -17,3 +17,4 @@
org.jboss.tools.common.model.ui
Export-Package: org.jboss.tools.cdi.core.test,
org.jboss.tools.cdi.core.test.tck
+Bundle-ClassPath: cdi-core-test.jar
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties 2010-03-19 17:29:20 UTC (rev 20942)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties 2010-03-19 17:49:46 UTC (rev 20943)
@@ -1,6 +1,7 @@
source.. = src/
-output.. = bin/
+output.cdi-core-test.jar = bin/
bin.includes = META-INF/,\
- .,\
+ cdi-core-test.jar,\
resources/,\
projects/
+source.cdi-core-test.jar = src/
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2010-03-19 17:29:20 UTC (rev 20942)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2010-03-19 17:49:46 UTC (rev 20943)
@@ -18,3 +18,5 @@
org.jboss.tools.common,
org.eclipse.osgi,
org.eclipse.core.runtime
+Bundle-ClassPath: cdi-ui-test.jar
+Export-Package: org.jboss.tools.cdi.ui.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties 2010-03-19 17:29:20 UTC (rev 20942)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties 2010-03-19 17:49:46 UTC (rev 20943)
@@ -1,5 +1,5 @@
-source.. = src/
-output.. = bin/
bin.includes = META-INF/,\
- .,\
- resources/
+ resources/,\
+ cdi-ui-test.jar
+source.cdi-ui-test.jar = src/
+jars.compile.order = cdi-ui-test.jar
Modified: trunk/tests/features/org.jboss.tools.all.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.all.test.feature/feature.xml 2010-03-19 17:29:20 UTC (rev 20942)
+++ trunk/tests/features/org.jboss.tools.all.test.feature/feature.xml 2010-03-19 17:49:46 UTC (rev 20943)
@@ -309,8 +309,7 @@
id="org.jboss.tools.cdi.core.test"
download-size="0"
install-size="0"
- version="0.0.0"
- unpack="false"/>
+ version="0.0.0"/>
<plugin
id="org.jboss.tools.cdi.text.ext.test"
@@ -322,7 +321,6 @@
id="org.jboss.tools.cdi.ui.test"
download-size="0"
install-size="0"
- version="0.0.0"
- unpack="false"/>
+ version="0.0.0"/>
</feature>
14 years, 7 months
JBoss Tools SVN: r20942 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: src/org/jboss/tools/jst/web/kb/internal/taglib and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-03-19 13:29:20 -0400 (Fri, 19 Mar 2010)
New Revision: 20942
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5977
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2010-03-19 16:59:44 UTC (rev 20941)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2010-03-19 17:29:20 UTC (rev 20942)
@@ -32,43 +32,43 @@
<extension
point="org.jboss.tools.jst.web.kb.tagLib">
<tag-lib
- location="taglibs/Ajax4jsf.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/Ajax4jsf.xml"
name="JBoss Ajax4jsf"
uri="http://richfaces.org/a4j"/>
<tag-lib
- location="taglibs/Richfaces.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/Richfaces.xml"
name="JBoss RichFaces"
uri="http://richfaces.org/rich"/>
<tag-lib
- location="taglibs/JsfCore.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/JsfCore.xml"
name="JSF Core"
uri="http://java.sun.com/jsf/core"/>
<tag-lib
- location="taglibs/JsfHtmlBasic.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/JsfHtmlBasic.xml"
name="JSF HTML Basic"
uri="http://java.sun.com/jsf/html"/>
<tag-lib
- location="taglibs/Facelets.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/Facelets.xml"
name="Facelets UI"
uri="http://java.sun.com/jsf/facelets"/>
<tag-lib
- location="taglibs/FaceletsHtml.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/FaceletsHtml.xml"
name="Facelets Html"
uri="http://www.w3.org/1999/xhtml/facelets"/>
<tag-lib
- location="taglibs/JBossSeam.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/JBossSeam.xml"
name="JBoss Seam"
uri="http://jboss.com/products/seam/taglib"/>
<tag-lib
- location="taglibs/Jsp.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/Jsp.xml"
name="JSP"
uri="http://java.sun.com/JSP/Page"/>
<tag-lib
name="Struts HTML"
- location="taglibs/StrutsHtml.xml"
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/StrutsHtml.xml"
uri="http://struts.apache.org/tags-html"/>
<component-extension
- location="taglibs/componentExtension.xml"/>
+ location="platform:/plugin/org.jboss.tools.jst.web.kb/taglibs/componentExtension.xml"/>
</extension>
<extension point="org.jboss.tools.jst.web.kb.KbIncludeContext">
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java 2010-03-19 16:59:44 UTC (rev 20941)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java 2010-03-19 17:29:20 UTC (rev 20942)
@@ -11,8 +11,8 @@
package org.jboss.tools.jst.web.kb.internal.taglib;
import java.io.ByteArrayInputStream;
-import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -62,14 +62,14 @@
protected String name;
protected String defaultPrefix;
- public CustomTagLibrary(File file, String uri, String version, String name) {
+ public CustomTagLibrary(InputStream inputStream, String uri, String version, String name) {
setURI(uri);
setVersion(version);
this.name = name;
Document document = null;
try {
DocumentBuilder builder = createDocumentBuilder(false);
- document = builder.parse(file);
+ document = builder.parse(inputStream);
} catch (SAXException e) {
WebKbPlugin.getDefault().logError(e);
} catch (IOException e) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java 2010-03-19 16:59:44 UTC (rev 20941)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java 2010-03-19 17:29:20 UTC (rev 20942)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.taglib;
-import java.io.File;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -28,8 +28,8 @@
*/
public class HTMLTagLibrary extends CustomTagLibrary {
- public HTMLTagLibrary(File file, String uri, String version, String name) {
- super(file, uri, version, name);
+ public HTMLTagLibrary(InputStream inputStream, String uri, String version, String name) {
+ super(inputStream, uri, version, name);
}
/*
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java 2010-03-19 16:59:44 UTC (rev 20941)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java 2010-03-19 17:29:20 UTC (rev 20942)
@@ -10,8 +10,9 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.taglib;
-import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
import java.util.HashSet;
import java.util.Set;
@@ -28,7 +29,6 @@
import org.jboss.tools.jst.web.kb.internal.taglib.CustomTagLibAttribute;
import org.jboss.tools.jst.web.kb.internal.taglib.CustomTagLibrary;
import org.jboss.tools.jst.web.kb.internal.taglib.HTMLTagLibrary;
-import org.osgi.framework.Bundle;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -78,6 +78,17 @@
}
return extensions;
}
+
+ private InputStream getInputStream(IConfigurationElement element){
+ String location = element.getAttribute("location"); //$NON-NLS-1$
+ try{
+ URL url = FileLocator.resolve(new URL(location));
+ return url.openConnection().getInputStream();
+ }catch(IOException ex){
+ WebKbPlugin.getDefault().logError(ex);
+ return null;
+ }
+ }
private void init() {
Set<ICustomTagLibrary> libSet = new HashSet<ICustomTagLibrary>();
@@ -93,62 +104,28 @@
String elementName = elements[j].getName();
if(CustomTagLibrary.TAG_LIB.equals(elementName)) {
String uri = elements[j].getAttribute("uri"); //$NON-NLS-1$
- String location = elements[j].getAttribute("location"); //$NON-NLS-1$
String version = elements[j].getAttribute("version"); //$NON-NLS-1$
String name = elements[j].getAttribute("name"); //$NON-NLS-1$
- Bundle sourcePlugin = Platform.getBundle(elements[j].getNamespaceIdentifier());
- File schemaLocation = null;
- try {
- String pluginPath = FileLocator.resolve(sourcePlugin.getEntry("/")).getPath(); //$NON-NLS-1$
- if(uri==null || uri.length()==0 || location==null || location.length()==0) {
- WebKbPlugin.getDefault().logWarning("Incorrect org.jboss.tools.jst.web.kb.KbTagLib extension in " + pluginPath + " plugin. URI or location can't be empty."); //$NON-NLS-1$ //$NON-NLS-2$
- continue;
- }
- schemaLocation = new File(pluginPath, location);
- } catch (IOException e) {
- WebKbPlugin.getDefault().logError(e);
- continue;
- }
- if(schemaLocation.isFile()) {
- CustomTagLibrary lib = FACELETS_HTML_TAG_LIB_URI.equals(uri)?new HTMLTagLibrary(schemaLocation, uri, version, name):new CustomTagLibrary(schemaLocation, uri, version, name);
- libSet.add(lib);
- } else {
- WebKbPlugin.getDefault().logWarning("Can't load KB schema: " + schemaLocation); //$NON-NLS-1$
- }
+ InputStream schemaStream = getInputStream(elements[j]);
+ CustomTagLibrary lib = FACELETS_HTML_TAG_LIB_URI.equals(uri)?new HTMLTagLibrary(schemaStream, uri, version, name):new CustomTagLibrary(schemaStream, uri, version, name);
+ libSet.add(lib);
} else if(CustomTagLibrary.COMPONET_EXTENSION.equals(elementName)) {
- String location = elements[j].getAttribute("location"); //$NON-NLS-1$
- Bundle sourcePlugin = Platform.getBundle(elements[j].getNamespaceIdentifier());
- File schemaLocation = null;
+ InputStream schemaStream = getInputStream(elements[j]);
+ Document document = null;
try {
- String pluginPath = FileLocator.resolve(sourcePlugin.getEntry("/")).getPath(); //$NON-NLS-1$
- if(location==null || location.length()==0) {
- WebKbPlugin.getDefault().logWarning("Incorrect org.jboss.tools.jst.web.kb.KbTagLib extension in " + pluginPath + " plugin. Location can't be empty."); //$NON-NLS-1$ //$NON-NLS-2$
- continue;
- }
- schemaLocation = new File(pluginPath, location);
+ DocumentBuilder builder = CustomTagLibrary.createDocumentBuilder(false);
+ document = builder.parse(schemaStream);
+ } catch (SAXException e) {
+ WebKbPlugin.getDefault().logError(e);
} catch (IOException e) {
WebKbPlugin.getDefault().logError(e);
- continue;
+ } catch (ParserConfigurationException e) {
+ WebKbPlugin.getDefault().logError(e);
}
- if(schemaLocation.isFile()) {
- Document document = null;
- try {
- DocumentBuilder builder = CustomTagLibrary.createDocumentBuilder(false);
- document = builder.parse(schemaLocation);
- } catch (SAXException e) {
- WebKbPlugin.getDefault().logError(e);
- } catch (IOException e) {
- WebKbPlugin.getDefault().logError(e);
- } catch (ParserConfigurationException e) {
- WebKbPlugin.getDefault().logError(e);
- }
- Element root = document.getDocumentElement();
- CustomTagLibAttribute[] attributes = CustomTagLibrary.getAttributes(root);
- for (int k = 0; k < attributes.length; k++) {
- extensionSet.add(attributes[k]);
- }
- } else {
- WebKbPlugin.getDefault().logWarning("Can't load KB schema: " + schemaLocation); //$NON-NLS-1$
+ Element root = document.getDocumentElement();
+ CustomTagLibAttribute[] attributes = CustomTagLibrary.getAttributes(root);
+ for (int k = 0; k < attributes.length; k++) {
+ extensionSet.add(attributes[k]);
}
}
}
14 years, 7 months
JBoss Tools SVN: r20941 - trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-19 12:59:44 -0400 (Fri, 19 Mar 2010)
New Revision: 20941
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/studio_eclipse_option.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-5888
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/studio_eclipse_option.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/studio_eclipse_option.meta 2010-03-19 16:37:15 UTC (rev 20940)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/studio_eclipse_option.meta 2010-03-19 16:59:44 UTC (rev 20941)
@@ -214,6 +214,7 @@
<value name="2.3"/>
<value name="2.4"/>
<value name="2.5"/>
+ <value name="3.0"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
@@ -250,6 +251,7 @@
<value name="2.3"/>
<value name="2.4"/>
<value name="2.5"/>
+ <value name="3.0"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
@@ -562,6 +564,7 @@
<value name="2.3"/>
<value name="2.4"/>
<value name="2.5"/>
+ <value name="3.0"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
@@ -623,6 +626,7 @@
<value name="2.3"/>
<value name="2.4"/>
<value name="2.5"/>
+ <value name="3.0"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
14 years, 7 months
JBoss Tools SVN: r20940 - trunk/smooks/docs/reference/en-US/images/reference.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2010-03-19 12:37:15 -0400 (Fri, 19 Mar 2010)
New Revision: 20940
Added:
trunk/smooks/docs/reference/en-US/images/reference/reference_16.png
trunk/smooks/docs/reference/en-US/images/reference/reference_17.png
trunk/smooks/docs/reference/en-US/images/reference/reference_18.png
trunk/smooks/docs/reference/en-US/images/reference/reference_19.png
trunk/smooks/docs/reference/en-US/images/reference/reference_20.png
trunk/smooks/docs/reference/en-US/images/reference/reference_21.png
trunk/smooks/docs/reference/en-US/images/reference/reference_22.png
trunk/smooks/docs/reference/en-US/images/reference/reference_23.png
trunk/smooks/docs/reference/en-US/images/reference/reference_24.png
trunk/smooks/docs/reference/en-US/images/reference/reference_25.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-821 -added Apply Template Wizard section to Smooks-doc.</p>
</body></html>
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_16.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_17.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_17.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_18.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_18.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_19.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_19.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_20.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_21.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_21.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_22.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_22.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_23.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_23.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_24.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_24.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en-US/images/reference/reference_25.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en-US/images/reference/reference_25.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 7 months
JBoss Tools SVN: r20939 - trunk/smooks/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2010-03-19 12:35:27 -0400 (Fri, 19 Mar 2010)
New Revision: 20939
Modified:
trunk/smooks/docs/reference/en-US/references.xml
trunk/smooks/docs/reference/en-US/tasks.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-821 -added Apply Template Wizard section to Smooks-doc.</p>
</body></html>
Modified: trunk/smooks/docs/reference/en-US/references.xml
===================================================================
--- trunk/smooks/docs/reference/en-US/references.xml 2010-03-19 16:26:24 UTC (rev 20938)
+++ trunk/smooks/docs/reference/en-US/references.xml 2010-03-19 16:35:27 UTC (rev 20939)
@@ -11,493 +11,493 @@
<title>Reference</title>
<para>This chapter includes detailed reference information about all tabs of the Smooks Configuration Editor.</para>
<section id="process_tab">
- <title>Process tab</title>
- <para>The Process tab of the Smooks Configuration Editor helps to configure different types of transformations.
- By default smooks configuration file is opened in this editor.If you have another default settings for editor opening
- you should left click smooks configuration file and select:<emphasis>Open With->Smooks Configuration Editor</emphasis>.</para>
- <para>The Process tab has two sections:</para>
- <itemizedlist>
- <listitem><para><link linkend="processing_task_section">Processing Task section</link></para></listitem>
- <listitem><para><link linkend="selected_task_details">Selected Task Details section</link></para></listitem>
- </itemizedlist>
- <para>You can see them on the picture below.</para>
- <figure>
- <title>Two Sections of the Process tab.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_1.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- <section id="processing_task_section">
- <title>Processing Task section</title>
- <para>Using the popup menu in the Processing Task section you
- can select which types of technologies(templating or mapping ones) you will use for transofmation: </para>
- <para>The descriptions of the popup menu options are in the following table.</para>
- <table>
- <title>Process Tab. Processing Task section.</title>
- <tgroup cols="3">
- <colspec colnum="1" align="left" colwidth="1*"/>
- <colspec colnum="2" align="left" colwidth="3*"/>
- <colspec colnum="3" align="left" colwidth="1*"/>
-
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Description</entry>
- <entry>Default</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Add Task</entry>
- <entry>Select one of the following tasks according to the necessary type of Source and Result types of the files:
- <itemizedlist>
- <listitem><para><emphasis>Input</emphasis> - this task is required and
- appears automatically when Smooks config file is created.
- You should just configure it properly.</para></listitem>
- <listitem><para><emphasis>Java Mapping</emphasis></para></listitem>
- <listitem><para><emphasis>Apply Template</emphasis></para></listitem>
- </itemizedlist>
- </entry>
- <entry></entry>
- </row>
-
- <row>
- <entry>Delete</entry>
- <entry>Click this option if you want to delete some task from the section.
- Note:you can't delete input task because it's required.</entry>
- <entry></entry>
-
- </row>
-
- <row>
- <entry>Input Methods</entry>
- <entry>Choose one of the following methods:
- <itemizedlist>
- <listitem><para>System</para></listitem>
- <listitem><para>Simple</para></listitem>
- <listitem><para>Amharic(EZ+)</para></listitem>
- <listitem><para>Cedilla</para></listitem>
- <listitem><para>Cyrillic</para></listitem>
- <listitem><para>Inuktitut</para></listitem>
- <listitem><para>IPA</para></listitem>
- <listitem><para>Multipress</para></listitem>
- <listitem><para>SCIM Bridge Input Method</para></listitem>
- <listitem><para>SCIM Input Method</para></listitem>
- <listitem><para>Thai-Lio</para></listitem>
- <listitem><para>Tigrigna-Eritrean(EZ+)</para></listitem>
- <listitem><para>Tigrigna-Ethiopian(EZ+)</para></listitem>
- <listitem><para>Vietnamese</para></listitem>
- <listitem><para>X input Method</para></listitem>
- </itemizedlist>
- </entry>
- <entry>System</entry>
+ <title>Process tab</title>
+ <para>The Process tab of the Smooks Configuration Editor helps to configure different types of transformations.
+ By default smooks configuration file is opened in this editor.If you have another default settings for editor opening
+ you should left click smooks configuration file and select:<emphasis>Open With->Smooks Configuration Editor</emphasis>.</para>
+ <para>The Process tab has two sections:</para>
+ <itemizedlist>
+ <listitem><para><link linkend="processing_task_section">Processing Task section</link></para></listitem>
+ <listitem><para><link linkend="selected_task_details">Selected Task Details section</link></para></listitem>
+ </itemizedlist>
+ <para>You can see them on the picture below.</para>
+ <figure>
+ <title>Two Sections of the Process tab.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_1.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <section id="processing_task_section">
+ <title>Processing Task section</title>
+ <para>Using the popup menu in the Processing Task section you
+ can select which types of technologies(templating or mapping ones) you will use for transofmation: </para>
+ <para>The descriptions of the popup menu options are in the following table.</para>
+ <table>
+ <title>Process Tab. Processing Task section.</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="3*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
+
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Add Task</entry>
+ <entry>Select one of the following tasks according to the necessary type of Source and Result types of the files:
+ <itemizedlist>
+ <listitem><para><emphasis>Input</emphasis> - this task is required and
+ appears automatically when Smooks config file is created.
+ You should just configure it properly.</para></listitem>
+ <listitem><para><emphasis>Java Mapping</emphasis></para></listitem>
+ <listitem><para><emphasis>Apply Template</emphasis></para></listitem>
+ </itemizedlist>
+ </entry>
+ <entry></entry>
</row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id="selected_task_details">
- <title>Selected Task Details Section</title>
- <para>The options of this section depends on the selected task in the Processing Task section.
- Because there are 3 types of tasks there are 3 different sets of its options in the Selected Task Details Section.
- They will be described one by one. </para>
- <section>
- <title>Selected Task Details Section for Input Task.</title>
- <para>On the picture below you can find an example of Selected Task Details Section view
- if XML is selected as input type.</para>
-
- <figure>
- <title>Selected Task Details Section for Input XML Task.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_2.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>As you can see on the picture above Input Configuration section is empty for XML input file.
- But this section has special configuration options for CSV,EDI,JSON,Custom input files.</para>
-
- <para>Here are the screens of these configuration options:</para>
- <itemizedlist>
- <listitem><para>CSV:</para>
- <figure>
- <title>Selected Task Details Section for Input CSV Task.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_3.png" />
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem><para>EDI:</para>
- <figure>
- <title>Selected Task Details Section for Input EDI Task.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem><para>JSON:</para>
- <figure>
- <title>Selected Task Details Section for Input JSON Task.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem><para>Custom:</para>
- <figure>
- <title>Selected Task Details Section for Input Custom Task.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- <para>All the input task configuration positions can be found in the table below:</para>
- <table>
- <title>Selected Task Details Section. Options for Input Task.</title>
- <tgroup cols="3">
- <colspec colnum="1" align="left" colwidth="1*"/>
- <colspec colnum="2" align="left" colwidth="3*"/>
- <colspec colnum="3" align="left" colwidth="1*"/>
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Description</entry>
- <entry>Default</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Input type</entry>
- <entry>Select your type of input file.
- If don't find your type in the list,you should use Custom type:
- <itemizedlist>
- <listitem><para>No Input</para></listitem>
- <listitem><para>XML</para></listitem>
- <listitem><para>Java</para></listitem>
- <listitem><para>XSD/WSDL</para></listitem>
- <listitem><para>CSV</para></listitem>
- <listitem><para>EDI</para></listitem>
- <listitem><para>JSON</para></listitem>
- <listitem><para>Custom</para></listitem>
- </itemizedlist>
- </entry>
- <entry>XML</entry>
- </row>
-
- <row>
- <entry>Input configuration
-
- </entry>
- <entry>
- <itemizedlist>
- <listitem><para><emphasis>No Input</emphasis> - no info required</para></listitem>
- <listitem><para><emphasis>XML</emphasis> - no info required</para></listitem>
- <listitem><para><emphasis>Java</emphasis> - no info required</para></listitem>
- <listitem><para><emphasis>XSD/WSDL</emphasis> - no info required</para></listitem>
- <listitem><para><emphasis>CSV</emphasis></para><itemizedlist>
- <listitem><para><emphasis>Fields</emphasis> - Comma separated list of CSV record field names
- </para></listitem>
- <listitem><para><emphasis>Separator Character</emphasis> - Field separator character.
- </para></listitem>
- <listitem><para><emphasis>Quote Character</emphasis> - Quote character.
- </para></listitem>
- <listitem><para><emphasis>Record Name</emphasis> - Name of csv record element.</para></listitem>
- <listitem><para><emphasis>Root Name</emphasis> - Name of csv root element.</para></listitem>
- <listitem><para><emphasis>indent</emphasis> - Add indentation character data to
- the generated event stream. This simply makes
- the generated event stream easier to read in its serialized form. Useful for
- testing etc.
- </para></listitem>
- <listitem><para><emphasis>Skip Lines</emphasis> - Number of lines to skip before processing starts.
- </para></listitem>
- </itemizedlist>
- </listitem>
- <listitem><para><emphasis>EDI</emphasis></para>
- <itemizedlist>
- <listitem><para><emphasis>Target Profile</emphasis> - Defines the output
- transformation profile
- </para></listitem>
- <listitem><para><emphasis>Encoding</emphasis> - The character encoding.</para></listitem>
- <listitem><para><emphasis>Mapping Model</emphasis> - Defines the EDI Mapping Model
- configuration for processing the
- EDI message stream to a stream of SAX events that can be processed by Smooks.</para></listitem>
- <listitem><para><emphasis>Validate</emphasis> - This attribute turns on/off datatype validation in the EDI Parser.
- Validation is on by default.
- It makes sense to turn datatype validation off on the EDI Reader
- if the EDI data is being bound into a Java Object model.
- </para></listitem>
- </itemizedlist>
- </listitem>
- <listitem><para><emphasis>JSON</emphasis></para>
- <itemizedlist>
- <listitem><para><emphasis>Target Profile</emphasis> - Defines the output transformation profile</para></listitem>
- <listitem><para><emphasis>Array Element Name</emphasis> - The element name of an array element.
- </para></listitem>
- <listitem><para><emphasis>Encoding</emphasis> - encoding: The default encoding of any JSON message
- InputStream processed by this Reader.</para></listitem>
- <listitem><para><emphasis>Illegal Element Name Char Replacement</emphasis> - If illegal characters are encountered in a JSON element name then they are replaced with this value.
- By default this is not defined, so that the reader doesn't doesn't search for illegal characters.
- </para></listitem>
- <listitem><para><emphasis>Indent</emphasis> - Add indentation character data to the generated event stream. This simply makes
- the generated event stream easier to read in its serialized form. Useful for
- testing etc.
- </para></listitem>
- <listitem><para><emphasis>Key Prefix on Numeric</emphasis> - The prefix character to add if the JSON node name starts with a number.
- By default this is not defined, so that the reader doesn't search for element names that start with a number.
- </para></listitem>
- <listitem><para><emphasis>Key Whitespace Replacement</emphasis> - The replacement character for whitespaces in a JSON map key.
- By default this not defined, so that the reader doesn't search for whitespaces.
- </para></listitem>
- <listitem><para><emphasis>Null Value Replacement</emphasis> - The replacement string for JSON NULL values.</para></listitem>
- <listitem><para><emphasis>Root Name</emphasis> - The element name of the document root.
- </para></listitem>
- <listitem><para><emphasis>Key Maps</emphasis> - Defines a JSON element name mapping
- The "from" key will be replaced with the "to" key or the contents of the element.
- </para></listitem>
- </itemizedlist>
- </listitem>
- <listitem><para><emphasis>Custom</emphasis></para>
- <itemizedlist>
- <listitem><para><emphasis>Target Profile</emphasis> - Defines the output transformation profile</para></listitem>
- <listitem><para><emphasis>Class</emphasis> - Custom reader class.</para></listitem>
- <listitem><para><emphasis>Handlers</emphasis> - Set a handler on the reader instance e.g. an EntityResolver, ErrorHandler etc.
- </para></listitem>
- <listitem><para><emphasis>Features</emphasis> - Reader Features List</para></listitem>
- <listitem><para><emphasis>Parametres</emphasis> - Resource Parameters</para></listitem>
-
- </itemizedlist>
- </listitem>
- </itemizedlist></entry>
- <entry><itemizedlist>
- <listitem><para><emphasis>CSV</emphasis></para><itemizedlist>
- <listitem><para>not defined</para></listitem>
- <listitem><para>','</para></listitem>
- <listitem><para>'"'</para></listitem>
- <listitem><para>csv-record</para></listitem>
- <listitem><para>csv-set</para></listitem>
- <listitem><para>true</para></listitem>
- <listitem><para>0</para></listitem>
- </itemizedlist>
- </listitem>
- <listitem><para><emphasis>EDI</emphasis></para>
- <itemizedlist>
- <listitem><para>not defined</para></listitem>
- <listitem><para>UTF-8</para></listitem>
- <listitem><para>not defined</para></listitem>
- <listitem><para>true</para></listitem>
- </itemizedlist>
- </listitem>
- <listitem><para><emphasis>JSON</emphasis></para>
- <itemizedlist>
- <listitem><para>not defined</para></listitem>
- <listitem><para>element</para></listitem>
- <listitem><para>UTF-8</para></listitem>
- <listitem><para>not defined</para></listitem>
- <listitem><para>false</para></listitem>
- <listitem><para>not defined</para></listitem>
- <listitem><para>not defined</para></listitem>
- <listitem><para>""(an empty string)</para></listitem>
- <listitem><para>'json'</para></listitem>
- <listitem><para>not defined</para></listitem>
- </itemizedlist>
- </listitem>
- <listitem><para><emphasis>Custom</emphasis></para>
- <itemizedlist>
- <listitem><para>no defaults</para></listitem>
-
- </itemizedlist>
- </listitem>
- </itemizedlist></entry>
- </row>
- <row>
- <entry>Input Data</entry>
- <entry>You should select a data file using <emphasis>Add</emphasis> and <emphasis>Delete</emphasis> buttons</entry>
- <entry></entry>
- </row>
- <row>
- <entry>Input Model View</entry>
- <entry>Using this view you can see the structure of your input file.If the file has been changed, to see the changes
- click <emphasis>Refresh</emphasis>link.</entry>
- <entry></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id="mapping_task"><title>Selected Task Details section for Java Mapping Task.</title>
- <para>Selected Task Details section for this task is presented by the graf,
- that lighten the process of java mapping. </para>
- <figure>
- <title>Selected Task Details Section for Mapping Task.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_7.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>This graphical editor allows you to perform drag&drop operation with the nodes of transformed data to map the source data to target data.
- When you save the changes in the graphical editor the correct Smooks configuration file content will be generated. </para>
- <para>Using the popup menu in the <emphasis>Selected Task Details</emphasis> section you
- can manage the diagram elements on the canvas. </para>
- <para>The descriptions of the popup menu options are in the following table.</para>
- <table id="popup">
- <title>Popup menu. Selected Task Details section.</title>
- <tgroup cols="3">
- <colspec colnum="1" align="left" colwidth="1*"/>
- <colspec colnum="2" align="left" colwidth="3*"/>
- <colspec colnum="3" align="left" colwidth="1*"/>
-
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Description</entry>
- <entry>Default</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Add</entry>
- <entry>Select one of the following tasks:
- <itemizedlist>
- <listitem><para><emphasis>Java Class</emphasis> - adds bean context item to the config file.
- This option is available when no elements are selected and a user right click the canvas.
- </para></listitem>
- <listitem><para><emphasis>Expession Binding</emphasis> - adds expression based
- binding to selected java binding element.</para></listitem>
- <listitem><para><emphasis>Value Binding</emphasis> - adds Value binding (<jb:value>)
- to the selected java binding element.</para></listitem>
- <listitem><para><emphasis>Bean Binding</emphasis> - adds Wiring binding (<jb:wiring>)
- to the selected java binding element.</para></listitem>
- </itemizedlist>
- </entry>
- <entry></entry>
- </row>
- <row>
- <entry>Undo</entry>
- <entry>By this option you can revert the changes made at the previous step.
- </entry>
- <entry></entry>
-
- </row>
- <row>
- <entry>Redo</entry>
- <entry>By this option you can redo the changes made at the previous step.
- </entry>
- <entry></entry>
-
- </row>
- <row>
- <entry>Delete</entry>
- <entry>This option is available only if you select some element on the canvas.
- Click this option if you want to delete the element from it.
- </entry>
- <entry></entry>
-
- </row>
- <row>
- <entry>Auto Layout</entry>
- <entry>Sets the default layout of the elements on the canvas.</entry>
- <entry></entry>
-
- </row>
- <row>
- <entry>Properties</entry>
- <entry>Click this option if you want to add <emphasis>Properties view</emphasis>
- to the current perspective.
- The just opened <emphasis>Properties view</emphasis>
- will automatically reflect the properties of the selected
- diagram element.
- </entry>
- <entry></entry>
- </row>
-
- <row>
- <entry>Input Methods</entry>
- <entry>Choose one of the following methods:
- <itemizedlist>
- <listitem><para>System</para></listitem>
- <listitem><para>Simple</para></listitem>
- <listitem><para>Amharic(EZ+)</para></listitem>
- <listitem><para>Cedilla</para></listitem>
- <listitem><para>Cyrillic</para></listitem>
- <listitem><para>Inuktitut</para></listitem>
- <listitem><para>IPA</para></listitem>
- <listitem><para>Multipress</para></listitem>
- <listitem><para>SCIM Bridge Input Method</para></listitem>
- <listitem><para>SCIM Input Method</para></listitem>
- <listitem><para>Thai-Lio</para></listitem>
- <listitem><para>Tigrigna-Eritrean(EZ+)</para></listitem>
- <listitem><para>Tigrigna-Ethiopian(EZ+)</para></listitem>
- <listitem><para>Vietnamese</para></listitem>
- <listitem><para>X input Method</para></listitem>
- </itemizedlist>
- </entry>
- <entry>System</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section><title>Selected Task Details section for Template Task.</title>
- <para>Selected Task Details section for this task is presented by the graf,
- that is similar to the one in the <link linkend="mapping_task">previous section</link>.
- </para>
- <figure>
- <title>Selected Task Details Section for Template Task.</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_7a.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Popup menu similar to the one in <link linkend="popup">Selected Task Details section
- for Java Mapping Task</link> is also available here.</para>
+
+ <row>
+ <entry>Delete</entry>
+ <entry>Click this option if you want to delete some task from the section.
+ Note:you can't delete input task because it's required.</entry>
+ <entry></entry>
+
+ </row>
+
+ <row>
+ <entry>Input Methods</entry>
+ <entry>Choose one of the following methods:
+ <itemizedlist>
+ <listitem><para>System</para></listitem>
+ <listitem><para>Simple</para></listitem>
+ <listitem><para>Amharic(EZ+)</para></listitem>
+ <listitem><para>Cedilla</para></listitem>
+ <listitem><para>Cyrillic</para></listitem>
+ <listitem><para>Inuktitut</para></listitem>
+ <listitem><para>IPA</para></listitem>
+ <listitem><para>Multipress</para></listitem>
+ <listitem><para>SCIM Bridge Input Method</para></listitem>
+ <listitem><para>SCIM Input Method</para></listitem>
+ <listitem><para>Thai-Lio</para></listitem>
+ <listitem><para>Tigrigna-Eritrean(EZ+)</para></listitem>
+ <listitem><para>Tigrigna-Ethiopian(EZ+)</para></listitem>
+ <listitem><para>Vietnamese</para></listitem>
+ <listitem><para>X input Method</para></listitem>
+ </itemizedlist>
+ </entry>
+ <entry>System</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</section>
- </section>
-
- </section>
- <section id="options_tab">
- <title>Options Tab</title>
- <para>This section describes Options tab of the Smooks Configuration File editor, gives short recommendations how this tab can be used during the project configuring.</para>
- <figure>
- <title> Options tab of the Smooks Configuration File editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_8.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <section id="selected_task_details">
+ <title>Selected Task Details Section</title>
+ <para>The options of this section depends on the selected task in the Processing Task section.
+ Because there are 3 types of tasks there are 3 different sets of its options in the Selected Task Details Section.
+ They will be described one by one. </para>
<section>
- <title>Smooks Configuration section</title>
- <para>
- In the <property>Smooks Configuration</property> section of <property>Options Tab</property>
- only one element is availible:Smooks Platform Version
+ <title>Selected Task Details Section for Input Task.</title>
+ <para>On the picture below you can find an example of Selected Task Details Section view
+ if XML is selected as input type.</para>
+
+ <figure>
+ <title>Selected Task Details Section for Input XML Task.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_2.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>As you can see on the picture above Input Configuration section is empty for XML input file.
+ But this section has special configuration options for CSV,EDI,JSON,Custom input files.</para>
+
+ <para>Here are the screens of these configuration options:</para>
+ <itemizedlist>
+ <listitem><para>CSV:</para>
+ <figure>
+ <title>Selected Task Details Section for Input CSV Task.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_3.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem><para>EDI:</para>
+ <figure>
+ <title>Selected Task Details Section for Input EDI Task.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem><para>JSON:</para>
+ <figure>
+ <title>Selected Task Details Section for Input JSON Task.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem><para>Custom:</para>
+ <figure>
+ <title>Selected Task Details Section for Input Custom Task.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ <para>All the input task configuration positions can be found in the table below:</para>
+ <table>
+ <title>Selected Task Details Section. Options for Input Task.</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="3*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Input type</entry>
+ <entry>Select your type of input file.
+ If don't find your type in the list,you should use Custom type:
+ <itemizedlist>
+ <listitem><para>No Input</para></listitem>
+ <listitem><para>XML</para></listitem>
+ <listitem><para>Java</para></listitem>
+ <listitem><para>XSD/WSDL</para></listitem>
+ <listitem><para>CSV</para></listitem>
+ <listitem><para>EDI</para></listitem>
+ <listitem><para>JSON</para></listitem>
+ <listitem><para>Custom</para></listitem>
+ </itemizedlist>
+ </entry>
+ <entry>XML</entry>
+ </row>
+
+ <row>
+ <entry>Input configuration
+
+ </entry>
+ <entry>
+ <itemizedlist>
+ <listitem><para><emphasis>No Input</emphasis> - no info required</para></listitem>
+ <listitem><para><emphasis>XML</emphasis> - no info required</para></listitem>
+ <listitem><para><emphasis>Java</emphasis> - no info required</para></listitem>
+ <listitem><para><emphasis>XSD/WSDL</emphasis> - no info required</para></listitem>
+ <listitem><para><emphasis>CSV</emphasis></para><itemizedlist>
+ <listitem><para><emphasis>Fields</emphasis> - Comma separated list of CSV record field names
+ </para></listitem>
+ <listitem><para><emphasis>Separator Character</emphasis> - Field separator character.
+ </para></listitem>
+ <listitem><para><emphasis>Quote Character</emphasis> - Quote character.
+ </para></listitem>
+ <listitem><para><emphasis>Record Name</emphasis> - Name of csv record element.</para></listitem>
+ <listitem><para><emphasis>Root Name</emphasis> - Name of csv root element.</para></listitem>
+ <listitem><para><emphasis>indent</emphasis> - Add indentation character data to
+ the generated event stream. This simply makes
+ the generated event stream easier to read in its serialized form. Useful for
+ testing etc.
+ </para></listitem>
+ <listitem><para><emphasis>Skip Lines</emphasis> - Number of lines to skip before processing starts.
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><emphasis>EDI</emphasis></para>
+ <itemizedlist>
+ <listitem><para><emphasis>Target Profile</emphasis> - Defines the output
+ transformation profile
+ </para></listitem>
+ <listitem><para><emphasis>Encoding</emphasis> - The character encoding.</para></listitem>
+ <listitem><para><emphasis>Mapping Model</emphasis> - Defines the EDI Mapping Model
+ configuration for processing the
+ EDI message stream to a stream of SAX events that can be processed by Smooks.</para></listitem>
+ <listitem><para><emphasis>Validate</emphasis> - This attribute turns on/off datatype validation in the EDI Parser.
+ Validation is on by default.
+ It makes sense to turn datatype validation off on the EDI Reader
+ if the EDI data is being bound into a Java Object model.
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><emphasis>JSON</emphasis></para>
+ <itemizedlist>
+ <listitem><para><emphasis>Target Profile</emphasis> - Defines the output transformation profile</para></listitem>
+ <listitem><para><emphasis>Array Element Name</emphasis> - The element name of an array element.
+ </para></listitem>
+ <listitem><para><emphasis>Encoding</emphasis> - encoding: The default encoding of any JSON message
+ InputStream processed by this Reader.</para></listitem>
+ <listitem><para><emphasis>Illegal Element Name Char Replacement</emphasis> - If illegal characters are encountered in a JSON element name then they are replaced with this value.
+ By default this is not defined, so that the reader doesn't doesn't search for illegal characters.
+ </para></listitem>
+ <listitem><para><emphasis>Indent</emphasis> - Add indentation character data to the generated event stream. This simply makes
+ the generated event stream easier to read in its serialized form. Useful for
+ testing etc.
+ </para></listitem>
+ <listitem><para><emphasis>Key Prefix on Numeric</emphasis> - The prefix character to add if the JSON node name starts with a number.
+ By default this is not defined, so that the reader doesn't search for element names that start with a number.
+ </para></listitem>
+ <listitem><para><emphasis>Key Whitespace Replacement</emphasis> - The replacement character for whitespaces in a JSON map key.
+ By default this not defined, so that the reader doesn't search for whitespaces.
+ </para></listitem>
+ <listitem><para><emphasis>Null Value Replacement</emphasis> - The replacement string for JSON NULL values.</para></listitem>
+ <listitem><para><emphasis>Root Name</emphasis> - The element name of the document root.
+ </para></listitem>
+ <listitem><para><emphasis>Key Maps</emphasis> - Defines a JSON element name mapping
+ The "from" key will be replaced with the "to" key or the contents of the element.
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><emphasis>Custom</emphasis></para>
+ <itemizedlist>
+ <listitem><para><emphasis>Target Profile</emphasis> - Defines the output transformation profile</para></listitem>
+ <listitem><para><emphasis>Class</emphasis> - Custom reader class.</para></listitem>
+ <listitem><para><emphasis>Handlers</emphasis> - Set a handler on the reader instance e.g. an EntityResolver, ErrorHandler etc.
+ </para></listitem>
+ <listitem><para><emphasis>Features</emphasis> - Reader Features List</para></listitem>
+ <listitem><para><emphasis>Parametres</emphasis> - Resource Parameters</para></listitem>
+
+ </itemizedlist>
+ </listitem>
+ </itemizedlist></entry>
+ <entry><itemizedlist>
+ <listitem><para><emphasis>CSV</emphasis></para><itemizedlist>
+ <listitem><para>not defined</para></listitem>
+ <listitem><para>','</para></listitem>
+ <listitem><para>'"'</para></listitem>
+ <listitem><para>csv-record</para></listitem>
+ <listitem><para>csv-set</para></listitem>
+ <listitem><para>true</para></listitem>
+ <listitem><para>0</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><emphasis>EDI</emphasis></para>
+ <itemizedlist>
+ <listitem><para>not defined</para></listitem>
+ <listitem><para>UTF-8</para></listitem>
+ <listitem><para>not defined</para></listitem>
+ <listitem><para>true</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><emphasis>JSON</emphasis></para>
+ <itemizedlist>
+ <listitem><para>not defined</para></listitem>
+ <listitem><para>element</para></listitem>
+ <listitem><para>UTF-8</para></listitem>
+ <listitem><para>not defined</para></listitem>
+ <listitem><para>false</para></listitem>
+ <listitem><para>not defined</para></listitem>
+ <listitem><para>not defined</para></listitem>
+ <listitem><para>""(an empty string)</para></listitem>
+ <listitem><para>'json'</para></listitem>
+ <listitem><para>not defined</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><emphasis>Custom</emphasis></para>
+ <itemizedlist>
+ <listitem><para>no defaults</para></listitem>
+
+ </itemizedlist>
+ </listitem>
+ </itemizedlist></entry>
+ </row>
+ <row>
+ <entry>Input Data</entry>
+ <entry>You should select a data file using <emphasis>Add</emphasis> and <emphasis>Delete</emphasis> buttons</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>Input Model View</entry>
+ <entry>Using this view you can see the structure of your input file.If the file has been changed, to see the changes
+ click <emphasis>Refresh</emphasis>link.</entry>
+ <entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section id="mapping_task"><title>Selected Task Details section for Java Mapping Task.</title>
+ <para>Selected Task Details section for this task is presented by the graf,
+ that lighten the process of java mapping. </para>
+ <figure>
+ <title>Selected Task Details Section for Mapping Task.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_7.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>This graphical editor allows you to perform drag&drop operation with the nodes of transformed data to map the source data to target data.
+ When you save the changes in the graphical editor the correct Smooks configuration file content will be generated. </para>
+ <para>Using the popup menu in the <emphasis>Selected Task Details</emphasis> section you
+ can manage the diagram elements on the canvas. </para>
+ <para>The descriptions of the popup menu options are in the following table.</para>
+ <table id="popup">
+ <title>Popup menu. Selected Task Details section.</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="3*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
+
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Add</entry>
+ <entry>Select one of the following tasks:
+ <itemizedlist>
+ <listitem><para><emphasis>Java Class</emphasis> - adds bean context item to the config file.
+ This option is available when no elements are selected and a user right click the canvas.
+ </para></listitem>
+ <listitem><para><emphasis>Expession Binding</emphasis> - adds expression based
+ binding to selected java binding element.</para></listitem>
+ <listitem><para><emphasis>Value Binding</emphasis> - adds Value binding (<jb:value>)
+ to the selected java binding element.</para></listitem>
+ <listitem><para><emphasis>Bean Binding</emphasis> - adds Wiring binding (<jb:wiring>)
+ to the selected java binding element.</para></listitem>
+ </itemizedlist>
+ </entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>Undo</entry>
+ <entry>By this option you can revert the changes made at the previous step.
+ </entry>
+ <entry></entry>
+
+ </row>
+ <row>
+ <entry>Redo</entry>
+ <entry>By this option you can redo the changes made at the previous step.
+ </entry>
+ <entry></entry>
+
+ </row>
+ <row>
+ <entry>Delete</entry>
+ <entry>This option is available only if you select some element on the canvas.
+ Click this option if you want to delete the element from it.
+ </entry>
+ <entry></entry>
+
+ </row>
+ <row>
+ <entry>Auto Layout</entry>
+ <entry>Sets the default layout of the elements on the canvas.</entry>
+ <entry></entry>
+
+ </row>
+ <row>
+ <entry>Properties</entry>
+ <entry>Click this option if you want to add <emphasis>Properties view</emphasis>
+ to the current perspective.
+ The just opened <emphasis>Properties view</emphasis>
+ will automatically reflect the properties of the selected
+ diagram element.
+ </entry>
+ <entry></entry>
+ </row>
+
+ <row>
+ <entry>Input Methods</entry>
+ <entry>Choose one of the following methods:
+ <itemizedlist>
+ <listitem><para>System</para></listitem>
+ <listitem><para>Simple</para></listitem>
+ <listitem><para>Amharic(EZ+)</para></listitem>
+ <listitem><para>Cedilla</para></listitem>
+ <listitem><para>Cyrillic</para></listitem>
+ <listitem><para>Inuktitut</para></listitem>
+ <listitem><para>IPA</para></listitem>
+ <listitem><para>Multipress</para></listitem>
+ <listitem><para>SCIM Bridge Input Method</para></listitem>
+ <listitem><para>SCIM Input Method</para></listitem>
+ <listitem><para>Thai-Lio</para></listitem>
+ <listitem><para>Tigrigna-Eritrean(EZ+)</para></listitem>
+ <listitem><para>Tigrigna-Ethiopian(EZ+)</para></listitem>
+ <listitem><para>Vietnamese</para></listitem>
+ <listitem><para>X input Method</para></listitem>
+ </itemizedlist>
+ </entry>
+ <entry>System</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section><title>Selected Task Details section for Template Task.</title>
+ <para>Selected Task Details section for this task is presented by the graf,
+ that is similar to the one in the <link linkend="mapping_task">previous section</link>.
</para>
<figure>
- <title>Smooks Configuration section of Options tab</title>
+ <title>Selected Task Details Section for Template Task.</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/reference/reference_9.png" scale="90"/>
+ <imagedata fileref="images/reference/reference_7a.png" scale="90"/>
</imageobject>
</mediaobject>
</figure>
- <para>This parameter is not rechangable,
- and is set according to the vesion of the Smooks libraries that are added to the project.
- </para>
+ <para>Popup menu similar to the one in <link linkend="popup">Selected Task Details section
+ for Java Mapping Task</link> is also available here.</para>
</section>
+ </section>
+ </section>
+ <section id="options_tab">
+ <title>Options Tab</title>
+ <para>This section describes Options tab of the Smooks Configuration File editor, gives short recommendations how this tab can be used during the project configuring.</para>
+ <figure>
+ <title> Options tab of the Smooks Configuration File editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_8.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
<section>
+ <title>Smooks Configuration section</title>
+ <para>
+ In the <property>Smooks Configuration</property> section of <property>Options Tab</property>
+ only one element is availible:Smooks Platform Version
+ </para>
+ <figure>
+ <title>Smooks Configuration section of Options tab</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_9.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>This parameter is not rechangable,
+ and is set according to the vesion of the Smooks libraries that are added to the project.
+ </para>
+ </section>
+
+ <section>
<title>Filter Settings Filter section</title>
<para>
In Filter Settings section you can set
@@ -555,176 +555,314 @@
</table>
</section>
</section>
- <section id="smooksformeditor_sourcetab" xreflabel="Smooks Source Tab">
-
- <title>Source Tab</title>
- <para>This section provides information about Smooks Source Editor Page.</para>
- <section>
- <title>XML Source Editor</title>
- <para>You can use this editor to edit the Smooks Configuration file directly. </para>
- <figure>
- <title>Graphical Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/source_editor/source_editor1.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section>
- <title>Error underlining in Graphical Editor</title>
- <para>If the <property>Smooks tools</property> can't understand the configuration
- file or the configuration file is illegal (XML structure isn't right for Smooks
- Configuration file, etc.), the error is underlined.</para>
- <figure>
- <title>Graphical Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_11.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
- <section>
- <title>Smooks Configuration File Validator</title>
- <para>Smooks configuration file validator will validate your Smooks configuration file. Just right-click on the file and then click on the <property>Validate</property> button. The validator can be enabled/disabled in <emphasis><property>Window -> Preferences -> Validation</property></emphasis>:</para>
-
- <figure>
- <title>Validation: Smooks Configuration File Validator</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/source_editor/smooks_conf_validator.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You can set up your Smooks validator to include, exclude groups to validate and specify rules for validation. Just click on the <property>Settings</property> button and use the options provided:</para>
-
- <figure>
- <title>Smooks Configuration File Validator Settings</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/source_editor/smooks_conf_validator_settings.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <section id="smooksformeditor_sourcetab" xreflabel="Smooks Source Tab">
+
+ <title>Source Tab</title>
+ <para>This section provides information about Smooks Source Editor Page.</para>
+ <section>
+ <title>XML Source Editor</title>
+ <para>You can use this editor to edit the Smooks Configuration file directly. </para>
+ <figure>
+ <title>Graphical Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/source_editor/source_editor1.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section>
+ <title>Error underlining in Graphical Editor</title>
+ <para>If the <property>Smooks tools</property> can't understand the configuration
+ file or the configuration file is illegal (XML structure isn't right for Smooks
+ Configuration file, etc.), the error is underlined.</para>
+ <figure>
+ <title>Graphical Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_11.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
- </section>
- </section>
-<section>
- <title>Properties View</title>
- <para><emphasis><property>Properties View</property></emphasis> is available for some
- elements on the canvas of Java Mapping and Apply Template Tasks,like:</para>
- <itemizedlist>
- <listitem><para><emphasis><property>Java mapping</property></emphasis>:java class members,its fields,
- links between input values and the class members;</para></listitem>
- <listitem><para><emphasis><property>Apply Template</property></emphasis>:output template.</para></listitem>
- </itemizedlist>
- <para>To add <emphasis><property>Properties View</property></emphasis>
- to the opened perspective the user can either open <property>Window->Show View->Preferences</property>
- in the toolbar or right click the element which properties he wants to inspect and select <property>Properties</property>
- in the popup menu.On the picture below you can see how this view looks like when some csv template is selected.
- </para>
- <figure>
+ </section>
+
+ <section>
+ <title>Smooks Configuration File Validator</title>
+ <para>Smooks configuration file validator will validate your Smooks configuration file. Just right-click on the file and then click on the <property>Validate</property> button. The validator can be enabled/disabled in <emphasis><property>Window -> Preferences -> Validation</property></emphasis>:</para>
+
+ <figure>
+ <title>Validation: Smooks Configuration File Validator</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/source_editor/smooks_conf_validator.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can set up your Smooks validator to include, exclude groups to validate and specify rules for validation. Just click on the <property>Settings</property> button and use the options provided:</para>
+
+ <figure>
+ <title>Smooks Configuration File Validator Settings</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/source_editor/smooks_conf_validator_settings.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+ </section>
+ <section>
<title>Properties View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_12.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>
- This view is fully syncronized with the canvas of <emphasis><property>Smooks Configuration Editor</property></emphasis>.
- This means that when you change selected element by click,the properties of a new element are immediatly displayed in it.
- Using <emphasis><property>Properties View</property></emphasis> you can edit all the properties of the selected item.
- </para>
- <figure>
- <title>Synchronization between Properties View and the canvas</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/reference/reference_13.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
- <section>
- <title>Decode Configuration</title>
- <para>Smooks tools support decode parameter configuration through the Decode tab in <emphasis>
- <property>Properties View</property></emphasis>
- activated by clicking the connection between input model and bean items. </para>
- <para>On the picture below you can see an example of decode configurations
- for mapping some Input Model Item to Date format:</para>
+ <para><emphasis><property>Properties View</property></emphasis> is available for some
+ elements on the canvas of Java Mapping and Apply Template Tasks,like:</para>
+ <itemizedlist>
+ <listitem><para><emphasis><property>Java mapping</property></emphasis>:java class members,its fields,
+ links between input values and the class members;</para></listitem>
+ <listitem><para><emphasis><property>Apply Template</property></emphasis>:output template.</para></listitem>
+ </itemizedlist>
+ <para>To add <emphasis><property>Properties View</property></emphasis>
+ to the opened perspective the user can either open <property>Window->Show View->Preferences</property>
+ in the toolbar or right click the element which properties he wants to inspect and select <property>Properties</property>
+ in the popup menu.On the picture below you can see how this view looks like when some csv template is selected.
+ </para>
<figure>
- <title>Decode Configuration tab in Properties View</title>
+ <title>Properties View</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/reference/reference_14.png" scale="90"/>
+ <imagedata fileref="images/reference/reference_12.png" scale="90"/>
</imageobject>
</mediaobject>
</figure>
- <table>
- <title>Decode Configuration tab in Properties View</title>
- <tgroup cols="3">
- <colspec colnum="1" align="left" colwidth="1*"/>
- <colspec colnum="2" align="left" colwidth="3*"/>
- <colspec colnum="3" align="left" colwidth="1*"/>
-
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Decoder</entry>
- <entry>Select from the dropdown list the type of decoder you need.
- </entry>
- </row>
-
- <row>
- <entry>Decoder Parameters</entry>
- <entry>For most decoders <emphasis><property>Decoder Parametres table</property></emphasis> is empty.
- But some of the decoders require configuration
- (like Data decoder on the picture above),so you should configure them
- by editing corresponding line in the <property>Value</property> row.
- For example for data decoder:
- <itemizedlist>
- <listitem><para><property>format</property> - Date format string</para></listitem>
- <listitem><para><property>locale country</property> - ISO Country Code.
- Upper case two-letter code defined by ISO-3166. </para></listitem>
- <listitem><para><property>locale language</property> - ISO Language Code.
- Lower case two-letter code defined by ISO-639. </para></listitem>
- </itemizedlist>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>The Decoder Parameters section for EnumDecoder quite differs from other types of decoders.
- See the picture below:</para>
+ <para>
+ This view is fully syncronized with the canvas of <emphasis><property>Smooks Configuration Editor</property></emphasis>.
+ This means that when you change selected element by click,the properties of a new element are immediatly displayed in it.
+ Using <emphasis><property>Properties View</property></emphasis> you can edit all the properties of the selected item.
+ </para>
<figure>
- <title>EnumDecoder in Properties View</title>
+ <title>Synchronization between Properties View and the canvas</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/reference/reference_15.png" scale="90"/>
+ <imagedata fileref="images/reference/reference_13.png" scale="90"/>
</imageobject>
</mediaobject>
</figure>
- <para>The Decoder Parameters section in Properties View consists of 2 rows:</para>
- <itemizedlist>
- <listitem><para><property>From Data Value</property> - The lines in this row are editable.
- You can change them according to the names of enum types you used in input file.
- </para></listitem>
- <listitem><para><property>To Enum Value</property> - The lines in this row are not editable.
- Here the set of all the constants declared in mapped Enum type is listed.</para></listitem>
- </itemizedlist>
+ <section>
+ <title>Decode Configuration</title>
+ <para>Smooks tools support decode parameter configuration through the Decode tab in <emphasis>
+ <property>Properties View</property></emphasis>
+ activated by clicking the connection between input model and bean items. </para>
+ <para>On the picture below you can see an example of decode configurations
+ for mapping some Input Model Item to Date format:</para>
+ <figure>
+ <title>Decode Configuration tab in Properties View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_14.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The descriptions of the Decode Configuration tab options are in the following table:</para>
+ <table>
+ <title>Decode Configuration tab in Properties View</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" align="left" colwidth="3*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
+
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Decoder</entry>
+ <entry>Select from the dropdown list the type of decoder you need.
+ </entry>
+ </row>
+
+ <row>
+ <entry>Decoder Parameters</entry>
+ <entry>For most decoders <emphasis><property>Decoder Parametres table</property></emphasis> is empty.
+ But some of the decoders require configuration
+ (like Date decoder on the picture above),so you should configure them
+ by editing corresponding line in the <property>Value</property> row.
+ For example for Date Decoder:
+ <itemizedlist>
+ <listitem><para><property>format</property> - Date format string</para></listitem>
+ <listitem><para><property>locale country</property> - ISO Country Code.
+ Upper case two-letter code defined by ISO-3166. </para></listitem>
+ <listitem><para><property>locale language</property> - ISO Language Code.
+ Lower case two-letter code defined by ISO-639. </para></listitem>
+ </itemizedlist>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>The Decoder Parameters section for EnumDecoder quite differs from other types of decoders.
+ See the picture below:</para>
+ <figure>
+ <title>EnumDecoder in Properties View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_15.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The Decoder Parameters section in Properties View consists of 2 rows:</para>
+ <itemizedlist>
+ <listitem><para><property>From Data Value</property> - The lines in this row are editable.
+ You can change them according to the names of enum types you used in input file.
+ </para></listitem>
+ <listitem><para><property>To Enum Value</property> - The lines in this row are not editable.
+ Here a set of all constants declared in mapped Enum type is listed.
+ The user is responsible for correspondence between the values in these two rows. </para></listitem>
+ </itemizedlist>
+
+ <para>For more information about different decoder parametres read <ulink url="http://www.smooks.org/mediawiki/index.php?title=Main_Page">
+ Smooks Technology Documentation</ulink>.</para>
+ </section>
+ <section>
+ <title>Apply Template Wizard</title>
+ <para>The Apply Template Wizard helps you add a new Apply Template Task to
+ Smooks configuration file.
+ You can call it from the popup menu when Java Mapping Task in Processing
+ Task section is selected by selecting Add Task > Apply Template
+ (see <link linkend="apply_templ">Apply Template configuration</link> picture).</para>
+ <para>The wizard consists of several pages:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>The first one includes only one option to adjust.The user should select in
+ which of the two formats(XML or CSV) he prefer to create an output message:</para>
+ <figure>
+ <title>The first page of Apply Template Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_24.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </listitem>
+ <listitem><para>The second page is specific for each of the output message formats:</para>
+ <itemizedlist>
+ <listitem><para>If CSV output message type was selected at
+ the previous step the second wizard page will be the following :</para>
+ <figure>
+ <title>CSV:The second page of Apply Template Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_25.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The wizard page includes the next options to adjust:</para>
+
+ <table>
+ <title>Apply Template Wizard. Second Page Options if CSV output format is selected.</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" colwidth="3*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Fields</entry>
+ <entry>Comma separated list of CSV record field names.</entry>
+ <entry>Empty</entry>
+ </row>
+
+ <row>
+ <entry>Separator Character</entry>
+ <entry>Field separator character in the output message.</entry>
+ <entry>,</entry>
+ </row>
+
+ <row>
+ <entry>Quote Character</entry>
+ <entry>quote character in the output message.</entry>
+ <entry>"</entry>
+ </row>
+
+ <row>
+ <entry>Output Field name</entry>
+ <entry>Click the checkbox if you want the output csv message also include field names.</entry>
+ <entry></entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </listitem>
+ <listitem>
+ <para>The following second wizard page will appear
+ if XML output message type was selected at
+ the previous step:</para>
+ <figure>
+ <title>Apply Template Wizard. Second Page Options if XML output format is selected.</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_22.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Here you should firstly select XSD or Simple XML format of output template and then
+ click <property>Browse File System</property>
+ or <property>Browse Workspace</property> buttons depending on what
+ browse format you want to use.For example, if you click <property>Browse Workspace</property>
+ the following view will appear:
+ </para>
+ <figure>
+ <title>Browse Workspace</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_18.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>In the workspace you should select the template you
+ want to use and click <property>Ok</property>.
+ </para>
+ <para>If you selected XSD format after selecting the template you should click load button:
+ </para>
+ <figure>
+ <title>Load Button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_19.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>After that you should select in the <property>Select Root Element
+ </property> the root node and click Finish.</para>
+ <para>If you selected Sample XML option after selecting the template you should
+ only set a xml file destination and click finish:
+ </para>
+ <figure>
+ <title>Load Button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/reference_23.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </orderedlist>
+ </section>
- <para>For more information about different decoder parametres read <ulink url="http://www.smooks.org/mediawiki/index.php?title=Main_Page">
- Smooks Technology Documentation</ulink>.</para>
</section>
-</section>
-
</chapter>
Modified: trunk/smooks/docs/reference/en-US/tasks.xml
===================================================================
--- trunk/smooks/docs/reference/en-US/tasks.xml 2010-03-19 16:26:24 UTC (rev 20938)
+++ trunk/smooks/docs/reference/en-US/tasks.xml 2010-03-19 16:35:27 UTC (rev 20939)
@@ -162,7 +162,7 @@
<para>The "Apply Template" task works very similarly to the <link linkend="mapping">"Java Mapping" task</link>, where you map between an input model and an output model.
Select the <emphasis>Java Mapping</emphasis> task you want to use as the input model in the Process Map pane and click the plus (+) sign to the right of the icon.
</para>
- <figure>
+ <figure id="apply_templ">
<title>Apply Template configuration</title>
<mediaobject>
<imageobject>
14 years, 7 months
JBoss Tools SVN: r20938 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-03-19 12:26:24 -0400 (Fri, 19 Mar 2010)
New Revision: 20938
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropTarget.java
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
- Some comments have added.
- DropSpot has been renamed to DropTarget.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java 2010-03-19 16:14:58 UTC (rev 20937)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java 2010-03-19 16:26:24 UTC (rev 20938)
@@ -21,6 +21,8 @@
import org.mozilla.interfaces.nsIDOMNode;
/**
+ * Class responsible for showing the drag icon and the node being dragged.
+ *
* @author Yahor Radtsevich (yradtsevich)
*/
public class DraggablePattern {
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java 2010-03-19 16:14:58 UTC (rev 20937)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java 2010-03-19 16:26:24 UTC (rev 20938)
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.dnd;
-
-/**
- * @author Yahor Radtsevich (yradtsevich)
- *
- */
-public enum DropSpot {
- BEFORE,
- AFTER,
- BEGIN,
- END
-}
Copied: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropTarget.java (from rev 20936, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java)
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropTarget.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropTarget.java 2010-03-19 16:26:24 UTC (rev 20938)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.dnd;
+
+/**
+ * Target of a Drag&Drop action.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public enum DropTarget {
+ BEFORE,
+ AFTER,
+ BEGIN,
+ END
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java 2010-03-19 16:14:58 UTC (rev 20937)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java 2010-03-19 16:26:24 UTC (rev 20938)
@@ -23,17 +23,19 @@
import org.mozilla.interfaces.nsIDOMNode;
/**
+ * Class responsible for showing the place where the node being dragged
+ * could be dropped.
+ *
* @author Yahor Radtsevich (yradtsevich)
- *
*/
public class DropableArea {
private boolean visible;
- private EnumSet<DropSpot> dropSpots;
+ private EnumSet<DropTarget> dropTargets;
private final nsIDOMDocument document;
private nsIDOMNode node;
private nsIDOMElement domArea;
private static final String AREA_COLOR = "rgba(166, 202, 240, 0.5)"; //$NON-NLS-1$
- private DropSpot hightlightedSpot;
+ private DropTarget hightlightedDropTarget;
/**
*
@@ -51,10 +53,10 @@
}
/**
- * @param dropSpots cannot be null
+ * @param dropTargets cannot be null
*/
- public void setDropSpots(EnumSet<DropSpot> dropSpots) {
- this.dropSpots = dropSpots;
+ public void setDropTargets(EnumSet<DropTarget> dropTargets) {
+ this.dropTargets = dropTargets;
}
public void setVisible(boolean visible) {
@@ -62,31 +64,31 @@
}
public void setHighlightedSpot(int mouseX, int mouseY) {
- this.hightlightedSpot = getHighlightedSpot(mouseX, mouseY);
+ this.hightlightedDropTarget = getHighlightedDropTarget(mouseX, mouseY);
}
- public DropSpot getHighlightedSpot(int mouseX, int mouseY) {
+ public DropTarget getHighlightedDropTarget(int mouseX, int mouseY) {
if (node == null) {
return null;
}
Rectangle bounds = XulRunnerVpeUtils.getElementBounds(node);
- if (dropSpots.contains(DropSpot.BEFORE)
+ if (dropTargets.contains(DropTarget.BEFORE)
&& bounds.x <= mouseX
&& mouseX < bounds.x + bounds.width / 5) {
- return DropSpot.BEFORE;
- } else if (dropSpots.contains(DropSpot.AFTER)
+ return DropTarget.BEFORE;
+ } else if (dropTargets.contains(DropTarget.AFTER)
&& bounds.x + bounds.width * 4 / 5 <= mouseX
&& mouseX < bounds.x + bounds.width) {
- return DropSpot.AFTER;
- } else if (dropSpots.contains(DropSpot.BEGIN)
+ return DropTarget.AFTER;
+ } else if (dropTargets.contains(DropTarget.BEGIN)
&& bounds.y <= mouseY
&& mouseY < bounds.y + bounds.height / 5) {
- return DropSpot.BEGIN;
- } else if (dropSpots.contains(DropSpot.END)
+ return DropTarget.BEGIN;
+ } else if (dropTargets.contains(DropTarget.END)
&& bounds.y + bounds.height * 4 / 5 <= mouseY
&& mouseY < bounds.y + bounds.height) {
- return DropSpot.END;
+ return DropTarget.END;
} else {
return null;
}
@@ -112,25 +114,25 @@
nsIDOMCSSStyleDeclaration style;
nsIDOMElement line;
- if (dropSpots.contains(DropSpot.BEFORE)) {
- line = createVerticalLine(bounds.height, getColor(DropSpot.BEFORE));
+ if (dropTargets.contains(DropTarget.BEFORE)) {
+ line = createVerticalLine(bounds.height, getColor(DropTarget.BEFORE));
style = VpeStyleUtil.getStyle(line);
style.setProperty(HTML.STYLE_PARAMETER_LEFT,
VpeStyleUtil.toPxPosition(-6), HTML.STYLE_PRIORITY_DEFAULT);
domArea.appendChild(line);
}
- if (dropSpots.contains(DropSpot.AFTER)) {
- line = createVerticalLine(bounds.height, getColor(DropSpot.AFTER));
+ if (dropTargets.contains(DropTarget.AFTER)) {
+ line = createVerticalLine(bounds.height, getColor(DropTarget.AFTER));
style = VpeStyleUtil.getStyle(line);
style.setProperty(HTML.STYLE_PARAMETER_RIGHT,
VpeStyleUtil.toPxPosition(-6), HTML.STYLE_PRIORITY_DEFAULT);
domArea.appendChild(line);
}
- if (dropSpots.contains(DropSpot.BEGIN)) {
+ if (dropTargets.contains(DropTarget.BEGIN)) {
line = createHorizontalLine(bounds.width - 4,
- getColor(DropSpot.BEGIN));
+ getColor(DropTarget.BEGIN));
style = VpeStyleUtil.getStyle(line);
style.setProperty(HTML.STYLE_PARAMETER_LEFT,
VpeStyleUtil.toPxPosition(2), HTML.STYLE_PRIORITY_DEFAULT);
@@ -139,9 +141,9 @@
domArea.appendChild(line);
}
- if (dropSpots.contains(DropSpot.END)) {
+ if (dropTargets.contains(DropTarget.END)) {
line = createHorizontalLine(bounds.width - 4,
- getColor(DropSpot.END));
+ getColor(DropTarget.END));
style = VpeStyleUtil.getStyle(line);
style.setProperty(HTML.STYLE_PARAMETER_LEFT,
VpeStyleUtil.toPxPosition(2), HTML.STYLE_PRIORITY_DEFAULT);
@@ -155,8 +157,8 @@
}
}
- private String getColor(DropSpot dropSpot) {
- if (dropSpot == hightlightedSpot) {
+ private String getColor(DropTarget dropTarget) {
+ if (dropTarget == hightlightedDropTarget) {
return "red";
} else {
return "black";
14 years, 7 months
JBoss Tools SVN: r20937 - in trunk/maven: docs and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-03-19 12:14:58 -0400 (Fri, 19 Mar 2010)
New Revision: 20937
Added:
trunk/maven/docs/
trunk/maven/docs/maven_reference_guide/
trunk/maven/docs/maven_reference_guide/en-US/
trunk/maven/docs/maven_reference_guide/en-US/images/
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/configure_maven_integration.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/createMavenizedSeamProject.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/jbossM2capabilities.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/jbossMavenIntegrationFacet.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/mavenizedProjectStructure.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/seamFacetPage.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/seamJSFImplementation.png
trunk/maven/docs/maven_reference_guide/en-US/images/favicon0.ico
trunk/maven/docs/maven_reference_guide/en-US/images/jbosstools_logo.png
trunk/maven/docs/maven_reference_guide/en-US/introduction.xml
trunk/maven/docs/maven_reference_guide/en-US/links.xml
trunk/maven/docs/maven_reference_guide/en-US/master.xml
trunk/maven/docs/maven_reference_guide/en-US/master_output.xml
trunk/maven/docs/maven_reference_guide/en-US/tasks.xml
trunk/maven/docs/maven_reference_guide/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-1121 Maven guide is created (initial version - not finished) from seam chapter guide
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/configure_maven_integration.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/configure_maven_integration.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/createMavenizedSeamProject.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/createMavenizedSeamProject.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/jbossM2capabilities.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/jbossM2capabilities.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/jbossMavenIntegrationFacet.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/jbossMavenIntegrationFacet.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/mavenizedProjectStructure.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/mavenizedProjectStructure.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/seamFacetPage.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/seamFacetPage.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/seamJSFImplementation.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_seam/seamJSFImplementation.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/favicon0.ico
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/favicon0.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/jbosstools_logo.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/jbosstools_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/introduction.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/introduction.xml (rev 0)
+++ trunk/maven/docs/maven_reference_guide/en-US/introduction.xml 2010-03-19 16:14:58 UTC (rev 20937)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+<chapter id="introduction">
+ <?dbhtml filename="introduction.html"?>
+ <chapterinfo>
+ <keywordset>
+
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>JBoss</keyword>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Maven</keyword>
+ <keyword>Seam</keyword>
+
+ </keywordset>
+
+ </chapterinfo>
+ <title>Introduction</title>
+ <para>Starting from 3.1 M2 version JBoss Tools includes new Jboss Maven Integration plug-in which for now allows to create mavenized Seam projects and enable Seam tools support for imported Maven projects.</para>
+
+ <para>The Jboss Maven Integration requires m2eclipse to be installed.</para>
+ <note>
+ <title>Note:</title>
+ <para>For M2 release of <property>Jboss Tools</property> it is important to use m2eclipse
+ <ulink url="http://m2eclipse.sonatype.org/update/">stable updatesite</ulink> or the
+ <ulink url="http://m2eclipse.sonatype.org/releases/0.9.9.200906081351">latest
+ integration build</ulink> that M2 was developed against. If you want to use the
+ latest development release of m2eclipse you need to use the <ulink
+ url="http://download.jboss.org/jbosstools/updates/nightly/trunk/">nightly
+ builds</ulink> of <property>JBoss Tools</property>.</para>
+ </note>
+</chapter>
Added: trunk/maven/docs/maven_reference_guide/en-US/links.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/links.xml (rev 0)
+++ trunk/maven/docs/maven_reference_guide/en-US/links.xml 2010-03-19 16:14:58 UTC (rev 20937)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>JBDS</keyword>
+ <keyword>JBoss Tools</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Relevant Resources Links</title>
+ <para>In the <ulink url="http://in.relation.to/Bloggers/UsingMavenWithJBossTools">Using
+ Maven with JBoss Tools</ulink> article written by Max Andersen you'll find
+ references to the screencasts on how to use the examples of mavenized Seam projects
+ provided by <property>JBoss Tools</property>.</para>
+</chapter>
Added: trunk/maven/docs/maven_reference_guide/en-US/master.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/master.xml (rev 0)
+++ trunk/maven/docs/maven_reference_guide/en-US/master.xml 2010-03-19 16:14:58 UTC (rev 20937)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.docbook.org/xml/4.3/docbookx.dtd"
+
+[<!ENTITY introduction SYSTEM "introduction.xml">
+
+<!ENTITY tasks SYSTEM "tasks.xml">
+<!ENTITY links SYSTEM "links.xml">
+
+
+<!ENTITY seamlink "../../seam/html_single/index.html">
+<!ENTITY aslink "../../as/html_single/index.html">
+<!ENTITY esblink "../../esb_ref_guide/html_single/index.html">
+<!ENTITY gsglink "../../GettingStartedGuide/html_single/index.html">
+<!ENTITY hibernatelink "../../hibernatetools/html_single/index.html">
+<!ENTITY jbpmlink "../../jbpm/html_single/index.html">
+<!ENTITY jsflink "../../jsf/html_single/index.html">
+<!ENTITY jsfreflink "../../jsf_tools_ref_guide/html_single/index.html">
+<!ENTITY jsftutoriallink "../../jsf_tools_tutorial/html_single/index.html">
+<!ENTITY strutsreflink "../../struts_tools_ref_guide/html_single/index.html">
+<!ENTITY strutstutoriallink "../../struts_tools_tutorial/html_single/index.html">
+
+
+]>
+<book>
+ <bookinfo><title>JBoss Maven Integration Guide</title>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject role="fo">
+ <imagedata format="PNG" fileref="images/jbosstools_logo.png"/>
+ </imageobject>
+ <imageobject role="html">
+ <imagedata/>
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <author><firstname>Svetlana</firstname><surname>Mukhina</surname><email>smukhina(a)exadel.com</email></author><author><firstname>Olga</firstname><surname>Chikvina</surname></author>
+ <copyright>
+ <year>2010</year>
+ <holder>JBoss by Red Hat</holder>
+ </copyright>
+ <releaseinfo> Version: 3.1.0.GA </releaseinfo>
+ <abstract>
+ <title/>
+ <para>
+ <ulink
+ url="http://download.jboss.org/jbosstools/nightly-docs/en/maven/pdf/JBoss_Mave..."
+ >PDF version</ulink>
+ </para>
+ </abstract></bookinfo>
+ <toc/>
+ &introduction;
+ &tasks;
+ &links;
+</book>
Added: trunk/maven/docs/maven_reference_guide/en-US/master_output.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/master_output.xml (rev 0)
+++ trunk/maven/docs/maven_reference_guide/en-US/master_output.xml 2010-03-19 16:14:58 UTC (rev 20937)
@@ -0,0 +1,378 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.docbook.org/xml/4.3/docbookx.dtd"
+
+[<!ENTITY intro SYSTEM "introduction.xml">
+<!ENTITY creating_mavenized_seam SYSTEM "creating_mavenized_seam.xml">
+
+<!ENTITY seamlink "../../seam/html_single/index.html">
+<!ENTITY aslink "../../as/html_single/index.html">
+<!ENTITY esblink "../../esb_ref_guide/html_single/index.html">
+<!ENTITY gsglink "../../GettingStartedGuide/html_single/index.html">
+<!ENTITY hibernatelink "../../hibernatetools/html_single/index.html">
+<!ENTITY jbpmlink "../../jbpm/html_single/index.html">
+<!ENTITY jsflink "../../jsf/html_single/index.html">
+<!ENTITY jsfreflink "../../jsf_tools_ref_guide/html_single/index.html">
+<!ENTITY jsftutoriallink "../../jsf_tools_tutorial/html_single/index.html">
+<!ENTITY strutsreflink "../../struts_tools_ref_guide/html_single/index.html">
+<!ENTITY strutstutoriallink "../../struts_tools_tutorial/html_single/index.html">
+
+
+]><book xmlns:diffmk="http://diffmk.sf.net/ns/diff">
+
+ <bookinfo>
+
+ <title>JBoss Maven Integration Guide</title>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject role="fo">
+ <imagedata fileref="images/jbosstools_logo.png" format="PNG"></imagedata>
+ </imageobject>
+ <imageobject role="html">
+ <imagedata></imagedata>
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+
+
+ <author><firstname>Svetlana</firstname><surname>Mukhina</surname><email>smukhina(a)exadel.com</email></author>
+ <author><firstname>Olga</firstname><surname>Chikvina</surname></author>
+
+
+ <copyright>
+ <year>2010</year>
+ <holder>JBoss by Red Hat</holder>
+ </copyright>
+ <releaseinfo><diffmk:wrapper diffmk:change="changed">
+ Version: 3.1.0.GA
+ </diffmk:wrapper></releaseinfo>
+
+<abstract>
+ <title></title>
+ <para>
+ <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/maven/pdf/JBoss_Mave...">PDF version</ulink>
+ </para>
+</abstract>
+
+
+ </bookinfo>
+ <toc/>
+
+
+<chapter id="intro" xml:base="file:///home/vchukhutsina/repos/ochik_jboss/seam/docs/reference/en/modules/intro.xml" xreflabel="intro">
+ <?dbhtml filename="intro.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Seam</keyword>
+ <keyword>JBDS</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Introduction</title>
+
+ <section>
+
+ <title>What is Seam?</title>
+ <para>This introduction will help you to understand what is <property moreinfo="none">Seam</property>.</para>
+ <para><property moreinfo="none">Seam</property> is a fully featured application framework on top of Java EE
+ 5. It is also one of the most popular enterprise Java frameworks today. Seam deeply
+ integrates many other standard-based or open source frameworks (e.g., JSF, EJB3, JMS,
+ Web Services, jBPM, JBoss Rules, Ajax4jsf, RichFaces, Facelets, Spring, iText, Quartz,
+ TestNG, etc.), and provides a single programming model for developers to
+ "drive" those underlying frameworks via simple annotated POJOs (Plain
+ Old Java Objects). It makes life easier for developers to tackle complex enterprise
+ applications with many component frameworks.</para>
+ </section>
+
+ <section><title>Key Features of JBoss Seam</title>
+ <para>For a start, we propose you to look through the table of main features of JBoss Seam:</para>
+
+ <table>
+
+ <title>Key Functionality for JBoss Seam</title>
+ <tgroup cols="3">
+
+ <colspec align="left" colnum="1" colwidth="2*"></colspec>
+ <colspec colnum="2" colwidth="4*"></colspec>
+ <colspec align="left" colnum="3" colwidth="2*"></colspec>
+
+ <thead>
+ <row>
+ <entry>Feature</entry>
+ <entry>Benefit</entry>
+ <entry>Chapter</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry><para>Integrated JSF with EJB 3.0</para></entry>
+ <entry><para>JBoss Seam combines the component models of EJB3 and JSF, eliminating glue code, and thus, letting the developer think about the business problem.</para></entry>
+ </row>
+
+ <row>
+ <entry><para>Integrated AJAX</para></entry>
+ <entry><para>Developer can add AJAX capability to the user interface of his application without the need to write any JavaScript code as Seam supports JBoss RichFaces and ICEfaces - the best open source JSF-based AJAX solutions.</para></entry>
+ </row>
+
+ <row>
+ <entry><para>Bijection</para></entry>
+ <entry><para>Bijection allows auto-assembly of stateful components by the container. It even allows a component to safely and easily manipulate the value of a context variable, just by assigning it to an attribute of the component.</para></entry>
+ </row>
+
+ <row>
+ <entry><para>New Seam Project wizard</para></entry>
+ <entry><para>An easy step-by-step wizard to create a standalone Seam Web Project with a form to create runtime and server instances in order to get started creating, running, and debugging J2EE (only) applications. You may also add JSF capabilities.</para></entry>
+ <entry>
+ <link linkend="create_seam">New Seam Project wizard</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry><para>Seam component generations options </para></entry>
+ <entry><para>All the Seam component generations options known from Seam-gen are available as wizards (with sensible auto-defaulting) for creating various common Seam components.</para></entry>
+ <entry>
+ <link linkend="seam_wizards">Seam Wizards</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry><para>Seam Editors</para></entry>
+ <entry><para>Visual Page Editor, Seam Pages Editor and Seam Components Editor provide you with a range of great possibilities and will be helpful when working with JBoss Seam.</para></entry>
+ <entry>
+ <link linkend="seam_editors">Seam Editors</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry><para>Seam Validator</para></entry>
+ <entry><para>A configured Seam Validator provides validation of various possible problematic definitions.</para></entry>
+ <entry>
+ <link linkend="SeamValidation">Seam Validation</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry><para>CRUD Database Application Generation</para></entry>
+ <entry><para>JBoss Seam allows adding CRUD support to a Seam Web application.</para></entry>
+ <entry>
+ <link linkend="crud_database_application">CRUD Database Application</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry><para>TestNG Framework</para></entry>
+ <entry><para>TestNG ("Testing, the Next Generation") is a Java unit testing framework that aims to overcome many limitations of JUnit.</para></entry>
+ <entry>
+ <link linkend="testNG">Using TestNG project</link>
+ </entry>
+ </row>
+
+ </tbody>
+
+ </tgroup>
+ </table>
+
+
+
+
+
+
+
+
+</section>
+
+ <section>
+ <title>Installation into Eclipse</title>
+
+ <para>Here, we are going to explain how to install Seam plugin into Eclipse.</para>
+
+ <para>Seam is a one module of JBoss Tools project. Since Seam has a dependence on other JBoss Tools modules we recommend you to install
+ a bundle of all <ulink url="http://labs.jboss.com/tools/download.html">JBoss Tools plug-ins</ulink>. Installation instruction you can find on JBoss Wiki in <ulink url="http://labs.jboss.com/wiki/InstallingJBossTools">InstallingJBossTools</ulink> section.</para>
+
+ </section>
+
+ <section>
+ <title>Other relevant resources on the topic</title>
+
+ <para>The <ulink url="http://seamframework.org/">Seam Framework</ulink> - Next generation enterprise Java development.</para>
+ <para>All JBoss Developer Studio/JBoss Tools release documentation you can find at<ulink url="http://docs.jboss.org/tools/">http://docs.jboss.org/tools</ulink> in the corresponding release directory.</para>
+ <para>There is some extra information on <ulink url="http://www.jboss.org/community/wiki/JBossSeam">JBoss Wiki. </ulink></para>
+ <para>The latest documentation builds are available at <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">http://download.jboss.org/jbosstools/nightly-docs</ulink>.</para>
+ <para>You can find a set of screencasts on how to search/find references and use Seam refactoring tools in the following Max Andersen's
+ <ulink url="http://in.relation.to/12524.lace">blog post</ulink>.</para>
+ </section>
+</chapter>
+<chapter id="mavenized_seam" xml:base="file:///home/vchukhutsina/repos/ochik_jboss/seam/docs/reference/en/modules/creating_mavenized_seam.xml" xreflabel="mavenized_seam">
+ <?dbhtml filename="create_mavenized_seam.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Seam</keyword>
+ <keyword>JBDS</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Maven Integration for Seam Projects</title>
+ <para>Starting from 3.1 M2 version <property moreinfo="none">JBoss Tools</property> includes new Jboss Maven
+ Integration plug-in which for now allows to create mavenized Seam projects and enable Seam
+ tools support for imported Maven projects.</para>
+ <para>The Jboss Maven Integration requires <ulink url="http://m2eclipse.sonatype.org/">m2eclipse</ulink> to be installed.</para>
+ <note>
+ <title>Note:</title>
+ <para>For M2 release of <property moreinfo="none">Jboss Tools</property> it is important to use m2eclipse
+ <ulink url="http://m2eclipse.sonatype.org/update/">stable updatesite</ulink> or the
+ <ulink url="http://m2eclipse.sonatype.org/releases/0.9.9.200906081351">latest
+ integration build</ulink> that M2 was developed against. If you want to use the
+ latest development release of m2eclipse you need to use the <ulink url="http://download.jboss.org/jbosstools/updates/nightly/trunk/">nightly
+ builds</ulink> of <property moreinfo="none">JBoss Tools</property>.</para>
+ </note>
+ <section id="create_mavenized_project">
+ <title>Creating Maven ready Seam project</title>
+ <para>Maven Integration makes the Seam Wizard capable of creating Maven ready projects to
+ let Maven get the libraries instead of using the Seam runtime.</para>
+ <para>To create a mavenized Seam project you should perform the following steps:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Navigate to <emphasis>
+ <property moreinfo="none">File > New Seam Project</property>.</emphasis> Give the project
+ a meaningful name, specify a target runtime and server and select the proper
+ configuration for your Seam project:</para>
+ <figure float="0">
+ <title>Starting the Mavenized Seam Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/createMavenizedSeamProject.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Click the <emphasis>
+ <property moreinfo="none">Modify</property></emphasis> button to enable the <emphasis>
+ <property moreinfo="none">Jboss Maven Integration</property></emphasis> facet:</para>
+ <figure float="0">
+ <title>Enabling the Jboss Maven Integration Facet</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/jbossMavenIntegrationFacet.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>On the <property moreinfo="none">JBoss M2 capabilities</property> page you'll be prompted
+ to add the following maven properties: groupId, artifactId, version, packaging,
+ name and description. Here it's possible to set a maven version of Seam and
+ also decide whether to remove WTP classpath containers (where the path starts
+ with org.eclipse.jst). </para>
+ <figure float="0">
+ <title>Adjusting JBoss M2 Capabilities</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/jbossM2capabilities.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para> On the <property moreinfo="none">JSF Capabilities</property> page you can choose Maven as
+ libraries provider. This is possible when you use Maven JSF 1.2 Libraries as
+ type of JSF Implementing Library. Also it gives you capability to edit
+ Dependencies and Exclusions for the mavenized Seam project directly from the
+ wizard. </para>
+ <figure float="0">
+ <title>Using JSF Implementation libraries provided by Maven</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/seamJSFImplementation.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>On the <property moreinfo="none">Seam Facet</property> page configure the Seam Facet settings
+ and click <emphasis>
+ <property moreinfo="none">Finish</property>:</emphasis></para>
+ <figure float="0">
+ <title>Seam Facet Settings</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/seamFacetPage.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ <para>The organized Seam project contains five projects with the Maven nature, builder,
+ Maven classpath and the <emphasis>
+ <property moreinfo="none">pom.xml</property></emphasis> files added: projectname, projectname-ear,
+ projectname-ejb, projectname-parent and projectname-test.</para>
+ <figure float="0">
+ <title>Mavenized Seam Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/mavenizedProjectStructure.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="import_maven_project">
+ <title>Existing Maven Projects Import</title>
+ <para>Maven Integration includes the Seam Maven configurator which is called when importing
+ a project, changing <emphasis>
+ <property moreinfo="none">pom.xml</property></emphasis> and/or calling <emphasis>
+ <property moreinfo="none">Maven > Update Project Configuration</property>.</emphasis> When
+ importing a Maven Seam project, the Seam Maven configurator picks up the settings set up
+ in <emphasis>
+ <property moreinfo="none">pom.xml</property></emphasis> and adds to the project the
+ following:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Seam nature</para>
+ </listitem>
+ <listitem>
+ <para>Seam facet and dependent facets to the EJB, EAR and WAR projects</para>
+ </listitem>
+ <listitem>
+ <para>JBoss Maven Integration facet if the Maven project contains a dependency with
+ the org.jboss.seam groupId and an artifactId starting with 'jboss-seam'</para>
+ </listitem>
+ <listitem>
+ <para>other required facets (Web Module, Java, JSF, etc.)</para>
+ </listitem>
+ </itemizedlist>
+ <para>If the Seam version from <emphasis>
+ <property moreinfo="none">pom.xml</property></emphasis> matches a version of a Seam runtime
+ configured in the workspace, Seam configurator will set that runtime, otherwise no Seam
+ runtime will be set and you'll have to set it manually under <link linkend="project_pref">Seam Settings in the project preferences</link>.</para>
+ <para>Seam configurator recognizes the Seam artifacts in the following way: the view folder
+ is a web content folder from the WAR project, the source folder is the first Eclipse
+ source folder. If there is a folder containing "hot" in the name, it will be
+ chosen as the action source folder. Package is the first package that has children or
+ doesn't have any subpackage. </para>
+ <para>Configuring the Seam when importing a Maven project as well as a Seam Runtime, Seam
+ artifacts and some facets could be suspended in the JBoss Maven Integration preferences
+ (<emphasis>
+ <property moreinfo="none">Window > Preferences > JBoss Tools > JBoss Maven
+ Integration</property></emphasis>).</para>
+ <figure float="0">
+ <title>JBoss Maven Integration Preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/configure_maven_integration.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section>
+ <title>Relevant Resources Links</title>
+ <para>In the <ulink url="http://in.relation.to/Bloggers/UsingMavenWithJBossTools">Using
+ Maven with JBoss Tools</ulink> article written by Max Andersen you'll find
+ references to the screencasts on how to use the examples of mavenized Seam projects
+ provided by <property moreinfo="none">JBoss Tools</property>.</para>
+ </section>
+</chapter>
+
+</book>
Added: trunk/maven/docs/maven_reference_guide/en-US/tasks.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/tasks.xml (rev 0)
+++ trunk/maven/docs/maven_reference_guide/en-US/tasks.xml 2010-03-19 16:14:58 UTC (rev 20937)
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter id="tasks">
+ <?dbhtml filename="tasks.html"?>
+ <chapterinfo>
+ <keywordset>
+
+
+ <keyword>Eclipse</keyword>
+ <keyword>JBoss</keyword>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Maven</keyword>
+ <keyword>Seam</keyword>
+
+ </keywordset>
+ </chapterinfo>
+
+ <title>Tasks</title>
+ <para>This chapter will provide you with the information on how to create mavenized projects and import already existing maven project with JBoss Maven Tool.</para>
+ <section id="create_mavenized_project">
+ <title>Creating Maven ready Seam project</title>
+ <para>Maven Integration makes the Seam Wizard capable of creating Maven ready projects to
+ let Maven get the libraries instead of using the Seam runtime.</para>
+ <para>To create a mavenized Seam project you should perform the following steps:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Navigate to <emphasis>
+ <property>File > New Seam Project</property>.</emphasis> Give the project
+ a meaningful name, specify a target runtime and server and select the proper
+ configuration for your Seam project:</para>
+ <figure>
+ <title>Starting the Mavenized Seam Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_mavenized_seam/createMavenizedSeamProject.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Click the <emphasis>
+ <property>Modify</property></emphasis> button to enable the <emphasis>
+ <property>Jboss Maven Integration</property></emphasis> facet:</para>
+ <figure>
+ <title>Enabling the Jboss Maven Integration Facet</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_mavenized_seam/jbossMavenIntegrationFacet.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>On the <property>JBoss M2 capabilities</property> page you'll be prompted
+ to add the following maven properties: groupId, artifactId, version, packaging,
+ name and description. Here it's possible to set a maven version of Seam and
+ also decide whether to remove WTP classpath containers (where the path starts
+ with org.eclipse.jst). </para>
+ <figure>
+ <title>Adjusting JBoss M2 Capabilities</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_mavenized_seam/jbossM2capabilities.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para> On the <property>JSF Capabilities</property> page you can choose Maven as
+ libraries provider. This is possible when you use Maven JSF 1.2 Libraries as
+ type of JSF Implementing Library. Also it gives you capability to edit
+ Dependencies and Exclusions for the mavenized Seam project directly from the
+ wizard. </para>
+ <figure>
+ <title>Using JSF Implementation libraries provided by Maven</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_mavenized_seam/seamJSFImplementation.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>On the <property>Seam Facet</property> page configure the Seam Facet settings
+ and click <emphasis>
+ <property>Finish</property>:</emphasis></para>
+ <figure>
+ <title>Seam Facet Settings</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/seamFacetPage.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ <para>The organized Seam project contains five projects with the Maven nature, builder,
+ Maven classpath and the <emphasis>
+ <property>pom.xml</property></emphasis> files added: projectname, projectname-ear,
+ projectname-ejb, projectname-parent and projectname-test.</para>
+ <figure>
+ <title>Mavenized Seam Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_seam/mavenizedProjectStructure.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="import_maven_project">
+ <title>Existing Maven Projects Import</title>
+ <para>Maven Integration includes the Seam Maven configurator which is called when importing
+ a project, changing <emphasis>
+ <property>pom.xml</property></emphasis> and/or calling <emphasis>
+ <property>Maven > Update Project Configuration</property>.</emphasis> When
+ importing a Maven Seam project, the Seam Maven configurator picks up the settings set up
+ in <emphasis>
+ <property>pom.xml</property></emphasis> and adds to the project the
+ following:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Seam nature</para>
+ </listitem>
+ <listitem>
+ <para>Seam facet and dependent facets to the EJB, EAR and WAR projects</para>
+ </listitem>
+ <listitem>
+ <para>JBoss Maven Integration facet if the Maven project contains a dependency with
+ the org.jboss.seam groupId and an artifactId starting with 'jboss-seam'</para>
+ </listitem>
+ <listitem>
+ <para>other required facets (Web Module, Java, JSF, etc.)</para>
+ </listitem>
+ </itemizedlist>
+ <para>If the Seam version from <emphasis>
+ <property>pom.xml</property></emphasis> matches a version of a Seam runtime
+ configured in the workspace, Seam configurator will set that runtime, otherwise no Seam
+ runtime will be set and you'll have to set it manually under <link
+ linkend="project_pref">Seam Settings in the project preferences</link>.</para>
+ <para>Seam configurator recognizes the Seam artifacts in the following way: the view folder
+ is a web content folder from the WAR project, the source folder is the first Eclipse
+ source folder. If there is a folder containing "hot" in the name, it will be
+ chosen as the action source folder. Package is the first package that has children or
+ doesn't have any subpackage. </para>
+ <para>Configuring the Seam when importing a Maven project as well as a Seam Runtime, Seam
+ artifacts and some facets could be suspended in the JBoss Maven Integration preferences
+ (<emphasis>
+ <property>Window > Preferences > JBoss Tools > JBoss Maven
+ Integration</property></emphasis>).</para>
+ <figure>
+ <title>JBoss Maven Integration Preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_mavenized_seam/configure_maven_integration.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+
+
+
+</chapter>
Added: trunk/maven/docs/maven_reference_guide/pom.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/pom.xml (rev 0)
+++ trunk/maven/docs/maven_reference_guide/pom.xml 2010-03-19 16:14:58 UTC (rev 20937)
@@ -0,0 +1,152 @@
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jboss-maven-integration-guide-${translation}</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>JBoss_Maven_Integration_Guide</name>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
+ <id>releaseJBDS</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
+ </properties>
+ </profile>
+ <profile>
+ <id>diffmk</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-diff.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-diff.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf-diff.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+ <extensions>true</extensions>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-docbook-xslt</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-jdocbook-style</artifactId>
+ <version>1.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jbosstools-docbook-xslt</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>fop</artifactId>
+ <version>0.95</version>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <sourceDocumentName>${master}</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en-US</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en-US</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <cssResource>
+ <directory>${pom.basedir}/${cssdir}</directory>
+ </cssResource>
+
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>${xsl-pdf}</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>${xsl-chunked}</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>${xsl-single}</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats><profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources</stylesdir>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
+ <master>master.xml</master>
+ <translation>en-US</translation>
+ </properties>
+</project>
14 years, 7 months
JBoss Tools SVN: r20936 - in trunk/vpe/plugins/org.jboss.tools.vpe: src/org/jboss/tools/vpe/editor/util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-03-19 12:14:36 -0400 (Fri, 19 Mar 2010)
New Revision: 20936
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java
trunk/vpe/plugins/org.jboss.tools.vpe/ve/dragIcon.gif
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
- Created classes: DraggablePattern and DropableArea.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java 2010-03-19 16:00:30 UTC (rev 20935)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java 2010-03-19 16:14:36 UTC (rev 20936)
@@ -14,15 +14,19 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Stack;
+import java.util.Map.Entry;
import org.eclipse.swt.events.TypedEvent;
import org.jboss.tools.common.model.ui.editors.dnd.context.DropContext;
import org.jboss.tools.common.model.ui.editors.dnd.context.IDNDTextEditor;
import org.jboss.tools.vpe.editor.VpeController;
-import org.jboss.tools.vpe.editor.util.VpeDebugUtil;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.xulrunner.XPCOM;
import org.mozilla.interfaces.nsIComponentManager;
-import org.mozilla.interfaces.nsIDOMEvent;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNSDocument;
import org.mozilla.interfaces.nsIDragService;
import org.mozilla.interfaces.nsIDragSession;
import org.mozilla.interfaces.nsIServiceManager;
@@ -209,4 +213,51 @@
return dataLen;
}
}
+
+
+ public static void setTemporaryDndElement(nsIDOMElement element,
+ boolean temporary) {
+ if (temporary) {
+ element.setAttribute("vpeTemporaryDndElement",
+ Boolean.TRUE.toString());
+ } else {
+ element.removeAttribute("vpeTemporaryDndElement");
+ }
+ }
+
+ public static boolean isTemporaryDndElement(nsIDOMElement element) {
+ String attribute = element.getAttribute("vpeTemporaryDndElement");
+ if (Boolean.TRUE.toString().equals(attribute)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public static nsIDOMElement getElementFromPoint(nsIDOMNSDocument document,
+ int x, int y) {
+ nsIDOMElement element = document.elementFromPoint(x, y);
+
+ Stack<nsIDOMElement> hiddenElements = new Stack<nsIDOMElement>();
+ Stack<String> hiddenElementsStyles = new Stack<String>();
+ while (element != null && isTemporaryDndElement(element)) {
+ hiddenElements.push(element);
+ hiddenElementsStyles.push(element.getAttribute(HTML.ATTR_STYLE));
+
+ element.setAttribute(HTML.ATTR_STYLE, "display:none !important;");
+ element = document.elementFromPoint(x, y);
+ }
+
+ while (!hiddenElements.empty()) {
+ nsIDOMElement element2 = hiddenElements.pop();
+ String style = hiddenElementsStyles.pop();
+ if (style == null) {
+ element2.removeAttribute(HTML.ATTR_STYLE);
+ } else {
+ element2.setAttribute(HTML.ATTR_STYLE, style);
+ }
+ }
+
+ return element;
+ }
}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java 2010-03-19 16:14:36 UTC (rev 20936)
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.dnd;
+
+import org.eclipse.swt.graphics.Rectangle;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerVpeUtils;
+import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMElementCSSInlineStyle;
+import org.mozilla.interfaces.nsIDOMNode;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class DraggablePattern {
+ private static final String DRAGGING_OPACITY = "0.5"; //$NON-NLS-1$
+ private static final String DRAG_ICON_ID = "dragIcon"; //$NON-NLS-1$
+ private static final String DRAG_ICON_FILE = "dragIcon.gif"; //$NON-NLS-1$
+ private static final String DEFAULT_DISPLAY = ""; //$NON-NLS-1$
+ private static final String NONE_DISPLAY = "none"; //$NON-NLS-1$
+ private static final String ABSOLUTE_POSITION = "absolute"; //$NON-NLS-1$
+ private static final String IMPORTANT_PRIORITY = "important"; //$NON-NLS-1$
+ private static final String DEFAULT_PRIORITY = ""; //$NON-NLS-1$
+ private static final String DRAG_ICON_STYLE
+ = "display:none; position: absolute; cursor: move"; //$NON-NLS-1$
+
+ private int offsetX;
+ private int offsetY;
+ private boolean sessionStarted;
+ private nsIDOMNode nodeCopy;
+ private nsIDOMNode node;
+ private nsIDOMCSSStyleDeclaration nodeCopyStyle;
+ private final MozillaEditor mozillaEditor;
+
+ public DraggablePattern(MozillaEditor mozillaEditor) {
+ sessionStarted = false;
+ this.mozillaEditor = mozillaEditor;
+ }
+
+ public void showDragIcon(nsIDOMNode node) {
+ this.node = node;
+ Rectangle bounds = XulRunnerVpeUtils.getElementBounds(node);
+ DragIcon dragIcon = getDragIcon();
+ dragIcon.setStyleProperty(HTML.STYLE_PARAMETER_DISPLAY,
+ DEFAULT_DISPLAY, DEFAULT_PRIORITY);
+ dragIcon.setStyleProperty(HTML.STYLE_PARAMETER_LEFT,
+ VpeStyleUtil.toPxPosition(bounds.x), DEFAULT_PRIORITY);
+ dragIcon.setStyleProperty(HTML.STYLE_PARAMETER_TOP,
+ VpeStyleUtil.toPxPosition(bounds.y - 20), DEFAULT_PRIORITY);
+ }
+
+ public void hideDragIcon() {
+ this.node = null;
+ DragIcon dragIcon = getDragIcon();
+ dragIcon.setStyleProperty(HTML.STYLE_PARAMETER_DISPLAY,
+ NONE_DISPLAY, DEFAULT_PRIORITY);
+ }
+
+ public DragIcon getDragIcon() {
+ nsIDOMElement dragIconElement = mozillaEditor.getDomDocument()
+ .getElementById(DRAG_ICON_ID);
+ if (dragIconElement == null) {
+ dragIconElement = mozillaEditor.getDomDocument()
+ .createElement(HTML.TAG_IMG);
+ DndUtil.setTemporaryDndElement(dragIconElement, true);
+ mozillaEditor.getDomDocument().getElementsByTagName(HTML.TAG_BODY)
+ .item(0).appendChild(dragIconElement);
+ dragIconElement.setAttribute(HTML.ATTR_ID, DRAG_ICON_ID);
+ dragIconElement.setAttribute(HTML.ATTR_SRC,
+ VpeStyleUtil.getAbsoluteResourcePathUrl(DRAG_ICON_FILE));
+ dragIconElement.setAttribute(HTML.ATTR_STYLE, DRAG_ICON_STYLE);
+ }
+ return new DragIcon(dragIconElement);
+ }
+
+ public nsIDOMNode getNode() {
+ return node;
+ }
+
+ public void startSession(int mouseStartX, int mouseStartY) {
+ if (sessionStarted) {
+ new IllegalStateException(
+ "Session is already started."); //$NON-NLS-1$
+ }
+ if (node == null) {
+ new IllegalStateException(
+ "No node to drag."); //$NON-NLS-1$
+ }
+
+ Rectangle nodeBounds = XulRunnerVpeUtils.getElementBounds(node);
+ offsetX = nodeBounds.x - mouseStartX;
+ offsetY = nodeBounds.y - mouseStartY;
+
+ nodeCopy = node.cloneNode(true);
+ if (nodeCopy.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
+ nsIDOMElement elementCopy = (nsIDOMElement) nodeCopy.queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ DndUtil.setTemporaryDndElement(elementCopy, true);
+ }
+ nodeCopyStyle = ((nsIDOMElementCSSInlineStyle)
+ nodeCopy.queryInterface(
+ nsIDOMElementCSSInlineStyle
+ .NS_IDOMELEMENTCSSINLINESTYLE_IID)).getStyle();
+
+ nodeCopyStyle.setProperty(HTML.STYLE_PARAMETER_POSITION,
+ ABSOLUTE_POSITION, IMPORTANT_PRIORITY);
+ nodeCopyStyle.setProperty(HTML.STYLE_PARAMETER_OPACITY,
+ DRAGGING_OPACITY, IMPORTANT_PRIORITY);
+ setVisible(false);
+ node.getParentNode().appendChild(nodeCopy);
+ move(mouseStartX, mouseStartY);
+ setVisible(true);
+ sessionStarted = true;
+ }
+
+ public void closeSession() {
+ if (!sessionStarted) {
+ new IllegalStateException(
+ "Session is already closed."); //$NON-NLS-1$
+ }
+
+ nsIDOMNode parent = nodeCopy.getParentNode();
+ if (parent != null) {
+ parent.removeChild(nodeCopy);
+ }
+
+ hideDragIcon();
+ nodeCopy = null;
+ nodeCopyStyle = null;
+ sessionStarted = false;
+ }
+
+ public void setVisible(boolean visible) {
+ nodeCopyStyle.setProperty(HTML.STYLE_PARAMETER_DISPLAY,
+ visible ? DEFAULT_DISPLAY : NONE_DISPLAY, IMPORTANT_PRIORITY);
+ DragIcon dragIcon = getDragIcon();
+ dragIcon.setStyleProperty(HTML.STYLE_PARAMETER_DISPLAY,
+ visible ? DEFAULT_DISPLAY : NONE_DISPLAY, DEFAULT_PRIORITY);
+ }
+
+ public void move(int mouseX, int mouseY) {
+ nodeCopyStyle.setProperty(HTML.STYLE_PARAMETER_LEFT,
+ VpeStyleUtil.toPxPosition(offsetX + mouseX),
+ IMPORTANT_PRIORITY);
+ nodeCopyStyle.setProperty(HTML.STYLE_PARAMETER_TOP,
+ VpeStyleUtil.toPxPosition(offsetY + mouseY),
+ IMPORTANT_PRIORITY);
+
+ DragIcon dragIcon = getDragIcon();
+ dragIcon.setStyleProperty(HTML.STYLE_PARAMETER_LEFT,
+ VpeStyleUtil.toPxPosition(offsetX + mouseX),
+ DEFAULT_PRIORITY);
+ dragIcon.setStyleProperty(HTML.STYLE_PARAMETER_TOP,
+ VpeStyleUtil.toPxPosition(offsetY + mouseY - 20),
+ DEFAULT_PRIORITY);
+ }
+
+ public class DragIcon {
+ private final nsIDOMElement element;
+ private final nsIDOMCSSStyleDeclaration style;
+
+ public DragIcon(nsIDOMElement element) {
+ this.element = element;
+ style = VpeStyleUtil.getStyle(element);
+ }
+
+ public nsIDOMElement getElement() {
+ return element;
+ }
+
+ public nsIDOMCSSStyleDeclaration getStyle() {
+ return style;
+ }
+
+ public void setStyleProperty(String propertyName, String value,
+ String priority) {
+ style.setProperty(propertyName, value, priority);
+ }
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropSpot.java 2010-03-19 16:14:36 UTC (rev 20936)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.dnd;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public enum DropSpot {
+ BEFORE,
+ AFTER,
+ BEGIN,
+ END
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DropableArea.java 2010-03-19 16:14:36 UTC (rev 20936)
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.dnd;
+
+import java.util.EnumSet;
+
+import org.eclipse.swt.graphics.Rectangle;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerVpeUtils;
+import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public class DropableArea {
+ private boolean visible;
+ private EnumSet<DropSpot> dropSpots;
+ private final nsIDOMDocument document;
+ private nsIDOMNode node;
+ private nsIDOMElement domArea;
+ private static final String AREA_COLOR = "rgba(166, 202, 240, 0.5)"; //$NON-NLS-1$
+ private DropSpot hightlightedSpot;
+
+ /**
+ *
+ * @param document cannot be null
+ */
+ public DropableArea(nsIDOMDocument document) {
+ this.document = document;
+ }
+
+ /**
+ * @param node cannot be null
+ */
+ public void setNode(nsIDOMNode node) {
+ this.node = node;
+ }
+
+ /**
+ * @param dropSpots cannot be null
+ */
+ public void setDropSpots(EnumSet<DropSpot> dropSpots) {
+ this.dropSpots = dropSpots;
+ }
+
+ public void setVisible(boolean visible) {
+ this.visible = visible;
+ }
+
+ public void setHighlightedSpot(int mouseX, int mouseY) {
+ this.hightlightedSpot = getHighlightedSpot(mouseX, mouseY);
+ }
+
+ public DropSpot getHighlightedSpot(int mouseX, int mouseY) {
+ if (node == null) {
+ return null;
+ }
+
+ Rectangle bounds = XulRunnerVpeUtils.getElementBounds(node);
+ if (dropSpots.contains(DropSpot.BEFORE)
+ && bounds.x <= mouseX
+ && mouseX < bounds.x + bounds.width / 5) {
+ return DropSpot.BEFORE;
+ } else if (dropSpots.contains(DropSpot.AFTER)
+ && bounds.x + bounds.width * 4 / 5 <= mouseX
+ && mouseX < bounds.x + bounds.width) {
+ return DropSpot.AFTER;
+ } else if (dropSpots.contains(DropSpot.BEGIN)
+ && bounds.y <= mouseY
+ && mouseY < bounds.y + bounds.height / 5) {
+ return DropSpot.BEGIN;
+ } else if (dropSpots.contains(DropSpot.END)
+ && bounds.y + bounds.height * 4 / 5 <= mouseY
+ && mouseY < bounds.y + bounds.height) {
+ return DropSpot.END;
+ } else {
+ return null;
+ }
+ }
+
+ public void redraw() {
+ if (!visible || node == null) {
+ if (domArea != null) {
+ domArea.getParentNode().removeChild(domArea);
+ domArea = null;
+ }
+ return;
+ }
+
+ Rectangle bounds = XulRunnerVpeUtils.getElementBounds(node);
+
+ nsIDOMElement oldDomArea = domArea;
+ domArea = createRect(bounds, AREA_COLOR);
+ nsIDOMElement contentArea
+ = document.getElementById(MozillaEditor.CONTENT_AREA_ID);
+ contentArea.appendChild(domArea);
+
+ nsIDOMCSSStyleDeclaration style;
+ nsIDOMElement line;
+
+ if (dropSpots.contains(DropSpot.BEFORE)) {
+ line = createVerticalLine(bounds.height, getColor(DropSpot.BEFORE));
+ style = VpeStyleUtil.getStyle(line);
+ style.setProperty(HTML.STYLE_PARAMETER_LEFT,
+ VpeStyleUtil.toPxPosition(-6), HTML.STYLE_PRIORITY_DEFAULT);
+ domArea.appendChild(line);
+ }
+
+ if (dropSpots.contains(DropSpot.AFTER)) {
+ line = createVerticalLine(bounds.height, getColor(DropSpot.AFTER));
+ style = VpeStyleUtil.getStyle(line);
+ style.setProperty(HTML.STYLE_PARAMETER_RIGHT,
+ VpeStyleUtil.toPxPosition(-6), HTML.STYLE_PRIORITY_DEFAULT);
+ domArea.appendChild(line);
+ }
+
+ if (dropSpots.contains(DropSpot.BEGIN)) {
+ line = createHorizontalLine(bounds.width - 4,
+ getColor(DropSpot.BEGIN));
+ style = VpeStyleUtil.getStyle(line);
+ style.setProperty(HTML.STYLE_PARAMETER_LEFT,
+ VpeStyleUtil.toPxPosition(2), HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_TOP,
+ VpeStyleUtil.toPxPosition(1), HTML.STYLE_PRIORITY_DEFAULT);
+ domArea.appendChild(line);
+ }
+
+ if (dropSpots.contains(DropSpot.END)) {
+ line = createHorizontalLine(bounds.width - 4,
+ getColor(DropSpot.END));
+ style = VpeStyleUtil.getStyle(line);
+ style.setProperty(HTML.STYLE_PARAMETER_LEFT,
+ VpeStyleUtil.toPxPosition(2), HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_BOTTOM,
+ VpeStyleUtil.toPxPosition(1), HTML.STYLE_PRIORITY_DEFAULT);
+ domArea.appendChild(line);
+ }
+
+ if (oldDomArea != null) {
+ contentArea.removeChild(oldDomArea);
+ }
+ }
+
+ private String getColor(DropSpot dropSpot) {
+ if (dropSpot == hightlightedSpot) {
+ return "red";
+ } else {
+ return "black";
+ }
+ }
+
+ private nsIDOMElement createRect(Rectangle coords, String color) {
+ nsIDOMElement rect = createElement(HTML.TAG_DIV);
+
+ nsIDOMCSSStyleDeclaration style = VpeStyleUtil.getStyle(rect);
+ style.setProperty(HTML.STYLE_PARAMETER_POSITION,
+ HTML.STYLE_VALUE_ABSOLUTE,
+ HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_LEFT,
+ VpeStyleUtil.toPxPosition(coords.x),
+ HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_TOP,
+ VpeStyleUtil.toPxPosition(coords.y),
+ HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_HEIGHT,
+ VpeStyleUtil.toPxPosition(coords.height),
+ HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_WIDTH,
+ VpeStyleUtil.toPxPosition(coords.width),
+ HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_BACKGROUND_COLOR,
+ color,
+ HTML.STYLE_PRIORITY_DEFAULT);
+
+ return rect;
+ }
+
+ private void drawRect(nsIDOMElement container,
+ Rectangle coords, String color) {
+ container.appendChild(createRect(coords, color));
+ }
+
+ private nsIDOMElement createHorizontalLine(int width, String color) {
+ nsIDOMElement line = createElement(HTML.TAG_DIV);
+ nsIDOMCSSStyleDeclaration style = VpeStyleUtil.getStyle(line);
+ style.setProperty(HTML.STYLE_PARAMETER_POSITION,
+ HTML.STYLE_VALUE_ABSOLUTE, HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_WIDTH,
+ VpeStyleUtil.toPxPosition(width), HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_HEIGHT,
+ VpeStyleUtil.toPxPosition(6), HTML.STYLE_PRIORITY_DEFAULT);
+ for (int i = 0; i < 2; i++) {
+ drawRect(line, new Rectangle(i, i, 1, 6 - 2 * i), color);
+ }
+ drawRect(line, new Rectangle(2, 2, width - 2 * 2, 2), color);
+ for (int i = 0; i < 2; i++) {
+ drawRect(line, new Rectangle(width - 1 - i, i, 1, 6 - 2 * i),
+ color);
+ }
+
+ return line;
+ }
+
+ private nsIDOMElement createVerticalLine(int height, String color) {
+ nsIDOMElement line = createElement(HTML.TAG_DIV);
+ nsIDOMCSSStyleDeclaration style = VpeStyleUtil.getStyle(line);
+ style.setProperty(HTML.STYLE_PARAMETER_POSITION,
+ HTML.STYLE_VALUE_ABSOLUTE, HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_WIDTH,
+ VpeStyleUtil.toPxPosition(6), HTML.STYLE_PRIORITY_DEFAULT);
+ style.setProperty(HTML.STYLE_PARAMETER_HEIGHT,
+ VpeStyleUtil.toPxPosition(height), HTML.STYLE_PRIORITY_DEFAULT);
+ for (int i = 0; i < 2; i++) {
+ drawRect(line, new Rectangle(i, i, 6 - 2 * i, 1), color);
+ }
+ drawRect(line, new Rectangle(2, 2, 2, height - 2 * 2), color);
+ for (int i = 0; i < 2; i++) {
+ drawRect(line, new Rectangle(i, height - 1 - i, 6 - 2 * i, 1),
+ color);
+ }
+
+ return line;
+ }
+
+ private nsIDOMElement createElement(String tagName) {
+ nsIDOMElement element = document.createElement(tagName);
+ DndUtil.setTemporaryDndElement(element, true);
+ return element;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2010-03-19 16:00:30 UTC (rev 20935)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2010-03-19 16:14:36 UTC (rev 20936)
@@ -141,9 +141,12 @@
public static final String STYLE_VALUE_NONE = "none"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_WIDTH = "width"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_TOP = "top"; //$NON-NLS-1$
+ public static final String STYLE_PARAMETER_BOTTOM = "bottom"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_LEFT = "left"; //$NON-NLS-1$
+ public static final String STYLE_PARAMETER_RIGHT = "right"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_HEIGHT = "height"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_BACKGROUND_IMAGE = "background-image"; //$NON-NLS-1$
+ public static final String STYLE_PARAMETER_BACKGROUND_COLOR = "background-color"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_BORDER_WIDTH = "border-width"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_BORDER_STYLE = "border-style"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_MAX_HEIGHT = "max-height"; //$NON-NLS-1$
@@ -151,6 +154,12 @@
public static final String STYLE_PARAMETER_CLEAR = "clear"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_OVERFLOW = "overflow"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_TABLE_LAYOUT = "table-layout"; //$NON-NLS-1$
+ public static final String STYLE_PARAMETER_OPACITY = "opacity"; //$NON-NLS-1$
public static final String STYLE_VALUE_FIXED = "fixed"; //$NON-NLS-1$
public static final String STYLE_VALUE_MIDDLE = "middle"; //$NON-NLS-1$
+ public static final String STYLE_PARAMETER_POSITION = "position"; //$NON-NLS-1$;
+ public static final String STYLE_VALUE_ABSOLUTE = "absolute"; //$NON-NLS-1$;
+
+ public static final String STYLE_PRIORITY_DEFAULT = ""; //$NON-NLS-1$;
+ public static final String STYLE_PRIORITY_IMPORTANT = "important"; //$NON-NLS-1$;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2010-03-19 16:00:30 UTC (rev 20935)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2010-03-19 16:14:36 UTC (rev 20936)
@@ -27,6 +27,7 @@
import org.eclipse.ui.editors.text.ILocationProvider;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.ui.views.navigator.NDeleteAction;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.jst.web.project.WebProject;
@@ -34,8 +35,12 @@
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
+import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMElementCSSInlineStyle;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDebug;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -69,7 +74,20 @@
public static String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
public static String HTTP_PROTOCOL = "http:"; //$NON-NLS-1$
public static String SLASH = "/"; //$NON-NLS-1$
-
+
+ /**
+ * Returns CSS style declaration corresponding to the given {@code element}.
+ */
+ public static nsIDOMCSSStyleDeclaration getStyle(nsIDOMElement element) {
+ nsIDOMElementCSSInlineStyle inlineStyle =
+ (nsIDOMElementCSSInlineStyle)
+ element.queryInterface(nsIDOMElementCSSInlineStyle
+ .NS_IDOMELEMENTCSSINLINESTYLE_IID);
+ return inlineStyle.getStyle();
+ }
+
+
+
// sets parameter position in attribute style to absolute value
public static void setAbsolute(Element sourceElement) {
String style = sourceElement.getAttribute(ATTRIBUTE_STYLE);
@@ -553,6 +571,12 @@
return finalStr;
}
+ public static String getAbsoluteResourcePathUrl(String resourcePathInPlugin) {
+ return FILE_PROTOCOL + SLASH + SLASH + SLASH
+ + getAbsoluteResourcePath(resourcePathInPlugin)
+ .replace('\\', '/');
+ }
+
/**
* Adds the full path to image "src" attribute.
*
@@ -782,6 +806,14 @@
return size;
}
+ /**
+ * Converts the argument to the form {@code "Xpx"},
+ * where {@code X=position}.
+ */
+ public static String toPxPosition(int position) {
+ return Integer.toString(position) + PX_STRING;
+ }
+
public static String processUrl(String url, IFile file) {
String resolvedValue = url
Added: trunk/vpe/plugins/org.jboss.tools.vpe/ve/dragIcon.gif
===================================================================
(Binary files differ)
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/ve/dragIcon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 7 months
JBoss Tools SVN: r20935 - in trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates: jsf-1.1/JSFKickStartWithLibs/WebContent/WEB-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-19 12:00:30 -0400 (Fri, 19 Mar 2010)
New Revision: 20935
Modified:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFBlankWithLibs/WebContent/WEB-INF/web.xml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithLibs/WebContent/WEB-INF/web.xml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsBlankWithoutLibs/WebContent/WEB-INF/web.xml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithRILibs/WebContent/WEB-INF/web.xml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithoutLibs/WebContent/WEB-INF/web.xml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFBlankWithoutLibs/WebContent/WEB-INF/web.xml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5888
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFBlankWithLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFBlankWithLibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFBlankWithLibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithLibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithLibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.1/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFBlankWithoutLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFBlankWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFBlankWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2/JSFKickStartWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsBlankWithoutLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsBlankWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsBlankWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithRILibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithRILibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithRILibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithoutLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 15:39:44 UTC (rev 20934)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/jsf-1.2-facelets/FaceletsKickStartWithoutLibs/WebContent/WEB-INF/web.xml 2010-03-19 16:00:30 UTC (rev 20935)
@@ -9,6 +9,11 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+#elseif ($servlet_version == "3.0")
+<web-app version="3.0"
+xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
#else
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
14 years, 7 months