From: Mathieu Baudier Date: Sat, 15 Apr 2017 12:06:48 +0000 (+0200) Subject: Improve Javadoc X-Git-Tag: argeo-commons-2.1.69~11 X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=5330a39edafd14df2e6cdc57aae4e9393ebca75c Improve Javadoc --- diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/DumpNode.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/DumpNode.java index 4a7bf734f..ebf7d34f8 100644 --- a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/DumpNode.java +++ b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/DumpNode.java @@ -30,7 +30,6 @@ import java.util.Map; import javax.jcr.Node; import javax.jcr.RepositoryException; -import javax.jcr.Session; import org.argeo.cms.ui.workbench.WorkbenchUiPlugin; import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem; @@ -46,10 +45,10 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.handlers.HandlerUtil; /** - * Canonically call JCR {@link Session#exportSystemView()} on the first element - * returned by {@link HandlerUtil#getActiveWorkbenchWindow()} + * Canonically call JCR Session#exportSystemView() on the first element returned + * by HandlerUtil#getActiveWorkbenchWindow() * (...getActivePage().getSelection()), if it is a {@link SingleJcrNodeElem}, - * with both skipBinary & noRecurse boolean flags set to false. + * with both skipBinary and noRecurse boolean flags set to false. * * Resulting stream is saved in a tmp file and opened via the {@link OpenFile} * single-sourced command. diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/RenameNode.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/RenameNode.java index 7d3194022..07c722b23 100644 --- a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/RenameNode.java +++ b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/RenameNode.java @@ -36,8 +36,8 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.handlers.HandlerUtil; /** - * Canonically call JCR {@link Session#move(String, String)} on the first - * element returned by {@link HandlerUtil#getActiveWorkbenchWindow()} + * Canonically call JCR Session#move(String, String) on the first element + * returned by HandlerUtil#getActiveWorkbenchWindow() * (...getActivePage().getSelection()), if it is a {@link SingleJcrNodeElem}. * The user must then fill a new name in and confirm */ @@ -45,8 +45,7 @@ public class RenameNode extends AbstractHandler { public final static String ID = WorkbenchUiPlugin.PLUGIN_ID + ".renameNode"; public Object execute(ExecutionEvent event) throws ExecutionException { - IWorkbenchPage iwp = HandlerUtil.getActiveWorkbenchWindow(event) - .getActivePage(); + IWorkbenchPage iwp = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage(); ISelection selection = iwp.getSelection(); if (selection == null || !(selection instanceof IStructuredSelection)) @@ -63,22 +62,19 @@ public class RenameNode extends AbstractHandler { String oldPath = null; try { newName = SingleValue.ask("New node name", - "Please provide a new name for [" + node.getName() - + "]"); + "Please provide a new name for [" + node.getName() + "]"); // TODO sanity check and user feedback newName = JcrUtils.replaceInvalidChars(newName); oldPath = node.getPath(); session = node.getSession(); - session.move(oldPath, JcrUtils.parentPath(oldPath) + "/" - + newName); + session.move(oldPath, JcrUtils.parentPath(oldPath) + "/" + newName); session.save(); // Manually refresh the browser view. Must be enhanced if (iwp.getActivePart() instanceof JcrBrowserView) ((JcrBrowserView) iwp.getActivePart()).refresh(sjn); } catch (RepositoryException e) { - throw new EclipseUiException("Unable to rename " + node - + " to " + newName, e); + throw new EclipseUiException("Unable to rename " + node + " to " + newName, e); } } } diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoryElem.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoryElem.java index 6657adfd0..118ab23fe 100644 --- a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoryElem.java +++ b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoryElem.java @@ -24,7 +24,7 @@ import org.argeo.eclipse.ui.TreeParent; /** * UI Tree component that wraps a JCR {@link Repository}. It also keeps a reference - * to its parent Tree Ui component; typically the unique {@link Repositories} + * to its parent Tree Ui component; typically the unique {@link RepositoriesElem} * object of the current view to enable bi-directionnal browsing in the tree. */ @@ -33,7 +33,7 @@ public class RepositoryElem extends TreeParent { protected Repository repository; private Session defaultSession = null; - /** Create a new repository with distinct name & alias */ + /** Create a new repository with distinct name and alias */ public RepositoryElem(String alias, Repository repository, TreeParent parent) { super(alias); this.repository = repository; diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/AbstractJcrQueryEditor.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/AbstractJcrQueryEditor.java index 27c7cdb15..3839a81c6 100644 --- a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/AbstractJcrQueryEditor.java +++ b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/AbstractJcrQueryEditor.java @@ -55,8 +55,7 @@ import org.eclipse.ui.part.EditorPart; /** Executes any JCR query. */ public abstract class AbstractJcrQueryEditor extends EditorPart { - private final static Log log = LogFactory - .getLog(AbstractJcrQueryEditor.class); + private final static Log log = LogFactory.getLog(AbstractJcrQueryEditor.class); protected String initialQuery; protected String initialQueryType; @@ -73,8 +72,7 @@ public abstract class AbstractJcrQueryEditor extends EditorPart { protected abstract void createQueryForm(Composite parent); @Override - public void init(IEditorSite site, IEditorInput input) - throws PartInitException { + public void init(IEditorSite site, IEditorInput input) throws PartInitException { JcrQueryEditorInput editorInput = (JcrQueryEditorInput) input; initialQuery = editorInput.getQuery(); initialQueryType = editorInput.getQueryType(); @@ -101,8 +99,7 @@ public abstract class AbstractJcrQueryEditor extends EditorPart { sashForm.setWeights(getWeights()); viewer = new TableViewer(bottom); - viewer.getTable().setLayoutData( - new GridData(SWT.FILL, SWT.FILL, true, true)); + viewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); viewer.getTable().setHeaderVisible(true); viewer.setContentProvider(getQueryResultContentProvider()); viewer.setInput(getEditorSite()); @@ -121,8 +118,8 @@ public abstract class AbstractJcrQueryEditor extends EditorPart { if (log.isDebugEnabled()) log.debug("Query : " + statement); - QueryResult qr = session.getWorkspace().getQueryManager() - .createQuery(statement, initialQueryType).execute(); + QueryResult qr = session.getWorkspace().getQueryManager().createQuery(statement, initialQueryType) + .execute(); // remove previous columns for (TableViewerColumn tvc : tableViewerColumns) @@ -150,9 +147,8 @@ public abstract class AbstractJcrQueryEditor extends EditorPart { } } catch (RepositoryException e) { - ErrorDialog.openError(null, "Error", "Cannot execute JCR query: " - + statement, new Status(IStatus.ERROR, - "org.argeo.eclipse.ui.jcr", e.getMessage())); + ErrorDialog.openError(null, "Error", "Cannot execute JCR query: " + statement, + new Status(IStatus.ERROR, "org.argeo.eclipse.ui.jcr", e.getMessage())); } } @@ -222,26 +218,22 @@ public abstract class AbstractJcrQueryEditor extends EditorPart { /** * To be overridden in order to configure the columns. * - * @deprecated use {@link - * org.argeo.eclipse.ui.jcr.editors.AbstractJcrQueryEditor. - * configureColumn(String jcrColumnName, TableViewerColumn - * column, int columnIndex)} instead + * @deprecated use + * {@link AbstractJcrQueryEditor#configureColumn(String, TableViewerColumn , int )} + * instead */ - protected void configureColumn(String jcrColumnName, - TableViewerColumn column) { + protected void configureColumn(String jcrColumnName, TableViewerColumn column) { column.getColumn().setWidth(50); column.getColumn().setText(jcrColumnName); } /** To be overridden in order to configure the columns. */ - protected void configureColumn(String jcrColumnName, - TableViewerColumn column, int columnIndex) { + protected void configureColumn(String jcrColumnName, TableViewerColumn column, int columnIndex) { column.getColumn().setWidth(50); column.getColumn().setText(jcrColumnName); } - private class QueryResultContentProvider implements - IStructuredContentProvider { + private class QueryResultContentProvider implements IStructuredContentProvider { private static final long serialVersionUID = -5421095459600554741L; public void dispose() { @@ -287,8 +279,7 @@ public abstract class AbstractJcrQueryEditor extends EditorPart { * @param index * @return */ - protected SelectionAdapter getSelectionAdapter(final TableColumn column, - final int index) { + protected SelectionAdapter getSelectionAdapter(final TableColumn column, final int index) { // A comparator must be define if (comparator == null) diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/useradmin/parts/GroupMainPage.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/useradmin/parts/GroupMainPage.java index 0b16466ad..32219d2d7 100644 --- a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/useradmin/parts/GroupMainPage.java +++ b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/useradmin/parts/GroupMainPage.java @@ -222,7 +222,7 @@ public class GroupMainPage extends FormPage implements ArgeoNames { getManagedForm().addPart(part); } - /** Filtered table with members. Has drag & drop ability */ + /** Filtered table with members. Has drag and drop ability */ protected void appendMembersPart(Composite parent, Group group) { FormToolkit tk = getManagedForm().getToolkit(); diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/util/CommandUtils.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/util/CommandUtils.java index 29f9e3e9e..b05ba0746 100644 --- a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/util/CommandUtils.java +++ b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/util/CommandUtils.java @@ -47,19 +47,10 @@ public class CommandUtils { * * Note: that this method should be called with a false show command flag to * remove a contribution that have been previously contributed - * - * @param menuManager - * @param locator - * @param cmdId - * @param label - * @param icon - * @param showCommand */ - public static void refreshCommand(IMenuManager menuManager, - IServiceLocator locator, String cmdId, String label, + public static void refreshCommand(IMenuManager menuManager, IServiceLocator locator, String cmdId, String label, ImageDescriptor icon, boolean showCommand) { - refreshParameterizedCommand(menuManager, locator, cmdId, label, icon, - showCommand, null); + refreshParameterizedCommand(menuManager, locator, cmdId, label, icon, showCommand, null); } /** @@ -67,20 +58,10 @@ public class CommandUtils { * parameters in a context menu * * The command ID is used has contribution item ID - * - * @param menuManager - * @param locator - * @param cmdId - * @param label - * @param iconPath - * @param showCommand */ - public static void refreshParameterizedCommand(IMenuManager menuManager, - IServiceLocator locator, String cmdId, String label, - ImageDescriptor icon, boolean showCommand, - Map params) { - refreshParameterizedCommand(menuManager, locator, cmdId, cmdId, label, - icon, showCommand, params); + public static void refreshParameterizedCommand(IMenuManager menuManager, IServiceLocator locator, String cmdId, + String label, ImageDescriptor icon, boolean showCommand, Map params) { + refreshParameterizedCommand(menuManager, locator, cmdId, cmdId, label, icon, showCommand, params); } /** @@ -96,16 +77,15 @@ public class CommandUtils { * @param showCommand * @param params */ - public static void refreshParameterizedCommand(IMenuManager menuManager, - IServiceLocator locator, String contributionId, String commandId, - String label, ImageDescriptor icon, boolean showCommand, + public static void refreshParameterizedCommand(IMenuManager menuManager, IServiceLocator locator, + String contributionId, String commandId, String label, ImageDescriptor icon, boolean showCommand, Map params) { IContributionItem ici = menuManager.find(contributionId); if (ici != null) menuManager.remove(ici); if (showCommand) { - CommandContributionItemParameter contributionItemParameter = new CommandContributionItemParameter( - locator, null, commandId, SWT.PUSH); + CommandContributionItemParameter contributionItemParameter = new CommandContributionItemParameter(locator, + null, commandId, SWT.PUSH); // Set Params contributionItemParameter.label = label; @@ -114,8 +94,7 @@ public class CommandUtils { if (params != null) contributionItemParameter.parameters = params; - CommandContributionItem cci = new CommandContributionItem( - contributionItemParameter); + CommandContributionItem cci = new CommandContributionItem(contributionItemParameter); cci.setId(contributionId); menuManager.add(cci); } @@ -127,8 +106,7 @@ public class CommandUtils { } /** Helper to call a command with a single parameter easily */ - public static void callCommand(String commandID, String parameterID, - String parameterValue) { + public static void callCommand(String commandID, String parameterID, String parameterValue) { Map params = new HashMap(); params.put(parameterID, parameterValue); callCommand(commandID, params); @@ -141,15 +119,12 @@ public class CommandUtils { * a map that links various command IDs with corresponding String * values. */ - public static void callCommand(String commandID, - Map paramMap) { + public static void callCommand(String commandID, Map paramMap) { try { IWorkbench iw = WorkbenchUiPlugin.getDefault().getWorkbench(); - IHandlerService handlerService = (IHandlerService) iw - .getService(IHandlerService.class); - ICommandService cmdService = (ICommandService) iw - .getActiveWorkbenchWindow().getService( - ICommandService.class); + IHandlerService handlerService = (IHandlerService) iw.getService(IHandlerService.class); + ICommandService cmdService = (ICommandService) iw.getActiveWorkbenchWindow() + .getService(ICommandService.class); Command cmd = cmdService.getCommand(commandID); ArrayList parameters = null; @@ -161,21 +136,17 @@ public class CommandUtils { Parameterization parameterization; for (String id : paramMap.keySet()) { - parameterization = new Parameterization( - cmd.getParameter(id), paramMap.get(id)); + parameterization = new Parameterization(cmd.getParameter(id), paramMap.get(id)); parameters.add(parameterization); } - pc = new ParameterizedCommand(cmd, - parameters.toArray(new Parameterization[parameters - .size()])); + pc = new ParameterizedCommand(cmd, parameters.toArray(new Parameterization[parameters.size()])); } else pc = new ParameterizedCommand(cmd, null); // execute the command handlerService.executeCommand(pc, null); } catch (Exception e) { - throw new EclipseUiException("Unexpected error while" - + " calling the command " + commandID, e); + throw new EclipseUiException("Unexpected error while" + " calling the command " + commandID, e); } } } diff --git a/org.argeo.cms.ui/src/org/argeo/cms/forms/FormUtils.java b/org.argeo.cms.ui/src/org/argeo/cms/forms/FormUtils.java index d0fa9269c..be087027a 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/forms/FormUtils.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/forms/FormUtils.java @@ -183,7 +183,7 @@ public class FormUtils { private static String AMPERSAND = "&"; /** - * Cleans a String by replacing any '&' by its HTML encoding '&' to + * Cleans a String by replacing any '&' by its HTML encoding '&' to * avoid SAXParseException while rendering HTML with RWT */ public static String replaceAmpersand(String value) { diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsImageManager.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsImageManager.java index ddae6006e..eb9cb752d 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsImageManager.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsImageManager.java @@ -13,24 +13,25 @@ import org.eclipse.swt.widgets.Control; /** Read and write access to images. */ public interface CmsImageManager { /** Load image in control */ - public Boolean load(Node node, Control control, Point size) - throws RepositoryException; + public Boolean load(Node node, Control control, Point size) throws RepositoryException; /** @return (0,0) if not available */ public Point getImageSize(Node node) throws RepositoryException; /** - * The related - * Supported standard {@link Callback}s are:
+ * {@link #createCallbackHandlers(Callback[])}. Supported standard + * {@link Callback}s are:
*
    *
  • {@link PasswordCallback}
  • *
  • {@link NameCallback}
  • *
  • {@link TextOutputCallback}
  • *
- *

- *

* Supported Argeo {@link Callback}s are:
*

    *
  • {@link LocaleChoice}
  • *
- *

*/ -public class CompositeCallbackHandler extends Composite implements - CallbackHandler { +public class CompositeCallbackHandler extends Composite implements CallbackHandler { private static final long serialVersionUID = -928223893722723777L; private boolean wasUsedAlready = false; @@ -56,8 +51,7 @@ public class CompositeCallbackHandler extends Composite implements } @Override - public synchronized void handle(final Callback[] callbacks) - throws IOException, UnsupportedCallbackException { + public synchronized void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { // reset if (wasUsedAlready && !isSubmitted() && !isCanceled()) { cancel(); @@ -81,23 +75,20 @@ public class CompositeCallbackHandler extends Composite implements if (!wasUsedAlready) wasUsedAlready = true; -// while (!isSubmitted() && !isCanceled()) { -// try { -// wait(1000l); -// } catch (InterruptedException e) { -// // silent -// } -// } + // while (!isSubmitted() && !isCanceled()) { + // try { + // wait(1000l); + // } catch (InterruptedException e) { + // // silent + // } + // } -// cleanCallbacksAfterCancel(callbacks); + // cleanCallbacksAfterCancel(callbacks); } - public void checkCallbackSupported(Callback callback) - throws UnsupportedCallbackException { - if (callback instanceof TextOutputCallback - || callback instanceof NameCallback - || callback instanceof PasswordCallback - || callback instanceof LocaleChoice) { + public void checkCallbackSupported(Callback callback) throws UnsupportedCallbackException { + if (callback instanceof TextOutputCallback || callback instanceof NameCallback + || callback instanceof PasswordCallback || callback instanceof LocaleChoice) { return; } else { throw new UnsupportedCallbackException(callback); @@ -130,8 +121,7 @@ public class CompositeCallbackHandler extends Composite implements for (int i = 0; i < callbacks.length; i++) { Callback callback = callbacks[i]; if (callback instanceof TextOutputCallback) { - createLabelTextoutputHandler(composite, - (TextOutputCallback) callback); + createLabelTextoutputHandler(composite, (TextOutputCallback) callback); } else if (callback instanceof NameCallback) { createNameHandler(composite, (NameCallback) callback); } else if (callback instanceof PasswordCallback) { @@ -142,12 +132,10 @@ public class CompositeCallbackHandler extends Composite implements } } - protected Text createNameHandler(Composite composite, - final NameCallback callback) { + protected Text createNameHandler(Composite composite, final NameCallback callback) { Label label = new Label(composite, SWT.NONE); label.setText(callback.getPrompt()); - final Text text = new Text(composite, SWT.SINGLE | SWT.LEAD - | SWT.BORDER); + final Text text = new Text(composite, SWT.SINGLE | SWT.LEAD | SWT.BORDER); if (callback.getDefaultName() != null) { // set default value, if provided text.setText(callback.getDefaultName()); @@ -188,14 +176,11 @@ public class CompositeCallbackHandler extends Composite implements return text; } - protected Text createPasswordHandler(Composite composite, - final PasswordCallback callback) { + protected Text createPasswordHandler(Composite composite, final PasswordCallback callback) { Label label = new Label(composite, SWT.NONE); label.setText(callback.getPrompt()); - final Text passwordText = new Text(composite, SWT.SINGLE | SWT.LEAD - | SWT.PASSWORD | SWT.BORDER); - passwordText - .setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + final Text passwordText = new Text(composite, SWT.SINGLE | SWT.LEAD | SWT.PASSWORD | SWT.BORDER); + passwordText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); passwordText.addModifyListener(new ModifyListener() { private static final long serialVersionUID = -7099363995047686732L; @@ -218,8 +203,7 @@ public class CompositeCallbackHandler extends Composite implements return passwordText; } - protected Combo createLocaleHandler(Composite composite, - final LocaleChoice callback) { + protected Combo createLocaleHandler(Composite composite, final LocaleChoice callback) { String[] labels = callback.getSupportedLocalesLabels(); if (labels.length == 0) return null; @@ -245,8 +229,7 @@ public class CompositeCallbackHandler extends Composite implements return combo; } - protected Label createLabelTextoutputHandler(Composite composite, - final TextOutputCallback callback) { + protected Label createLabelTextoutputHandler(Composite composite, final TextOutputCallback callback) { Label label = new Label(composite, SWT.NONE); label.setText(callback.getMessage()); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); diff --git a/org.argeo.cms/src/org/argeo/cms/internal/backup/BackupFileSystemManager.java b/org.argeo.cms/src/org/argeo/cms/internal/backup/BackupFileSystemManager.java index 05c7d61a3..d8d626ad5 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/backup/BackupFileSystemManager.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/backup/BackupFileSystemManager.java @@ -30,7 +30,7 @@ import org.argeo.cms.CmsException; * Programatically configured VFS file system manager which can be declared as a * bean and associated with a life cycle (methods * {@link DefaultFileSystemManager#init()} and - * {@link DefaultFileSystemManager#closet()}). Supports bz2, file, ram, gzip, + * {@link DefaultFileSystemManager#close()}). Supports bz2, file, ram, gzip, * ftp, sftp */ public class BackupFileSystemManager extends DefaultFileSystemManager { diff --git a/org.argeo.cms/src/org/argeo/cms/spring/AbstractSystemExecution.java b/org.argeo.cms/src/org/argeo/cms/spring/AbstractSystemExecution.java index f478f37db..ce92c4613 100644 --- a/org.argeo.cms/src/org/argeo/cms/spring/AbstractSystemExecution.java +++ b/org.argeo.cms/src/org/argeo/cms/spring/AbstractSystemExecution.java @@ -29,10 +29,7 @@ abstract class AbstractSystemExecution { private final static Log log = LogFactory.getLog(AbstractSystemExecution.class); private final Subject subject = new Subject(); - /** - * Authenticate the calling thread to the underlying - * {@link AuthenticationManager} - */ + /** Authenticate the calling thread */ protected void authenticateAsSystem() { ClassLoader origClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); diff --git a/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java b/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java index 63cf457a1..b669033de 100644 --- a/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java +++ b/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java @@ -24,8 +24,6 @@ public class EclipseUiSpecificUtils { /** * TootlTip support is supported only for {@link AbstractTableViewer} in RAP - * - * @see ColumnViewerToolTipSupport#enableFor(AbstractTableViewer) */ public static void enableToolTipSupport(Viewer viewer) { if (viewer instanceof AbstractTableViewer) diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/GenericTableComparator.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/GenericTableComparator.java index a4179cbee..c6e205cea 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/GenericTableComparator.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/GenericTableComparator.java @@ -27,7 +27,7 @@ public abstract class GenericTableComparator extends ViewerComparator { /** * Creates an instance of a sorter for TableViewer. * - * @param defaultColumn + * @param defaultColumnIndex * the default sorter column */ diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/JcrFileProvider.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/JcrFileProvider.java index 6967af461..472101f34 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/JcrFileProvider.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/JcrFileProvider.java @@ -28,7 +28,7 @@ import org.argeo.eclipse.ui.FileProvider; /** * Implements a FileProvider for UI purposes. Note that it might not be very - * reliable as long as we have not fixed login & multi repository issues that + * reliable as long as we have not fixed login and multi repository issues that * will be addressed in the next version. * * NOTE: id used here is the real id of the JCR Node, not the JCR Path @@ -47,48 +47,19 @@ public class JcrFileProvider implements FileProvider { * and thus have the ability to get the file node corresponding to a given * file ID * - * FIXME : this introduces some concurrences ISSUES. - * - * @param repositoryNode + * @param refNode */ public void setReferenceNode(Node refNode) { + // FIXME : this introduces some concurrency ISSUES. this.refNode = refNode; } - /** - * Must be set in order for the provider to be able to search the repository - * Provided object might be either JCR Nodes or UI RepositoryNode for the - * time being. - * - * @param repositoryNode - */ - // public void setRootNodes(Object[] rootNodes) { - // List tmpNodes = new ArrayList(); - // for (int i = 0; i < rootNodes.length; i++) { - // Object obj = rootNodes[i]; - // if (obj instanceof Node) { - // tmpNodes.add(obj); - // } else if (obj instanceof RepositoryRegister) { - // RepositoryRegister repositoryRegister = (RepositoryRegister) obj; - // Map repositories = repositoryRegister - // .getRepositories(); - // for (String name : repositories.keySet()) { - // // tmpNodes.add(new RepositoryNode(name, repositories - // // .get(name))); - // } - // - // } - // } - // this.rootNodes = tmpNodes.toArray(); - // } - public byte[] getByteArrayFileFromId(String fileId) { InputStream fis = null; byte[] ba = null; Node child = getFileNodeFromId(fileId); try { - fis = (InputStream) child.getProperty(Property.JCR_DATA) - .getBinary().getStream(); + fis = (InputStream) child.getProperty(Property.JCR_DATA).getBinary().getStream(); ba = IOUtils.toByteArray(fis); } catch (Exception e) { @@ -104,12 +75,10 @@ public class JcrFileProvider implements FileProvider { InputStream fis = null; Node child = getFileNodeFromId(fileId); - fis = (InputStream) child.getProperty(Property.JCR_DATA) - .getBinary().getStream(); + fis = (InputStream) child.getProperty(Property.JCR_DATA).getBinary().getStream(); return fis; } catch (RepositoryException re) { - throw new EclipseUiException("Cannot get stream from file node for Id " - + fileId, re); + throw new EclipseUiException("Cannot get stream from file node for Id " + fileId, re); } } @@ -150,31 +119,26 @@ public class JcrFileProvider implements FileProvider { throw new EclipseUiException("File node not found for ID" + fileId); Node child = null; - + boolean isValid = true; - if (!result.isNodeType(NodeType.NT_FILE)) + if (!result.isNodeType(NodeType.NT_FILE)) // useless: mandatory child node - // || !result.hasNode(Property.JCR_CONTENT)) + // || !result.hasNode(Property.JCR_CONTENT)) isValid = false; else { child = result.getNode(Property.JCR_CONTENT); - if (!(child.isNodeType(NodeType.NT_RESOURCE) || child - .hasProperty(Property.JCR_DATA))) + if (!(child.isNodeType(NodeType.NT_RESOURCE) || child.hasProperty(Property.JCR_DATA))) isValid = false; } if (!isValid) - throw new EclipseUiException( - "ERROR: In the current implemented model, '" - + NodeType.NT_FILE - + "' file node must have a child node named jcr:content " - + "that has a BINARY Property named jcr:data " - + "where the actual data is stored"); + throw new EclipseUiException("ERROR: In the current implemented model, '" + NodeType.NT_FILE + + "' file node must have a child node named jcr:content " + + "that has a BINARY Property named jcr:data " + "where the actual data is stored"); return child; } catch (RepositoryException re) { - throw new EclipseUiException("Erreur while getting file node of ID " - + fileId, re); + throw new EclipseUiException("Erreur while getting file node of ID " + fileId, re); } } } diff --git a/org.argeo.enterprise/src/org/argeo/naming/AttributesDictionary.java b/org.argeo.enterprise/src/org/argeo/naming/AttributesDictionary.java index fe59c1002..e04721610 100644 --- a/org.argeo.enterprise/src/org/argeo/naming/AttributesDictionary.java +++ b/org.argeo.enterprise/src/org/argeo/naming/AttributesDictionary.java @@ -145,8 +145,8 @@ public class AttributesDictionary extends Dictionary { } /** - * Copy the content of an {@link javax.naming.Attributes} to the - * provided {@link Dictionary}. + * Copy the content of an {@link Attributes} to the provided + * {@link Dictionary}. */ public static void copy(Attributes attributes, Dictionary dictionary) { AttributesDictionary ad = new AttributesDictionary(attributes); @@ -158,7 +158,7 @@ public class AttributesDictionary extends Dictionary { } /** - * Copy a {@link Dictionary} into an {@link javax.naming.Attributes}. + * Copy a {@link Dictionary} into an {@link Attributes}. */ public static void copy(Dictionary dictionary, Attributes attributes) { AttributesDictionary ad = new AttributesDictionary(attributes); diff --git a/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java b/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java index 97a65a819..c2450e8c7 100644 --- a/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java +++ b/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java @@ -146,7 +146,7 @@ public class JcrUtils { /** * Creates a deep path based on a URL: - * http://subdomain.example.com/to/content?args => + * http://subdomain.example.com/to/content?args becomes * com/example/subdomain/to/content */ public static String urlAsPath(String url) { @@ -208,7 +208,7 @@ public class JcrUtils { /** * Creates a path from a FQDN, inverting the order of the component: - * www.argeo.org => org.argeo.www + * www.argeo.org becomes org.argeo.www */ public static String hostAsPath(String host) { StringBuffer path = new StringBuffer(host.length()); @@ -222,7 +222,7 @@ public class JcrUtils { } /** - * Creates a path from a UUID (e.g. 6ebda899-217d-4bf1-abe4-2839085c8f3c => + * Creates a path from a UUID (e.g. 6ebda899-217d-4bf1-abe4-2839085c8f3c becomes * 6ebda899-217d/4bf1/abe4/2839085c8f3c/). '/' at the end, not the beginning */ public static String uuidAsPath(String uuid) { @@ -1008,7 +1008,7 @@ public class JcrUtils { /** * Creates depth from a string (typically a username) by adding levels based - * on its first characters: "aBcD",2 => a/aB + * on its first characters: "aBcD",2 becomes a/aB */ public static String firstCharsToPath(String str, Integer nbrOfChars) { if (str.length() < nbrOfChars) @@ -1210,7 +1210,7 @@ public class JcrUtils { /** * Estimate the sub tree size from current node. Computation is based on the - * Jcr {@link Property.getLength()} method. Note : it is not the exact size + * Jcr {@link Property#getLength()} method. Note : it is not the exact size * used on the disk by the current part of the JCR Tree. */ diff --git a/org.argeo.node.api/src/org/argeo/node/ArgeoLogListener.java b/org.argeo.node.api/src/org/argeo/node/ArgeoLogListener.java index 698dfe1be..303bbef7e 100644 --- a/org.argeo.node.api/src/org/argeo/node/ArgeoLogListener.java +++ b/org.argeo.node.api/src/org/argeo/node/ArgeoLogListener.java @@ -31,7 +31,7 @@ public interface ArgeoLogListener { * @param msg * any object as long as its toString() method returns the * message - * @param the + * @param exception * exception in log4j ThrowableStrRep format */ public void appendLog(String username, Long timestamp, String level, diff --git a/org.argeo.node.api/src/org/argeo/node/NodeUtils.java b/org.argeo.node.api/src/org/argeo/node/NodeUtils.java index 8edea1a73..afb64bd7a 100644 --- a/org.argeo.node.api/src/org/argeo/node/NodeUtils.java +++ b/org.argeo.node.api/src/org/argeo/node/NodeUtils.java @@ -36,7 +36,7 @@ import javax.jcr.query.qom.StaticOperand; public class NodeUtils { /** * Wraps the call to the repository factory based on parameter - * {@link NodeConstants#JCR_REPOSITORY_ALIAS} in order to simplify it and + * {@link NodeConstants#CN} in order to simplify it and * protect against future API changes. */ public static Repository getRepositoryByAlias(RepositoryFactory repositoryFactory, String alias) { @@ -52,7 +52,7 @@ public class NodeUtils { /** * Wraps the call to the repository factory based on parameter - * {@link NodeConstants#JCR_REPOSITORY_URI} in order to simplify it and + * {@link NodeConstants#LABELED_URI} in order to simplify it and * protect against future API changes. */ public static Repository getRepositoryByUri(RepositoryFactory repositoryFactory, String uri) { @@ -61,7 +61,7 @@ public class NodeUtils { /** * Wraps the call to the repository factory based on parameter - * {@link NodeConstants#JCR_REPOSITORY_URI} in order to simplify it and + * {@link NodeConstants#LABELED_URI} in order to simplify it and * protect against future API changes. */ public static Repository getRepositoryByUri(RepositoryFactory repositoryFactory, String uri, String alias) { @@ -165,25 +165,4 @@ public class NodeUtils { return buf.append('/').append(cn).append('/').append(node.getSession().getWorkspace().getName()) .append(node.getPath()).toString(); } - - // public static Node getUserProfile(Session session, String username) { - // try { - // QueryObjectModelFactory qomf = session.getWorkspace() - // .getQueryManager().getQOMFactory(); - // Selector userHomeSel = qomf.selector(ArgeoTypes.ARGEO_USER_PROFILE, - // "userProfile"); - // DynamicOperand userIdDop = qomf.propertyValue( - // userHomeSel.getSelectorName(), ArgeoNames.ARGEO_USER_ID); - // StaticOperand userIdSop = qomf.literal(session.getValueFactory() - // .createValue(username)); - // Constraint constraint = qomf.comparison(userIdDop, - // QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, userIdSop); - // Query query = qomf.createQuery(userHomeSel, constraint, null, null); - // return querySingleNode(query); - // } catch (RepositoryException e) { - // throw new RuntimeException( - // "Cannot find profile for user " + username, e); - // } - // } - // } diff --git a/org.argeo.node.api/src/org/argeo/node/security/CryptoKeyring.java b/org.argeo.node.api/src/org/argeo/node/security/CryptoKeyring.java index 72f9ff7a7..026fcb06d 100644 --- a/org.argeo.node.api/src/org/argeo/node/security/CryptoKeyring.java +++ b/org.argeo.node.api/src/org/argeo/node/security/CryptoKeyring.java @@ -15,12 +15,8 @@ */ package org.argeo.node.security; - - /** - * Advanced keyring based on cryptography that can easily be centralized and - * coordinated with {@link KeyringLoginModule} (since they ar ein the same - * package) + * Marker interface for an advanced keyring based on cryptography. */ public interface CryptoKeyring extends Keyring { diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java index 212e6baa4..e21212662 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBootUtils.java @@ -71,7 +71,7 @@ public class OsgiBootUtils { } /** - * @return ==0: versions are identical, <0: tested version is newer, >0: + * @return ==0: versions are identical, <0: tested version is newer, >0: * currentVersion is newer. */ public static int compareVersions(String currentVersion, String testedVersion) { diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/AntPathMatcher.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/AntPathMatcher.java index 0b9ad1a23..e3fc6c299 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/AntPathMatcher.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/AntPathMatcher.java @@ -366,14 +366,14 @@ public class AntPathMatcher implements PathMatcher { * Given a pattern and a full path, determine the pattern-mapped part. *

For example: *

    - *
  • '/docs/cvs/commit.html' and '/docs/cvs/commit.html -> ''
  • - *
  • '/docs/*' and '/docs/cvs/commit -> 'cvs/commit'
  • - *
  • '/docs/cvs/*.html' and '/docs/cvs/commit.html -> 'commit.html'
  • - *
  • '/docs/**' and '/docs/cvs/commit -> 'cvs/commit'
  • - *
  • '/docs/**\/*.html' and '/docs/cvs/commit.html -> 'cvs/commit.html'
  • - *
  • '/*.html' and '/docs/cvs/commit.html -> 'docs/cvs/commit.html'
  • - *
  • '*.html' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html'
  • - *
  • '*' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html'
  • + *
  • '/docs/cvs/commit.html' and '/docs/cvs/commit.html to ''
  • + *
  • '/docs/*' and '/docs/cvs/commit to 'cvs/commit'
  • + *
  • '/docs/cvs/*.html' and '/docs/cvs/commit.html to 'commit.html'
  • + *
  • '/docs/**' and '/docs/cvs/commit to 'cvs/commit'
  • + *
  • '/docs/**\/*.html' and '/docs/cvs/commit.html to 'cvs/commit.html'
  • + *
  • '/*.html' and '/docs/cvs/commit.html to 'docs/cvs/commit.html'
  • + *
  • '*.html' and '/docs/cvs/commit.html to '/docs/cvs/commit.html'
  • + *
  • '*' and '/docs/cvs/commit.html to '/docs/cvs/commit.html'
  • *
*

Assumes that {@link #match} returns true for 'pattern' * and 'path', but does not enforce this. diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/ObjectUtils.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/ObjectUtils.java index 691aaf58c..2c98b465c 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/ObjectUtils.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/ObjectUtils.java @@ -30,7 +30,6 @@ import java.util.Arrays; * @author Rob Harrop * @author Alex Ruiz * @since 19.03.2004 - * @see org.apache.commons.lang.ObjectUtils */ @SuppressWarnings({ "rawtypes", "unchecked" }) public abstract class ObjectUtils { diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/StringUtils.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/StringUtils.java index 83d91755b..6cbaee8f8 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/StringUtils.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/internal/springutil/StringUtils.java @@ -49,7 +49,6 @@ import java.util.TreeSet; * @author Rob Harrop * @author Rick Evans * @since 16 April 2001 - * @see org.apache.commons.lang.StringUtils */ @SuppressWarnings({ "rawtypes", "unchecked" }) public abstract class StringUtils { @@ -431,7 +430,7 @@ public abstract class StringUtils { * Quote the given String with single quotes. * @param str the input String (e.g. "myString") * @return the quoted String (e.g. "'myString'"), - * or null if the input was null + * or null if the input was null */ public static String quote(String str) { return (str != null ? "'" + str + "'" : null); @@ -506,7 +505,7 @@ public abstract class StringUtils { /** * Extract the filename from the given path, - * e.g. "mypath/myfile.txt" -> "myfile.txt". + * e.g. "mypath/myfile.txt" to "myfile.txt". * @param path the file path (may be null) * @return the extracted filename, or null if none */ @@ -520,7 +519,7 @@ public abstract class StringUtils { /** * Extract the filename extension from the given path, - * e.g. "mypath/myfile.txt" -> "txt". + * e.g. "mypath/myfile.txt" to "txt". * @param path the file path (may be null) * @return the extracted filename extension, or null if none */ @@ -534,7 +533,7 @@ public abstract class StringUtils { /** * Strip the filename extension from the given path, - * e.g. "mypath/myfile.txt" -> "mypath/myfile". + * e.g. "mypath/myfile.txt" to "mypath/myfile". * @param path the file path (may be null) * @return the path with stripped filename extension, * or null if none diff --git a/pom.xml b/pom.xml index 9cf77854f..55b6d8ab4 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.argeo.commons argeo-commons @@ -45,8 +46,8 @@ scm:git:http://git.argeo.org/apache2/argeo-commons.git http://git.argeo.org/?p=apache2/argeo-commons.git;a=summary scm:git:https://code.argeo.org/git/apache2/argeo-commons.git - HEAD - + HEAD + 2007 @@ -213,10 +214,10 @@ limitations under the License. true - - maven-javadoc-plugin - 2.10.1 - + + + + org.apache.felix @@ -274,50 +275,49 @@ limitations under the License. 1.1.6 + maven-site-plugin - 3.4 + 3.6 - doc/site - true - true + + + - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.8.1 - - - - index - summary - license - scm - - - - + + + + + + + + + + + + + + + maven-javadoc-plugin - 2.10.3 + 2.10.4 - false UTF-8 - *.demo.*:*.internal.* true + src - http://docs.oracle.com/javase/6/docs/api + http://docs.oracle.com/javase/8/docs/api - http://www.osgi.org/javadoc/r4v42 + http://www.osgi.org/javadoc/r5/core + http://www.osgi.org/javadoc/r5/enterprise - http://static.springsource.org/spring/docs/2.5.x/api - http://static.springsource.org/osgi/docs/1.2.x/api - http://static.springsource.org/spring-security/site/docs/2.0.x/apidocs + http://docs.spring.io/spring/docs/3.2.x/javadoc-api http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0 - http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/api + http://help.eclipse.org/neon/topic/org.eclipse.platform.doc.isv/reference/api @@ -332,12 +332,6 @@ limitations under the License. maven-jxr-plugin 2.5 - - - **/demo/**/* - **/internal/**/* - - aggregate @@ -366,12 +360,12 @@ limitations under the License. - - maven-javadoc-plugin - - true - - + + + + + + maven-resources-plugin @@ -382,7 +376,7 @@ limitations under the License. maven-site-plugin false - false + true @@ -465,6 +459,10 @@ limitations under the License. dav:https://forge.argeo.org/data/java/argeo-${developmentCycle.argeo-commons} false + + staging + dav:https://forge.argeo.org/data/docs/argeo-${developmentCycle.argeo-commons} + @@ -505,8 +503,10 @@ limitations under the License. - - + + @@ -531,8 +531,10 @@ limitations under the License. - - + +