rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
final DocumentModel documentModel = DocumentModel.getModel(); final DocumentContent content = documentModel.getContent(document); xmppHelper.send(users, XMPPDocument.create(document, content));
final DocumentModel documentModel = getDocumentModel(); documentModel.createVersion( document, DocumentAction.SEND, createSendDocumentActionData()); xmppHelper.send( users, XMPPDocument.create( document, documentModel.getContent(document)));
void send(final Collection<User> users, final Document document) throws ParityException { synchronized(xmppHelperLock) { assertIsLoggedIn("send(Collection<User>,Document)", xmppHelper); try { final DocumentModel documentModel = DocumentModel.getModel(); final DocumentContent content = documentModel.getContent(document); xmppHelper.send(users, XMPPDocument.create(document, content)); } catch(SmackException sx) { logger.error("send(Collection<User>,Document)", sx); throw ParityErrorTranslator.translate(sx); } catch(RuntimeException rx) { logger.error("send(Collection<User>,Document)", rx); throw ParityErrorTranslator.translate(rx); } } }
private Boolean isBrowserWindowMaximized() {
public Boolean isBrowserWindowMaximized() {
private Boolean isBrowserWindowMaximized() { return JFrame.MAXIMIZED_BOTH == mainWindow.getExtendedState(); }
if (isBrowserWindowMaximized()) { mainWindow.setExtendedState(JFrame.NORMAL); mainWindow.maximizeMainWindow(Boolean.FALSE); } else { mainWindow.setExtendedState(mainWindow.getExtendedState() | JFrame.MAXIMIZED_BOTH); GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); Rectangle bounds = env.getMaximumWindowBounds(); mainWindow.setLocation(0,0); mainWindow.setSize(bounds.getSize()); mainWindow.maximizeMainWindow(Boolean.TRUE); }
mainWindow.maximizeMainWindow(!isBrowserWindowMaximized());
public void maximize() { if (isBrowserWindowMaximized()) { mainWindow.setExtendedState(JFrame.NORMAL); mainWindow.maximizeMainWindow(Boolean.FALSE); } else { mainWindow.setExtendedState(mainWindow.getExtendedState() | JFrame.MAXIMIZED_BOTH); /* This works... mainWindow.setLocation(0,0); mainWindow.setSize(java.awt.Toolkit.getDefaultToolkit().getScreenSize()); */ GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); Rectangle bounds = env.getMaximumWindowBounds(); mainWindow.setLocation(0,0); mainWindow.setSize(bounds.getSize()); mainWindow.maximizeMainWindow(Boolean.TRUE); } }
"Avatar " + avatar.getId() + " already registerd.",
"Avatar " + avatar.getId() + " already registered.",
private void register(final Avatar avatar) { Assert.assertIsNull( "Avatar " + avatar.getId() + " already registerd.", avatarRegistry.put(avatar.getId(), avatar)); }
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation"));
explanationJLabel.setText(java.util.ResourceBundle.getBundle("localization/JPanel_Messages").getString("NewContainerDialog.Explanation"));
private void initComponents() { explanationJLabel = new javax.swing.JLabel(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); nameJLabel = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); okJButton.setText(bundle.getString("NewContainerDialog.Ok")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); nameJLabel.setText(bundle.getString("NewContainerDialog.Name")); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameJLabel) .add(nameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
okJButton.setText(bundle.getString("NewContainerDialog.Ok"));
okJButton.setText(java.util.ResourceBundle.getBundle("localization/JPanel_Messages").getString("NewContainerDialog.Ok"));
private void initComponents() { explanationJLabel = new javax.swing.JLabel(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); nameJLabel = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); okJButton.setText(bundle.getString("NewContainerDialog.Ok")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); nameJLabel.setText(bundle.getString("NewContainerDialog.Name")); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameJLabel) .add(nameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel"));
cancelJButton.setText(java.util.ResourceBundle.getBundle("localization/JPanel_Messages").getString("NewContainerDialog.Cancel"));
private void initComponents() { explanationJLabel = new javax.swing.JLabel(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); nameJLabel = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); okJButton.setText(bundle.getString("NewContainerDialog.Ok")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); nameJLabel.setText(bundle.getString("NewContainerDialog.Name")); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameJLabel) .add(nameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
nameJLabel.setText(bundle.getString("NewContainerDialog.Name"));
nameJLabel.setText(java.util.ResourceBundle.getBundle("localization/JPanel_Messages").getString("NewContainerDialog.Name"));
private void initComponents() { explanationJLabel = new javax.swing.JLabel(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); nameJLabel = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); okJButton.setText(bundle.getString("NewContainerDialog.Ok")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); nameJLabel.setText(bundle.getString("NewContainerDialog.Name")); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameJLabel) .add(nameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
.add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)))
.add(cancelJButton)))
private void initComponents() { explanationJLabel = new javax.swing.JLabel(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); nameJLabel = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); okJButton.setText(bundle.getString("NewContainerDialog.Ok")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); nameJLabel.setText(bundle.getString("NewContainerDialog.Name")); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameJLabel) .add(nameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
.add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(explanationJLabel)
private void initComponents() { explanationJLabel = new javax.swing.JLabel(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); nameJLabel = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); okJButton.setText(bundle.getString("NewContainerDialog.Ok")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); nameJLabel.setText(bundle.getString("NewContainerDialog.Name")); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameJLabel) .add(nameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
private void initComponents() { explanationJLabel = new javax.swing.JLabel(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); nameJLabel = new javax.swing.JLabel(); nameJTextField = new javax.swing.JTextField(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("NewContainerDialog.Explanation")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); okJButton.setText(bundle.getString("NewContainerDialog.Ok")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("NewContainerDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); nameJLabel.setText(bundle.getString("NewContainerDialog.Name")); // NOI18N nameJTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameJTextFieldActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton)) .add(explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(nameJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 92, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(14, 14, 14) .add(nameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameJLabel) .add(nameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 19, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
public void addListener(final ArtifactListener listener) { xmppArtifact.addListener(listener); }
public <T extends XMPPEvent> void addListener(final Class<T> eventClass, final XMPPEventListener<T> listener) { xmppEventDispatcher.addListener(eventClass, listener); }
public void addListener(final ArtifactListener listener) { xmppArtifact.addListener(listener); }
xmppArchive.clearListeners(); xmppArtifact.clearListeners(); xmppBackup.clearListeners(); xmppContact.clearListeners(); xmppContainer.clearListeners(); xmppProfile.clearListeners(); xmppStream.clearListeners(); xmppSystem.clearListeners(); xmppUser.clearListeners();
xmppEventDispatcher.clearListeners();
public void clearListeners() { logger.logApiId(); synchronized (listeners) { listeners.clear(); } xmppArchive.clearListeners(); xmppArtifact.clearListeners(); xmppBackup.clearListeners(); xmppContact.clearListeners(); xmppContainer.clearListeners(); xmppProfile.clearListeners(); xmppStream.clearListeners(); xmppSystem.clearListeners(); xmppUser.clearListeners(); }
clearEventHandlers();
public void logout() { logger.logApiId(); clearEventHandlers(); clearListeners(); xmppAnonymousConnection.close(); xmppAnonymousConnection = null; xmppConnection.close(); xmppConnection = null; }
public void removeListener(final ArtifactListener listener) { xmppArtifact.removeListener(listener);
public void removeListener(final SessionListener listener) { synchronized (listeners) { if (listeners.contains(listener)) { listeners.remove(listener); } else { return; } }
public void removeListener(final ArtifactListener listener) { xmppArtifact.removeListener(listener); }
this.historyProvider = new HistoryProvider(dModel);
this.historyProvider = new HistoryProvider(loggedInUser, dModel, sModel);
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.artifactModel = modelFactory.getArtifactModel(getClass()); this.dModel = modelFactory.getDocumentModel(getClass()); this.logger = ModelLoggerFactory.getLogger(getClass()); this.loggedInUser = JabberIdBuilder.parseUsername(preferences.getUsername()); this.sModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new HistoryProvider(dModel); this.infoProvider = new InfoProvider(dModel, sModel); this.mainProvider = new MainProvider(artifactModel, dModel, systemMessageModel); this.manageContactsProvider = new ManageContactsProvider(sModel); this.sendArtifactProvider = new SendArtifactProvider(dModel, sModel, loggedInUser); this.sendVersionProvider = new SendVersionProvider(dModel, sModel, loggedInUser); }
final int compareResult = o1.getOrganization().compareTo(o2.getOrganization()); if(0 == compareResult) { return subCompare(o1, o2); } else { return compareResult * resultMultiplier; }
final int compareResult = comparator.compare(o1.getOrganization(), o2.getOrganization()); if (0 == compareResult) { return subCompare(o1, o2); } else { return compareResult; }
public int compare(final User o1, final User o2) { final int compareResult = o1.getOrganization().compareTo(o2.getOrganization()); if(0 == compareResult) { return subCompare(o1, o2); } else { return compareResult * resultMultiplier; } }
EarthViewWrapper evw = new EarthViewWrapper("Applet", "localhost",
evw = new EarthViewWrapper("Applet", "luijten.local",
public Applet() { EarthViewWrapper evw = new EarthViewWrapper("Applet", "localhost", 10000); Container mainpane = this.getContentPane(); mainpane.setBackground(Color.black); mainpane.add(evw.earthView); this.setVisible(true); evw.start(); }
evw.start();
public Applet() { EarthViewWrapper evw = new EarthViewWrapper("Applet", "localhost", 10000); Container mainpane = this.getContentPane(); mainpane.setBackground(Color.black); mainpane.add(evw.earthView); this.setVisible(true); evw.start(); }
} catch (final SmackException sx) { throw new RuntimeException(sx);
private void processOfflineQueue() { assertIsReachable(environment); XMPPSession session = null; try { session = new XMPPSessionImpl(); session.login(environment, credentials); session.processOfflineQueue(session.readCurrentUser().getId()); } catch (final SmackException sx) { throw new RuntimeException(sx); } finally { Assert.assertNotNull(session, "User {0}'s session is null.", credentials.getUsername()); Assert.assertTrue(session.isLoggedIn(), "User {0} not logged in.", credentials.getUsername()); try { session.logout(); } catch (final SmackException sx) { throw new RuntimeException(sx); } } }
try { session.logout(); } catch (final SmackException sx) { throw new RuntimeException(sx); }
session.logout();
private void processOfflineQueue() { assertIsReachable(environment); XMPPSession session = null; try { session = new XMPPSessionImpl(); session.login(environment, credentials); session.processOfflineQueue(session.readCurrentUser().getId()); } catch (final SmackException sx) { throw new RuntimeException(sx); } finally { Assert.assertNotNull(session, "User {0}'s session is null.", credentials.getUsername()); Assert.assertTrue(session.isLoggedIn(), "User {0} not logged in.", credentials.getUsername()); try { session.logout(); } catch (final SmackException sx) { throw new RuntimeException(sx); } } }
} catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; }
public void changeEncoding(String charset) throws UnsupportedEncodingException { isReader = new InputStreamReader(iStream, charset); }
public void close() throws IOException { isReader.close(); }
public void close() throws IOException { try { if(DEBUG) os.println(PREFIX + "isReader.close()"); isReader.close(); } catch(IOException ioe) { if(DEBUG) ioe.printStackTrace(); throw ioe; } catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; } }
public void close() throws IOException { isReader.close(); }
public void mark(int readAheadLimit) throws IOException { isReader.mark(readAheadLimit); }
public void mark(int readAheadLimit) throws IOException { try { if(DEBUG) os.println(PREFIX + "isReader.mark(" + readAheadLimit + ")"); isReader.mark(readAheadLimit); } catch(IOException ioe) { if(DEBUG) ioe.printStackTrace(); throw ioe; } catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; } }
public void mark(int readAheadLimit) throws IOException { isReader.mark(readAheadLimit); }
public boolean markSupported() { return isReader.markSupported(); }
public boolean markSupported() { try { boolean result = isReader.markSupported(); if(DEBUG) os.println(PREFIX + "isReader.markSupported() == " + result); return result; } catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; } }
public boolean markSupported() { return isReader.markSupported(); }
public int read() throws IOException { return isReader.read(); }
public int read() throws IOException { try { int result = isReader.read(); if(DEBUG) os.println(PREFIX + "isReader.read() == " + result); return result; } catch(IOException ioe) { if(DEBUG) ioe.printStackTrace(); throw ioe; } catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; } }
public int read() throws IOException { return isReader.read(); }
public boolean ready() throws IOException { return isReader.ready(); }
public boolean ready() throws IOException { try { boolean result = isReader.ready(); if(DEBUG) os.println(PREFIX + "isReader.ready() == " + result); return result; } catch(IOException ioe) { if(DEBUG) ioe.printStackTrace(); throw ioe; } catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; } }
public boolean ready() throws IOException { return isReader.ready(); }
public void reset() throws IOException { isReader.reset(); }
public void reset() throws IOException { try { if(DEBUG) os.println(PREFIX + "isReader.reset()"); isReader.reset(); } catch(IOException ioe) { if(DEBUG) ioe.printStackTrace(); throw ioe; } catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; } }
public void reset() throws IOException { isReader.reset(); }
public long skip(long n) throws IOException { return isReader.skip(n); }
public long skip(long n) throws IOException { try { long result = isReader.skip(n); if(DEBUG) os.println(PREFIX + "isReader.skip(" + n + ") == " + result); return result; } catch(IOException ioe) { if(DEBUG) ioe.printStackTrace(); throw ioe; } catch(RuntimeException e) { if(DEBUG) e.printStackTrace(); throw e; } }
public long skip(long n) throws IOException { return isReader.skip(n); }
try { usedReader.changeEncoding(encoding.image); } catch(Exception e) { {if (true) throw new RuntimeException(e);} }
final public String encodingDecl() throws ParseException { Token encoding; jj_consume_token(XMLDECL_S); jj_consume_token(ENCODING); jj_consume_token(XMLDECL_EQ); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XD_SQUOTE_OPEN: jj_consume_token(XD_SQUOTE_OPEN); encoding = jj_consume_token(XD_SQUOTE_STRING); jj_consume_token(XD_SQUOTE_CLOSE); break; case XD_DQUOTE_OPEN: jj_consume_token(XD_DQUOTE_OPEN); encoding = jj_consume_token(XD_DQUOTE_STRING); jj_consume_token(XD_DQUOTE_CLOSE); break; default: jj_la1[5] = jj_gen; jj_consume_token(-1); throw new ParseException(); } try { usedReader.changeEncoding(encoding.image); } catch(Exception e) { {if (true) throw new RuntimeException(e);} } {if (true) return encoding.image;} throw new Error("Missing return statement in function"); }
Ass a = new Ass(usedReader); a.usedReader = usedReader; a.contentHandler = new DebugXMLContentHandler();
Ass a = create(usedReader, new DebugXMLContentHandler());
public static void main(String[] args) throws Exception { MutableInputStreamReader usedReader; if(args.length == 1) usedReader = new MutableInputStreamReader(new FileInputStream(args[0]), "US-ASCII"); else usedReader = new MutableInputStreamReader(System.in, "US-ASCII"); Ass a = new Ass(usedReader); a.usedReader = usedReader; a.contentHandler = new DebugXMLContentHandler(); a.xmlDocument(); }
final public void xmlDecl() throws ParseException {
final public String xmlDecl() throws ParseException {
final public void xmlDecl() throws ParseException { String version, encoding = null; Boolean standalone = null; jj_consume_token(STARTXMLDECL); // Takes us to state WithinXMLDecl version = versionInfo(); if (jj_2_1(2)) { encoding = encodingDecl(); } else { ; } if (jj_2_2(2)) { standalone = sdDecl(); } else { ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XMLDECL_S: jj_consume_token(XMLDECL_S); break; default: jj_la1[3] = jj_gen; ; } jj_consume_token(ENDXMLDECL); contentHandler.xmlDecl(version, encoding, standalone); }
contentHandler.xmlDecl(version, encoding, standalone);
contentHandler.xmlDecl(version, encoding, standalone); {if (true) return encoding;} throw new Error("Missing return statement in function");
final public void xmlDecl() throws ParseException { String version, encoding = null; Boolean standalone = null; jj_consume_token(STARTXMLDECL); // Takes us to state WithinXMLDecl version = versionInfo(); if (jj_2_1(2)) { encoding = encodingDecl(); } else { ; } if (jj_2_2(2)) { standalone = sdDecl(); } else { ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XMLDECL_S: jj_consume_token(XMLDECL_S); break; default: jj_la1[3] = jj_gen; ; } jj_consume_token(ENDXMLDECL); contentHandler.xmlDecl(version, encoding, standalone); }
public File[] listFiles(final String path, final Boolean doRecurse) { final File file = resolve(path); if(null == file) { return null; } else if(file.isFile()) { return null; } else { if(doRecurse) { return listFiles(file).toArray(new File[] {}); } else { return file.listFiles(new FileFilter() { public boolean accept(final File pathname) { return pathname.isFile(); } }); } }
public File[] listFiles(final String path) { return listFiles(path, Boolean.FALSE);
public File[] listFiles(final String path, final Boolean doRecurse) { final File file = resolve(path); if(null == file) { return null; } else if(file.isFile()) { return null; } else { if(doRecurse) { return listFiles(file).toArray(new File[] {}); } else { return file.listFiles(new FileFilter() { public boolean accept(final File pathname) { return pathname.isFile(); } }); } } }
final InternalAuditModel iAModel = InternalAuditModel.getInternalModel(context); return iAModel;
return InternalAuditModel.getInternalModel(context);
protected InternalAuditModel getInternalAuditModel() { final InternalAuditModel iAModel = InternalAuditModel.getInternalModel(context); return iAModel; }
final InternalDocumentModel iDocumentModel = DocumentModel.getInternalModel(getContext()); return iDocumentModel;
return DocumentModel.getInternalModel(context);
protected InternalDocumentModel getInternalDocumentModel() { final InternalDocumentModel iDocumentModel = DocumentModel.getInternalModel(getContext()); return iDocumentModel; }
final InternalSessionModel iSessionModel = SessionModel.getInternalModel(getContext()); return iSessionModel;
return SessionModel.getInternalModel(getContext());
protected InternalSessionModel getInternalSessionModel() { final InternalSessionModel iSessionModel = SessionModel.getInternalModel(getContext()); return iSessionModel; }
assertDraftExists("DRAFT DOES NOT EXIST", containerId); containerIO.createDraftArtifactRel(containerId, documentId, ContainerDraft.ArtifactState.ADDED); getIndexModel().indexDocument(containerId, documentId); final Container postAdditionContainer = read(containerId); final ContainerDraft postAdditionDraft = readDraft(containerId); final Document postAdditionDocument = getInternalDocumentModel().read(documentId); notifyDocumentAdded(postAdditionContainer, postAdditionDraft, postAdditionDocument, localEventGenerator);
try { assertDraftExists("DRAFT DOES NOT EXIST", containerId); containerIO.createDraftArtifactRel(containerId, documentId, ContainerDraft.ArtifactState.ADDED); getIndexModel().indexDocument(containerId, documentId); final Container postAdditionContainer = read(containerId); final ContainerDraft postAdditionDraft = readDraft(containerId); final Document postAdditionDocument = getInternalDocumentModel().read(documentId); notifyDocumentAdded(postAdditionContainer, postAdditionDraft, postAdditionDocument, localEventGenerator); } catch (final Throwable t) { throw translateError(t); }
void addDocument(final Long containerId, final Long documentId) { logger.logApiId(); logger.logVariable("containerId", containerId); logger.logVariable("documentId", documentId); assertDraftExists("DRAFT DOES NOT EXIST", containerId); containerIO.createDraftArtifactRel(containerId, documentId, ContainerDraft.ArtifactState.ADDED); getIndexModel().indexDocument(containerId, documentId); final Container postAdditionContainer = read(containerId); final ContainerDraft postAdditionDraft = readDraft(containerId); final Document postAdditionDocument = getInternalDocumentModel().read(documentId); notifyDocumentAdded(postAdditionContainer, postAdditionDraft, postAdditionDocument, localEventGenerator); }
assertContainerDraftDoesNotExist("Draft already exist.", containerId); if (isFirstDraft(containerId)) { createFirstDraft(containerId, localTeamMember(containerId)); } else { assertOnline("The user is not online."); final Container container = read(containerId); if (!isDistributed(container.getId())) { createDistributed(container);
try { assertContainerDraftDoesNotExist("Draft already exist.", containerId); if (isFirstDraft(containerId)) { createFirstDraft(containerId, localTeamMember(containerId)); } else { assertOnline("The user is not online."); final Container container = read(containerId); if (!isDistributed(container.getId())) { createDistributed(container); } final ContainerVersion latestVersion = readLatestVersion(container.getId()); final List<Document> documents = readDocuments( latestVersion.getArtifactId(), latestVersion.getVersionId()); final ContainerDraft draft = new ContainerDraft(); draft.setOwner(localTeamMember(containerId)); draft.setContainerId(containerId); for (final Document document : documents) { draft.addDocument(document); draft.putState(document, ContainerDraft.ArtifactState.NONE); } containerIO.createDraft(draft); getInternalArtifactModel().applyFlagKey(container.getId()); getSessionModel().createDraft(container.getUniqueId());
ContainerDraft createDraft(final Long containerId) { logger.logApiId(); logger.logVariable("containerId", containerId); assertContainerDraftDoesNotExist("Draft already exist.", containerId); if (isFirstDraft(containerId)) { createFirstDraft(containerId, localTeamMember(containerId)); } else { assertOnline("The user is not online."); final Container container = read(containerId); if (!isDistributed(container.getId())) { createDistributed(container); } final ContainerVersion latestVersion = readLatestVersion(container.getId()); final List<Document> documents = readDocuments( latestVersion.getArtifactId(), latestVersion.getVersionId()); // create final ContainerDraft draft = new ContainerDraft(); draft.setOwner(localTeamMember(containerId)); draft.setContainerId(containerId); for (final Document document : documents) { draft.addDocument(document); draft.putState(document, ContainerDraft.ArtifactState.NONE); } containerIO.createDraft(draft); getInternalArtifactModel().applyFlagKey(container.getId()); // remote create getSessionModel().createDraft(container.getUniqueId()); } // fire event final Container postCreation= read(containerId); final ContainerDraft postCreationDraft = readDraft(containerId); notifyDraftCreated(postCreation, postCreationDraft, localEventGenerator); return postCreationDraft; }
final ContainerVersion latestVersion = readLatestVersion(container.getId()); final List<Document> documents = readDocuments( latestVersion.getArtifactId(), latestVersion.getVersionId()); final ContainerDraft draft = new ContainerDraft(); draft.setOwner(localTeamMember(containerId)); draft.setContainerId(containerId); for (final Document document : documents) { draft.addDocument(document); draft.putState(document, ContainerDraft.ArtifactState.NONE); } containerIO.createDraft(draft); getInternalArtifactModel().applyFlagKey(container.getId()); getSessionModel().createDraft(container.getUniqueId());
final Container postCreation= read(containerId); final ContainerDraft postCreationDraft = readDraft(containerId); notifyDraftCreated(postCreation, postCreationDraft, localEventGenerator); return postCreationDraft; } catch (final Throwable t) { throw translateError(t);
ContainerDraft createDraft(final Long containerId) { logger.logApiId(); logger.logVariable("containerId", containerId); assertContainerDraftDoesNotExist("Draft already exist.", containerId); if (isFirstDraft(containerId)) { createFirstDraft(containerId, localTeamMember(containerId)); } else { assertOnline("The user is not online."); final Container container = read(containerId); if (!isDistributed(container.getId())) { createDistributed(container); } final ContainerVersion latestVersion = readLatestVersion(container.getId()); final List<Document> documents = readDocuments( latestVersion.getArtifactId(), latestVersion.getVersionId()); // create final ContainerDraft draft = new ContainerDraft(); draft.setOwner(localTeamMember(containerId)); draft.setContainerId(containerId); for (final Document document : documents) { draft.addDocument(document); draft.putState(document, ContainerDraft.ArtifactState.NONE); } containerIO.createDraft(draft); getInternalArtifactModel().applyFlagKey(container.getId()); // remote create getSessionModel().createDraft(container.getUniqueId()); } // fire event final Container postCreation= read(containerId); final ContainerDraft postCreationDraft = readDraft(containerId); notifyDraftCreated(postCreation, postCreationDraft, localEventGenerator); return postCreationDraft; }
final Container postCreation= read(containerId); final ContainerDraft postCreationDraft = readDraft(containerId); notifyDraftCreated(postCreation, postCreationDraft, localEventGenerator); return postCreationDraft;
ContainerDraft createDraft(final Long containerId) { logger.logApiId(); logger.logVariable("containerId", containerId); assertContainerDraftDoesNotExist("Draft already exist.", containerId); if (isFirstDraft(containerId)) { createFirstDraft(containerId, localTeamMember(containerId)); } else { assertOnline("The user is not online."); final Container container = read(containerId); if (!isDistributed(container.getId())) { createDistributed(container); } final ContainerVersion latestVersion = readLatestVersion(container.getId()); final List<Document> documents = readDocuments( latestVersion.getArtifactId(), latestVersion.getVersionId()); // create final ContainerDraft draft = new ContainerDraft(); draft.setOwner(localTeamMember(containerId)); draft.setContainerId(containerId); for (final Document document : documents) { draft.addDocument(document); draft.putState(document, ContainerDraft.ArtifactState.NONE); } containerIO.createDraft(draft); getInternalArtifactModel().applyFlagKey(container.getId()); // remote create getSessionModel().createDraft(container.getUniqueId()); } // fire event final Container postCreation= read(containerId); final ContainerDraft postCreationDraft = readDraft(containerId); notifyDraftCreated(postCreation, postCreationDraft, localEventGenerator); return postCreationDraft; }
assertDoesExistLocalDraft("Draft does not exist.", containerId); final Container container = read(containerId); if (!isFirstDraft(container.getId())) { assertOnline("User is not online."); assertIsDistributed("Draft has not been distributed.", containerId); getSessionModel().deleteDraft(container.getUniqueId());
try { assertDoesExistLocalDraft("Draft does not exist.", containerId); final Container container = read(containerId); if (!isFirstDraft(container.getId())) { assertOnline("User is not online."); assertIsDistributed("Draft has not been distributed.", containerId); getSessionModel().deleteDraft(container.getUniqueId()); } final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); notifyDraftDeleted(container, draft, localEventGenerator); } catch (final Throwable t) { throw translateError(t);
void deleteDraft(final Long containerId) { logger.logApiId(); logger.logVariable("containerId", containerId); assertDoesExistLocalDraft("Draft does not exist.", containerId); final Container container = read(containerId); if (!isFirstDraft(container.getId())) { assertOnline("User is not online."); assertIsDistributed("Draft has not been distributed.", containerId); getSessionModel().deleteDraft(container.getUniqueId()); } // delete local data final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); notifyDraftDeleted(container, draft, localEventGenerator); }
final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); notifyDraftDeleted(container, draft, localEventGenerator);
void deleteDraft(final Long containerId) { logger.logApiId(); logger.logVariable("containerId", containerId); assertDoesExistLocalDraft("Draft does not exist.", containerId); final Container container = read(containerId); if (!isFirstDraft(container.getId())) { assertOnline("User is not online."); assertIsDistributed("Draft has not been distributed.", containerId); getSessionModel().deleteDraft(container.getUniqueId()); } // delete local data final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); notifyDraftDeleted(container, draft, localEventGenerator); }
assertIsNotLocalUserId(publishedBy);
void handleArtifactPublished(final UUID uniqueId, final Long versionId, final String name, final UUID artifactUniqueId, final Long artifactVersionId, final String artifactName, final ArtifactType artifactType, final String artifactChecksum, final String artifactStreamId, final JabberId publishedBy, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactUniqueId", artifactUniqueId); logger.logVariable("artifactVersionId", artifactVersionId); logger.logVariable("artifactName", artifactName); logger.logVariable("artifactType", artifactType); logger.logVariable("artifactChecksum", artifactChecksum); logger.logVariable("artifactStreamId", artifactStreamId); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedOn", publishedOn); assertIsNotLocalUserId(publishedBy); try { // determine the existance of the container and the version. final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Boolean doesExist = artifactModel.doesExist(uniqueId); final Boolean doesVersionExist; final Long containerId; final Container container; final ContainerVersion version; if (doesExist) { containerId = artifactModel.readId(uniqueId); container = read(containerId); doesVersionExist = artifactModel.doesVersionExist(containerId, versionId); if (doesVersionExist) { version = readVersion(container.getId(), versionId); } else { version = createVersion(container.getId(), versionId, publishedBy, publishedOn); } } else { doesVersionExist = Boolean.FALSE; // ensure the published by user exists locally getInternalUserModel().readLazyCreate(publishedBy); container = new Container(); container.setCreatedBy(publishedBy); container.setCreatedOn(publishedOn); container.setName(name); container.setState(ArtifactState.ACTIVE); container.setType(ArtifactType.CONTAINER); container.setUniqueId(uniqueId); container.setUpdatedBy(container.getCreatedBy()); container.setUpdatedOn(container.getCreatedOn()); // create containerIO.create(container); // create version version = createVersion(container.getId(), versionId, publishedBy, publishedOn); // create remote info artifactModel.createRemoteInfo(container.getId(), publishedBy, container.getCreatedOn()); // index getIndexModel().indexContainer(container.getId()); } // handle the artifact by specific type final ArtifactVersion artifactVersion; switch(artifactType) { case DOCUMENT: artifactVersion = handleDocumentPublished(artifactUniqueId, artifactVersionId, artifactName, artifactChecksum, artifactStreamId, publishedBy, publishedOn); break; case CONTAINER: default: throw Assert.createUnreachable("UNKNOWN ARTIFACT TYPE"); } containerIO.addVersion(version.getArtifactId(), version.getVersionId(), artifactVersion.getArtifactId(), artifactVersion.getVersionId(), artifactVersion.getArtifactType()); final Container postPublish = read(container.getId()); final ContainerVersion postPublishVersion = readVersion(version.getArtifactId(), version.getVersionId()); notifyContainerPublished(postPublish, null, postPublishVersion, remoteEventGenerator); } catch(final Throwable t) { throw translateError(t); } }
assertIsNotLocalUserId(publishedBy);
void handleArtifactPublished(final UUID uniqueId, final Long versionId, final String name, final UUID artifactUniqueId, final Long artifactVersionId, final String artifactName, final ArtifactType artifactType, final String artifactChecksum, final String artifactStreamId, final JabberId publishedBy, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactUniqueId", artifactUniqueId); logger.logVariable("artifactVersionId", artifactVersionId); logger.logVariable("artifactName", artifactName); logger.logVariable("artifactType", artifactType); logger.logVariable("artifactChecksum", artifactChecksum); logger.logVariable("artifactStreamId", artifactStreamId); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedOn", publishedOn); assertIsNotLocalUserId(publishedBy); try { // determine the existance of the container and the version. final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Boolean doesExist = artifactModel.doesExist(uniqueId); final Boolean doesVersionExist; final Long containerId; final Container container; final ContainerVersion version; if (doesExist) { containerId = artifactModel.readId(uniqueId); container = read(containerId); doesVersionExist = artifactModel.doesVersionExist(containerId, versionId); if (doesVersionExist) { version = readVersion(container.getId(), versionId); } else { version = createVersion(container.getId(), versionId, publishedBy, publishedOn); } } else { doesVersionExist = Boolean.FALSE; // ensure the published by user exists locally getInternalUserModel().readLazyCreate(publishedBy); container = new Container(); container.setCreatedBy(publishedBy); container.setCreatedOn(publishedOn); container.setName(name); container.setState(ArtifactState.ACTIVE); container.setType(ArtifactType.CONTAINER); container.setUniqueId(uniqueId); container.setUpdatedBy(container.getCreatedBy()); container.setUpdatedOn(container.getCreatedOn()); // create containerIO.create(container); // create version version = createVersion(container.getId(), versionId, publishedBy, publishedOn); // create remote info artifactModel.createRemoteInfo(container.getId(), publishedBy, container.getCreatedOn()); // index getIndexModel().indexContainer(container.getId()); } // handle the artifact by specific type final ArtifactVersion artifactVersion; switch(artifactType) { case DOCUMENT: artifactVersion = handleDocumentPublished(artifactUniqueId, artifactVersionId, artifactName, artifactChecksum, artifactStreamId, publishedBy, publishedOn); break; case CONTAINER: default: throw Assert.createUnreachable("UNKNOWN ARTIFACT TYPE"); } containerIO.addVersion(version.getArtifactId(), version.getVersionId(), artifactVersion.getArtifactId(), artifactVersion.getVersionId(), artifactVersion.getArtifactType()); final Container postPublish = read(container.getId()); final ContainerVersion postPublishVersion = readVersion(version.getArtifactId(), version.getVersionId()); notifyContainerPublished(postPublish, null, postPublishVersion, remoteEventGenerator); } catch(final Throwable t) { throw translateError(t); } }
final ContainerDraft draft = new ContainerDraft(); draft.setContainerId(containerId); final List<TeamMember> team = readTeam(containerId); logger.logVariable("team", team); draft.setOwner(team.get(indexOf(team, createdBy))); containerIO.createDraft(draft); notifyDraftCreated(read(containerId), readDraft(containerId), remoteEventGenerator);
try { final ContainerDraft draft = new ContainerDraft(); draft.setContainerId(containerId); final List<TeamMember> team = readTeam(containerId); logger.logVariable("team", team); draft.setOwner(team.get(indexOf(team, createdBy))); containerIO.createDraft(draft); notifyDraftCreated(read(containerId), readDraft(containerId), remoteEventGenerator); } catch (final Throwable t) { throw translateError(t); }
void handleDraftCreated(final Long containerId, final JabberId createdBy, final Calendar createdOn) { logger.logApiId(); logger.logVariable("containerId", containerId); logger.logVariable("createdBy", createdBy); logger.logVariable("createdOn", createdOn); final ContainerDraft draft = new ContainerDraft(); draft.setContainerId(containerId); final List<TeamMember> team = readTeam(containerId); logger.logVariable("team", team); draft.setOwner(team.get(indexOf(team, createdBy))); containerIO.createDraft(draft); // fire event notifyDraftCreated(read(containerId), readDraft(containerId), remoteEventGenerator); }
final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId());
try { final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); notifyDraftDeleted(read(containerId), draft, remoteEventGenerator); } catch (final Throwable t) { throw translateError(t);
void handleDraftDeleted(final Long containerId, final JabberId deletedBy, final Calendar deletedOn) { logger.logApiId(); logger.logVariable("containerId", containerId); logger.logVariable("createdBy", deletedBy); logger.logVariable("createdOn", deletedOn); final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); // fire event notifyDraftDeleted(read(containerId), draft, remoteEventGenerator); }
containerIO.deleteDraft(containerId); notifyDraftDeleted(read(containerId), draft, remoteEventGenerator);
void handleDraftDeleted(final Long containerId, final JabberId deletedBy, final Calendar deletedOn) { logger.logApiId(); logger.logVariable("containerId", containerId); logger.logVariable("createdBy", deletedBy); logger.logVariable("createdOn", deletedOn); final ContainerDraft draft = readDraft(containerId); for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); // fire event notifyDraftDeleted(read(containerId), draft, remoteEventGenerator); }
final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(uniqueId); final InternalUserModel userModel = getInternalUserModel(); final List<TeamMember> localTeam = artifactModel.readTeam2(containerId); final List<User> publishedToUsers = new ArrayList<User>(); for (final JabberId publishedToId : publishedTo) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId);
try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(uniqueId); final InternalUserModel userModel = getInternalUserModel(); final List<TeamMember> localTeam = artifactModel.readTeam2(containerId); final List<User> publishedToUsers = new ArrayList<User>(); for (final JabberId publishedToId : publishedTo) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId); } publishedToUsers.add(userModel.read(publishedToId));
void handlePublished(final UUID uniqueId, final Long versionId, final String name, final Integer artifactCount, final JabberId publishedBy, final List<JabberId> publishedTo, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactCount", artifactCount); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedTo", publishedTo); logger.logVariable("publishedOn", publishedOn); final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(uniqueId); // add to local team final InternalUserModel userModel = getInternalUserModel(); final List<TeamMember> localTeam = artifactModel.readTeam2(containerId); final List<User> publishedToUsers = new ArrayList<User>(); for (final JabberId publishedToId : publishedTo) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId); } publishedToUsers.add(userModel.read(publishedToId)); } // add the sender as well if (!contains(localTeam, publishedBy)) { artifactModel.addTeamMember(containerId, publishedBy); } // delete draft final ContainerDraft draft = readDraft(containerId); if (null == draft) { logger.logWarning("Draft did not previously exist for {0}.", name); } else { for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); } // create published to list containerIO.createPublishedTo(containerId, versionId, publishedToUsers); // send confirmation getSessionModel().confirmArtifactReceipt(localUserId(), uniqueId, versionId, localUserId(), currentDateTime()); // audit\fire event final Container postPublish = read(containerId); final ContainerDraft postPublishDraft = readDraft(containerId); final ContainerVersion postPublishVersion = readVersion(containerId, versionId); auditContainerPublished(postPublish, postPublishDraft, postPublishVersion, publishedBy, publishedTo, publishedOn); notifyContainerPublished(postPublish, postPublishDraft, postPublishVersion, remoteEventGenerator); }
publishedToUsers.add(userModel.read(publishedToId));
if (!contains(localTeam, publishedBy)) { artifactModel.addTeamMember(containerId, publishedBy); } final ContainerDraft draft = readDraft(containerId); if (null == draft) { logger.logWarning("Draft did not previously exist for {0}.", name); } else { for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); } containerIO.createPublishedTo(containerId, versionId, publishedToUsers); getSessionModel().confirmArtifactReceipt(localUserId(), uniqueId, versionId, localUserId(), currentDateTime()); final Container postPublish = read(containerId); final ContainerDraft postPublishDraft = readDraft(containerId); final ContainerVersion postPublishVersion = readVersion(containerId, versionId); auditContainerPublished(postPublish, postPublishDraft, postPublishVersion, publishedBy, publishedTo, publishedOn); notifyContainerPublished(postPublish, postPublishDraft, postPublishVersion, remoteEventGenerator); } catch (final Throwable t) { throw translateError(t);
void handlePublished(final UUID uniqueId, final Long versionId, final String name, final Integer artifactCount, final JabberId publishedBy, final List<JabberId> publishedTo, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactCount", artifactCount); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedTo", publishedTo); logger.logVariable("publishedOn", publishedOn); final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(uniqueId); // add to local team final InternalUserModel userModel = getInternalUserModel(); final List<TeamMember> localTeam = artifactModel.readTeam2(containerId); final List<User> publishedToUsers = new ArrayList<User>(); for (final JabberId publishedToId : publishedTo) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId); } publishedToUsers.add(userModel.read(publishedToId)); } // add the sender as well if (!contains(localTeam, publishedBy)) { artifactModel.addTeamMember(containerId, publishedBy); } // delete draft final ContainerDraft draft = readDraft(containerId); if (null == draft) { logger.logWarning("Draft did not previously exist for {0}.", name); } else { for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); } // create published to list containerIO.createPublishedTo(containerId, versionId, publishedToUsers); // send confirmation getSessionModel().confirmArtifactReceipt(localUserId(), uniqueId, versionId, localUserId(), currentDateTime()); // audit\fire event final Container postPublish = read(containerId); final ContainerDraft postPublishDraft = readDraft(containerId); final ContainerVersion postPublishVersion = readVersion(containerId, versionId); auditContainerPublished(postPublish, postPublishDraft, postPublishVersion, publishedBy, publishedTo, publishedOn); notifyContainerPublished(postPublish, postPublishDraft, postPublishVersion, remoteEventGenerator); }
if (!contains(localTeam, publishedBy)) { artifactModel.addTeamMember(containerId, publishedBy); } final ContainerDraft draft = readDraft(containerId); if (null == draft) { logger.logWarning("Draft did not previously exist for {0}.", name); } else { for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); } containerIO.createPublishedTo(containerId, versionId, publishedToUsers); getSessionModel().confirmArtifactReceipt(localUserId(), uniqueId, versionId, localUserId(), currentDateTime()); final Container postPublish = read(containerId); final ContainerDraft postPublishDraft = readDraft(containerId); final ContainerVersion postPublishVersion = readVersion(containerId, versionId); auditContainerPublished(postPublish, postPublishDraft, postPublishVersion, publishedBy, publishedTo, publishedOn); notifyContainerPublished(postPublish, postPublishDraft, postPublishVersion, remoteEventGenerator);
void handlePublished(final UUID uniqueId, final Long versionId, final String name, final Integer artifactCount, final JabberId publishedBy, final List<JabberId> publishedTo, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactCount", artifactCount); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedTo", publishedTo); logger.logVariable("publishedOn", publishedOn); final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(uniqueId); // add to local team final InternalUserModel userModel = getInternalUserModel(); final List<TeamMember> localTeam = artifactModel.readTeam2(containerId); final List<User> publishedToUsers = new ArrayList<User>(); for (final JabberId publishedToId : publishedTo) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId); } publishedToUsers.add(userModel.read(publishedToId)); } // add the sender as well if (!contains(localTeam, publishedBy)) { artifactModel.addTeamMember(containerId, publishedBy); } // delete draft final ContainerDraft draft = readDraft(containerId); if (null == draft) { logger.logWarning("Draft did not previously exist for {0}.", name); } else { for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); } // create published to list containerIO.createPublishedTo(containerId, versionId, publishedToUsers); // send confirmation getSessionModel().confirmArtifactReceipt(localUserId(), uniqueId, versionId, localUserId(), currentDateTime()); // audit\fire event final Container postPublish = read(containerId); final ContainerDraft postPublishDraft = readDraft(containerId); final ContainerVersion postPublishVersion = readVersion(containerId, versionId); auditContainerPublished(postPublish, postPublishDraft, postPublishVersion, publishedBy, publishedTo, publishedOn); notifyContainerPublished(postPublish, postPublishDraft, postPublishVersion, remoteEventGenerator); }
containerIO.updatePublishedTo(containerId, versionId, receivedBy, receivedOn); containerIO.updateSharedWith(containerId, versionId, receivedBy, receivedOn);
try { containerIO.updatePublishedTo(containerId, versionId, receivedBy, receivedOn); logger.logTraceId(); } catch (final Throwable t) { throw translateError(t); }
void handleReceived(final Long containerId, final Long versionId, final JabberId receivedBy, final Calendar receivedOn) { logger.logApiId(); logger.logVariable("containerId", containerId); logger.logVariable("versionId", versionId); logger.logVariable("receivedBy", receivedBy); logger.logVariable("receivedOn", receivedOn); containerIO.updatePublishedTo(containerId, versionId, receivedBy, receivedOn); containerIO.updateSharedWith(containerId, versionId, receivedBy, receivedOn); }
public UnsubscribeUser() { super(IQAction.UNSUBSCRIBEUSER); }
public UnsubscribeUser() { super("unsubscribeuser"); }
public UnsubscribeUser() { super(IQAction.UNSUBSCRIBEUSER); }
private void displayMainBrowserAvatar() {
private void displayMainBrowserAvatar(final Boolean doReload) { if(doReload) { getController().reloadMainBrowserAvatar(); }
private void displayMainBrowserAvatar() { getController().displayMainBrowserAvatar(); }
displayMainBrowserAvatar();
displayMainBrowserAvatar(Boolean.TRUE);
private void sendJButtonActionPerformed(java.awt.event.ActionEvent evt) { if(isInputValid()) { final Long documentId = extractDocumentId(); final List<User> users = extractTeam(); users.addAll(extractContacts()); final Boolean doIncludeKey = extractDoIncludeKey(); toggleVisualFeedback(Boolean.TRUE); try { if(doIncludeKey) { // create a version and send it // update the server key holder final User user = users.get(0); getSessionModel().sendKeyResponse(documentId, user, KeyResponse.ACCEPT); displayMainBrowserAvatar(); } else { final DocumentVersion version = extractDocumentVersion(); if(version == WorkingVersion.getWorkingVersion()) { // create a version and send it getSessionModel().send(users, documentId); displayMainBrowserAvatar(); } else { // send a specific version getSessionModel().send( users, documentId, version.getVersionId()); displayMainBrowserAvatar(); } } } catch(final ParityException px) { throw new RuntimeException(px); } finally { toggleVisualFeedback(Boolean.FALSE); } } }
public void artifactClosed(final UUID artifactUniqueId) { handleArtifactClosed(artifactUniqueId);
public void artifactClosed(final UUID artifactUniqueId, final JabberId artifactClosedBy) { handleArtifactClosed(artifactUniqueId, artifactClosedBy);
SessionModelXMPPHelper() { super(); this.xmppSession = XMPPSessionFactory.createSession(); this.xmppExtensionListener = new XMPPExtensionListener() { public void artifactClosed(final UUID artifactUniqueId) { handleArtifactClosed(artifactUniqueId); } public void documentReceived(final XMPPDocument xmppDocument) { handleDocumentReceived(xmppDocument); } public void keyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { handleKeyRequestAccepted(artifactUniqueId, acceptedBy); } public void keyRequestDenied(final UUID artifactUniqueId, final JabberId deniedBy) { handleKeyRequestDenied(artifactUniqueId, deniedBy); } public void keyRequested(final UUID artifactUniqueId, final JabberId requestedBy) { handleKeyRequested(artifactUniqueId, requestedBy); } }; this.xmppPresenceListener = new XMPPContactListener() { public void invitationAccepted(final JabberId acceptedBy) { handleInvitationAccepted(acceptedBy); } public void invitationDeclined(final JabberId declinedBy) { handleInvitationDeclined(declinedBy); } public void invitationExtended(final JabberId invitedBy) { handleInvitationExtended(invitedBy); } }; this.xmppSessionListener = new XMPPSessionListener() { public void sessionEstablished() { handleSessionEstablished(); } public void sessionTerminated() { handleSessionTerminated(); } public void sessionTerminated(final Exception x) { handleSessionTerminated(x); } }; xmppSession.addListener(xmppExtensionListener); xmppSession.addListener(xmppPresenceListener); xmppSession.addListener(xmppSessionListener); }
public void artifactClosed(final UUID artifactUniqueId) { handleArtifactClosed(artifactUniqueId);
public void artifactClosed(final UUID artifactUniqueId, final JabberId artifactClosedBy) { handleArtifactClosed(artifactUniqueId, artifactClosedBy);
public void artifactClosed(final UUID artifactUniqueId) { handleArtifactClosed(artifactUniqueId); }
private void handleArtifactClosed(final UUID artifactUniqueId) { SessionModelImpl.notifyArtifactClosed(artifactUniqueId);
private void handleArtifactClosed(final UUID artifactUniqueId, final JabberId artifactClosedBy) { SessionModelImpl.notifyArtifactClosed(artifactUniqueId, artifactClosedBy);
private void handleArtifactClosed(final UUID artifactUniqueId) { SessionModelImpl.notifyArtifactClosed(artifactUniqueId); }
return getArchiveModel().readTeam(userId, uniqueId);
return getArchiveModel().readTeamIds(userId, uniqueId);
private List<JabberId> readTeamIds(final JabberId userId, final UUID uniqueId) { return getArchiveModel().readTeam(userId, uniqueId); }
final UUID uniqueId, final Long versionId, final UUID documentUniqueId) {
final UUID uniqueId, final Long versionId) {
private List<DocumentVersion> readArchiveDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { return getContainerModel().readArchiveDocumentVersions(userId, uniqueId, versionId, documentUniqueId); }
uniqueId, versionId, documentUniqueId);
uniqueId, versionId);
private List<DocumentVersion> readArchiveDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { return getContainerModel().readArchiveDocumentVersions(userId, uniqueId, versionId, documentUniqueId); }
readLong("versionId"), readUUID("documentUniqueId"));
readLong("versionId"));
public void service() { logApiId(); final List<DocumentVersion> versions = readArchiveDocumentVersions( readJabberId("userId"), readUUID("uniqueId"), readLong("versionId"), readUUID("documentUniqueId")); writeDocumentVersions("documentVersions", "documentVersion", versions); }
setBackground(new java.awt.Color(255, 255, 255));
confirmJButton.setText("!Yes!");
private void initComponents() { confirmJButton = ButtonFactory.create(getString("ConfirmButton")); denyJButton = ButtonFactory.create(getString("DenyButton")); confirmMessageJTextArea = TextFactory.createArea(); setBackground(new java.awt.Color(255, 255, 255)); confirmJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { confirmJButtonActionPerformed(e); } }); denyJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { denyJButtonActionPerformed(e); } }); confirmMessageJTextArea.setColumns(20); confirmMessageJTextArea.setEditable(false); confirmMessageJTextArea.setLineWrap(true); confirmMessageJTextArea.setRows(5); confirmMessageJTextArea.setWrapStyleWord(true); confirmMessageJTextArea.setBorder(null); confirmMessageJTextArea.setFocusable(false); confirmMessageJTextArea.setBorder(null); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, confirmMessageJTextArea, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(denyJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(confirmJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(confirmMessageJTextArea, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(confirmJButton) .add(denyJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
confirmMessageJTextArea.setOpaque(false);
private void initComponents() { confirmJButton = ButtonFactory.create(getString("ConfirmButton")); denyJButton = ButtonFactory.create(getString("DenyButton")); confirmMessageJTextArea = TextFactory.createArea(); setBackground(new java.awt.Color(255, 255, 255)); confirmJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { confirmJButtonActionPerformed(e); } }); denyJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { denyJButtonActionPerformed(e); } }); confirmMessageJTextArea.setColumns(20); confirmMessageJTextArea.setEditable(false); confirmMessageJTextArea.setLineWrap(true); confirmMessageJTextArea.setRows(5); confirmMessageJTextArea.setWrapStyleWord(true); confirmMessageJTextArea.setBorder(null); confirmMessageJTextArea.setFocusable(false); confirmMessageJTextArea.setBorder(null); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, confirmMessageJTextArea, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(denyJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(confirmJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(confirmMessageJTextArea, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(confirmJButton) .add(denyJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
private ModelTestUser(final String password, final String serverHost, final Integer serverPort, final String username) {
private ModelTestUser(final String password, final String resource, final String serverHost, final Integer serverPort, final String username) {
private ModelTestUser(final String password, final String serverHost, final Integer serverPort, final String username) { super(); this.password = password; this.serverHost = serverHost; this.serverPort = serverPort; this.username = username; }
this.resource = resource;
private ModelTestUser(final String password, final String serverHost, final Integer serverPort, final String username) { super(); this.password = password; this.serverHost = serverHost; this.serverPort = serverPort; this.username = username; }
public Boolean extractSavePassword() { return SwingUtil.extract(savePasswordJCheckBox); }
public Boolean extractSavePassword() { return Boolean.FALSE; }
public Boolean extractSavePassword() { return SwingUtil.extract(savePasswordJCheckBox); }
private void hideConnectionInfo() { infoJLabel.setText(""); }
private void hideConnectionInfo() { }
private void hideConnectionInfo() { infoJLabel.setText(""); }
savePasswordJCheckBox = CheckBoxFactory.create(getString("SavePasswordCheckBox"));
private void initComponents() { javax.swing.JButton cancelJButton; javax.swing.JButton loginJButton; javax.swing.JLabel passwordJLabel; javax.swing.JLabel usernameJLabel; usernameJLabel = LabelFactory.create(getString("UsernameLabel")); usernameJTextField = TextFactory.create(); passwordJLabel = LabelFactory.create(getString("PasswordLabel")); passwordJPasswordField = TextFactory.createPassword(); savePasswordJCheckBox = CheckBoxFactory.create(getString("SavePasswordCheckBox")); loginJButton = ButtonFactory.create(getString("LoginButton")); cancelJButton = ButtonFactory.create(getString("CancelButton")); infoJLabel = LabelFactory.create(); passwordJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { passwordJLabelMouseClicked(e); } }); passwordJPasswordField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { passwordJPasswordFieldActionPerformed(e); } }); savePasswordJCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); savePasswordJCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); savePasswordJCheckBox.setOpaque(false); loginJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { loginJButtonActionPerformed(e); } }); cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { cancelJButtonActionPerformed(e); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(usernameJLabel) .add(passwordJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(savePasswordJCheckBox) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(cancelJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(loginJButton)) .add(infoJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(usernameJLabel) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(passwordJLabel) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(savePasswordJCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(infoJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(loginJButton) .add(cancelJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
infoJLabel = LabelFactory.create();
paddingJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(22, 11, 3, 3); add(usernameJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(22, 3, 3, 22); add(usernameJTextField, gridBagConstraints);
private void initComponents() { javax.swing.JButton cancelJButton; javax.swing.JButton loginJButton; javax.swing.JLabel passwordJLabel; javax.swing.JLabel usernameJLabel; usernameJLabel = LabelFactory.create(getString("UsernameLabel")); usernameJTextField = TextFactory.create(); passwordJLabel = LabelFactory.create(getString("PasswordLabel")); passwordJPasswordField = TextFactory.createPassword(); savePasswordJCheckBox = CheckBoxFactory.create(getString("SavePasswordCheckBox")); loginJButton = ButtonFactory.create(getString("LoginButton")); cancelJButton = ButtonFactory.create(getString("CancelButton")); infoJLabel = LabelFactory.create(); passwordJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { passwordJLabelMouseClicked(e); } }); passwordJPasswordField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { passwordJPasswordFieldActionPerformed(e); } }); savePasswordJCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); savePasswordJCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); savePasswordJCheckBox.setOpaque(false); loginJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { loginJButtonActionPerformed(e); } }); cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { cancelJButtonActionPerformed(e); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(usernameJLabel) .add(passwordJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(savePasswordJCheckBox) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(cancelJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(loginJButton)) .add(infoJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(usernameJLabel) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(passwordJLabel) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(savePasswordJCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(infoJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(loginJButton) .add(cancelJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
savePasswordJCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); savePasswordJCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); savePasswordJCheckBox.setOpaque(false);
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(3, 3, 0, 22); add(passwordJPasswordField, gridBagConstraints);
private void initComponents() { javax.swing.JButton cancelJButton; javax.swing.JButton loginJButton; javax.swing.JLabel passwordJLabel; javax.swing.JLabel usernameJLabel; usernameJLabel = LabelFactory.create(getString("UsernameLabel")); usernameJTextField = TextFactory.create(); passwordJLabel = LabelFactory.create(getString("PasswordLabel")); passwordJPasswordField = TextFactory.createPassword(); savePasswordJCheckBox = CheckBoxFactory.create(getString("SavePasswordCheckBox")); loginJButton = ButtonFactory.create(getString("LoginButton")); cancelJButton = ButtonFactory.create(getString("CancelButton")); infoJLabel = LabelFactory.create(); passwordJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { passwordJLabelMouseClicked(e); } }); passwordJPasswordField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { passwordJPasswordFieldActionPerformed(e); } }); savePasswordJCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); savePasswordJCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); savePasswordJCheckBox.setOpaque(false); loginJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { loginJButtonActionPerformed(e); } }); cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { cancelJButtonActionPerformed(e); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(usernameJLabel) .add(passwordJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(savePasswordJCheckBox) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(cancelJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(loginJButton)) .add(infoJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(usernameJLabel) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(passwordJLabel) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(savePasswordJCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(infoJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(loginJButton) .add(cancelJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(usernameJLabel) .add(passwordJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(savePasswordJCheckBox) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(cancelJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(loginJButton)) .add(infoJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(usernameJLabel) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(passwordJLabel) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(savePasswordJCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(infoJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(loginJButton) .add(cancelJButton)) .addContainerGap()) );
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.insets = new java.awt.Insets(11, 3, 0, 22); add(cancelJButton, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(paddingJLabel, gridBagConstraints);
private void initComponents() { javax.swing.JButton cancelJButton; javax.swing.JButton loginJButton; javax.swing.JLabel passwordJLabel; javax.swing.JLabel usernameJLabel; usernameJLabel = LabelFactory.create(getString("UsernameLabel")); usernameJTextField = TextFactory.create(); passwordJLabel = LabelFactory.create(getString("PasswordLabel")); passwordJPasswordField = TextFactory.createPassword(); savePasswordJCheckBox = CheckBoxFactory.create(getString("SavePasswordCheckBox")); loginJButton = ButtonFactory.create(getString("LoginButton")); cancelJButton = ButtonFactory.create(getString("CancelButton")); infoJLabel = LabelFactory.create(); passwordJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { passwordJLabelMouseClicked(e); } }); passwordJPasswordField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { passwordJPasswordFieldActionPerformed(e); } }); savePasswordJCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); savePasswordJCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); savePasswordJCheckBox.setOpaque(false); loginJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { loginJButtonActionPerformed(e); } }); cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { cancelJButtonActionPerformed(e); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(usernameJLabel) .add(passwordJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(savePasswordJCheckBox) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(cancelJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(loginJButton)) .add(infoJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(usernameJLabel) .add(usernameJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(passwordJLabel) .add(passwordJPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(savePasswordJCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(infoJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(loginJButton) .add(cancelJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
infoJLabel.setText(extractErrorMessage());
public void reload() { if(getPreferences().isSetUsername()) { usernameJTextField.setText(getPreferences().getUsername()); usernameJTextField.setEnabled(false); } else { usernameJTextField.setEnabled(true); } if(containsErrors()) { infoJLabel.setText(extractErrorMessage()); clearErrors(); } }
infoJLabel.setText(buffer.toString());
private void showConnectionInfo() { final StringBuffer buffer = new StringBuffer(getPreferences().getServerHost()) .append(":") .append(getPreferences().getServerPort()) .append(" ") .append(com.thinkparity.browser.Version.getVersion()) .append(" ") .append(com.thinkparity.browser.Version.getBuildId()) .append(" ") .append(com.thinkparity.browser.Version.getMode()); infoJLabel.setText(buffer.toString()); final javax.swing.Timer timer = new javax.swing.Timer(3 * 1000, new ActionListener() { public void actionPerformed(final ActionEvent e) { hideConnectionInfo(); } }); timer.setRepeats(false); timer.start(); }
public void run() { window.open(avatar); }
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.TRUE); }
public void run() { window.open(avatar); }
reloadMainList();
SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE); } });
public void fireDocumentCreated(final Long documentId) { SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload(); } }); reloadMainList(); }
((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload();
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).applyFilter(filter);
public void run() { ((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload(); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId);
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE);
public void fireDocumentDeleted(final Long documentId) { SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload(); } }); // refresh the document main list SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId); } }); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId);
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE);
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId);
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.TRUE);
public void fireDocumentReceived(final Long documentId) { // refresh the document main list SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId); } }); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId);
((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload();
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId); }
SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId); } });
fireDocumentUpdated(documentId, Boolean.FALSE);
public void fireDocumentUpdated(final Long documentId) { // refresh the document in the main list SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId); } }); }
reloadMainList();
public void runAcceptContactInvitation(final Long systemMessageId) { final Data data = new Data(1); data.set(AcceptInvitation.DataKey.SYSTEM_MESSAGE_ID, systemMessageId); invoke(ActionId.SESSION_ACCEPT_INVITATION, data); reloadMainList(); }
reloadMainList();
public void runDeclineAllKeyRequests(final Long artifactId) { final Data data = new Data(1); data.set(DeclineAllKeyRequests.DataKey.ARTIFACT_ID, artifactId); invoke(ActionId.ARTIFACT_DECLINE_ALL_KEY_REQUESTS, data); reloadMainList(); }
reloadMainList();
public void runDeleteSystemMessage(final Long systemMessageId) { final Data data = new Data(1); data.set(DeleteSystemMessage.DataKey.SYSTEM_MESSAGE_ID, systemMessageId); invoke(ActionId.SYSTEM_MESSAGE_DELETE, data); reloadMainList(); }
runApplyFlagSeen(session.getSelectedDocumentId()); reloadMainList();
runApplyFlagSeen(getSelectedDocumentId()); fireDocumentUpdated(getSelectedDocumentId());
public void toggleHistory3Avatar() { if(null == history2Window) { final Avatar avatar = getAvatar(AvatarId.DOCUMENT_HISTORY3); if(null != getAvatarInput(AvatarId.DOCUMENT_HISTORY3)) avatar.setInput(getAvatarInput(AvatarId.DOCUMENT_HISTORY3)); history2Window = new History2Window(mainWindow, avatar); history2Window.setVisible(true); runApplyFlagSeen(session.getSelectedDocumentId()); reloadMainList(); } else { history2Window.dispose(); history2Window = null; } }
final JLabel addDocumentJLabel = LabelFactory.createLink( getString("AddDocument"), UIConstants.DefaultFont); final Color originalForeground = addDocumentJLabel.getForeground(); addDocumentJLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(final MouseEvent e) { addDocumentJLabel.setForeground(originalForeground); runCreateDocumentAction(); } }); c.anchor = GridBagConstraints.SOUTH; c.fill = GridBagConstraints.NONE; c.insets.top = c.insets.bottom = 2; c.gridy = 1; add(addDocumentJLabel, c.clone());
private void initBrowserMainComponents() { final GridBagConstraints c = new GridBagConstraints(); jListModel = new DefaultListModel(); // the list that resides on the browser's main avatar // * is a single selection list // * spans the width of the entire avatar // * uses a custom cell renderer // * uses a selection driver to select an item on mouse over final JList jList = new JList(jListModel); jList.setLayoutOrientation(JList.VERTICAL); jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jList.setCellRenderer(new CellRenderer()); final JListSelectionDriver jListSelectionDriver = new JListSelectionDriver(jList); jList.addMouseListener(jListSelectionDriver); jList.addMouseMotionListener(jListSelectionDriver); jList.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(final ListSelectionEvent e) { if(!e.getValueIsAdjusting()) { final Integer selectedIndex = jList.getSelectedIndex(); if(-1 != selectedIndex) { final ListItem item = (ListItem) jList.getSelectedValue(); item.fireSelection(); } } } }); final JScrollPane jListScrollPane = new JScrollPane(jList); jListScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; add(jListScrollPane, c.clone()); }
Assert.assertTrue( "File \"" + file.getAbsolutePath() + "\" does not exist.", file.exists());
Document create(final UUID projectId, final String name, final String description, final File file) throws ParityException { logger.info("create(Project,String,String,File)"); logger.debug(projectId); logger.debug(name); logger.debug(description); logger.debug(file); assertCanCreateArtifacts(); Assert.assertTrue( "create(Project,String,String,File)", (file.length() <= IParityModelConstants.FILE_SIZE_UPPER_BOUNDS)); try { final Calendar now = getTimestamp(); final Document document = new Document(preferences.getUsername(), now, description, NO_FLAGS, UUIDGenerator.nextUUID(), name, projectId, preferences.getUsername(), now); final byte[] contentBytes = FileUtil.readBytes(file); final DocumentContent content = new DocumentContent( MD5Util.md5Hex(contentBytes), contentBytes, document.getId()); // create the local file final LocalFile localFile = getLocalFile(document); localFile.write(contentBytes); // create the document documentXmlIO.create(document, content); // create a version createVersion( document.getId(), DocumentAction.CREATE, createActionData(document)); // flag the document as having been seen. flagAsSEEN(document); // flag the document with the key flagKey(document.getId()); // fire a creation event notifyCreation_objectCreated(document); return document; } catch(IOException iox) { logger.error("createDocument(Document)", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("createDocument(Document)", rx); throw ParityErrorTranslator.translate(rx); } }
return logVariable("response", super.handleIQ(logVariable("iq", iq)));
final IQ response = super.handleIQ(iq); IQ_LOGGER.logVariable("anonymous iq", iq); IQ_LOGGER.logVariable("anonymous iq response", response); return response;
public IQ handleIQ(final IQ iq) throws UnauthorizedException { synchronized (AbstractHandler.SERIALIZER) { this.userModel = UserModel.getModel(); return logVariable("response", super.handleIQ(logVariable("iq", iq))); } }
logVariable("iq", iq);
public IQ handleIQ(final IQ iq) throws UnauthorizedException { synchronized (SERIALIZER) { this.session = SessionUtil.getInstance().createSession(iq); this.archiveModel = ArchiveModel.getModel(session); this.artifactModel = ArtifactModel.getModel(session); this.backupModel = BackupModel.getModel(session); this.contactModel = ContactModel.getModel(session); this.containerModel = ContainerModel.getModel(session); this.profileModel = ProfileModel.getModel(session); this.queueModel = QueueModel.getModel(session); this.streamModel = StreamModel.getModel(session); this.userModel = UserModel.getModel(session); logVariable("iq", iq); final IQ response = super.handleIQ(iq); logVariable("response", response); return response; } }
logVariable("response", response);
IQ_LOGGER.logVariable("iq", iq); IQ_LOGGER.logVariable("iq response", response);
public IQ handleIQ(final IQ iq) throws UnauthorizedException { synchronized (SERIALIZER) { this.session = SessionUtil.getInstance().createSession(iq); this.archiveModel = ArchiveModel.getModel(session); this.artifactModel = ArtifactModel.getModel(session); this.backupModel = BackupModel.getModel(session); this.contactModel = ContactModel.getModel(session); this.containerModel = ContainerModel.getModel(session); this.profileModel = ProfileModel.getModel(session); this.queueModel = QueueModel.getModel(session); this.streamModel = StreamModel.getModel(session); this.userModel = UserModel.getModel(session); logVariable("iq", iq); final IQ response = super.handleIQ(iq); logVariable("response", response); return response; } }
digester.setClassLoader(getClass().getClassLoader());
public MappingDescriptor loadClassDescriptors(InputStream stream) { try { Digester digester = new Digester(); digester.setValidating(this.validating); if (null != this.dtdResolver) { digester.register("-//The Apache Software Foundation//DTD Repository//EN", this.dtdResolver.toString()); } MappingDescriptor mappingDescriptor = new MappingDescriptor(); digester.push(mappingDescriptor); // TODO : activater the following line wich cause some bugs when loading the xml stream //digester.addSetProperties("graffito-jcr", package, pa); // -------------------------------------------------------------------------------- // Rules used for the class-descriptor element // -------------------------------------------------------------------------------- digester.addObjectCreate("graffito-jcr/class-descriptor", ClassDescriptor.class); digester.addSetProperties("graffito-jcr/class-descriptor"); digester.addSetNext("graffito-jcr/class-descriptor", "addClassDescriptor"); // -------------------------------------------------------------------------------- // Rules used for the field-descriptor element // -------------------------------------------------------------------------------- digester.addObjectCreate("graffito-jcr/class-descriptor/implement-descriptor", ImplementDescriptor.class); digester.addSetProperties("graffito-jcr/class-descriptor/implement-descriptor"); digester.addSetNext("graffito-jcr/class-descriptor/implement-descriptor", "addImplementDescriptor"); // -------------------------------------------------------------------------------- // Rules used for the field-descriptor element // -------------------------------------------------------------------------------- digester.addObjectCreate("graffito-jcr/class-descriptor/field-descriptor", FieldDescriptor.class); digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor"); digester.addSetNext("graffito-jcr/class-descriptor/field-descriptor", "addFieldDescriptor"); // -------------------------------------------------------------------------------- // Rules used for the bean-descriptor element // -------------------------------------------------------------------------------- digester.addObjectCreate("graffito-jcr/class-descriptor/bean-descriptor", BeanDescriptor.class); digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor"); digester.addSetNext("graffito-jcr/class-descriptor/bean-descriptor", "addBeanDescriptor"); // -------------------------------------------------------------------------------- // Rules used for the collection-descriptor element // -------------------------------------------------------------------------------- digester.addObjectCreate("graffito-jcr/class-descriptor/collection-descriptor", CollectionDescriptor.class); digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor"); digester.addSetNext("graffito-jcr/class-descriptor/collection-descriptor", "addCollectionDescriptor"); return (MappingDescriptor) digester.parse(stream); } catch (Exception e) { throw new InitMapperException("Impossible to read the xml mapping file", e); } }
index.addLookup(
index.addXmlFileLookup(
private void readIndex(final Index index, final HierarchicalStreamReader reader, final UnmarshallingContext context) { while(reader.hasMoreChildren()) { reader.moveDown(); index.addLookup( UUID.fromString(reader.getAttribute("id")), new File(reader.getAttribute("xmlFile"))); reader.moveUp(); } }
assertNull(NAME + " [EVENT CONTAINER IS NOT NULL]", e.getContainer());
assertNotNull(NAME + " [EVENT CONTAINER IS NOT NULL]", e.getContainer());
public void containerDeleted(ContainerEvent e) { didNotify = Boolean.TRUE; assertTrue(NAME + " [EVENT GENERATED IS NOT LOCAL]", e.isLocal()); assertTrue(NAME + " [EVENT GENERATED IS REMOTE]", !e.isRemote()); assertNull(NAME + " [EVENT CONTAINER IS NOT NULL]", e.getContainer()); assertNull(NAME + " [EVENT DOCUMENT IS NOT NULL]", e.getDocument()); assertNull(NAME + " [EVENT DRAFT IS NOT NULL]", e.getDraft()); assertNull(NAME + " [EVENT TEAM MEMBER IS NOT NULL]", e.getTeamMember()); assertNull(NAME + " [EVENT VERSION NOT NULL]", e.getVersion()); }
modifyDocument(OpheliaTestUser.JUNIT, document);
modifyDocument(OpheliaTestUser.JUNIT, document.getId());
protected void setUp() throws Exception { super.setUp(); final Document document = createDocument(OpheliaTestUser.JUNIT, getInputFiles()[0]); modifyDocument(OpheliaTestUser.JUNIT, document); datum = new Fixture(getDocumentModel(OpheliaTestUser.JUNIT), document.getId(), Boolean.TRUE); }
this.sessionModel = modelFactory.getSessionModel(getClass());
this.sModel = modelFactory.getSessionModel(getClass());
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.artifactModel = modelFactory.getArtifactModel(getClass()); this.dModel = modelFactory.getDocumentModel(getClass()); this.logger = ModelLoggerFactory.getLogger(getClass()); this.loggedInUser = JabberIdBuilder.parseUsername(preferences.getUsername()); this.sessionModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new HistoryProvider(dModel); this.infoProvider = new InfoProvider(dModel); this.mainProvider = new MainProvider(artifactModel, dModel, systemMessageModel); this.manageContactsProvider = new ManageContactsProvider(sessionModel); this.sendArtifactProvider = new SendArtifactProvider(dModel, sessionModel, loggedInUser); this.sendVersionProvider = new SendVersionProvider(dModel, sessionModel, loggedInUser); }
this.infoProvider = new InfoProvider(dModel);
this.infoProvider = new InfoProvider(dModel, sModel);
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.artifactModel = modelFactory.getArtifactModel(getClass()); this.dModel = modelFactory.getDocumentModel(getClass()); this.logger = ModelLoggerFactory.getLogger(getClass()); this.loggedInUser = JabberIdBuilder.parseUsername(preferences.getUsername()); this.sessionModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new HistoryProvider(dModel); this.infoProvider = new InfoProvider(dModel); this.mainProvider = new MainProvider(artifactModel, dModel, systemMessageModel); this.manageContactsProvider = new ManageContactsProvider(sessionModel); this.sendArtifactProvider = new SendArtifactProvider(dModel, sessionModel, loggedInUser); this.sendVersionProvider = new SendVersionProvider(dModel, sessionModel, loggedInUser); }
this.manageContactsProvider = new ManageContactsProvider(sessionModel); this.sendArtifactProvider = new SendArtifactProvider(dModel, sessionModel, loggedInUser); this.sendVersionProvider = new SendVersionProvider(dModel, sessionModel, loggedInUser);
this.manageContactsProvider = new ManageContactsProvider(sModel); this.sendArtifactProvider = new SendArtifactProvider(dModel, sModel, loggedInUser); this.sendVersionProvider = new SendVersionProvider(dModel, sModel, loggedInUser);
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.artifactModel = modelFactory.getArtifactModel(getClass()); this.dModel = modelFactory.getDocumentModel(getClass()); this.logger = ModelLoggerFactory.getLogger(getClass()); this.loggedInUser = JabberIdBuilder.parseUsername(preferences.getUsername()); this.sessionModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new HistoryProvider(dModel); this.infoProvider = new InfoProvider(dModel); this.mainProvider = new MainProvider(artifactModel, dModel, systemMessageModel); this.manageContactsProvider = new ManageContactsProvider(sessionModel); this.sendArtifactProvider = new SendArtifactProvider(dModel, sessionModel, loggedInUser); this.sendVersionProvider = new SendVersionProvider(dModel, sessionModel, loggedInUser); }
final Project inbox = projectModel.getInbox(); final Document document = new Document(inbox.getId(), xmppDocument.getName(), xmppDocument.getCreatedOn(), xmppDocument.getCreatedBy(), xmppDocument.getDescription(), xmppDocument.getId()); final DocumentContent content = new DocumentContent( MD5Util.md5Hex(xmppDocument.getContent()), xmppDocument.getContent(), xmppDocument.getId()); documentXmlIO.create(document, content); createVersion(document, DocumentAction.RECEIVE, receive_ActionData(document)); notifyCreation_objectReceived(document);
final Document existingDocument = get(xmppDocument.getId()); logger.debug(existingDocument); if(null == existingDocument) { receiveCreate(xmppDocument); } else { receiveUpdate(xmppDocument, existingDocument); }
void receive(final XMPPDocument xmppDocument) throws ParityException { logger.info("receiveDocument(XMPPDocument)"); logger.debug(xmppDocument); try { /* * Obtain the inbox parity project within the workspace, and place * the received document within it, the notify all listeners about * the new document. */ final Project inbox = projectModel.getInbox(); final Document document = new Document(inbox.getId(), xmppDocument.getName(), xmppDocument.getCreatedOn(), xmppDocument.getCreatedBy(), xmppDocument.getDescription(), xmppDocument.getId()); final DocumentContent content = new DocumentContent( MD5Util.md5Hex(xmppDocument.getContent()), xmppDocument.getContent(), xmppDocument.getId()); documentXmlIO.create(document, content); // create a new version createVersion(document, DocumentAction.RECEIVE, receive_ActionData(document)); // fire a receive event notifyCreation_objectReceived(document); } catch(IOException iox) { logger.error("receiveDocument(XMPPDocument)", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("receiveDocument(XMPPDocument)", rx); throw ParityErrorTranslator.translate(rx); } }
final int compareResult = o1.getName().compareTo(o2.getName()); if(0 == compareResult) { return subCompare(o1, o2); } else { return compareResult * resultMultiplier; }
final int compareResult = comparator.compare(o1.getName(), o2.getName()); if (0 == compareResult) { return subCompare(o1, o2); } else { return compareResult; }
public int compare(final User o1, final User o2) { final int compareResult = o1.getName().compareTo(o2.getName()); if(0 == compareResult) { return subCompare(o1, o2); } else { return compareResult * resultMultiplier; } }