Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 17A5017ABF for ; Mon, 6 Apr 2015 17:20:40 +0000 (UTC) Received: (qmail 86018 invoked by uid 500); 6 Apr 2015 17:20:40 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 85907 invoked by uid 500); 6 Apr 2015 17:20:40 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 85149 invoked by uid 99); 6 Apr 2015 17:20:39 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Apr 2015 17:20:39 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 4BF4BAC0E1C for ; Mon, 6 Apr 2015 17:20:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r946543 [12/31] - in /websites/staging/chemistry/trunk/content: ./ java/0.13.0/maven/chemistry-opencmis-workbench/ java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/ java/0.13.0/maven/chemistry-opencmis-workbench/c... Date: Mon, 06 Apr 2015 17:20:37 -0000 To: commits@chemistry.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150406172039.4BF4BAC0E1C@hades.apache.org> Added: websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/CreateRelationshipDialog.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/CreateRelationshipDialog.html (added) +++ websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/CreateRelationshipDialog.html Mon Apr 6 17:20:35 2015 @@ -0,0 +1,142 @@ + + + + +CreateRelationshipDialog xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.workbench;
+20  
+21  import java.awt.Cursor;
+22  import java.awt.Frame;
+23  import java.awt.event.ActionEvent;
+24  import java.awt.event.ActionListener;
+25  import java.awt.event.ItemEvent;
+26  import java.awt.event.ItemListener;
+27  
+28  import javax.swing.JButton;
+29  import javax.swing.JComboBox;
+30  import javax.swing.JOptionPane;
+31  import javax.swing.JTextField;
+32  
+33  import org.apache.chemistry.opencmis.client.api.ObjectId;
+34  import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+35  import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+36  import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+37  import org.apache.chemistry.opencmis.workbench.swing.CreateDialog;
+38  
+39  public class CreateRelationshipDialog extends CreateDialog {
+40  
+41      private static final long serialVersionUID = 1L;
+42  
+43      private JTextField nameField;
+44      private JComboBox typeBox;
+45      private JTextField sourceIdField;
+46      private JTextField targetIdField;
+47  
+48      public CreateRelationshipDialog(Frame owner, ClientModel model) {
+49          super(owner, "Create Relationship", model);
+50          createGUI();
+51      }
+52  
+53      private void createGUI() {
+54          final CreateRelationshipDialog thisDialog = this;
+55  
+56          nameField = new JTextField(60);
+57          createRow("Name:", nameField, 0);
+58  
+59          Object[] types = getTypes(BaseTypeId.CMIS_RELATIONSHIP.value());
+60          if (types.length == 0) {
+61              JOptionPane.showMessageDialog(this, "No creatable type!", "Creatable Types", JOptionPane.ERROR_MESSAGE);
+62              thisDialog.dispose();
+63              return;
+64          }
+65  
+66          typeBox = new JComboBox(types);
+67          typeBox.setSelectedIndex(0);
+68          typeBox.addItemListener(new ItemListener() {
+69              public void itemStateChanged(ItemEvent e) {
+70                  TypeDefinition type = ((ObjectTypeItem) typeBox.getSelectedItem()).getObjectType();
+71                  updateMandatoryFields(type);
+72              }
+73          });
+74  
+75          ObjectTypeItem type = (ObjectTypeItem) typeBox.getSelectedItem();
+76          updateMandatoryFields(type.getObjectType());
+77  
+78          createRow("Type:", typeBox, 1);
+79  
+80          sourceIdField = new JTextField(60);
+81          if (getClientModel().getCurrentObject() != null) {
+82              sourceIdField.setText(getClientModel().getCurrentObject().getId());
+83          }
+84          createRow("Source Id:", sourceIdField, 2);
+85  
+86          targetIdField = new JTextField(60);
+87          createRow("Target Id:", targetIdField, 3);
+88  
+89          JButton createButton = new JButton("Create Relationship", ClientHelper.getIcon("newrelationship.png"));
+90          createButton.addActionListener(new ActionListener() {
+91              public void actionPerformed(ActionEvent event) {
+92                  String name = nameField.getText();
+93                  String type = ((ObjectTypeItem) typeBox.getSelectedItem()).getObjectType().getId();
+94                  String sourceId = sourceIdField.getText();
+95                  String targetId = targetIdField.getText();
+96  
+97                  try {
+98                      setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+99  
+100                     ObjectId objectId = getClientModel().createRelationship(name, type, sourceId, targetId,
+101                             getMandatoryPropertyValues());
+102 
+103                     if (objectId != null) {
+104                         getClientModel().loadObject(objectId.getId());
+105                     }
+106 
+107                     thisDialog.setVisible(false);
+108                     thisDialog.dispose();
+109                 } catch (Exception e) {
+110                     ClientHelper.showError(null, e);
+111                 } finally {
+112                     setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+113 
+114                     try {
+115                         getClientModel().reloadFolder();
+116                     } catch (Exception e) {
+117                         ClientHelper.showError(null, e);
+118                     }
+119                 }
+120             }
+121         });
+122         createActionRow("", createButton, 4);
+123 
+124         getRootPane().setDefaultButton(createButton);
+125 
+126         showDialog();
+127     }
+128 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/ExpertLoginTab.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/ExpertLoginTab.html (added) +++ websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/ExpertLoginTab.html Mon Apr 6 17:20:35 2015 @@ -0,0 +1,146 @@ + + + + +ExpertLoginTab xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.workbench;
+20  
+21  import java.awt.BorderLayout;
+22  import java.awt.Font;
+23  import java.awt.event.ItemEvent;
+24  import java.awt.event.ItemListener;
+25  import java.io.File;
+26  import java.net.URI;
+27  import java.util.List;
+28  import java.util.Map;
+29  
+30  import javax.swing.BorderFactory;
+31  import javax.swing.JComboBox;
+32  import javax.swing.JScrollPane;
+33  import javax.swing.JTextArea;
+34  
+35  import org.apache.chemistry.opencmis.client.SessionParameterMap;
+36  import org.apache.chemistry.opencmis.workbench.ClientHelper.FileEntry;
+37  import org.apache.chemistry.opencmis.workbench.model.ClientSession;
+38  
+39  public class ExpertLoginTab extends AbstractLoginTab {
+40  
+41      private static final long serialVersionUID = 1L;
+42  
+43      public static final String SYSPROP_CONFIGS = ClientSession.WORKBENCH_PREFIX + "configs";
+44  
+45      private static final String CONFIGS_FOLDER = "/configs/";
+46      private static final String CONFIGS_LIBRARY = "config-library.properties";
+47  
+48      private JComboBox configs;
+49      private JTextArea sessionParameterTextArea;
+50      private List<FileEntry> sessionConfigurations;
+51  
+52      public ExpertLoginTab() {
+53          super();
+54          createGUI();
+55      }
+56  
+57      private void createGUI() {
+58          setLayout(new BorderLayout());
+59          setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
+60  
+61          URI propFile = null;
+62  
+63          String externalConfigs = System.getProperty(SYSPROP_CONFIGS);
+64          if (externalConfigs == null) {
+65              propFile = ClientHelper.getClasspathURI(CONFIGS_FOLDER + CONFIGS_LIBRARY);
+66          } else {
+67              propFile = (new File(externalConfigs)).toURI();
+68          }
+69  
+70          sessionConfigurations = ClientHelper.readFileProperties(propFile);
+71  
+72          configs = new JComboBox();
+73          configs.setMaximumRowCount(20);
+74  
+75          configs.addItem(new FileEntry("", null));
+76          if (sessionConfigurations != null) {
+77              for (FileEntry fe : sessionConfigurations) {
+78                  configs.addItem(fe);
+79              }
+80          }
+81  
+82          configs.addItemListener(new ItemListener() {
+83              public void itemStateChanged(ItemEvent e) {
+84                  if (e.getStateChange() == ItemEvent.SELECTED) {
+85                      FileEntry fe = (FileEntry) e.getItem();
+86  
+87                      sessionParameterTextArea.setText(ClientHelper.readFileAndRemoveHeader(fe.getFile()));
+88                      sessionParameterTextArea.setCaretPosition(0);
+89                  }
+90              }
+91          });
+92  
+93          add(configs, BorderLayout.PAGE_START);
+94  
+95          sessionParameterTextArea = new JTextArea();
+96          sessionParameterTextArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
+97          add(new JScrollPane(sessionParameterTextArea), BorderLayout.CENTER);
+98      }
+99  
+100     public void setSessionParameters(Map<String, String> parameters) {
+101         configs.setSelectedIndex(0);
+102 
+103         StringBuilder sb = new StringBuilder();
+104         for (Map.Entry<String, String> parameter : parameters.entrySet()) {
+105             sb.append(parameter.getKey());
+106             sb.append('=');
+107             sb.append(parameter.getValue());
+108             sb.append('\n');
+109         }
+110 
+111         sessionParameterTextArea.setText(sb.toString());
+112         sessionParameterTextArea.setCaretPosition(0);
+113     }
+114 
+115     @Override
+116     public String getTabTitle() {
+117         return "Expert";
+118     }
+119 
+120     @Override
+121     public Map<String, String> getSessionParameters() {
+122         SessionParameterMap result = new SessionParameterMap();
+123         result.parse(sessionParameterTextArea.getText());
+124 
+125         return result;
+126     }
+127 
+128     @Override
+129     public boolean transferSessionParametersToExpertTab() {
+130         return false;
+131     }
+132 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/FolderPanel.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/FolderPanel.html (added) +++ websites/staging/chemistry/trunk/content/java/0.13.0/maven/chemistry-opencmis-workbench/chemistry-opencmis-workbench/xref/org/apache/chemistry/opencmis/workbench/FolderPanel.html Mon Apr 6 17:20:35 2015 @@ -0,0 +1,200 @@ + + + + +FolderPanel xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.workbench;
+20  
+21  import java.awt.BorderLayout;
+22  import java.awt.Cursor;
+23  import java.awt.event.ActionEvent;
+24  import java.awt.event.ActionListener;
+25  import java.awt.event.KeyEvent;
+26  import java.awt.event.KeyListener;
+27  
+28  import javax.swing.BorderFactory;
+29  import javax.swing.BoxLayout;
+30  import javax.swing.JButton;
+31  import javax.swing.JPanel;
+32  import javax.swing.JScrollPane;
+33  import javax.swing.JTextField;
+34  import javax.swing.SwingUtilities;
+35  
+36  import org.apache.chemistry.opencmis.client.api.Folder;
+37  import org.apache.chemistry.opencmis.client.api.ObjectId;
+38  import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+39  import org.apache.chemistry.opencmis.workbench.model.ClientModelEvent;
+40  import org.apache.chemistry.opencmis.workbench.model.FolderListener;
+41  import org.apache.chemistry.opencmis.workbench.model.ObjectListener;
+42  
+43  public class FolderPanel extends JPanel implements FolderListener, ObjectListener {
+44  
+45      private static final long serialVersionUID = 1L;
+46  
+47      private final ClientModel model;
+48  
+49      private String parentId;
+50  
+51      private JButton upButton;
+52      private JTextField pathField;
+53      private JButton goButton;
+54      private FolderTable folderTable;
+55  
+56      public FolderPanel(ClientModel model) {
+57          super();
+58  
+59          this.model = model;
+60          model.addFolderListener(this);
+61          model.addObjectListener(this);
+62          createGUI();
+63      }
+64  
+65      public void folderLoaded(final ClientModelEvent event) {
+66          SwingUtilities.invokeLater(new Runnable() {
+67              public void run() {
+68                  Folder currentFolder = event.getClientModel().getCurrentFolder();
+69  
+70                  if (currentFolder != null) {
+71                      String path = currentFolder.getPath();
+72                      pathField.setText(path);
+73  
+74                      Folder parent = currentFolder.getFolderParent();
+75                      if (parent == null) {
+76                          parentId = null;
+77                          upButton.setEnabled(false);
+78                      } else {
+79                          parentId = parent.getId();
+80                          upButton.setEnabled(true);
+81                      }
+82                  } else {
+83                      pathField.setText("???");
+84                      parentId = null;
+85                      upButton.setEnabled(false);
+86                  }
+87              }
+88          });
+89      }
+90  
+91      public void objectLoaded(ClientModelEvent event) {
+92          int selectedRow = folderTable.getSelectedRow();
+93          if (selectedRow > -1 && event.getClientModel().getCurrentObject() != null) {
+94              if (selectedRow < folderTable.getRowCount()) {
+95  
+96                  String selId = folderTable.getValueAt(folderTable.getSelectedRow(), FolderTable.ID_COLUMN).toString();
+97                  String curId = event.getClientModel().getCurrentObject().getId();
+98  
+99                  if (!curId.equals(selId)) {
+100                     folderTable.clearSelection();
+101                 }
+102             } else {
+103                 folderTable.clearSelection();
+104             }
+105         }
+106     }
+107 
+108     private void createGUI() {
+109         setLayout(new BorderLayout());
+110 
+111         JPanel panel = new JPanel();
+112         panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
+113         panel.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0));
+114 
+115         upButton = new JButton("up");
+116         upButton.setEnabled(false);
+117         upButton.addActionListener(new ActionListener() {
+118             public void actionPerformed(ActionEvent e) {
+119                 try {
+120                     setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+121                     ObjectId objectId = model.loadFolder(parentId, false);
+122                     model.loadObject(objectId.getId());
+123                 } catch (Exception ex) {
+124                     ClientHelper.showError(null, ex);
+125                     return;
+126                 } finally {
+127                     setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+128                 }
+129             }
+130         });
+131         panel.add(upButton);
+132 
+133         pathField = new JTextField("");
+134         pathField.addKeyListener(new KeyListener() {
+135             public void keyTyped(KeyEvent e) {
+136             }
+137 
+138             public void keyReleased(KeyEvent e) {
+139                 if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+140                     loadFolder();
+141                 }
+142             }
+143 
+144             public void keyPressed(KeyEvent e) {
+145             }
+146         });
+147         panel.add(pathField);
+148 
+149         goButton = new JButton("go");
+150         goButton.addActionListener(new ActionListener() {
+151             public void actionPerformed(ActionEvent e) {
+152                 loadFolder();
+153             }
+154         });
+155         panel.add(goButton);
+156 
+157         add(panel, BorderLayout.PAGE_START);
+158 
+159         folderTable = new FolderTable(model);
+160         folderTable.setFillsViewportHeight(true);
+161         model.addFolderListener(folderTable);
+162 
+163         add(new JScrollPane(folderTable), BorderLayout.CENTER);
+164     }
+165 
+166     private void loadFolder() {
+167         SwingUtilities.invokeLater(new Runnable() {
+168             public void run() {
+169                 try {
+170                     setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+171                     String id = pathField.getText().trim();
+172                     if (id.length() == 0) {
+173                         id = "/";
+174                     }
+175                     ObjectId objectId = model.loadFolder(id, id.charAt(0) == '/');
+176                     model.loadObject(objectId.getId());
+177                 } catch (Exception ex) {
+178                     ClientHelper.showError(null, ex);
+179                     return;
+180                 } finally {
+181                     setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+182                 }
+183             }
+184         });
+185     }
+186 }
+
+
+ +