Changeset 28516

Show
Ignore:
Timestamp:
01/06/08 23:18:55 (1 year ago)
Author:
sfermigier
Message:

Forward port.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.common/trunk/src/main/java/org/nuxeo/common/utils/SerializableHelper.java

    r20729 r28516  
    2727 
    2828/** 
    29  * Helper to test object serialization. 
     29 * Helper to test object serialization. Used only in tests. 
    3030 * 
    3131 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a> 
     
    4747    // a DocumentModel for instance. 
    4848    public static boolean isSerializable(Object ob) { 
    49  
    5049        if (!(ob instanceof Serializable)) { 
    5150            return false; 
  • org.nuxeo.common/trunk/src/main/java/org/nuxeo/common/xmap/XValueFactory.java

    r21743 r28516  
    4444 
    4545 
    46     public abstract Object getValue(Context ctx, String value); 
     46    public abstract Object getValue(Context context, String value); 
    4747 
    4848 
    49     public final Object getElementValue(Context ctx, Node element, boolean trim) { 
     49    public final Object getElementValue(Context context, Node element, boolean trim) { 
    5050        String text = element.getTextContent(); 
    51         return getValue(ctx, trim ? text.trim() : text); 
     51        return getValue(context, trim ? text.trim() : text); 
    5252    } 
    5353 
    54     public final Object getAttributeValue(Context ctx, Node element, String name) { 
     54    public final Object getAttributeValue(Context context, Node element, String name) { 
    5555        Node at = element.getAttributes().getNamedItem(name); 
    56         return at != null ? getValue(ctx, at.getNodeValue()) : null; 
     56        return at != null ? getValue(context, at.getNodeValue()) : null; 
    5757    } 
    5858 
     
    6666    } 
    6767 
    68     public static Object getValue(Context ctx, Class klass, String value) { 
     68    public static Object getValue(Context context, Class klass, String value) { 
    6969        XValueFactory factory = defaultFactories.get(klass); 
    7070        if (factory == null) { 
    7171            return null; 
    7272        } 
    73         return factory.getValue(ctx, value); 
     73        return factory.getValue(context, value); 
    7474    } 
    7575 
    7676    public static final XValueFactory STRING = new XValueFactory() { 
    7777        @Override 
    78         public Object getValue(Context ctx, String value) { 
     78        public Object getValue(Context context, String value) { 
    7979            return value; 
    8080        } 
     
    8383    public static final XValueFactory INTEGER = new XValueFactory() { 
    8484        @Override 
    85         public Object getValue(Context ctx, String value) { 
     85        public Object getValue(Context context, String value) { 
    8686            return Integer.valueOf(value); 
    8787        } 
     
    9090    public static final XValueFactory LONG = new XValueFactory() { 
    9191        @Override 
    92         public Object getValue(Context ctx, String value) { 
     92        public Object getValue(Context context, String value) { 
    9393            return Long.valueOf(value); 
    9494        } 
     
    9797    public static final XValueFactory DOUBLE = new XValueFactory() { 
    9898        @Override 
    99         public Object getValue(Context ctx, String value) { 
     99        public Object getValue(Context context, String value) { 
    100100            return Double.valueOf(value); 
    101101        } 
     
    104104    public static final XValueFactory FLOAT = new XValueFactory() { 
    105105        @Override 
    106         public Object getValue(Context ctx, String value) { 
     106        public Object getValue(Context context, String value) { 
    107107            return Float.valueOf(value); 
    108108        } 
     
    111111    public static final XValueFactory BOOLEAN = new XValueFactory() { 
    112112        @Override 
    113         public Object getValue(Context ctx, String value) { 
     113        public Object getValue(Context context, String value) { 
    114114            return Boolean.valueOf(value); 
    115115        } 
     
    120120 
    121121        @Override 
    122         public Object getValue(Context ctx, String value) { 
     122        public Object getValue(Context context, String value) { 
    123123            try { 
    124124                return df.parse(value); 
     
    131131    public static final XValueFactory FILE = new XValueFactory() { 
    132132        @Override 
    133         public Object getValue(Context ctx, String value) { 
     133        public Object getValue(Context context, String value) { 
    134134            return new File(value); 
    135135        } 
     
    138138    public static final XValueFactory URL = new XValueFactory() { 
    139139        @Override 
    140         public Object getValue(Context ctx, String value) { 
     140        public Object getValue(Context context, String value) { 
    141141            try { 
    142142                return new URL(value); 
     
    149149    public static final XValueFactory CLASS = new XValueFactory() { 
    150150        @Override 
    151         public Object getValue(Context ctx, String value) { 
     151        public Object getValue(Context context, String value) { 
    152152            try { 
    153                 return ctx.loadClass(value); 
     153                return context.loadClass(value); 
    154154            } catch (Exception e) { 
    155155                e.printStackTrace(); //TODO 
     
    161161    public static final XValueFactory RESOURCE = new XValueFactory() { 
    162162        @Override 
    163         public Object getValue(Context ctx, String value) { 
     163        public Object getValue(Context context, String value) { 
    164164            try { 
    165                 return new Resource(ctx.getResource(value)); 
     165                return new Resource(context.getResource(value)); 
    166166            } catch (Exception e) { 
    167167                e.printStackTrace(); //TODO 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-cache-jboss/src/main/java/org/nuxeo/ecm/platform/cache/CacheRuntimeException.java

    r20672 r28516  
    2525 
    2626    public CacheRuntimeException() { 
    27         super(); 
    28         // TODO Auto-generated constructor stub 
    2927    } 
    3028 
    3129    public CacheRuntimeException(String arg0, Throwable arg1) { 
    3230        super(arg0, arg1); 
    33         // TODO Auto-generated constructor stub 
    3431    } 
    3532 
    3633    public CacheRuntimeException(String arg0) { 
    3734        super(arg0); 
    38         // TODO Auto-generated constructor stub 
    3935    } 
    4036 
    4137    public CacheRuntimeException(Throwable arg0) { 
    4238        super(arg0); 
    43         // TODO Auto-generated constructor stub 
    4439    } 
    4540 
    46  
    4741} 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-dublincore/src/test/java/org/nuxeo/ecm/platform/dublincore/TestDublinCoreStorage.java

    r28511 r28516  
    2020package org.nuxeo.ecm.platform.dublincore; 
    2121 
    22 import java.io.Serializable; 
    23 import java.util.Arrays; 
    24 import java.util.Calendar; 
    25 import java.util.HashMap; 
    26 import java.util.List; 
    27 import java.util.Map; 
    28  
    2922import org.apache.commons.logging.Log; 
    3023import org.apache.commons.logging.LogFactory; 
     
    4336import org.nuxeo.ecm.core.listener.CoreEventListenerService; 
    4437import org.nuxeo.ecm.core.listener.EventListener; 
    45 import org.nuxeo.ecm.core.model.Document; 
    46 import org.nuxeo.ecm.core.model.Session; 
    4738import org.nuxeo.ecm.core.repository.jcr.testing.RepositoryTestCase; 
    4839import org.nuxeo.ecm.platform.dublincore.listener.DublinCoreListener; 
    4940import org.nuxeo.ecm.platform.dublincore.service.DublinCoreStorageService; 
     41 
     42import java.io.Serializable; 
     43import java.util.Arrays; 
     44import java.util.Calendar; 
     45import java.util.HashMap; 
     46import java.util.List; 
     47import java.util.Map; 
    5048 
    5149/** 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forum/src/main/java/org/nuxeo/ecm/platform/forum/workflow/AbstractForumWorkflowDocumentHandler.java

    r19692 r28516  
    4646 
    4747    protected AbstractForumWorkflowDocumentHandler() { 
    48         super(); 
    4948    } 
    5049 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-imaging-transform/src/test/java/org/nuxeo/ecm/platform/imaging/transform/TestImagingTransformPlugin.java

    r28509 r28516  
    1919package org.nuxeo.ecm.platform.imaging.transform; 
    2020 
    21 import java.awt.image.BufferedImage; 
    22 import java.io.File; 
    23 import java.io.FileInputStream; 
    24 import java.io.IOException; 
    25 import java.io.InputStream; 
    26 import java.io.Serializable; 
    27 import java.util.HashMap; 
    28 import java.util.List; 
    29 import java.util.Map; 
    30  
    31 import javax.imageio.ImageIO; 
    32  
    3321import org.nuxeo.common.utils.FileUtils; 
    3422import org.nuxeo.ecm.core.api.impl.blob.FileBlob; 
     
    4230import org.nuxeo.runtime.api.Framework; 
    4331import org.nuxeo.runtime.test.NXRuntimeTestCase; 
     32 
     33import javax.imageio.ImageIO; 
     34import java.awt.image.BufferedImage; 
     35import java.io.File; 
     36import java.io.FileInputStream; 
     37import java.io.InputStream; 
     38import java.io.Serializable; 
     39import java.util.HashMap; 
     40import java.util.List; 
     41import java.util.Map; 
    4442 
    4543/** 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-modifier/src/main/java/org/nuxeo/ecm/platform/modifier/DocModifierException.java

    r28492 r28516  
    2525 
    2626    public DocModifierException() { 
    27         // TODO Auto-generated constructor stub 
    2827    } 
    2928 
    3029    public DocModifierException(String message, Throwable cause) { 
    3130        super(message, cause); 
    32         // TODO Auto-generated constructor stub 
    3331    } 
    3432 
    3533    public DocModifierException(String message) { 
    3634        super(message); 
    37         // TODO Auto-generated constructor stub 
    3835    } 
    3936 
    4037    public DocModifierException(Throwable cause) { 
    4138        super(cause); 
    42         // TODO Auto-generated constructor stub 
    4339    } 
    4440 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/client/indexing/resources/document/impl/DocumentIndexableResourceImpl.java

    r28481 r28516  
    8585 
    8686    public DocumentIndexableResourceImpl() { 
    87         super(); 
    8887    } 
    8988 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/client/indexing/resources/impl/IndexableResourcesImpl.java

    r19063 r28516  
    4141 
    4242    public IndexableResourcesImpl() { 
    43         super(); 
    4443    } 
    4544 
    4645    public IndexableResourcesImpl(String id, 
    4746            List<IndexableResource> indexableResources) { 
    48         super(); 
    4947        this.id = id; 
    5048        this.indexableResources = indexableResources; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/client/query/impl/ComposedNXQueryImpl.java

    r21705 r28516  
    4040 
    4141    public ComposedNXQueryImpl() { 
    42         super(); 
    4342    } 
    4443 
     
    4847 
    4948    public ComposedNXQueryImpl(SQLQuery query) { 
    50         super(); 
    5149        this.query = query; 
    5250    } 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/client/query/impl/NativeQueryImpl.java

    r19063 r28516  
    3838 
    3939    public NativeQueryImpl() { 
    40         super(); 
    4140    } 
    4241 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/client/query/impl/SearchPrincipalImpl.java

    r28475 r28516  
    4848 
    4949    public SearchPrincipalImpl() { 
    50         super(); 
    5150    } 
    5251 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/events/IndexingEventDescriptor.java

    r28475 r28516  
    3939    protected String action; 
    4040 
    41     @XNodeList(value = "resource", type = HashSet.class, 
    42             componentType = String.class) 
    43     protected Set<String> resources = null; 
     41    @XNodeList(value = "resource", type = HashSet.class, componentType = String.class) 
     42    protected Set<String> resources; 
    4443 
    4544    @XNode("@recursive") 
     
    5453 
    5554    public IndexingEventDescriptor() { 
    56         super(); 
    5755    } 
    5856 
    5957    public IndexingEventDescriptor(String action, Set<String> resources, 
    6058            boolean recursive, String name) { 
    61         super(); 
    6259        this.action = action; 
    6360        this.resources = resources; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/indexing/resources/configuration/IndexableResourceDescriptor.java

    r24803 r28516  
    6363 
    6464    public IndexableResourceDescriptor() { 
    65         super(); 
    6665    } 
    6766 
     
    9493 
    9594    public String getPrefix() { 
    96         return (prefix != null) && (!prefix.equals("")) ? prefix : name; 
     95        return (prefix != null && !prefix.equals("")) ? prefix : name; 
    9796    } 
    9897 
    9998    public void setPrefix(String schemaPrefix) { 
    100         this.prefix = schemaPrefix; 
     99        prefix = schemaPrefix; 
    101100    } 
    102101 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-facade/src/test/java/org/nuxeo/ecm/core/search/ejb/TestSearchService.java

    r28513 r28516  
    2222import org.nuxeo.ecm.core.search.NXSearch; 
    2323import org.nuxeo.ecm.core.search.api.client.SearchService; 
    24 import org.nuxeo.runtime.RuntimeService; 
    25 import org.nuxeo.runtime.api.Framework; 
    2624import org.nuxeo.runtime.test.NXRuntimeTestCase; 
    2725 
     
    4644 
    4745    public void testPlatformServiceRegistration() { 
    48         //RuntimeService runtime = Framework.getRuntime(); 
    4946        SearchService service = runtime.getService(SearchService.class); 
    5047        assertNotNull(service); 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-test/src/main/java/org/nuxeo/ecm/core/search/backend/testing/FakeIndexableDocResourceConf.java

    r21619 r28516  
    4848 
    4949    public FakeIndexableDocResourceConf(String name, String prefix) { 
    50         super(); 
    5150        this.name = name; 
    5251        this.prefix = prefix; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/api/ResultsProviderFarm.java

    r25547 r28516  
    2828 * A Results Provider Farm registers methods to create named 
    2929 * {@link PagedDocumentsProvider}. 
    30  * 
    31  * <p>Typically, results provider implementations can vary a lot: we'll have 
     30 * <p> 
     31 * Typically, results provider implementations can vary a lot: we'll have 
    3232 * the search service, the document repository. This interface allows to 
    3333 * register and call factories for them. 
    34  * </p> 
    3534 * 
    3635 * @author <a href="mailto:gracinet@nuxeo.com">Georges Racinet</a> 
    37  * 
    3836 */ 
    3937public interface ResultsProviderFarm { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-versioning-api/src/main/java/org/nuxeo/ecm/platform/versioning/api/VersioningException.java

    r21343 r28516  
    2828public class VersioningException extends Exception { 
    2929 
    30     /** 
    31      * 
    32      */ 
    3330    private static final long serialVersionUID = 5390675925763793228L; 
    3431 
    3532    public VersioningException() { 
    36         super(); 
    37         // TODO Auto-generated constructor stub 
    3833    } 
    3934 
    4035    public VersioningException(String message, Throwable cause) { 
    4136        super(message, cause); 
    42         // TODO Auto-generated constructor stub 
    4337    } 
    4438 
    4539    public VersioningException(String message) { 
    4640        super(message); 
    47         // TODO Auto-generated constructor stub 
    4841    } 
    4942 
    5043    public VersioningException(Throwable cause) { 
    5144        super(cause); 
    52         // TODO Auto-generated constructor stub 
    5345    } 
    5446 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/contentbrowser/WorkspaceActionsBean.java

    r22137 r28516  
    257257        String navResult = null; 
    258258 
    259         if ((useTemplateFlag == null) || (!useTemplateFlag) 
    260                 || (selectedTemplateId == null) 
    261                 || (selectedTemplateId.equals("none"))) { 
     259        if (useTemplateFlag == null || !useTemplateFlag 
     260                || selectedTemplateId == null || selectedTemplateId.equals("none")) { 
    262261            // create the new Workspace without Template 
    263262            // and navigate to it 
     
    305304        String navResult = null; 
    306305 
    307         if ((!useTemplateFlag) || (selectedTemplateId.equals("none"))) { 
     306        if (!useTemplateFlag || selectedTemplateId.equals("none")) { 
    308307            // create the new Workspace without Template 
    309308            // and navigate to it 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/context/NavigationContextBean.java

    r27602 r28516  
    10691069        // if we switched branch then realign currentDocument 
    10701070        if (currentDocumentParents != null 
    1071                 && (!DocumentsListsUtils.isDocumentInList(crDocumentModel, 
    1072                         currentDocumentParents))) { 
     1071                && !DocumentsListsUtils.isDocumentInList( 
     1072                        crDocumentModel, currentDocumentParents)) { 
    10731073            try { 
    10741074                setCurrentDocument(crDocumentModel); 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/fragment/ActionFragment.java

    r21449 r28516  
    4545 
    4646    public ActionFragment() { 
    47         super(); 
    4847    } 
    4948 
    5049    public ActionFragment(String category) { 
    51         super(); 
    5250        this.category = category; 
    5351    } 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/theme/negotiation/LocalThemeConfig.java

    r21341 r28516  
    5151    private String docId; 
    5252 
     53 
    5354    public LocalThemeConfig() { 
    5455        this(null, null, null, null, null, null); 
     
    5758    public LocalThemeConfig(String theme, String page, String perspective, 
    5859            String engine, String mode, String docId) { 
    59         super(); 
    6060        this.theme = theme; 
    6161        this.page = page; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-jbpm-document-handlers/src/main/java/org/nuxeo/ecm/platform/workflow/jbpm/handlers/api/client/AbstractWorkflowDocumentActionHandler.java

    r19070 r28516  
    3737 
    3838    protected AbstractWorkflowDocumentActionHandler() { 
    39         super(); 
    4039    } 
    4140 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-jbpm-document-handlers/src/main/java/org/nuxeo/ecm/platform/workflow/jbpm/handlers/api/client/AbstractWorkflowDocumentAssignmentHandler.java

    r20218 r28516  
    3737 
    3838    protected AbstractWorkflowDocumentAssignmentHandler() { 
    39         super(); 
    4039    } 
    4140 
  • org.nuxeo.runtime/trunk/nuxeo-runtime/src/main/java/org/nuxeo/runtime/api/ServiceGroup.java

    r28345 r28516  
    4848 
    4949    /** 
    50      * @return Returns the name. 
     50     * @return the name. 
    5151     */ 
    5252    public String getName() { 
  • org.nuxeo.theme/trunk/nuxeo-theme-core/src/main/java/org/nuxeo/theme/formats/FormatFilter.java

    r28490 r28516  
    4040 
    4141    private final TypeRegistry typeRegistry; 
     42 
    4243 
    4344    public FormatFilter() { 
  • org.nuxeo.theme/trunk/nuxeo-theme-jsf/src/main/java/org/nuxeo/theme/jsf/facelets/vendor/DefaultFaceletContext.java

    r28485 r28516  
    243243        TemplateClient client; 
    244244 
    245         for (int i = 0; i < this.clients.size() && found == false; i++) { 
     245        for (int i = 0; i < this.clients.size() && !found; i++) { 
    246246            client = ((TemplateClient) this.clients.get(i)); 
    247247            if (client.equals(this.facelet)) { 
     
    255255 
    256256    private final static class TemplateManager implements TemplateClient { 
     257 
    257258        private final DefaultFacelet owner; 
    258259