Changeset 34691

Show
Ignore:
Timestamp:
03/23/06 17:10:44 (4 years ago)
Author:
eionica
Message:

added CNCC comments support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/ResourceFactory.java

    r29811 r34691  
    2626import com.nuxeo.sdr.core.util.Assert; 
    2727import com.nuxeo.sdr.core.vocabulary.CPS; 
     28import com.nuxeo.sdr.core.vocabulary.CPSM; 
    2829import com.nuxeo.sdr.core.vocabulary.SDR; 
    2930 
     
    7576     
    7677     
    77      
     78    public final static ResourceDescriptor  COMMENT 
     79    = new ResourceDescriptor(CPSM.COMMENT, Comment.class,  
     80        "documents", null, null); 
    7881 
    7982    public final static ResourceDescriptor ATTACHMENT  
  • com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/ResourceManager.java

    r32700 r34691  
    7777        return new IResource[] {};               
    7878    } 
    79      
    80      
     79 
     80     
     81    public static IResource[] getComments(IResource resource) { 
     82        IResourceStore store = RepositoryCore.getDefaultRepository().getDocumentStore(); 
     83        Queries.GET_COMMENTS.setUri(resource.getUri()); 
     84        try { 
     85            return (IResource[])Queries.GET_COMMENTS.run(store); 
     86        } catch (QueryException e) { 
     87            e.printStackTrace(); 
     88        } 
     89        return new IResource[] {};       
     90    } 
     91 
    8192     
    8293    /** 
  • com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/query/Queries.java

    r32700 r34691  
    4242    public final static GetRevisionsQuery GET_REVISIONS = new GetRevisionsQuery(); 
    4343    public final static GetSelectedResourcesQuery GET_SELECTED_RESOURCES= new GetSelectedResourcesQuery(); 
     44     
     45    public final static GetCommentsQuery GET_COMMENTS= new GetCommentsQuery(); 
    4446} 
    4547 
  • com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/vocabulary/CPS.java

    r32700 r34691  
    7373    public static final String PN_LEGIFRANCE_ARTICLE_RANGE  = PREFIX + ":" + SN_LEGIFRANCE_ARTICLE_RANGE; 
    7474     
    75      
    76  
    7775    public static final String OUVRAGE                      = NAMESPACE + SN_OUVRAGE; 
    7876    public static final String SECTIONOUVRAGE               = NAMESPACE + SN_SECTIONOUVRAGE; 
     
    9189    public static final String LEGIFRANCE_ARTICLE_RANGE     = NAMESPACE + SN_LEGIFRANCE_ARTICLE_RANGE; 
    9290     
     91    public final static String SN_HASCOMMENT = "hasComment"; 
     92    public final static String PN_HASCOMMENT = PREFIX + ":" + SN_HASCOMMENT; 
     93    public final static String HASCOMMENT   = NAMESPACE+ SN_HASCOMMENT; 
    9394     
    9495} 
  • com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/vocabulary/CPSM.java

    r31681 r34691  
    2222    public final static String PN_DOCUMENTTYPE  = PREFIX + ":" + SN_DOCUMENTTYPE; 
    2323    public final static String DOCUMENTTYPE     = NAMESPACE+ SN_DOCUMENTTYPE; 
     24     
     25    public final static String SN_AUTHOR    = "author"; 
     26    public final static String PN_AUTHOR = PREFIX + ":" + SN_AUTHOR; 
     27    public final static String AUTHOR   = NAMESPACE+ SN_AUTHOR; 
     28     
     29    public final static String SN_CREATOR   = "Creator"; 
     30    public final static String PN_CREATOR = PREFIX + ":" + SN_CREATOR; 
     31    public final static String CREATOR  = NAMESPACE+ SN_CREATOR; 
    2432 
     33    public final static String SN_MODIFICATIONDATE  = "ModificationDate"; 
     34    public final static String PN_MODIFICATIONDATE  = PREFIX + ":" + SN_MODIFICATIONDATE; 
     35    public final static String MODIFICATIONDATE     = NAMESPACE+ SN_MODIFICATIONDATE; 
     36     
     37    public final static String SN_COMMENT = "comment"; 
     38    public final static String PN_COMMENT = PREFIX + ":" + SN_COMMENT; 
     39    public final static String COMMENT = NAMESPACE+ SN_COMMENT; 
    2540} 
  • com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/ui/views/NotesView.java

    r28128 r34691  
    11/* 
    2 * (C) Copyright 2002 - 2005 Nuxeo SARL <http://nuxeo.com> 
    3 
    4 * This program is free software; you can redistribute it and/or modify 
    5 * it under the terms of the GNU General Public License version 2 as published 
    6 * by the Free Software Foundation. 
    7 
    8 * This program is distributed in the hope that it will be useful, 
    9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    11 * GNU General Public License for more details. 
    12 
    13 * You should have received a copy of the GNU General Public License 
    14 * along with this program; if not, write to the Free Software 
    15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 
    16 * 02111-1307, USA. 
    17 
    18 
    19 * $Id$ 
    20 */ 
     2 * (C) Copyright 2002 - 2005 Nuxeo SARL <http://nuxeo.com> 
     3
     4 * This program is free software; you can redistribute it and/or modify 
     5 * it under the terms of the GNU General Public License version 2 as published 
     6 * by the Free Software Foundation. 
     7
     8 * This program is distributed in the hope that it will be useful, 
     9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     11 * GNU General Public License for more details. 
     12
     13 * You should have received a copy of the GNU General Public License 
     14 * along with this program; if not, write to the Free Software 
     15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 
     16 * 02111-1307, USA. 
     17
     18
     19 * $Id$ 
     20 */ 
    2121 
    2222package com.nuxeo.sdr.ui.views; 
    2323 
     24import org.eclipse.jface.viewers.TableViewer; 
     25import org.eclipse.swt.SWT; 
     26import org.eclipse.swt.widgets.Composite; 
     27import org.eclipse.swt.widgets.Table; 
     28import org.eclipse.swt.widgets.TableColumn; 
     29import org.eclipse.ui.IEditorPart; 
     30import org.nuxeo.eclipse.ui.UI; 
     31 
     32import com.nuxeo.sdr.core.resources.Document; 
     33import com.nuxeo.sdr.core.resources.IResource; 
    2434import com.nuxeo.sdr.core.util.IResourceActionListener; 
     35import com.nuxeo.sdr.ui.browser.BrowserEditor; 
    2536 
    26 public class NotesView extends EditorInfoView implements IResourceActionListener{ 
     37public class NotesView extends EditorInfoView implements 
     38        IResourceActionListener { 
    2739 
    28     public void actionPerformed(Object target, int actionID) { 
     40    protected TableViewer mTable; 
     41 
     42    protected NotesProvider mProvider; 
     43 
     44    public void createPartControl(Composite parent) { 
     45        mProvider = new NotesProvider(); 
     46        mTable = new TableViewer(parent); 
     47        Table table = mTable.getTable(); 
     48        table.setLinesVisible(true); 
     49        table.setHeaderVisible(true); 
     50         
     51        TableColumn col = null; 
     52         
     53        col = new TableColumn(table, SWT.LEFT); 
     54        col.setText("Title");  
     55        col.setResizable(true); 
     56        col.setWidth(150); 
     57         
     58        col = new TableColumn(table, SWT.LEFT); 
     59        col.setText("Author");  
     60        col.setResizable(true); 
     61        col.setWidth(100); 
     62         
     63        col = new TableColumn(table, SWT.LEFT); 
     64        col.setText("Comment");  
     65        col.setResizable(true); 
     66        col.setWidth(200); 
     67         
     68        col = new TableColumn(table, SWT.LEFT); 
     69        col.setText("Modification Date");  
     70        col.setResizable(true); 
     71        col.setWidth(75); 
    2972         
    3073         
     74        mTable.setContentProvider(mProvider); 
     75        mTable.setLabelProvider(mProvider); 
     76        editorChanged(getActiveEditor()); 
     77    } 
     78 
     79    public void editorChanged(IEditorPart editor) { 
     80        if (editor instanceof BrowserEditor) { 
     81            IResource resource = (IResource)editor.getEditorInput().getAdapter(IResource.class); 
     82            if(resource instanceof Document) { 
     83            mTable.setInput(resource);   
     84            }                    
     85        } else { 
     86            mTable.setInput(null); 
     87        } 
     88    } 
     89     
     90     
     91    public void actionPerformed(Object target, int actionID) { 
     92 
    3193    } 
    3294 
  • com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/ui/views/SearchView.java

    r34615 r34691  
    105105        mViewer = new TableViewer( parent, SWT.H_SCROLL | SWT.V_SCROLL ); 
    106106        updateProvider();    
    107          
    108          
    109  
    110 //      Tree tree  = mViewer.getTree(); 
     107 
    111108        Table table = mViewer.getTable(); 
    112109        table.setLinesVisible(true); 
     
    114111         
    115112         
    116 //      Listener keyListener = new Listener() { 
    117 //          public void handleEvent(Event event) { 
    118 //              if ( event.type == SWT.KeyUp && event.keyCode == SWT.CONTROL ){ 
    119 //                  mIsCtrlPressed = false; 
    120 //              } 
    121 //              if ( event.type == SWT.KeyDown   && event.keyCode == SWT.CONTROL ){ 
    122 //                  mIsCtrlPressed = true; 
    123 //              } 
    124 //          } 
    125 //      }; 
    126 //      mViewer.getTable().addListener(SWT.KeyDown, keyListener); 
    127 //      mViewer.getTable().addListener(SWT.KeyUp, keyListener); 
    128          
    129113        mViewer.getTable().addMouseListener(new MouseListener(){ 
    130114            public void mouseDoubleClick(MouseEvent mouseEvent) {} 
     
    136120        }); 
    137121 
    138          
    139          
    140          
    141122         
    142123