JBoss Tools SVN: r6442 - in trunk/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-02-19 14:36:36 -0500 (Tue, 19 Feb 2008)
New Revision: 6442
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPreferenceInitializer.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-999 Done
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2008-02-19 18:55:07 UTC (rev 6441)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2008-02-19 19:36:36 UTC (rev 6442)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jdt.core.JavaCore;
/**
* Constants for names of seam preferences.
@@ -44,6 +45,9 @@
public static final String WARNING = "warning"; //$NON-NLS-1$
public static final String IGNORE = "ignore"; //$NON-NLS-1$
+ public static final String ENABLE = JavaCore.ENABLED; //$NON-NLS-1$
+ public static final String DISABLE = JavaCore.DISABLED; //$NON-NLS-1$
+
public static final Set<String> severityOptionNames = new HashSet<String>();
//Components
@@ -108,6 +112,8 @@
// Mark EL Variable name which we can't resolve.
public static final String UNKNOWN_EL_VARIABLE_NAME = createSeverityOption("unknownElVariableName"); //$NON-NLS-1$
+ // Check "var" attributes.
+ public static final String CHECK_VARS = createSeverityOption("checkVars"); //$NON-NLS-1$
// Mark EL Variable property name which we can't resolve.
public static final String UNKNOWN_EL_VARIABLE_PROPERTY_NAME = createSeverityOption("unknownElVariablePropertyName"); //$NON-NLS-1$
// If Expression use property of component and this property has only setter(getter) without getter(setter) then mark it.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPreferenceInitializer.java 2008-02-19 18:55:07 UTC (rev 6441)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPreferenceInitializer.java 2008-02-19 19:36:36 UTC (rev 6442)
@@ -35,5 +35,6 @@
defaultPreferences.put(SeamPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, SeamPreferences.WARNING);
defaultPreferences.put(SeamPreferences.UNKNOWN_VARIABLE_NAME, SeamPreferences.WARNING);
defaultPreferences.put(SeamPreferences.UNPAIRED_GETTER_OR_SETTER, SeamPreferences.IGNORE);
+ defaultPreferences.put(SeamPreferences.CHECK_VARS, SeamPreferences.ENABLE);
}
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-02-19 18:55:07 UTC (rev 6441)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-02-19 19:36:36 UTC (rev 6442)
@@ -35,6 +35,7 @@
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
@@ -205,7 +206,11 @@
}
private void validateChildNodes(IFile file, Node parent) {
- Var var = ElVarSearcher.findVar(parent);
+ String preferenceValue = SeamPreferences.getProjectPreference(project, SeamPreferences.CHECK_VARS);
+ Var var = null;
+ if (SeamPreferences.ENABLE.equals(preferenceValue)) {
+ var = ElVarSearcher.findVar(parent);
+ }
if(var!=null) {
varListForCurentValidatedNode.add(var);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2008-02-19 18:55:07 UTC (rev 6441)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2008-02-19 19:36:36 UTC (rev 6442)
@@ -89,6 +89,7 @@
//Seam Expression language
public static String SeamValidatorConfigurationBlock_section_el;
public static String SeamValidatorConfigurationBlock_pb_unknownElVariableName_label;
+ public static String SeamValidatorConfigurationBlock_pb_checkVars_label;
public static String SeamValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label;
public static String SeamValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2008-02-19 18:55:07 UTC (rev 6441)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2008-02-19 19:36:36 UTC (rev 6442)
@@ -57,6 +57,7 @@
##Seam Expression language
SeamValidatorConfigurationBlock_section_el=Expression language
SeamValidatorConfigurationBlock_pb_unknownElVariableName_label=Context variable cannot be resolved:
+SeamValidatorConfigurationBlock_pb_checkVars_label=Recognize "var" attributes
SeamValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label=Property cannot be resolved:
SeamValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label=Unpaired Getter/Setter:
SEAM_VALIDATOR_CONFIGURATION_BLOCK_SEAM_VALIDATOR_CONFIGURATION_BLOCK=SeamValidatorConfigurationBlock
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2008-02-19 18:55:07 UTC (rev 6441)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2008-02-19 19:36:36 UTC (rev 6442)
@@ -14,6 +14,7 @@
import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock;
import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent;
@@ -21,8 +22,12 @@
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
@@ -30,6 +35,7 @@
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
+import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
/**
* Find in SeamPreferences the instruction to Framework for Severity preferences
@@ -54,6 +60,10 @@
public class SeamValidatorConfigurationBlock extends OptionsConfigurationBlock {
private static final String SETTINGS_SECTION_NAME = SeamPreferencesMessages.SEAM_VALIDATOR_CONFIGURATION_BLOCK_SEAM_VALIDATOR_CONFIGURATION_BLOCK;
+ private Button recognizeVarsCheckBox;
+ private Combo elVariablesCombo;
+ private Combo elPropertiesCombo;
+
private static SectionDescription SECTION_COMPONENT = new SectionDescription(
SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_component,
new String[][]{
@@ -129,12 +139,13 @@
SECTION_EL
};
- private static Key PREF_NON_UNIQUE_COMPONENT_NAME = getSeamKey(SeamPreferences.NONUNIQUE_COMPONENT_NAME);
-
private static final String ERROR = SeamPreferences.ERROR;
private static final String WARNING = SeamPreferences.WARNING;
private static final String IGNORE = SeamPreferences.IGNORE;
+ private static final String ENABLED= JavaCore.ENABLED;
+ private static final String DISABLED= JavaCore.DISABLED;
+
private PixelConverter fPixelConverter;
private static Key[] getKeys() {
@@ -144,6 +155,7 @@
keys.add(ALL_SECTIONS[i].options[j].key);
}
}
+ keys.add(getSeamKey(SeamPreferences.CHECK_VARS));
return keys.toArray(new Key[0]);
}
@@ -177,6 +189,7 @@
private Composite createStyleTabContent(Composite folder) {
String[] errorWarningIgnore = new String[] {ERROR, WARNING, IGNORE};
+ String[] enableDisableValues= new String[] {ENABLED, DISABLED};
String[] errorWarningIgnoreLabels = new String[] {
SeamPreferencesMessages.SEAM_VALIDATOR_CONFIGURATION_BLOCK_ERROR,
@@ -214,17 +227,59 @@
for (int j = 0; j < section.options.length; j++) {
OptionDescription option = section.options[j];
label = option.label;
- addComboBox(inner, label, option.key, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
+ Combo combo = addComboBox(inner, label, option.key, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
+ if(option.label == SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unknownElVariableName_label) {
+ elVariablesCombo = combo;
+ combo.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent e) {
+ updateELCombox();
+ }
+ public void widgetSelected(SelectionEvent e) {
+ updateELCombox();
+ }
+ });
+ } else if(option.label == SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label) {
+ elPropertiesCombo = combo;
+ combo.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent e) {
+ updateELCombox();
+ }
+ public void widgetSelected(SelectionEvent e) {
+ updateELCombox();
+ }
+ });
+ }
}
+
+ if(section==SECTION_EL) {
+ label = SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_checkVars_label;
+ recognizeVarsCheckBox = addCheckBox(inner, label, getSeamKey(SeamPreferences.CHECK_VARS), enableDisableValues, defaultIndent);
+ }
}
IDialogSettings section = SeamCorePlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
restoreSectionExpansionStates(section);
+ updateELCombox();
+
return sc1;
}
@Override
+ public void performDefaults() {
+ super.performDefaults();
+ updateELCombox();
+ }
+
+ private void updateELCombox() {
+ if(elPropertiesCombo.getSelectionIndex()==2 && elVariablesCombo.getSelectionIndex()==2) {
+ recognizeVarsCheckBox.setEnabled(false);
+ } else {
+ recognizeVarsCheckBox.setEnabled(true);
+ }
+ }
+
+ @Override
protected String[] getFullBuildDialogStrings(boolean workspaceSettings) {
String title= SeamPreferencesMessages.SeamValidatorConfigurationBlock_needsbuild_title;
String message;
18 years, 1 month
JBoss Tools SVN: r6441 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-19 13:55:07 -0500 (Tue, 19 Feb 2008)
New Revision: 6441
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
Log:
JBIDE-696 - finally agreed to do it. (edit runtime location / configuration)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java 2008-02-19 18:44:50 UTC (rev 6440)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java 2008-02-19 18:55:07 UTC (rev 6441)
@@ -43,156 +43,141 @@
/**
* @author Marshall
*/
-public class JBossConfigurationTableViewer extends TableViewer
-{
- //private String jbossHome;
+public class JBossConfigurationTableViewer extends TableViewer {
+ // private String jbossHome;
private String selectedConfiguration;
private WizardFragment fragment;
-
- public JBossConfigurationTableViewer (Composite parent)
- {
- super (parent);
+
+ public JBossConfigurationTableViewer(Composite parent) {
+ super(parent);
init();
}
-
- public JBossConfigurationTableViewer (Composite parent, int style)
- {
- super (parent, style);
+
+ public JBossConfigurationTableViewer(Composite parent, int style) {
+ super(parent, style);
init();
}
-
- public JBossConfigurationTableViewer (Table table)
- {
- super (table);
+
+ public JBossConfigurationTableViewer(Table table) {
+ super(table);
init();
}
-
- public void setJBossHome (String jbossHome)
- {
- //this.jbossHome = jbossHome;
+
+ public void setJBossHome(String jbossHome) {
+ // this.jbossHome = jbossHome;
setInput(jbossHome);
}
-
- public String getSelectedConfiguration ()
- {
+
+ public String getSelectedConfiguration() {
return selectedConfiguration;
}
-
- public void setDefaultConfiguration (String defaultConfiguration)
- {
+
+ public void setConfiguration(String defaultConfiguration) {
int item = -1;
TableItem items[] = getTable().getItems();
- for (int i = 0; i < items.length; i++)
- {
- if (items[i] != null && items[i].getText() != null && items[i].getText().equals(defaultConfiguration))
- {
+ for (int i = 0; i < items.length; i++) {
+ if (items[i] != null && items[i].getText() != null
+ && items[i].getText().equals(defaultConfiguration)) {
item = i;
break;
}
}
-
+
if (item != -1) {
getTable().setSelection(item);
}
-
+
selectedConfiguration = defaultConfiguration;
}
-
- private void init ()
- {
+
+ private void init() {
ConfigurationProvider provider = new ConfigurationProvider();
setContentProvider(provider);
setLabelProvider(provider);
- getControl().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- getControl().setEnabled(false);
- addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
+ getControl().setLayoutData(
+ new GridData(GridData.FILL, GridData.FILL, true, true));
+ addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
configurationSelected();
}
});
}
-
- protected String getCurrentlySelectedConfiguration ()
- {
- if (getSelection() instanceof IStructuredSelection)
- {
+
+ protected String getCurrentlySelectedConfiguration() {
+ if (getSelection() instanceof IStructuredSelection) {
IStructuredSelection selection = (IStructuredSelection) getSelection();
- return (String) selection.getFirstElement();
+ return (String) selection.getFirstElement();
}
-
+
return null;
}
-
- protected void configurationSelected ()
- {
+
+ protected void configurationSelected() {
selectedConfiguration = getCurrentlySelectedConfiguration();
-
- if (fragment != null)
- {
+
+ if (fragment != null) {
fragment.updateChildFragments();
}
}
-
- protected class ConfigurationProvider implements IStructuredContentProvider, ILabelProvider
- {
+
+ protected class ConfigurationProvider implements
+ IStructuredContentProvider, ILabelProvider {
public void dispose() {
// ignore
}
+
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// ignore
}
-
- public Object[] getElements(Object inputElement)
- {
- ArrayList configList = new ArrayList();
- File serverDirectory = new File(inputElement.toString() + File.separator + "server");
-
- if (serverDirectory.exists())
- {
-
+
+ public Object[] getElements(Object inputElement) {
+ ArrayList<String> configList = new ArrayList<String>();
+ File serverDirectory = new File(inputElement.toString()
+ + File.separator + "server");
+
+ if (serverDirectory.exists()) {
+
File types[] = serverDirectory.listFiles();
- for (int i = 0; i < types.length; i++)
- {
- File serviceDescriptor = new File(
- types[i].getAbsolutePath() + File.separator +
- "conf" + File.separator + "jboss-service.xml");
-
- if (types[i].isDirectory() && serviceDescriptor.exists())
- {
+ for (int i = 0; i < types.length; i++) {
+ File serviceDescriptor = new File(types[i]
+ .getAbsolutePath()
+ + File.separator
+ + "conf"
+ + File.separator
+ + "jboss-service.xml");
+
+ if (types[i].isDirectory() && serviceDescriptor.exists()) {
String configuration = types[i].getName();
-
- // Can't shutdown the minimal configuration -- hopefully we can find something a little less crude in the future.
- //if (!configuration.equals("minimal"))
- configList.add(configuration);
+ configList.add(configuration);
}
}
-
- if (configList.size() > 0)
- {
+
+ if (configList.size() > 0) {
getControl().setEnabled(true);
}
}
-
+
return configList.toArray();
}
-
+
public void addListener(ILabelProviderListener listener) {
// ignore
}
- public boolean isLabelProperty(Object element, String property) { return false; }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
public void removeListener(ILabelProviderListener listener) {
// ignore
}
-
- public Image getImage(Object element)
- {
- return JBossServerUISharedImages.getImage(JBossServerUISharedImages.IMG_JBOSS_CONFIGURATION);
+
+ public Image getImage(Object element) {
+ return JBossServerUISharedImages
+ .getImage(JBossServerUISharedImages.IMG_JBOSS_CONFIGURATION);
}
-
- public String getText(Object element)
- {
+
+ public String getText(Object element) {
return (String) element;
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2008-02-19 18:44:50 UTC (rev 6440)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2008-02-19 18:55:07 UTC (rev 6441)
@@ -63,7 +63,6 @@
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -136,7 +135,7 @@
homeDirText.setText(rt.getRuntime().getLocation().toOSString());
homeDir = rt.getRuntime().getLocation().toOSString();
config = rt.getJBossConfiguration();
- configurations.setDefaultConfiguration(config);
+ configurations.setConfiguration(config);
configLabel.setText(Messages.wf_ConfigLabel + ": " + config);
IVMInstall install = rt.getVM();
@@ -383,9 +382,10 @@
configurations.getControl().setEnabled(false);
configurations.setJBossHome(homeDirText.getText());
} else {
+ configurations.getControl().setEnabled(true);
configurations.setJBossHome(homeDirText.getText());
- configurations
- .setDefaultConfiguration(IJBossServerConstants.DEFAULT_SERVER_NAME);
+ if( !homeDirText.getText().equals(configurations.getInput()))
+ configurations.setConfiguration(IJBossServerConstants.DEFAULT_SERVER_NAME);
}
int sel = jreCombo.getSelectionIndex();
18 years, 1 month
JBoss Tools SVN: r6440 - trunk.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2008-02-19 13:44:50 -0500 (Tue, 19 Feb 2008)
New Revision: 6440
Modified:
trunk/
Log:
Just for convenient using from eclipse workspace.
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
+ .project
18 years, 1 month
JBoss Tools SVN: r6439 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2008-02-19 12:36:04 -0500 (Tue, 19 Feb 2008)
New Revision: 6439
Added:
trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/plugin.properties
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.adf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.vpe.html/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/plugin.properties
trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/META-INF/MANIFEST.MF
Log:
Externalize string in manifests.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.adf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.adf/META-INF/MANIFEST.MF 2008-02-19 17:30:44 UTC (rev 6438)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.adf/META-INF/MANIFEST.MF 2008-02-19 17:36:04 UTC (rev 6439)
@@ -5,3 +5,4 @@
Bundle-Version: 2.1.0
Bundle-Vendor: %providerName
Require-Bundle: org.jboss.tools.vpe
+Bundle-Localization: plugin
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF 2008-02-19 17:30:44 UTC (rev 6438)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF 2008-02-19 17:36:04 UTC (rev 6439)
@@ -14,3 +14,5 @@
org.eclipse.wst.sse.core
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.jsf.vpe.jsf.template
+Bundle-Localization: plugin
+
Modified: trunk/jst/plugins/org.jboss.tools.jst.vpe.html/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.vpe.html/META-INF/MANIFEST.MF 2008-02-19 17:30:44 UTC (rev 6438)
+++ trunk/jst/plugins/org.jboss.tools.jst.vpe.html/META-INF/MANIFEST.MF 2008-02-19 17:36:04 UTC (rev 6439)
@@ -12,3 +12,5 @@
org.jboss.tools.jst.jsp,
org.jboss.tools.common
Eclipse-LazyStart: true
+Bundle-Localization: plugin
+
Modified: trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/META-INF/MANIFEST.MF 2008-02-19 17:30:44 UTC (rev 6438)
+++ trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/META-INF/MANIFEST.MF 2008-02-19 17:36:04 UTC (rev 6439)
@@ -13,3 +13,4 @@
org.jboss.tools.jst.jsp,
org.jboss.tools.common
Eclipse-LazyStart: true
+Bundle-Localization: plugin
Modified: trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/plugin.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/plugin.properties 2008-02-19 17:30:44 UTC (rev 6438)
+++ trunk/jst/plugins/org.jboss.tools.jst.vpe.jsp/plugin.properties 2008-02-19 17:36:04 UTC (rev 6439)
@@ -1,2 +1,2 @@
-providerName=Red Hat, Inc.
-pluginName=JSP support for JBoss Visual Page Editor Plug-in
\ No newline at end of file
+providerName = Red Hat, Inc.
+pluginName = JSP support for JBoss Visual Page Editor Plug-in
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/META-INF/MANIFEST.MF
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/META-INF/MANIFEST.MF 2008-02-19 17:30:44 UTC (rev 6438)
+++ trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/META-INF/MANIFEST.MF 2008-02-19 17:36:04 UTC (rev 6439)
@@ -1,10 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Struts support for JBoss Visual Page Editor Plug-in
+Bundle-Name: %bundleName
Bundle-SymbolicName: org.jboss.tools.struts.vpe.struts;singleton:=true
Bundle-Version: 2.1.0
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.vpe
Eclipse-LazyStart: false
-Bundle-Vendor: Red Hat, Inc.
+Bundle-Vendor: %vendorName
+Bundle-Localization: plugin
Added: trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/plugin.properties
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/plugin.properties (rev 0)
+++ trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/plugin.properties 2008-02-19 17:36:04 UTC (rev 6439)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.struts.vpe.struts
+vendorName = Red Hat, Inc.
+bundleName = Struts support for JBoss Visual Page Editor Plug-in
\ No newline at end of file
18 years, 1 month
JBoss Tools SVN: r6438 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-02-19 12:30:44 -0500 (Tue, 19 Feb 2008)
New Revision: 6438
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1457
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-02-19 16:54:08 UTC (rev 6437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-02-19 17:30:44 UTC (rev 6438)
@@ -409,7 +409,7 @@
if(visualBuilder==null) {
return;
}
- visualBuilder.rebuildFlag = false;
+// visualBuilder.rebuildFlag = false;
switch (eventType) {
case INodeNotifier.CHANGE:
@@ -473,9 +473,9 @@
break;
}
//TODO Max Areshkau JBIDE-1457
- if (visualBuilder.rebuildFlag) {
-// pageContext.fireTaglibsChanged();
- }
+// if (visualBuilder.rebuildFlag) {
+//// pageContext.fireTaglibsChanged();
+// }
switcher.stopActiveEditor();
}
@@ -602,7 +602,6 @@
sourceSelectionChanged(showCaret);
switcher.stopActiveEditor();
}
-
// IModelLifecycleListener implementation
public void processPreModelEvent(ModelLifecycleEvent event) {
}
@@ -611,6 +610,16 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
+ /* Added by Max Areshkau JBIDE-1457
+ * ModelLifecycleEvent.MODEL_RELEASED generated when model in
+ * model calls methods releaseFromRead() or releaseFromEdit().
+ * When editor is open he has only when href on model, so nothing can generated
+ * this event.When editor closes generation of this event depends from cantains
+ * any service href on model or not. It's can be a reason of problems
+ * on reopen file.
+ *
+ * We shouldn't call here rebuild dom.
+ */
if (event.getType() == ModelLifecycleEvent.MODEL_RELEASED) {
if (VpeDebug.PRINT_SOURCE_MODEL_LIFECYCLE_EVENT) {
System.out.println(">>> processPostModelEvent: " + event.toString()); //$NON-NLS-1$
@@ -624,7 +633,8 @@
bundle.refresh();
visualBuilder.setSelectionRectangle(null);
IDOMDocument sourceDocument = sourceModel.getDocument();
- visualBuilder.rebuildDom(sourceDocument);
+ // JBIDE-1457
+// visualBuilder.rebuildDom(sourceDocument);
// pageContext.fireTaglibsChanged();
}
switcher.stopActiveEditor();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-02-19 16:54:08 UTC (rev 6437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-02-19 17:30:44 UTC (rev 6438)
@@ -114,7 +114,7 @@
private nsIDOMNode headNode;
private List includeStack;
//TODO Max Areshkau JBIDE-1457
- boolean rebuildFlag = false;
+// boolean rebuildFlag = false;
/** faceletFile */
private boolean faceletFile = false;
@@ -205,10 +205,10 @@
}
public void rebuildDom(Document sourceDocument) {
- //clearIncludeDocuments();
+ //clearIncludeDocuments();
cleanHead();
domMapping.clear(visualContentArea);
- super.dispose();
+ super.dispose();
pageContext.clearAll();
refreshExternalLinks();
@@ -224,7 +224,6 @@
buildDom(sourceDocument);
}
- rebuildFlag = true;
}
// temporary, will be change to prefference's variable
18 years, 1 month
JBoss Tools SVN: r6437 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-02-19 11:54:08 -0500 (Tue, 19 Feb 2008)
New Revision: 6437
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-999
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java 2008-02-19 16:47:00 UTC (rev 6436)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java 2008-02-19 16:54:08 UTC (rev 6437)
@@ -13,6 +13,10 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.BadLocationException;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -25,7 +29,39 @@
private final static String VAR_ATTRIBUTE_NAME = "var";
private final static String VALUE_ATTRIBUTE_NAME = "value";
+ private ISeamProject project;
+ private IFile file;
+ private SeamELCompletionEngine engine;
+
/**
+ * Constructor.
+ * @param project Seam project where we will look for vars.
+ * @param file File where we will look for vars.
+ * @param engine Competion Engine that we will use for resolving vars.
+ */
+ public ElVarSearcher(ISeamProject project, IFile file, SeamELCompletionEngine engine) {
+ this.project = project;
+ this.file = file;
+ this.engine = engine;
+ }
+
+ /**
+ * Constructor.
+ * @param project Seam project where we will look for vars.
+ * @param engine Competion Engine that we will use for resolving vars.
+ */
+ public ElVarSearcher(ISeamProject project, SeamELCompletionEngine engine) {
+ this(project, null, engine);
+ }
+
+ /**
+ * @param file File where we will look for vars.
+ */
+ public void setFile(IFile file) {
+ this.file = file;
+ }
+
+ /**
* @param node
* @return All var/value that can be used in node and null if can't find anyone.
*/
@@ -77,9 +113,10 @@
* Finds var in list of vars that is used in given EL.
* @param el EL without brackets.
* @param vars
+ * @param initializeNestedVars
* @return
*/
- public static Var findVarForEl(String el, List<Var> vars) {
+ public Var findVarForEl(String el, List<Var> vars, boolean initializeNestedVars) {
if(vars!=null) {
ArrayList<Var> parentVars = new ArrayList<Var>();
for (Var var : vars) {
@@ -87,10 +124,21 @@
if(token!=null && !token.getText().endsWith(".")) {
String varName = var.getName();
if(el.equals(varName) || el.startsWith(varName + ".")) {
- if(var.getElToken()!=null) {
- Var parentVar = findVarForEl(var.getElToken().getText(), parentVars);
+ if(var.getElToken()!=null && initializeNestedVars) {
+ Var parentVar = findVarForEl(var.getElToken().getText(), parentVars, true);
if(parentVar!=null) {
ELToken resolvedToken = parentVar.getResolvedElToken();
+ if(resolvedToken==null && parentVar.getElToken()!=null) {
+ try {
+ // Initialize parent vars.
+ engine.resolveSeamELOperand(project, file, parentVar.getElToken().getText(), parentVar.getElToken().getText(), 0, true, parentVars, this);
+ resolvedToken = parentVar.getResolvedElToken();
+ } catch (StringIndexOutOfBoundsException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ } catch (BadLocationException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
if(resolvedToken!=null) {
String oldText = var.getElToken().getText();
String newValue = "#{" + resolvedToken.getText() + oldText.substring(parentVar.getName().length()) + "}";
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-02-19 16:47:00 UTC (rev 6436)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-02-19 16:54:08 UTC (rev 6437)
@@ -94,7 +94,7 @@
public List<String> getCompletions(ISeamProject project, IFile file, String documentContent, CharSequence prefix,
int position, boolean returnEqualedVariablesOnly, List<Var> vars) throws BadLocationException, StringIndexOutOfBoundsException {
List<String> completions = new ArrayList<String>();
- SeamELOperandResolveStatus status = resolveSeamELOperand(project, file, documentContent, prefix, position, returnEqualedVariablesOnly, vars);
+ SeamELOperandResolveStatus status = resolveSeamELOperand(project, file, documentContent, prefix, position, returnEqualedVariablesOnly, vars, new ElVarSearcher(project, file, this));
if (status.isOK()) {
completions.addAll(status.getProposals());
}
@@ -209,9 +209,9 @@
private static final String collectionAdditionForMapDataModel = ".entrySet().iterator().next()";
public SeamELOperandResolveStatus resolveSeamELOperand(ISeamProject project, IFile file, String documentContent, CharSequence prefix,
- int position, boolean returnEqualedVariablesOnly, List<Var> vars) throws BadLocationException, StringIndexOutOfBoundsException {
+ int position, boolean returnEqualedVariablesOnly, List<Var> vars, ElVarSearcher varSearcher) throws BadLocationException, StringIndexOutOfBoundsException {
String oldEl = prefix.toString();
- Var var = ElVarSearcher.findVarForEl(oldEl, vars);
+ Var var = varSearcher.findVarForEl(oldEl, vars, true);
String suffix = "";
String newEl = oldEl;
if(var!=null) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-02-19 16:47:00 UTC (rev 6436)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-02-19 16:54:08 UTC (rev 6437)
@@ -72,11 +72,13 @@
private SeamELCompletionEngine engine = new SeamELCompletionEngine();
private List<Var> varListForCurentValidatedNode = new ArrayList<Var>();
+ private ElVarSearcher elVarSearcher;
public SeamELValidator(SeamValidatorManager validatorManager,
SeamValidationHelper coreHelper, IReporter reporter,
SeamValidationContext validationContext, ISeamProject project) {
super(validatorManager, coreHelper, reporter, validationContext, project);
+ elVarSearcher = new ElVarSearcher(project, engine);
}
/* (non-Javadoc)
@@ -130,6 +132,7 @@
private void validateFile(IFile file) {
displaySubtask(VALIDATING_EL_FILE_MESSAGE_ID, new String[]{projectName, file.getName()});
+ elVarSearcher.setFile(file);
String ext = file.getFileExtension();
String content = null;
try {
@@ -282,7 +285,7 @@
}
SeamELCompletionEngine.SeamELOperandResolveStatus status =
- engine.resolveSeamELOperand(project, file, operand, prefix, position, true, varListForCurentValidatedNode);
+ engine.resolveSeamELOperand(project, file, operand, prefix, position, true, varListForCurentValidatedNode, elVarSearcher);
if(status.getUsedVariables().size()==0 && status.isError()) {
// Save resources with unknown variables names
18 years, 1 month
JBoss Tools SVN: r6436 - trunk/hibernatetools/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-02-19 11:47:00 -0500 (Tue, 19 Feb 2008)
New Revision: 6436
Modified:
trunk/hibernatetools/docs/reference/en/modules/ant.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-238 - adding introductory sentence, several links as well as fixing some spelling mistakes
Modified: trunk/hibernatetools/docs/reference/en/modules/ant.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/ant.xml 2008-02-19 16:06:02 UTC (rev 6435)
+++ trunk/hibernatetools/docs/reference/en/modules/ant.xml 2008-02-19 16:47:00 UTC (rev 6436)
@@ -2,6 +2,9 @@
<chapter id="ant">
<title>Ant Tools</title>
+ <para>Maybe somebody will find it more preferable to use Ant for generation purposes. Thus, this
+ chapter is intended to get you ready to start using Hibernate Tools via Ant tasks.</para>
+
<section>
<title>Introduction</title>
@@ -11,18 +14,17 @@
basis for both the Ant tasks described in this document and the eclipse plugins both available
from tools.hibernate.org. The <emphasis>
<property>hibernate-tools.jar</property>
- </emphasis> is located in your eclipse plugins directory at
- <emphasis>
+ </emphasis> is located in your eclipse plugins directory at <emphasis>
<property>/plugins/org.hibernate.eclipse.x.x.x/lib/tools/hibernate-tools.jar</property>.</emphasis></para>
<para>This jar is 100% independent from the eclipse platform and can thus be used independently
of eclipse.</para>
<note>
- <para>There might be incompatibilities with respect to the Hibernate3.jar bundled with the tools
- and your own jar. Thus to avoid any confusion it is recommended to use the hibernate3.jar
- and hibernate-annotations.jar bundled with the tools when you want to use the Ant tasks. Do
- not worry about using e.g. Hibernate 3.2 jar's with e.g. a Hibernate 3.1 project since the
- output generated will work with previous Hibernate 3 versions. </para>
+ <para>There might be incompatibilities with respect to the Hibernate3.jar bundled with the
+ tools and your own jar. Thus to avoid any confusion it is recommended to use the
+ hibernate3.jar and hibernate-annotations.jar bundled with the tools when you want to use the
+ Ant tasks. Do not worry about using e.g. Hibernate 3.2 jar's with e.g. a Hibernate 3.1
+ project since the output generated will work with previous Hibernate 3 versions. </para>
</note>
</section>
@@ -35,8 +37,8 @@
<property>build.xml</property>
</emphasis> by inserting the following xml (assuming the jars are in the
<literal>lib</literal> directory): </para>
-
- <programlisting role="XML"><![CDATA[<path id="toolslib">
+
+ <programlisting role="XML"><![CDATA[<path id="toolslib">
<path location="lib/hibernate-tools.jar" />
<path location="lib/hibernate3.jar" />
<path location="lib/freemarker.jar" />
@@ -68,7 +70,7 @@
<property> hibernatetool </property>
</emphasis> task you have to specify one or more of the following:</para>
- <programlisting role="XML"><![CDATA[<hibernatetool
+ <programlisting role="XML"><![CDATA[<hibernatetool
destdir="defaultDestinationDirectory"
templatepath="defaultTemplatePath"
>
@@ -82,87 +84,121 @@
<table frame="topbot">
<title>Hibernatetool attributes</title>
-
+
<tgroup cols="3">
-
- <colspec colwidth="0.3*"/>
-
+
+ <colspec colwidth="0.3*"/>
+
<colspec colwidth="1.0*"/>
-
+
<colspec colwidth="0.3*"/>
-
-
+
+
<thead>
<row>
<entry>Attribute name</entry>
-
+
<entry>Definition</entry>
-
+
<entry>Attribute use</entry>
</row>
</thead>
-
+
<tbody>
<row>
- <entry><para>destdir</para></entry>
-
- <entry><para>Destination directory for files generated
- with exporters.</para></entry>
-
- <entry><para>Required</para></entry>
+ <entry>
+ <para>destdir</para>
+ </entry>
+
+ <entry>
+ <para>Destination directory for files generated with exporters</para>
+ </entry>
+
+ <entry>
+ <para>Required</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>templatepath</para></entry>
-
- <entry><para>A path to be used to look up
- user-edited templates.</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>templatepath</para>
+ </entry>
+
+ <entry>
+ <para>A path to be used to look up user-edited templates</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>classpath</para></entry>
-
- <entry><para>A classpath to be used to resolve resources, such as
- mappings and usertypes.</para></entry>
-
- <entry><para>Optional, but very often required</para></entry>
+ <entry>
+ <para>classpath</para>
+ </entry>
+
+ <entry>
+ <para>A classpath to be used to resolve resources, such as mappings and
+ usertypes</para>
+ </entry>
+
+ <entry>
+ <para>Optional, but very often required</para>
+ </entry>
</row>
-
-
+
+
<row>
- <entry><para>property (and propertyset)</para></entry>
-
- <entry><para>Used to set properties to
- control the exporters. Mostly relevant for providing custom properties to user defined
- templates.</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>property (and propertyset)</para>
+ </entry>
+
+ <entry>
+ <para>Used to set properties to control the exporters. Mostly relevant for providing
+ custom properties to user defined templates</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>configuration (annotationconfiguration, jpaconfiguration, jdbcconfiguration)</para></entry>
-
- <entry><para>One of four different ways of configuring the Hibernate Meta Model must be
- specified.</para></entry>
-
- <entry><para></para></entry>
+ <entry>
+ <para>configuration (annotationconfiguration, jpaconfiguration,
+ jdbcconfiguration)</para>
+ </entry>
+
+ <entry>
+ <para>One of four different ways of configuring the Hibernate Meta Model must be
+ specified</para>
+ </entry>
+
+ <entry>
+ <para/>
+ </entry>
</row>
-
+
<row>
- <entry><para>hbm2java (hbm2cfgxml, hbmtemplate, etc.)</para></entry>
-
- <entry><para>One or more of the exporters must be specified.</para></entry>
-
- <entry><para></para></entry>
+ <entry>
+ <para>hbm2java (hbm2cfgxml, hbmtemplate, etc.)</para>
+ </entry>
+
+ <entry>
+ <para>One or more of the exporters must be specified</para>
+ </entry>
+
+ <entry>
+ <para/>
+ </entry>
</row>
-
+
</tbody>
-
+
</tgroup>
- </table>
-
+ </table>
+
<section>
<title>Basic examples</title>
@@ -171,12 +207,11 @@
</emphasis> from a normal <emphasis>
<property>
<literal>hibernate.cfg.xml</literal>
- </property>.
- </emphasis> The output will be put in the <emphasis>
+ </property>. </emphasis> The output will be put in the <emphasis>
<property>${build.dir}/generated</property>
</emphasis> directory.</para>
- <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
+ <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
<classpath>
<path location="${build.dir}/classes"/>
</classpath>
@@ -184,16 +219,14 @@
<configuration configurationfile="hibernate.cfg.xml"/>
<hbm2java/>
</hibernatetool>]]></programlisting>
-
+
<para>The following example is similar, but now we are performing multiple exports from the
same configuration. We are exporting the schema via <emphasis>
- <property><hbm2dll></property>,
- </emphasis> generates some DAO code via <emphasis>
+ <property><hbm2dll></property>, </emphasis> generates some DAO code via <emphasis>
<property><hbm2dao></property>
</emphasis> and finally runs a custom code generation via <emphasis>
- <property><hbmtemplate></property>.
- </emphasis> This is again from a normal <emphasis>
+ <property><hbmtemplate></property>. </emphasis> This is again from a normal <emphasis>
<property>hibernate.cfg.xml</property>
</emphasis> and the output is still put in the <emphasis>
<property>
@@ -203,7 +236,7 @@
when you e.g. have custom usertypes or some mappings that is needed to be looked up as a
classpath resource.</para>
- <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
+ <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
<classpath>
<path location="${build.dir}/classes"/>
</classpath>
@@ -226,25 +259,22 @@
<para><literal>Hibernatetool</literal> supports four different Hibernate configurations: A
standard Hibernate configuration <emphasis>
- (<property><configuration></property>),
- </emphasis> Annotation based configuration <emphasis>
- (<property><annotationconfiguration></property>),
+ (<property><configuration></property>), </emphasis> Annotation based
+ configuration <emphasis> (<property><annotationconfiguration></property>),
</emphasis> JPA persistence based configuration <emphasis>
- (<property><jpaconfiguration></property>)
- </emphasis> and a JDBC based configuration <emphasis>
- (<property><jdbcconfiguration></property>)
- </emphasis> for use when reverse engineering.</para>
+ (<property><jpaconfiguration></property>) </emphasis> and a JDBC based
+ configuration <emphasis> (<property><jdbcconfiguration></property>) </emphasis>
+ for use when reverse engineering.</para>
- <para>Each have in common that they are able to build up a Hibernate
- Configuration object from which a set of exporters can be run to generate
- various output. </para>
-
- <note>
- <para>Output can be anything, e.g. specific files, statements execution against a database,
- error reporting or anything else that can be done in java code.</para>
- </note>
-
- <para>The following section describes what the various configuration can do, plus list the
+ <para>Each have in common that they are able to build up a Hibernate Configuration object from
+ which a set of exporters can be run to generate various output. </para>
+
+ <note>
+ <para>Output can be anything, e.g. specific files, statements execution against a database,
+ error reporting or anything else that can be done in java code.</para>
+ </note>
+
+ <para>The following sections describe what the various configurations can do, plus lists the
individual settings they have.</para>
<section>
@@ -257,7 +287,7 @@
<property>cfg.xml</property>
</emphasis> and/or a fileset.</para>
- <programlisting role="XML"><![CDATA[<configuration
+ <programlisting role="XML"><![CDATA[<configuration
configurationfile="hibernate.cfg.xml"
propertyfile="hibernate.properties"
entityresolver="EntityResolver classname"
@@ -266,83 +296,110 @@
<fileset...>
</configuration>]]></programlisting>
-
+
<table frame="topbot">
<title>Configuration attributes</title>
-
+
<tgroup cols="3">
-
- <colspec colwidth="0.3*"/>
-
+
+ <colspec colwidth="0.3*"/>
+
<colspec colwidth="1.0*"/>
-
+
<colspec colwidth="0.3*"/>
-
-
+
+
<thead>
<row>
<entry>Attribute name</entry>
-
+
<entry>Definition</entry>
-
+
<entry>Attribute use</entry>
</row>
</thead>
-
+
<tbody>
<row>
- <entry><para>configurationfile</para></entry>
-
- <entry><para>The name of a Hibernate
- configuration file, e.g. "hibernate.cfg.xml"</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>configurationfile</para>
+ </entry>
+
+ <entry>
+ <para>The name of a Hibernate configuration file, e.g. "hibernate.cfg.xml"</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>propertyfile</para></entry>
-
- <entry><para>The name of a property file, e.g.
- "hibernate.properties".</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>propertyfile</para>
+ </entry>
+
+ <entry>
+ <para>The name of a property file, e.g. "hibernate.properties"</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>entity-resolver</para></entry>
-
- <entry><para>Name of a class that implements
- org.xml.sax.EntityResolver. Used if the mapping files require custom entity
- resolver.</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>entity-resolver</para>
+ </entry>
+
+ <entry>
+ <para>Name of a class that implements org.xml.sax.EntityResolver. Used if the
+ mapping files require custom entity resolver</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
-
+
+
<row>
- <entry><para>namingstrategy</para></entry>
-
- <entry><para>Name of a class that implements
- org.hibernate.cfg.NamingStrategy. Used for setting up the naming strategy in
- Hibernate which controls the automatic naming of tables and columns.</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>namingstrategy</para>
+ </entry>
+
+ <entry>
+ <para>Name of a class that implements org.hibernate.cfg.NamingStrategy. Used for
+ setting up the naming strategy in Hibernate which controls the automatic naming of
+ tables and columns.</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>fileset</para></entry>
-
- <entry><para>A standard Ant fileset. Used to include hibernate mapping files. Remember that
- if mappings are already specified in the hibernate.cfg.xml then it should not be
- included via the fileset as it will result in duplicate import exceptions.</para></entry>
-
- <entry><para></para></entry>
+ <entry>
+ <para>fileset</para>
+ </entry>
+
+ <entry>
+ <para>A standard Ant fileset. Used to include hibernate mapping files. Remember that
+ if mappings are already specified in the hibernate.cfg.xml then it should not be
+ included via the fileset as it will result in duplicate import exceptions.</para>
+ </entry>
+
+ <entry>
+ <para/>
+ </entry>
</row>
-
+
</tbody>
-
+
</tgroup>
- </table>
+ </table>
<section>
<title>Example</title>
@@ -352,19 +409,18 @@
<literal>hibernate.cfg.xml</literal>
</property>
</emphasis> exists, and a <emphasis>
- <property>
- hibernate.properties
- </property>
- </emphasis> and fileset is used instead. </para>
-
+ <property> hibernate.properties </property>
+ </emphasis> and fileset is used instead. </para>
+
<note>
<title>Tip:</title>
- <para> Hibernate will still read any global <emphasis><property>hibernate.properties</property></emphasis>
- available in the classpath, but the specified properties file here will override those
- values for any non-global property.</para>
+ <para> Hibernate will still read any global <emphasis>
+ <property>hibernate.properties</property>
+ </emphasis> available in the classpath, but the specified properties file here will
+ override those values for any non-global property.</para>
</note>
- <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
+ <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
<configuration propertyfile="{etc.dir}/hibernate.properties">
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml"/>
@@ -386,13 +442,13 @@
<property><annotationconfiguration></property>
</emphasis> is used when you want to read the metamodel from EJB3/Hibernate Annotations
based POJO's.</para>
-
+
<note>
<title>Tip:</title>
- <para>To use it remember to put the jar files needed for using hibernate annotations
- in the classpath of the <emphasis>
- <property><taskdef></property>,
- </emphasis> i. e. hibernate-annotations.jar and hibernate-commons-annotations.jar.</para>
+ <para>To use it remember to put the jar files needed for using hibernate annotations in the
+ classpath of the <emphasis>
+ <property><taskdef></property>, </emphasis> i. e.
+ hibernate-annotations.jar and hibernate-commons-annotations.jar.</para>
</note>
<para>The <emphasis>
@@ -405,7 +461,7 @@
<para>Thus the minimal usage is:</para>
- <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
+ <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
<annotationconfiguration
configurationfile="hibernate.cfg.xml"/>
@@ -424,8 +480,8 @@
</emphasis> is used when you want to read the metamodel from JPA/Hibernate Annotation where
you want to use the auto-scan configuration as defined in the JPA spec (part of EJB3). In
other words, when you do not have a <emphasis>
- <property>hibernate.cfg.xml</property>,
- </emphasis> but instead have a setup where you use a <emphasis>
+ <property>hibernate.cfg.xml</property>, </emphasis> but instead have a setup where you use
+ a <emphasis>
<property>persistence.xml</property>
</emphasis> packaged in a JPA compliant manner.</para>
@@ -433,15 +489,14 @@
<property><jpaconfiguration></property>
</emphasis> will simply just try and auto-configure it self based on the available
classpath, e.g. look for <emphasis>
- <property>META-INF/persistence.xml</property>.
- </emphasis></para>
+ <property>META-INF/persistence.xml</property>. </emphasis></para>
<para>The <emphasis>
- <property>persistenceunit</property></emphasis> attribute can be used to select a specific
- persistence unit. If no <emphasis>
- <property>persistenceunit</property></emphasis> is specified it will automatically search for one
- and if an unique one is found use it, but if multiple persistence units are available it
- will error.</para>
+ <property>persistenceunit</property>
+ </emphasis> attribute can be used to select a specific persistence unit. If no <emphasis>
+ <property>persistenceunit</property>
+ </emphasis> is specified it will automatically search for one and if a unique one is found,
+ use it, but if multiple persistence units are available it will error.</para>
<para>To use a <emphasis>
<property><jpaconfiguration></property>
@@ -478,9 +533,8 @@
<note>
- <para>ejb3configuration were the name used in previous versions. It still
- works but will emit a warning telling you to use <literal>jpaconfiguration</literal>
- instead.</para>
+ <para>ejb3configuration was the name used in previous versions. It still works but will emit
+ a warning telling you to use <literal>jpaconfiguration</literal> instead.</para>
</note>
</section>
@@ -495,8 +549,10 @@
</emphasis> is used to perform reverse engineering of the database from a JDBC connection.</para>
<para>This configuration works by reading the connection properties either from <emphasis>
- <property>hibernate.cfg.xml</property></emphasis> or <emphasis>
- <property>hibernate.properties</property></emphasis> with a fileset.</para>
+ <property>hibernate.cfg.xml</property>
+ </emphasis> or <emphasis>
+ <property>hibernate.properties</property>
+ </emphasis> with a fileset.</para>
<para>The <emphasis>
<property>
@@ -507,8 +563,8 @@
<literal><configuration></literal>
</property>
</emphasis> plus the following additional attributes:</para>
-
- <programlisting role="XML"><![CDATA[<jdbcconfiguration
+
+ <programlisting role="XML"><![CDATA[<jdbcconfiguration
...
packagename="package.name"
revengfile="hibernate.reveng.xml"
@@ -518,88 +574,114 @@
>
...
</jdbcconfiguration>]]></programlisting>
-
+
<table frame="topbot">
<title>Jdbcconfiguration attributes</title>
-
+
<tgroup cols="3">
-
- <colspec colwidth="0.3*"/>
-
+
+ <colspec colwidth="0.3*"/>
+
<colspec colwidth="1.0*"/>
-
+
<colspec colwidth="0.3*"/>
-
-
+
+
<thead>
<row>
<entry>Attribute name</entry>
-
+
<entry>Definition</entry>
-
+
<entry>Attribute use</entry>
</row>
</thead>
-
+
<tbody>
<row>
- <entry><para>packagename</para></entry>
-
- <entry><para>The default package name to use when
- mappings for classes is created.</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>packagename</para>
+ </entry>
+
+ <entry>
+ <para>The default package name to use when mappings for classes are created.</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>revengfile</para></entry>
-
- <entry><para>The name of a property file, e.g.
- "hibernate.properties".</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>revengfile</para>
+ </entry>
+
+ <entry>
+ <para>The name of a property file, e.g. "hibernate.properties".</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>reversestrategy</para></entry>
-
- <entry><para>Name of a class that implements
- org.hibernate.cfg.reveng.ReverseEngineeringStrategy. Used for
- setting up the strategy the tools will use to control the reverse engineering, e.g.
- naming of properties, which tables to include/exclude etc. Using a class instead of
- (or as addition to) a reveng.xml file gives you full programmatic control of the
- reverse engineering.</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>reversestrategy</para>
+ </entry>
+
+ <entry>
+ <para>Name of a class that implements
+ org.hibernate.cfg.reveng.ReverseEngineeringStrategy. Used for setting up the
+ strategy the tools will use to control the reverse engineering, e.g. naming of
+ properties, which tables to include/exclude etc. Using a class instead of (or as
+ addition to) a reveng.xml file gives you full programmatic control of the reverse
+ engineering.</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
-
+
+
<row>
- <entry><para>detectManytoMany</para></entry>
-
- <entry><para>If true tables which are pure
- many-to-many link tables will be mapped as such. A pure many-to-many table is one
- which primary-key contains has exactly two foreign-keys pointing to other entity
- tables and has no other columns.</para></entry>
-
- <entry><para>Default: true</para></entry>
+ <entry>
+ <para>detectManytoMany</para>
+ </entry>
+
+ <entry>
+ <para>If true, tables which are pure many-to-many link tables will be mapped as
+ such. A pure many-to-many table is one which primary-key contains exactly two
+ foreign-keys pointing to other entity tables and has no other columns.</para>
+ </entry>
+
+ <entry>
+ <para>Default: true</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>detectOptimisticLock</para></entry>
-
- <entry><para>If true columns named VERSION or TIMESTAMP
- with appropriate types will be mapped with the appropriate optimistic locking
- corresponding to <version> or
- <timestamp>.</para></entry>
-
- <entry><para>Default: true</para></entry>
+ <entry>
+ <para>detectOptimisticLock</para>
+ </entry>
+
+ <entry>
+ <para>If true, columns named VERSION or TIMESTAMP with appropriate types will be
+ mapped with the appropriate optimistic locking corresponding to
+ <version> or <timestamp>.</para>
+ </entry>
+
+ <entry>
+ <para>Default: true</para>
+ </entry>
</row>
-
+
</tbody>
-
+
</tgroup>
- </table>
+ </table>
<section>
<title>Example</title>
@@ -608,15 +690,12 @@
<property>
<literal><jdbcconfiguration></literal>
</property>
- </emphasis> to generate Hibernate xml mappings via
- <emphasis>
- <property><hbm2hbmxml></property>.</emphasis> The connection settings is here read from a <emphasis>
- <property>
- hibernate.properties
- </property>
+ </emphasis> to generate Hibernate xml mappings via <emphasis>
+ <property><hbm2hbmxml></property>.</emphasis> The connection settings here
+ is read from a <emphasis>
+ <property> hibernate.properties </property>
</emphasis> file but could just as well have been read from a <emphasis>
- <property>hibernate.cfg.xml</property>.
- </emphasis></para>
+ <property>hibernate.cfg.xml</property>. </emphasis></para>
<programlisting role="XML"><![CDATA[<hibernatetool>
<jdbcconfiguration propertyfile="etc/hibernate.properties" />
@@ -626,13 +705,13 @@
</section>
</section>
</section>
-
+
<section>
<title>Exporters</title>
- <para>Exporters are the parts that does the actual job of converting the hibernate metamodel
- into various artifacts, mainly code. The following section describes the current supported set
- of exporters in the <property>Hibernate Tool</property> distribution. It is also possible for
+ <para>Exporters are the parts that do the actual job of converting the hibernate metamodel into
+ various artifacts, mainly code. The following section describes the current supported set of
+ exporters in the <property>Hibernate Tool</property> distribution. It is also possible for
userdefined exporters, that is done through the <emphasis>
<property>
<literal><hbmtemplate></literal>
@@ -649,7 +728,7 @@
Remember that if a custom naming strategy is needed it is placed on the configuration
element.</para>
- <programlisting role="XML"><![CDATA[<hbm2ddl
+ <programlisting role="XML"><![CDATA[<hbm2ddl
export="true|false"
update="true|false"
drop="true|false"
@@ -659,118 +738,160 @@
format="true|false"
haltonerror="true|false"
>]]></programlisting>
-
+
<table frame="topbot">
<title>Hbm2ddl exporter attributes</title>
-
+
<tgroup cols="3">
-
- <colspec colwidth="0.3*"/>
-
+
+ <colspec colwidth="0.3*"/>
+
<colspec colwidth="1.0*"/>
-
+
<colspec colwidth="0.3*"/>
-
-
+
+
<thead>
<row>
<entry>Attribute name</entry>
-
+
<entry>Definition</entry>
-
+
<entry>Attribute use</entry>
</row>
</thead>
-
+
<tbody>
<row>
- <entry><para>export</para></entry>
-
- <entry><para>Execute the generated statements against the
- database.</para></entry>
-
- <entry><para>Default: true</para></entry>
+ <entry>
+ <para>export</para>
+ </entry>
+
+ <entry>
+ <para>Executes the generated statements against the database</para>
+ </entry>
+
+ <entry>
+ <para>Default: true</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>update</para></entry>
-
- <entry><para>Try and create an update script representing the
- "delta" between what is in the database and what the mappings
- specify. Ignores create/update attributes. (<emphasis>Do *not* use against
- production databases, no guarantees at all that the proper delta can be generated
- nor that the underlying database can actually execute the needed
- operations</emphasis>).</para></entry>
-
- <entry><para>Default: false</para></entry>
+ <entry>
+ <para>update</para>
+ </entry>
+
+ <entry>
+ <para>Try and create an update script representing the "delta"
+ between what is in the database and what the mappings specify. Ignores
+ create/update attributes. (<emphasis>Do *not* use against production databases, no
+ guarantees at all that the proper delta can be generated nor that the underlying
+ database can actually execute the needed operations</emphasis>).</para>
+ </entry>
+
+ <entry>
+ <para>Default: false</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>drop</para></entry>
-
- <entry><para>Output will contain drop statements for the tables,
- indices and constraints.</para></entry>
-
- <entry><para>Default: false</para></entry>
+ <entry>
+ <para>drop</para>
+ </entry>
+
+ <entry>
+ <para>Output will contain drop statements for the tables, indices and
+ constraints</para>
+ </entry>
+
+ <entry>
+ <para>Default: false</para>
+ </entry>
</row>
-
-
+
+
<row>
- <entry><para>create</para></entry>
-
- <entry><para>Output will contain create statements for the tables,
- indices and constraints.</para></entry>
-
- <entry><para>Default: true</para></entry>
+ <entry>
+ <para>create</para>
+ </entry>
+
+ <entry>
+ <para>Output will contain create statements for the tables, indices and
+ constraints</para>
+ </entry>
+
+ <entry>
+ <para>Default: true</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>outputfilename</para></entry>
-
- <entry><para>If specified the statements will be dumped to this
- file.</para></entry>
-
- <entry><para>Optional</para></entry>
+ <entry>
+ <para>outputfilename</para>
+ </entry>
+
+ <entry>
+ <para>If specified the statements will be dumped to this file</para>
+ </entry>
+
+ <entry>
+ <para>Optional</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>delimiter</para></entry>
-
- <entry><para>If specified the statements will be dumped to this
- file.</para></entry>
-
- <entry><para>Default: ";"</para></entry>
+ <entry>
+ <para>delimiter</para>
+ </entry>
+
+ <entry>
+ <para>If specified the statements will be dumped to this file</para>
+ </entry>
+
+ <entry>
+ <para>Default: ";"</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>format</para></entry>
-
- <entry><para>Apply basic formatting to the statements.</para></entry>
-
- <entry><para>Default: false</para></entry>
+ <entry>
+ <para>format</para>
+ </entry>
+
+ <entry>
+ <para>Apply basic formatting to the statements</para>
+ </entry>
+
+ <entry>
+ <para>Default: false</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>haltonerror</para></entry>
-
- <entry><para>Halt build process if an error occurs.</para></entry>
-
- <entry><para>Default: false</para></entry>
+ <entry>
+ <para>haltonerror</para>
+ </entry>
+
+ <entry>
+ <para>Halt build process if an error occurs</para>
+ </entry>
+
+ <entry>
+ <para>Default: false</para>
+ </entry>
</row>
</tbody>
-
+
</tgroup>
- </table>
-
+ </table>
+
<section>
<title>Example</title>
<para>Basic example of using <emphasis>
- <property><hbm2ddl></property>,
- </emphasis> which does not export to the database but simply dumps the sql to a file
- named <emphasis>
- <property>sql.ddl</property>.
- </emphasis></para>
+ <property><hbm2ddl></property>, </emphasis> which does not export to the
+ database but simply dumps the sql to a file named <emphasis>
+ <property>sql.ddl</property>. </emphasis></para>
<programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
<configuration configurationfile="hibernate.cfg.xml"/>
@@ -787,57 +908,68 @@
</emphasis> is a java codegenerator. Options for controlling whether JDK 5 syntax can be
used and whether the POJO should be annotated with EJB3/Hibernate Annotations.</para>
- <programlisting role="XML"><![CDATA[<hbm2java
+ <programlisting role="XML"><![CDATA[<hbm2java
jdk5="true|false"
ejb3="true|false"
>]]></programlisting>
<table frame="topbot">
<title>Hbm2java exporter attributes</title>
-
+
<tgroup cols="3">
-
- <colspec colwidth="0.3*"/>
-
+
+ <colspec colwidth="0.3*"/>
+
<colspec colwidth="1.0*"/>
-
+
<colspec colwidth="0.3*"/>
-
-
+
+
<thead>
<row>
<entry>Attribute name</entry>
-
+
<entry>Definition</entry>
-
+
<entry>Default value</entry>
</row>
</thead>
-
+
<tbody>
<row>
- <entry><para>jdk</para></entry>
-
- <entry><para>Code will contain JDK 5 constructs such as generics and
- static imports.</para></entry>
-
- <entry><para>False</para></entry>
+ <entry>
+ <para>jdk</para>
+ </entry>
+
+ <entry>
+ <para>Code will contain JDK 5 constructs such as generics and static imports.</para>
+ </entry>
+
+ <entry>
+ <para>False</para>
+ </entry>
</row>
-
+
<row>
- <entry><para>ejb3</para></entry>
-
- <entry><para>Code will contain EJB 3 features, e.g. using annotations
- from javax.persistence and org.hibernate.annotations.</para></entry>
-
- <entry><para>False</para></entry>
+ <entry>
+ <para>ejb3</para>
+ </entry>
+
+ <entry>
+ <para>Code will contain EJB 3 features, e.g. using annotations from
+ javax.persistence and org.hibernate.annotations.</para>
+ </entry>
+
+ <entry>
+ <para>False</para>
+ </entry>
</row>
-
+
</tbody>
-
+
</tgroup>
- </table>
-
+ </table>
+
<section>
<title>Example</title>
@@ -861,18 +993,20 @@
<property><jdbcconfiguration></property>
</emphasis> when performing reverse engineering, but can be used with any kind of
configuration. e.g. to convert from annotation based pojo's to <emphasis>
- <property>hbm.xml</property>.
- </emphasis> Note that not every possible mapping transformation is possible/implemented
- (contributions welcome) so some hand editing might be necessary.</para>
+ <property>hbm.xml</property>. </emphasis></para>
+ <note>
+ <para>Not every possible mapping transformation is possible/implemented (contributions
+ welcome) so some hand editing might be necessary.</para>
+ </note>
+
<programlisting role="XML"><![CDATA[<hbm2hbmxml/>]]></programlisting>
<section>
<title>Example</title>
<para>Basic usage of <emphasis>
- <property><hbm2hbmxml></property>.
- </emphasis></para>
+ <property><hbm2hbmxml></property>. </emphasis></para>
<programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
<configuration configurationfile="hibernate.cfg.xml"/>
@@ -894,7 +1028,7 @@
might be necessary.</para>
</note>
- <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
+ <programlisting role="XML"><![CDATA[<hibernatetool destdir="${build.dir}/generated">
<annotationconfiguration configurationfile="hibernate.cfg.xml"/>
<hbm2hbmxml/>
</hibernatetool>]]></programlisting>
@@ -907,58 +1041,62 @@
<para><emphasis>
<property><hbm2cfgxml></property>
</emphasis> generates a <emphasis>
- <property>hibernate.cfg.xml</property>.
- </emphasis> Intended to be used together with a <emphasis>
+ <property>hibernate.cfg.xml</property>. </emphasis> Intended to be used together with a <emphasis>
<property><jdbcconfiguration></property>
</emphasis> when performing reverse engineering, but it can be used with any kind of
configuration. The <emphasis>
<property><hbm2cfgxml></property>
</emphasis> will contain the properties used and adds mapping entries for each mapped class.</para>
- <programlisting role="XML"><![CDATA[<hbm2cfgxml
+ <programlisting role="XML"><![CDATA[<hbm2cfgxml
ejb3="true|false"
/>
]]></programlisting>
-
+
<table frame="topbot">
<title>Hbm2cfgxml exporter attribute</title>
-
+
<tgroup cols="3">
-
- <colspec colwidth="0.3*"/>
-
+
+ <colspec colwidth="0.3*"/>
+
<colspec colwidth="1.0*"/>
-
+
<colspec colwidth="0.3*"/>
-
-
+
+
<thead>
<row>
<entry>Attribute name</entry>
-
+
<entry>Definition</entry>
-
+
<entry>Default value</entry>
</row>
</thead>
-
+
<tbody>
-
+
<row>
- <entry><para>ejb3</para></entry>
-
- <entry><para>The generated cfg.xml will have <mapping
- class=".."/>, opposed to <mapping resource="..."/> for each
- mapping.</para></entry>
-
- <entry><para>False</para></entry>
+ <entry>
+ <para>ejb3</para>
+ </entry>
+
+ <entry>
+ <para>The generated cfg.xml will have <mapping class=".."/>, opposed
+ to <mapping resource="..."/> for each mapping.</para>
+ </entry>
+
+ <entry>
+ <para>False</para>
+ </entry>
</row>
-
+
</tbody>
-
+
</tgroup>
- </table>
-
+ </table>
+
</section>
<section>
@@ -1007,15 +1145,14 @@
<para>Multiple queries can be executed by nested <emphasis>
<property><hql></property>
</emphasis> elements. In this example we also let the output be dumped to <emphasis>
- <property>queryresult.txt</property>.
- </emphasis></para>
+ <property>queryresult.txt</property>. </emphasis></para>
<note>
<title>Tip:</title>
<para> Currently the dump is simply a call to toString on each element.</para>
</note>
- <programlisting role="XML"><![CDATA[<hibernatetool>
+ <programlisting role="XML"><![CDATA[<hibernatetool>
<configuration configurationfile="hibernate.cfg.xml"/>
<query destfile="queryresult.txt">
<hql>select c.name from Customer c where c.age > 42</hql>
@@ -1028,7 +1165,7 @@
<section id="hbmtemplate">
<title>Generic Hibernate metamodel exporter (<literal><hbmtemplate></literal>)</title>
- <para>Generic exporter that can be controlled by an user provides a template or class.</para>
+ <para>Generic exporter that can be controlled by a user provides a template or class.</para>
<programlisting role="XML"><![CDATA[<hbmtemplate
filepattern="{package-name}/{class-name}.ftl"
@@ -1050,7 +1187,7 @@
<property><hbmtemplate></property>
</emphasis>.</para>
- <programlisting role="XML"><![CDATA[ <hibernatetool destdir="${destdir}">
+ <programlisting role="XML"><![CDATA[ <hibernatetool destdir="${destdir}">
<jdbcconfiguration
configurationfile="hibernate.cfg.xml"
packagename="my.model"/>
@@ -1067,11 +1204,20 @@
]]></programlisting>
</section>
+ <section>
+ <title>Relevant Resources Links</title>
+
+ <para>Read more about <ulink url="http://velocity.apache.org/">Velocity</ulink> and <ulink
+ url="http://freemarker.org/">Freemarker</ulink> to find out why using the last is better
+ or refer to Max Andersen discussion on the topic in <ulink
+ url="http://in.relation.to/2110.lace;jsessionid=3462F47B17556604C15DF1B96572E940"
+ >"A story about FreeMarker and Velocity"</ulink>.</para>
+ </section>
</section>
</section>
-
+
<section>
<title>Using properties to configure Exporters</title>
@@ -1082,7 +1228,7 @@
<literal><propertyset></literal>
</property>
</emphasis> and each exporter will have access to them directly in the templates and via
- <property>Exporter.setProperties()</property>.</para>
+ <property>Exporter.setProperties()</property>.</para>
<section>
<title><literal><property></literal> and
@@ -1092,10 +1238,12 @@
<property><property></property>
</emphasis> allows you bind a string value to a key. The value will be available in the
templates via <emphasis>
- <property>$<key></property></emphasis>. The following example will assign the string value <emphasis>
+ <property>$<key></property>
+ </emphasis>. The following example will assign the string value <emphasis>
<property>"true"</property>
- </emphasis> to the variable <emphasis>
- <property>$descriptors</property></emphasis>.</para>
+ </emphasis> to the variable <emphasis>
+ <property>$descriptors</property>
+ </emphasis>.</para>
<programlisting role="XML"><![CDATA[<property key="descriptors" value="true"/>]]></programlisting>
@@ -1112,7 +1260,8 @@
<property>
<literal><propertyset></literal>
</property>
- </emphasis> is explained in detail in the <ulink url="http://ant.apache.org/manual/">Ant manual</ulink>.</para>
+ </emphasis> is explained in detail in the <ulink url="http://ant.apache.org/manual/">Ant
+ manual</ulink>.</para>
</section>
<section>
@@ -1147,6 +1296,7 @@
<property><property></property>
</emphasis> which will be available to the templates/exporter. </para>
<note>
+ <title>Tip:</title>
<para> This example actually simulates what <hbm2java> actually does.</para>
</note>
18 years, 1 month
JBoss Tools SVN: r6435 - in trunk/seam: tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-19 11:06:02 -0500 (Tue, 19 Feb 2008)
New Revision: 6435
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-518
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-02-19 16:04:25 UTC (rev 6434)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-02-19 16:06:02 UTC (rev 6435)
@@ -71,9 +71,7 @@
public void endTest(){
refresh();
- computeResult();
setResult(getSelectedItems().toList());
- okPressed();
}
protected Control createExtendedContentArea(Composite parent) {
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-02-19 16:04:25 UTC (rev 6434)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-02-19 16:06:02 UTC (rev 6435)
@@ -39,9 +39,9 @@
public void testOpenSeamComponentDialogSearch() {
- find("m","mockSecureEntity");
- find("o","org.jboss.seam.captcha.captcha");
- find("p","package1.package2.package3.package4.myComponent");
+ find("m", "mockSecureEntity");
+ find("o", "org.jboss.seam.captcha.captcha");
+ find("p", "package1.package2.package3.package4.myComponent");
}
@@ -49,6 +49,7 @@
OpenSeamComponentDialog dialog = new OpenSeamComponentDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ System.out.print("Searching the component "+componentName+" by pattern \""+pattern+"\"...");
dialog.setInitialPattern(pattern);
dialog.beginTest();
try{
@@ -67,6 +68,8 @@
SeamComponentWrapper wrapper = (SeamComponentWrapper)objects[0];
assertTrue("Component "+componentName+"not found", wrapper.getComponentName().equals(componentName));
+
+ System.out.println("done.");
}
}
18 years, 1 month
JBoss Tools SVN: r6434 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-02-19 11:04:25 -0500 (Tue, 19 Feb 2008)
New Revision: 6434
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
JBIDE-999
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-02-19 16:03:04 UTC (rev 6433)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-02-19 16:04:25 UTC (rev 6434)
@@ -272,22 +272,6 @@
return status;
}
- /**
- * Replace all el variables by variables from found "var" attributes.
- * @param el
- * @param vars
- * @return
- */
- private String replacePrefixByVar(String el, Var var, String suffix) {
- if(var!=null) {
- ELToken token = var.getElToken();
- if(token!=null) {
- return token.getText() + suffix + el.substring(var.getName().length());
- }
- }
- return el;
- }
-
public TypeInfoCollector.MemberInfo resolveSeamEL(ISeamProject project, IFile file, String elBody) throws BadLocationException, StringIndexOutOfBoundsException {
SeamELOperandResolveStatus status = resolveSeamELOperand(project, file, elBody, elBody, 0, true);
return status.getMemberOfResolvedOperand();
18 years, 1 month
JBoss Tools SVN: r6433 - in trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject: src/action/org/domain/SeamWebWarTestProject/entity and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-02-19 11:03:04 -0500 (Tue, 19 Feb 2008)
New Revision: 6433
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java
Log:
JBIDE-999 Improved JUnitTest
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml 2008-02-19 16:00:51 UTC (rev 6432)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml 2008-02-19 16:03:04 UTC (rev 6433)
@@ -1,20 +1,32 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
- xmlns:rich="http://richfaces.ajax4jsf.org/rich"
template="layout/template.xhtml">
-
<ui:define name="body">
- <h:dataTable var="entry" value="#{testComponentForVars.list}">
- <h:column>
- <h:outputText value="#{entry.name}" />
- </h:column>
- </h:dataTable>
+ <h:dataTable value="#{mapItems}" var="mapItem">
+ <h:dataTable value="#{mapItem.value.items}" var="test">
+ <h:outputText value="#{test.name}"/>
+ </h:dataTable>
-</ui:define>
+ <h:dataTable value="#{setItems}" var="value">
+ <h:outputText value="#{value.name}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{listItems}" var="value">
+ <h:outputText value="#{value.name}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{arrayItems}" var="item">
+ <h:outputText value="#{item.name}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testComponentForVars.list}" var="item">
+ <h:outputText value="#{item.name}"/>
+ </h:dataTable>
+ </h:dataTable>
+
+</ui:define>
</ui:composition>
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java 2008-02-19 16:00:51 UTC (rev 6432)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java 2008-02-19 16:03:04 UTC (rev 6433)
@@ -1,23 +1,44 @@
package org.domain.SeamWebWarTestProject.entity;
-import java.io.Serializable;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
-(a)Scope(ScopeType.EVENT)
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.datamodel.DataModel;
+
@Name("testComponentForVars")
-public class TestComponentForVarAttributes implements Serializable {
- static final long serialVersionUID = 1001;
+public class TestComponentForVarAttributes {
+ @DataModel
+ private Set<Value> setItems;
+
+ @DataModel
+ private List<Value> listItems;
+
+ @DataModel
+ private Map<String, Test> mapItems;
+
+ @DataModel
+ private Value[] arrayItems;
+
+ public Test getTest() {
+ return null;
+ }
+
+ public List<Value> getList() {
+ return null;
+ }
+
public static class Value {
public String getName() {
return null;
}
}
- public List<Value> getList() {
- return null;
+ public static class Test {
+ public List<Value> getItems() {
+ return null;
+ }
}
}
\ No newline at end of file
18 years, 1 month