rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
}
};
protected InternalDocumentModel getInternalDocumentModel() { return DocumentModel.getInternalModel(getContext(), workspace); }
};
}
protected InternalDownloadModel getInternalDownloadModel() { return DownloadModel.getInternalModel(getContext(), workspace); };
null == workspace ? "null" : workspace.getWorkspaceDirectory().getName(),
null == workspace ? NO_WORKSPACE : workspace.getWorkspaceDirectory().getName(),
protected final void logVariable(final String name, final Object value) { if(logger.isDebugEnabled()) { logger.debug(MessageFormat.format("{0} {1}:{2}", null == workspace ? "null" : workspace.getWorkspaceDirectory().getName(), name, Log4JHelper.render(logger, value))); } }
final Avatar a = new DocumentHistoryAvatar3();
final Avatar a = new HistoryItems();
private Avatar createDocumentHistory3List() { final Avatar a = new DocumentHistoryAvatar3(); a.setContentProvider(ProviderFactory.getHistoryProvider()); return a; }
case SESSION_SEND_KEY_FORM: avatar = createSessionSendKeyForm();
case SESSION_SEND_VERSION: avatar = createSendVersion();
private Avatar doCreate(final AvatarId id) { final Avatar avatar; switch(id) { case BROWSER_INFO: avatar = createBrowserInfo(); break; case BROWSER_MAIN: avatar = createBrowserMain(); break; case BROWSER_TITLE: avatar = createBrowserTitle(); break; case DOCUMENT_HISTORY3: avatar = createDocumentHistory3List(); break; case PLATFORM_LOGIN: avatar = createPlatformLogin(); break; case SESSION_INVITE_PARTNER: avatar = createSessionInvitePartner(); break; case SESSION_MANAGE_CONTACTS: avatar = createSessionManageContacts(); break; case SESSION_SEND_FORM: avatar = createSessionSendForm(); break; case SESSION_SEND_KEY_FORM: avatar = createSessionSendKeyForm(); break; default: throw Assert.createUnreachable("Unknown avatar: " + id); } register(avatar); return avatar; }
dateJLabel = LabelFactory.create(BrowserConstants.SmallFont); eventJLabel = LabelFactory.create(BrowserConstants.SmallFont); versionJLabel = LabelFactory.create(BrowserConstants.SmallFont);
itemJLabel = LabelFactory.create(BrowserConstants.SmallFont);
private void initComponents() { dateJLabel = LabelFactory.create(BrowserConstants.SmallFont); eventJLabel = LabelFactory.create(BrowserConstants.SmallFont); versionJLabel = LabelFactory.create(BrowserConstants.SmallFont); final GridBagConstraints c = new GridBagConstraints(); c.insets.left = 7; c.anchor = GridBagConstraints.WEST; add(dateJLabel, c.clone()); c.insets.left = 0; add(versionJLabel, c.clone()); c.weightx = 1; add(eventJLabel, c.clone()); }
final GridBagConstraints c = new GridBagConstraints(); c.insets.left = 7; c.anchor = GridBagConstraints.WEST; add(dateJLabel, c.clone()); c.insets.left = 0; add(versionJLabel, c.clone()); c.weightx = 1; add(eventJLabel, c.clone()); }
final GridBagConstraints c = new GridBagConstraints(); c.insets.left = 7; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.BOTH; c.weightx = 1; add(itemJLabel, c.clone()); }
private void initComponents() { dateJLabel = LabelFactory.create(BrowserConstants.SmallFont); eventJLabel = LabelFactory.create(BrowserConstants.SmallFont); versionJLabel = LabelFactory.create(BrowserConstants.SmallFont); final GridBagConstraints c = new GridBagConstraints(); c.insets.left = 7; c.anchor = GridBagConstraints.WEST; add(dateJLabel, c.clone()); c.insets.left = 0; add(versionJLabel, c.clone()); c.weightx = 1; add(eventJLabel, c.clone()); }
rootScriptsFolderBundleURI = iwb.getResourcesPath()+"javascript/";
rootScriptsFolderBundleURI = iwb.getResourcesVirtualPath()+"/javascript/";
public String getBundleURIToScriptsFolder(){ if(rootScriptsFolderBundleURI == null){ IWBundle iwb = this.getBundle(); rootScriptsFolderBundleURI = iwb.getResourcesPath()+"javascript/"; } return rootScriptsFolderBundleURI; }
modifyDocument(OpheliaTestUser.JUNIT, document);
modifyDocument(OpheliaTestUser.JUNIT, document.getId());
protected void setUp() throws Exception { super.setUp(); final DocumentModel documentModel = getDocumentModel(OpheliaTestUser.JUNIT); final File inputFile = getInputFiles()[0]; final Document document = createDocument(OpheliaTestUser.JUNIT, inputFile); modifyDocument(OpheliaTestUser.JUNIT, document); datum = new Fixture(document, documentModel); documentModel.addListener(datum); }
removeXmlFileLookup(document);
public void delete(final Document document) throws FileNotFoundException, IOException { logger.info("delete(Document)"); logger.debug(document); final DocumentContent content = getContent(document); final Collection<DocumentVersion> versions = listVersions(document); Assert.assertTrue("delete(Document)", getXmlFile(document, content).delete()); for(DocumentVersion version : versions) { Assert.assertTrue("delete(Document)", getXmlFile(document, version).delete()); } Assert.assertTrue("delete(Document)", getXmlFile(document).delete()); }
public Boolean confirm(final String confirmMessageKey) { return ConfirmDialog.confirm(mainWindow, confirmMessageKey);
public Boolean confirm(final String messageKey) { final Data input = new Data(1); input.set(ConfirmDialog.DataKey.MESSAGE_KEY, messageKey); return confirm(input);
public Boolean confirm(final String confirmMessageKey) { return ConfirmDialog.confirm(mainWindow, confirmMessageKey); }
private Boolean didConfirm() { return confirm; }
public Boolean didConfirm() { return confirm; }
private Boolean didConfirm() { return confirm; }
LOGGER.logVariable("streamId", streamOffset); LOGGER.logVariable("streamId", streamSize);
LOGGER.logVariable("streamOffset", streamOffset); LOGGER.logVariable("streamSize", streamSize);
public void run() { LOGGER.logApiId(); LOGGER.logVariable("streamId", streamId); LOGGER.logVariable("streamId", streamOffset); LOGGER.logVariable("streamId", streamSize); try { final InputStream input = streamServer.openInputStream(streamSession, streamId, streamOffset); int len; long total = streamOffset.longValue(); final byte[] b = new byte[streamSession.getBufferSize()]; try { while((len = input.read(b)) > 0) { LOGGER.logDebug("Downstream sent: {0}/{1}", total += len, streamSize); output.write(b, 0, len); output.flush(); } } finally { input.close(); output.flush(); output.close(); } } catch (final IOException iox) { throw new StreamException(iox); } }
public ServletLogger( ServletContext sc )
public ServletLogger()
public ServletLogger( ServletContext sc ) { servletContext = sc; }
servletContext = sc;
public ServletLogger( ServletContext sc ) { servletContext = sc; }
Object obj = rs.getApplicationAttribute(VelocityViewServlet.SERVLET_CONTEXT_KEY); if (obj == null) { throw new IllegalStateException("Could not retrieve ServletContext from application attributes!"); } servletContext = (ServletContext)obj;
public void init( RuntimeServices rs ) throws Exception { }
public void objectVersionReceived(VersionCreationEvent e) {}
public void objectVersionReceived(final VersionCreationEvent e) { controller.reloadMainBrowserAvatar(); }
private CreationListener createDocumentModelCreationListener() { return new CreationListener() { public void objectCreated(final CreationEvent e) {} public void objectReceived(final CreationEvent e) { controller.reloadMainBrowserAvatar(); } public void objectVersionCreated(final VersionCreationEvent e) { controller.reloadMainBrowserAvatar(); } public void objectVersionReceived(VersionCreationEvent e) {} }; }
public void objectVersionReceived(VersionCreationEvent e) {}
public void objectVersionReceived(final VersionCreationEvent e) { controller.reloadMainBrowserAvatar(); }
public void objectVersionReceived(VersionCreationEvent e) {}
public void objectReceived(final UpdateEvent e) {}
public void objectReceived(final UpdateEvent e) { controller.reloadMainBrowserAvatar(); }
private UpdateListener createDocumentModelUpdateListener() { return new UpdateListener() { public void objectDeleted(final DeleteEvent e) { controller.reloadMainBrowserAvatar(); } public void objectReceived(final UpdateEvent e) {} public void objectUpdated(final UpdateEvent e) { controller.reloadMainBrowserAvatar(); } }; }
public void objectReceived(final UpdateEvent e) {}
public void objectReceived(final UpdateEvent e) { controller.reloadMainBrowserAvatar(); }
public void objectReceived(final UpdateEvent e) {}
public void keyRequestAccepted(final KeyEvent e) {} public void keyRequestDenied(final KeyEvent e) {} public void keyRequested(final KeyEvent e) {}
public void keyRequestAccepted(final KeyEvent e) { controller.reloadMainBrowserAvatar(); } public void keyRequestDenied(final KeyEvent e) { controller.reloadMainBrowserAvatar(); } public void keyRequested(final KeyEvent e) { controller.reloadMainBrowserAvatar(); }
private KeyListener createSessionModelKeyListener() { return new KeyListener() { public void keyRequestAccepted(final KeyEvent e) {} public void keyRequestDenied(final KeyEvent e) {} public void keyRequested(final KeyEvent e) {} }; }
public void keyRequestAccepted(final KeyEvent e) {}
public void keyRequestAccepted(final KeyEvent e) { controller.reloadMainBrowserAvatar(); }
public void keyRequestAccepted(final KeyEvent e) {}
public void keyRequestDenied(final KeyEvent e) {}
public void keyRequestDenied(final KeyEvent e) { controller.reloadMainBrowserAvatar(); }
public void keyRequestDenied(final KeyEvent e) {}
public void keyRequested(final KeyEvent e) {}
public void keyRequested(final KeyEvent e) { controller.reloadMainBrowserAvatar(); }
public void keyRequested(final KeyEvent e) {}
public void presenceRequested(final PresenceEvent e) {}
public void presenceRequested(final PresenceEvent e) { controller.reloadMainBrowserAvatar(); }
private PresenceListener createSessionModelPresenceListener() { return new PresenceListener() { public void presenceRequested(final PresenceEvent e) {} }; }
public void presenceRequested(final PresenceEvent e) {}
public void presenceRequested(final PresenceEvent e) { controller.reloadMainBrowserAvatar(); }
public void presenceRequested(final PresenceEvent e) {}
public void addListener(final PresenceListener presenceListener) { synchronized(implLock) { impl.addListener(presenceListener); }
public void addListener(final KeyListener keyListener) { synchronized(implLock) { impl.addListener(keyListener); }
public void addListener(final PresenceListener presenceListener) { synchronized(implLock) { impl.addListener(presenceListener); } }
initFocusListeners();
public ContainerVersionsPanel(final ContainerModel model) { super(); this.documentVersions = new HashMap<ContainerVersion, List<DocumentVersion>>(); this.model = model; this.publishedBy = new HashMap<ContainerVersion, User>(); this.users = new HashMap<ContainerVersion, Map<User, ArtifactReceipt>>(); this.versions = new ArrayList<ContainerVersion>(); this.versionsModel = new DefaultListModel(); this.versionsContentModel = new DefaultListModel(); this.imageCacheTest = new MainCellImageCacheTest(); initComponents(); }
javax.swing.JScrollPane versionsJScrollPane;
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; javax.swing.JScrollPane versionsContentJScrollPane; versionsJSplitPane = new javax.swing.JSplitPane(); leftJPanel = new javax.swing.JPanel(); versionsJScrollPane = new javax.swing.JScrollPane(); versionsJList = new javax.swing.JList(); rightJPanel = new javax.swing.JPanel(); versionsContentJScrollPane = new javax.swing.JScrollPane(); versionsContentJList = new javax.swing.JList(); setLayout(new java.awt.GridBagLayout()); setOpaque(false); versionsJSplitPane.setBorder(null); versionsJSplitPane.setDividerSize(0); versionsJSplitPane.setResizeWeight(0.5); versionsJSplitPane.setMinimumSize(new java.awt.Dimension(52, 75)); leftJPanel.setLayout(new java.awt.GridBagLayout()); leftJPanel.setBackground(new java.awt.Color(255, 255, 255)); leftJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { leftJPanelMouseClicked(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { leftJPanelMousePressed(evt); } }); versionsJScrollPane.setBorder(null); versionsJList.setModel(versionsModel); versionsJList.setCellRenderer(new VersionCellRenderer()); versionsJList.setVisibleRowCount(5); versionsJList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { versionsJListValueChanged(evt); } }); versionsJList.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { versionsJListMouseClicked(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { versionsJListMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { versionsJListMouseReleased(evt); } }); versionsJScrollPane.setViewportView(versionsJList); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(3, 4, 4, 1); leftJPanel.add(versionsJScrollPane, gridBagConstraints); versionsJSplitPane.setLeftComponent(leftJPanel); rightJPanel.setLayout(new java.awt.GridBagLayout()); rightJPanel.setBackground(new java.awt.Color(255, 255, 255)); rightJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { rightJPanelMouseClicked(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { rightJPanelMousePressed(evt); } }); versionsContentJScrollPane.setBorder(null); versionsContentJList.setModel(versionsContentModel); versionsContentJList.setCellRenderer(new VersionContentCellRenderer()); versionsContentJList.setVisibleRowCount(5); versionsContentJList.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { versionsContentJListMouseClicked(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { versionsContentJListMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { versionsContentJListMouseReleased(evt); } }); versionsContentJScrollPane.setViewportView(versionsContentJList); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(3, 1, 4, 4); rightJPanel.add(versionsContentJScrollPane, gridBagConstraints); versionsJSplitPane.setRightComponent(rightJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(versionsJSplitPane, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
rightJPanelMouseClicked(evt);
leftJPanelMouseClicked(evt);
public void mouseClicked(java.awt.event.MouseEvent evt) { rightJPanelMouseClicked(evt); }
rightJPanelMousePressed(evt);
leftJPanelMousePressed(evt);
public void mousePressed(java.awt.event.MouseEvent evt) { rightJPanelMousePressed(evt); }
rightJPanel.setBackground(color); if (versionsJSplitPane.getSize().getWidth() > 0 ){ versionsJSplitPane.setDividerLocation(0.5); }
rightJPanel.setBackground(color);
public void prepareForRepaint() { // Set background colour final Color color = getBackgroundColor(); leftJPanel.setBackground(color); rightJPanel.setBackground(color); // Make sure the split pane remains in a 50/50 split if (versionsJSplitPane.getSize().getWidth() > 0 ){ versionsJSplitPane.setDividerLocation(0.5); } }
this.browser.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.BrowserMnemonic").charAt(0)));
this.browser.putValue(Action.MNEMONIC_KEY, Integer.valueOf(getString("Menu.BrowserMnemonic").charAt(0)));
TrayMenuBuilder(final SystemApplication application) { super(); this.application = application; this.browser = new AbstractAction(getString("Menu.Browser")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runRestoreBrowser(); }}; this.browser.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.BrowserMnemonic").charAt(0))); if(application.isDevelopmentMode()) { this.restart = new AbstractAction(getString("Menu.Restart")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runRestartPlatform(); } }; this.restart.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.RestartMnemonic").charAt(0))); } else { this.restart = null; } this.exit = new AbstractAction(getString("Menu.Exit")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runExitPlatform(); }}; this.exit.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.ExitMnemonic").charAt(0))); }
this.restart.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.RestartMnemonic").charAt(0)));
this.restart.putValue(Action.MNEMONIC_KEY, Integer.valueOf(getString("Menu.RestartMnemonic").charAt(0)));
TrayMenuBuilder(final SystemApplication application) { super(); this.application = application; this.browser = new AbstractAction(getString("Menu.Browser")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runRestoreBrowser(); }}; this.browser.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.BrowserMnemonic").charAt(0))); if(application.isDevelopmentMode()) { this.restart = new AbstractAction(getString("Menu.Restart")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runRestartPlatform(); } }; this.restart.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.RestartMnemonic").charAt(0))); } else { this.restart = null; } this.exit = new AbstractAction(getString("Menu.Exit")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runExitPlatform(); }}; this.exit.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.ExitMnemonic").charAt(0))); }
this.exit.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.ExitMnemonic").charAt(0)));
this.exit.putValue(Action.MNEMONIC_KEY, Integer.valueOf(getString("Menu.ExitMnemonic").charAt(0)));
TrayMenuBuilder(final SystemApplication application) { super(); this.application = application; this.browser = new AbstractAction(getString("Menu.Browser")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runRestoreBrowser(); }}; this.browser.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.BrowserMnemonic").charAt(0))); if(application.isDevelopmentMode()) { this.restart = new AbstractAction(getString("Menu.Restart")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runRestartPlatform(); } }; this.restart.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.RestartMnemonic").charAt(0))); } else { this.restart = null; } this.exit = new AbstractAction(getString("Menu.Exit")) { private static final long serialVersionUID = 1; public void actionPerformed(final ActionEvent e) { application.runExitPlatform(); }}; this.exit.putValue(Action.MNEMONIC_KEY, new Integer(getString("Menu.ExitMnemonic").charAt(0))); }
return (ActionMessages)request.getAttribute(Globals.MESSAGE_KEY);
ActionMessages messages = new ActionMessages(); HttpSession session = request.getSession(false); if (session != null) { ActionMessages sessionMessages = (ActionMessages)session.getAttribute(Globals.MESSAGE_KEY); if (sessionMessages != null) { messages.add(sessionMessages); } } ActionMessages requestMessages = (ActionMessages)request.getAttribute(Globals.MESSAGE_KEY); if (requestMessages != null) { messages.add(requestMessages); } return messages;
public static ActionMessages getMessages(HttpServletRequest request) { return (ActionMessages)request.getAttribute(Globals.MESSAGE_KEY); }
version.setMetaData(artifactIO.getVersionMetaData(session, version.getArtifactId(), version.getVersionId()));
version.setMetaData(getVersionMetaData(version.getArtifactId(), version.getVersionId()));
ContainerVersion extractVersion(final Session session) { final ContainerVersion version = new ContainerVersion(); version.setArtifactId(session.getLong("CONTAINER_ID")); version.setArtifactType(session.getTypeFromInteger("ARTIFACT_TYPE_ID")); version.setArtifactUniqueId(session.getUniqueId("ARTIFACT_UNIQUE_ID")); version.setCreatedBy(session.getString("CREATED_BY")); version.setCreatedOn(session.getCalendar("CREATED_ON")); version.setName(session.getString("ARTIFACT_NAME")); version.setUpdatedBy(session.getString("UPDATED_BY")); version.setUpdatedOn(session.getCalendar("UPDATED_ON")); version.setVersionId(session.getLong("CONTAINER_VERSION_ID")); version.setMetaData(artifactIO.getVersionMetaData(session, version.getArtifactId(), version.getVersionId())); return version; }
public ValueParser(Map source) { setSource(source); }
public ValueParser() {}
public ValueParser(Map source) { setSource(source); }
public boolean getBoolean(String key, boolean alternate)
public Boolean getBoolean(String key)
public boolean getBoolean(String key, boolean alternate) { Boolean bool = getBoolean(key); return (bool != null) ? bool.booleanValue() : alternate; }
Boolean bool = getBoolean(key); return (bool != null) ? bool.booleanValue() : alternate;
String s = getString(key); return (s != null) ? parseBoolean(s) : null;
public boolean getBoolean(String key, boolean alternate) { Boolean bool = getBoolean(key); return (bool != null) ? bool.booleanValue() : alternate; }
public Alternator(boolean auto, List list)
public Alternator(List list)
public Alternator(boolean auto, List list) { this(auto, list.toArray(new Object[list.size()])); }
this(auto, list.toArray(new Object[list.size()]));
this(true, list);
public Alternator(boolean auto, List list) { this(auto, list.toArray(new Object[list.size()])); }
velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, ServletLogger.class.getName());
try { ExtendedProperties defaultProperties = loadDefaultProperties(); velocity.setExtendedProperties(defaultProperties); } catch(Exception e) { log("VelocityViewServlet: Unable to read Velocity Servlet configuration file: ", e);
protected void initVelocity(ServletConfig config) throws ServletException { velocity = new VelocityEngine(); setVelocityEngine(velocity); // register this engine to be the default handler of log messages // if the user points commons-logging to the LogSystemCommonsLog LogSystemCommonsLog.setVelocityEngine(velocity); velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext()); // default to servletlogger, which logs to the servlet engines log velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, ServletLogger.class.getName()); // by default, load resources with webapp resource loader velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "webapp"); velocity.setProperty("webapp.resource.loader.class", WebappLoader.class.getName()); // Try reading an overriding Velocity configuration try { ExtendedProperties p = loadConfiguration(config); velocity.setExtendedProperties(p); } catch(Exception e) { getServletContext().log("VelocityViewServlet: Unable to read Velocity configuration file: "+e); getServletContext().log("VelocityViewServlet: Using default Velocity configuration."); } // now all is ready - init Velocity try { velocity.init(); } catch(Exception e) { getServletContext().log("VelocityViewServlet: PANIC! unable to init() - "+e); throw new ServletException(e); } }
velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "webapp"); velocity.setProperty("webapp.resource.loader.class", WebappLoader.class.getName());
throw new ServletException(e); }
protected void initVelocity(ServletConfig config) throws ServletException { velocity = new VelocityEngine(); setVelocityEngine(velocity); // register this engine to be the default handler of log messages // if the user points commons-logging to the LogSystemCommonsLog LogSystemCommonsLog.setVelocityEngine(velocity); velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext()); // default to servletlogger, which logs to the servlet engines log velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, ServletLogger.class.getName()); // by default, load resources with webapp resource loader velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "webapp"); velocity.setProperty("webapp.resource.loader.class", WebappLoader.class.getName()); // Try reading an overriding Velocity configuration try { ExtendedProperties p = loadConfiguration(config); velocity.setExtendedProperties(p); } catch(Exception e) { getServletContext().log("VelocityViewServlet: Unable to read Velocity configuration file: "+e); getServletContext().log("VelocityViewServlet: Using default Velocity configuration."); } // now all is ready - init Velocity try { velocity.init(); } catch(Exception e) { getServletContext().log("VelocityViewServlet: PANIC! unable to init() - "+e); throw new ServletException(e); } }
getServletContext().log("VelocityViewServlet: Unable to read Velocity configuration file: "+e); getServletContext().log("VelocityViewServlet: Using default Velocity configuration.");
log("VelocityViewServlet: Unable to read Velocity configuration file: ", e); log("VelocityViewServlet: Using default Velocity configuration.");
protected void initVelocity(ServletConfig config) throws ServletException { velocity = new VelocityEngine(); setVelocityEngine(velocity); // register this engine to be the default handler of log messages // if the user points commons-logging to the LogSystemCommonsLog LogSystemCommonsLog.setVelocityEngine(velocity); velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext()); // default to servletlogger, which logs to the servlet engines log velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, ServletLogger.class.getName()); // by default, load resources with webapp resource loader velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "webapp"); velocity.setProperty("webapp.resource.loader.class", WebappLoader.class.getName()); // Try reading an overriding Velocity configuration try { ExtendedProperties p = loadConfiguration(config); velocity.setExtendedProperties(p); } catch(Exception e) { getServletContext().log("VelocityViewServlet: Unable to read Velocity configuration file: "+e); getServletContext().log("VelocityViewServlet: Using default Velocity configuration."); } // now all is ready - init Velocity try { velocity.init(); } catch(Exception e) { getServletContext().log("VelocityViewServlet: PANIC! unable to init() - "+e); throw new ServletException(e); } }
getServletContext().log("VelocityViewServlet: PANIC! unable to init() - "+e);
log("VelocityViewServlet: PANIC! unable to init()", e);
protected void initVelocity(ServletConfig config) throws ServletException { velocity = new VelocityEngine(); setVelocityEngine(velocity); // register this engine to be the default handler of log messages // if the user points commons-logging to the LogSystemCommonsLog LogSystemCommonsLog.setVelocityEngine(velocity); velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext()); // default to servletlogger, which logs to the servlet engines log velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, ServletLogger.class.getName()); // by default, load resources with webapp resource loader velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "webapp"); velocity.setProperty("webapp.resource.loader.class", WebappLoader.class.getName()); // Try reading an overriding Velocity configuration try { ExtendedProperties p = loadConfiguration(config); velocity.setExtendedProperties(p); } catch(Exception e) { getServletContext().log("VelocityViewServlet: Unable to read Velocity configuration file: "+e); getServletContext().log("VelocityViewServlet: Using default Velocity configuration."); } // now all is ready - init Velocity try { velocity.init(); } catch(Exception e) { getServletContext().log("VelocityViewServlet: PANIC! unable to init() - "+e); throw new ServletException(e); } }
protected String createFailMessage(final Throwable t) { return createFailMessage(getName(), t); }
protected String createFailMessage(final Object message, final Throwable t) { return new StringBuffer() .append(message).append(Separator.SystemNewLine) .append(TestCaseHelper.createFailMessage(t)).toString(); }
protected String createFailMessage(final Throwable t) { return createFailMessage(getName(), t); }
return pathname.isFile();
return !illegalResources.contains(pathname.getName());
public boolean accept(final File pathname) { return pathname.isFile(); }
final File[] resourceFiles = fileSystem.list("/", RESOURCE_FILE_FILTER);
final File[] resourceFiles = fileSystem.list("/", RESOURCE_FILTER);
private List<URL> getResources() throws IOException { final List<URL> resources = new ArrayList<URL>(); final File[] resourceFiles = fileSystem.list("/", RESOURCE_FILE_FILTER); for (final File resourceFile : resourceFiles) { resources.add(resourceFile.toURL()); } return resources; }
public File[] list(final String path, final Boolean doRecurse) { final File file = resolve(path); if(null == file) { return null; } if(file.isFile()) { return null; } if(doRecurse) { return list(file).toArray(new File[] {}); } else { return file.listFiles(); } }
public File[] list(final String path) { return list(path, Boolean.FALSE); }
public File[] list(final String path, final Boolean doRecurse) { final File file = resolve(path); if(null == file) { return null; } if(file.isFile()) { return null; } if(doRecurse) { return list(file).toArray(new File[] {}); } else { return file.listFiles(); } }
return PluginException.translate(errorId.toString(), t);
return PluginException.translate(errorId, t);
protected PluginException translateError(final Throwable t) { if (PluginException.class.isAssignableFrom(t.getClass())) { return (PluginException) t; } else { final String errorId = new ErrorHelper().getErrorId(t); logger.logError(t, errorId); return PluginException.translate(errorId.toString(), t); } }
public AcceptInvitation() { super("AcceptInvitation", ID, NAME, ICON); }
public AcceptInvitation(final Browser browser) { super("AcceptInvitation", ID, NAME, ICON); this.browser = browser; }
public AcceptInvitation() { super("AcceptInvitation", ID, NAME, ICON); }
try { final SystemMessageModel sMModel = getSystemMessageModel(); final ContactInvitationMessage message = (ContactInvitationMessage) sMModel.read(messageId); getSessionModel().acceptInvitation(message.getInvitedBy()); sMModel.delete(messageId); } catch(final ParityException px) { throw new RuntimeException(px); }
final SystemMessageModel sMModel = getSystemMessageModel(); final ContactInvitationMessage message = (ContactInvitationMessage) sMModel.read(messageId); getSessionModel().acceptInvitation(message.getInvitedBy()); sMModel.delete(messageId); browser.fireSystemMessageDeleted(messageId);
public void invoke(final Data data) throws Exception { final Long messageId = (Long) data.get(DataKey.SYSTEM_MESSAGE_ID); try { final SystemMessageModel sMModel = getSystemMessageModel(); final ContactInvitationMessage message = (ContactInvitationMessage) sMModel.read(messageId); getSessionModel().acceptInvitation(message.getInvitedBy()); sMModel.delete(messageId); } catch(final ParityException px) { throw new RuntimeException(px); } }
public void open() {
public void open() throws IOException {
public void open() { connect(Type.DOWNSTREAM); }
write(new StreamHeader(StreamHeader.Type.STREAM_BEGIN, streamId));
write(new StreamHeader(StreamHeader.Type.STREAM_ID, streamId));
public void read(final String streamId, final OutputStream stream) { write(new StreamHeader(StreamHeader.Type.STREAM_BEGIN, streamId)); read(stream); }
logVariable("profile", read(readJabberId("userId")));
logger.logVariable("profile", read(readJabberId("userId")));
public void service() { logApiId(); final Profile profile = logVariable("profile", read(readJabberId("userId"))); if(null != profile) { writeJabberId("id", profile.getId()); writeString("name", profile.getName()); if (profile.isSetOrganization()) writeString("organization", profile.getOrganization()); if (profile.isSetTitle()) writeString("title", profile.getTitle()); } }
protected String createFailMessage(Throwable t) { testLogger.error("Failure", t);
protected String createFailMessage(final Throwable t) { logger.logFatal(t, "Test {0} failed.", getName());
protected String createFailMessage(Throwable t) { testLogger.error("Failure", t); return super.createFailMessage(t); }
testLogger.warn("[PARITY] Running test on un-supported platform.");
logger.logWarning("Running test on un-supported platform.");
protected boolean isNYIAOnLinux(final Throwable t) { Throwable cause = t.getCause(); while(null != cause) { if(NotYetImplementedAssertion.class.isAssignableFrom(cause.getClass())) { switch(OSUtil.getOS()) { case LINUX: testLogger.warn("[PARITY] Running test on un-supported platform."); return true; } } cause = cause.getCause(); } return false; }
if (-1 != mouseOverIndex) { updateCellMouseOver(mouseOverIndex, Boolean.FALSE); mouseOverIndex = -1;
if (!isResizeDragging()) { if (-1 != mouseOverIndex) { updateCellMouseOver(mouseOverIndex, Boolean.FALSE); mouseOverIndex = -1; }
public void mouseExited(final MouseEvent e) { if (-1 != mouseOverIndex) { updateCellMouseOver(mouseOverIndex, Boolean.FALSE); mouseOverIndex = -1; } }
final int mouseOverIndex = getMouseOverIndex(e); if (mouseOverIndex != this.mouseOverIndex) { if (-1 != this.mouseOverIndex) { updateCellMouseOver(this.mouseOverIndex, Boolean.FALSE);
if (!isResizeDragging()) { final int mouseOverIndex = getMouseOverIndex(e); if (mouseOverIndex != this.mouseOverIndex) { if (-1 != this.mouseOverIndex) { updateCellMouseOver(this.mouseOverIndex, Boolean.FALSE); } if (-1 != mouseOverIndex) { updateCellMouseOver(mouseOverIndex, Boolean.TRUE); } this.mouseOverIndex = mouseOverIndex;
public void mouseMoved(MouseEvent e) { final int mouseOverIndex = getMouseOverIndex(e); if (mouseOverIndex != this.mouseOverIndex) { if (-1 != this.mouseOverIndex) { updateCellMouseOver(this.mouseOverIndex, Boolean.FALSE); } if (-1 != mouseOverIndex) { updateCellMouseOver(mouseOverIndex, Boolean.TRUE); } this.mouseOverIndex = mouseOverIndex; } }
if (-1 != mouseOverIndex) { updateCellMouseOver(mouseOverIndex, Boolean.TRUE); } this.mouseOverIndex = mouseOverIndex;
public void mouseMoved(MouseEvent e) { final int mouseOverIndex = getMouseOverIndex(e); if (mouseOverIndex != this.mouseOverIndex) { if (-1 != this.mouseOverIndex) { updateCellMouseOver(this.mouseOverIndex, Boolean.FALSE); } if (-1 != mouseOverIndex) { updateCellMouseOver(mouseOverIndex, Boolean.TRUE); } this.mouseOverIndex = mouseOverIndex; } }
final DocumentVersion dv_odt_latest = readDocumentLatestVersion(datum.junit, d_odt.getId()); final InputStream dv_odt_latest_stream = getDocumentModel(datum.junit).openVersionStream(d_odt.getId(), dv_odt_latest.getVersionId()); getDocumentModel(datum.junit).open(d_odt.getId(), new Opener() { public void open(final File file) { try { final InputStream d_odt_stream = new FileInputStream(file); assertEquals("Reverted document's content does not match expectation.", d_odt_stream, dv_odt_latest_stream); } catch (final IOException iox) { fail(createFailMessage(iox)); } } });
public void testRestore() { // create a container; add two documents and publish final Container c = createContainer(datum.junit, NAME); final Document d_odt = addDocument(datum.junit, c.getId(), "JUnitTestFramework.odt"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.txt"); publishToContacts(datum.junit, c.getId(), "JUnit.X thinkParity", "JUnit.Y thinkParity"); datum.waitForEvents(); // create draft; remove first document; revert first document createDraft(datum.junit, c.getId()); removeDocument(datum.junit, c.getId(), d_odt.getId()); revertDocument(datum.junit, c.getId(), d_odt.getId()); }
protected static void assertNotNull(final String assertion, final List<Container> containers) { assertNotNull(assertion + " [CONTAINERS IS NULL]", (Object) containers); for(final Container container : containers) { assertNotNull(assertion, container);
protected static void assertNotNull(final String assertion, final ContainerDraft draft) { assertNotNull(assertion + " [DRAFT IS NULL]", (Object) draft); assertNotNull(assertion + " [DRAFT ID IS NULL]", draft.getContainerId()); assertNotNull(assertion + " [DRAFT ARTIFACTS ARE IS NULL]", draft.getArtifacts()); for(final Artifact artifact : draft.getArtifacts()) { assertNotNull(assertion + " [DRAFT ARTIFACT STATE IS NULL]", draft.getState(artifact));
protected static void assertNotNull(final String assertion, final List<Container> containers) { assertNotNull(assertion + " [CONTAINERS IS NULL]", (Object) containers); for(final Container container : containers) { assertNotNull(assertion, container); } }
assertNotNull(assertion + " [DRAFT OWNER IS NULL]", draft.getOwner());
protected static void assertNotNull(final String assertion, final List<Container> containers) { assertNotNull(assertion + " [CONTAINERS IS NULL]", (Object) containers); for(final Container container : containers) { assertNotNull(assertion, container); } }
NameComparator(final Boolean doCompareAscending) { super(doCompareAscending); this.comparator = new StringComparator(doCompareAscending);
NameComparator(final Boolean ascending) { super(); this.comparator = new StringComparator(ascending);
NameComparator(final Boolean doCompareAscending) { super(doCompareAscending); this.comparator = new StringComparator(doCompareAscending); }
configureGlobal(log4jProperties);
private static void configure() { synchronized(configureLock) { if(Boolean.FALSE == isConfigured) { final Properties log4jProperties = new Properties(); log4jProperties.setProperty("log4j.threshold", "debug"); log4jProperties.setProperty("log4j.rootLogger", "debug, broswerHTML, console"); configureGlobal(log4jProperties); configureRenderers(log4jProperties); final ModelFactory modelFactory = ModelFactory.getInstance(); configureBrowserHTMLAppender(log4jProperties, modelFactory.getWorkspace(LoggerFactory.class)); configureConsoleAppender(log4jProperties); PropertyConfigurator.configure(log4jProperties); isConfigured = Boolean.TRUE; } } }
avatar.setRoundCorners(Boolean.TRUE);
protected void initComponents(final Avatar avatar) { avatar.reload(); windowPanel = new WindowPanel(); windowPanel.addPanel(avatar); add(windowPanel); // Install the resizer here; if done earlier then the resizer // can't successfully get the window ancestor. avatar.installResizer(); avatar.setRoundCorners(Boolean.TRUE); }
this.logger = new Log4JWrapper();
public JFrameLocalization(final String l18nContext) { super(); this.bundleHelper = new ResourceBundleHelper(RESOURCE_BUNDLE, l18nContext); }
add(new WindowTitle(avatar.getAvatarTitle()), c.clone());
if (avatar.isAvatarTitle()) { add(new WindowTitle(avatar.getAvatarTitle()), c.clone()); }
void addPanel(final Avatar avatar) { final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; add(new WindowTitle(avatar.getAvatarTitle()), c.clone()); jPanels.add(avatar); ac.gridy++; add((Component) avatar, ac.clone()); }
if (0 == i) { toString.append(memberData[i]).append(":"); continue;
toString.append(null == memberData[i] ? Separator.Null : memberData[i]); if (0 == i % 2) { toString.append(":"); if (i + 1 >= memberData.length) { toString.append(Separator.Null); }
public static String toString(final Class type, final Object... memberData) { final StringBuffer toString = new StringBuffer(type.getName()) .append("$"); for (int i = 0; i < memberData.length; i++) { if (0 == i) { toString.append(memberData[i]).append(":"); continue; } if (0 == i % 2) { toString.append(","); } toString.append(memberData[i]); if (1 == i % 2) { toString.append(":"); } } return toString.toString(); }
if (0 == i % 2) { toString.append(","); } toString.append(memberData[i]); if (1 == i % 2) { toString.append(":");
else { if (i + 1 < memberData.length) { toString.append(","); }
public static String toString(final Class type, final Object... memberData) { final StringBuffer toString = new StringBuffer(type.getName()) .append("$"); for (int i = 0; i < memberData.length; i++) { if (0 == i) { toString.append(memberData[i]).append(":"); continue; } if (0 == i % 2) { toString.append(","); } toString.append(memberData[i]); if (1 == i % 2) { toString.append(":"); } } return toString.toString(); }
final DocumentVersion latestVersion = readLatestVersion(documentId); if (null == latestVersion) {
final List<DocumentVersion> versions = listVersions(documentId); if (0 == versions.size()) {
Boolean isDraftModified(final Long documentId) { logger.info(getApiId("[IS DRAFT MODIFIED]")); logger.debug(documentId); try { final DocumentVersion latestVersion = readLatestVersion(documentId); if (null == latestVersion) { return Boolean.TRUE; } else { final Document document = read(documentId); final LocalFile localFile = getLocalFile(document); localFile.read(); final String draftChecksum = localFile.getFileChecksum(); return !latestVersion.getChecksum().equals(draftChecksum); } } catch (final Throwable t) { throw translateError("[IS DRAFT MODIFIED]", t); } }
return !latestVersion.getChecksum().equals(draftChecksum);
return !versions.get(versions.size() - 1).getChecksum().equals(draftChecksum);
Boolean isDraftModified(final Long documentId) { logger.info(getApiId("[IS DRAFT MODIFIED]")); logger.debug(documentId); try { final DocumentVersion latestVersion = readLatestVersion(documentId); if (null == latestVersion) { return Boolean.TRUE; } else { final Document document = read(documentId); final LocalFile localFile = getLocalFile(document); localFile.read(); final String draftChecksum = localFile.getFileChecksum(); return !latestVersion.getChecksum().equals(draftChecksum); } } catch (final Throwable t) { throw translateError("[IS DRAFT MODIFIED]", t); } }
void create(final Long artifactId, final String artifactName)
void create(final Long documentId, final String documentName)
void create(final Long artifactId, final String artifactName) throws ParityException { getInternalIndexModel().createArtifact(artifactId, artifactName); }
getInternalIndexModel().createArtifact(artifactId, artifactName);
getInternalIndexModel().createDocument(documentId, documentName);
void create(final Long artifactId, final String artifactName) throws ParityException { getInternalIndexModel().createArtifact(artifactId, artifactName); }
void delete(final Long id) throws ParityException { getInternalIndexModel().deleteArtifact(id);
void delete(final Long artifactId) throws ParityException { getInternalIndexModel().deleteArtifact(artifactId);
void delete(final Long id) throws ParityException { getInternalIndexModel().deleteArtifact(id); }
void fireSessionEstablished() { impl.fireUpdateTrayMenu(Boolean.TRUE); }
void fireSessionEstablished() { impl.reloadConnectionStatus(Platform.Connection.ONLINE); }
void fireSessionEstablished() { impl.fireUpdateTrayMenu(Boolean.TRUE); }
void fireSessionTerminated() { impl.fireUpdateTrayMenu(Boolean.FALSE); }
void fireSessionTerminated() { impl.reloadConnectionStatus(Platform.Connection.OFFLINE); }
void fireSessionTerminated() { impl.fireUpdateTrayMenu(Boolean.FALSE); }
bootstrapLogging();
public WorkspaceImpl(final File workspace) { super(); this.logger = Logger.getLogger(getClass()); this.workspace = initRoot(workspace); }
xmppSessionImpl = new XMPPSessionImpl();
xmppSessionImpl = new XMPPSessionImpl(XMPPSessionDebugger.class);
public void open() { listenersImpl = new ListenersImpl(this); listenersImpl.start(); preferencesImpl = new PreferencesImpl(this); preferencesImpl.load(); sessionManagerImpl = new SessionManagerImpl(this); sessionManagerImpl.start(); xmppSessionImpl = new XMPPSessionImpl(); shutdownHooks = new ArrayList<ShutdownHook>(); FileUtil.deleteTree(initChild(DirectoryNames.Workspace.TEMP)); }
private void enqueue(final IQ iq) throws ParityServerModelException {
private void enqueue(final JID jid, final IQ iq) throws ParityServerModelException {
private void enqueue(final IQ iq) throws ParityServerModelException { final QueueModel queueModel = QueueModel.getModel(session); queueModel.enqueue(iq.toXML()); }
queueModel.enqueue(iq.toXML());
queueModel.enqueue(jid, iq);
private void enqueue(final IQ iq) throws ParityServerModelException { final QueueModel queueModel = QueueModel.getModel(session); queueModel.enqueue(iq.toXML()); }
else { enqueue(iq); }
else { enqueue(jid, iq); }
protected void send(final JID jid, final IQ iq) throws ParityServerModelException, UnauthorizedException { logger.info("route(JID,IQ)"); logger.debug(jid); logger.debug(iq); if(isOnline(jid)) { logger.info("isOnline(jid)"); getSessionManager().getSession(jid).process(iq); } else { enqueue(iq); } }
protected void tearDown() throws Exception {}
protected void tearDown() throws Exception { super.tearDown(); }
protected void tearDown() throws Exception {}
ContainerEvent generate(final Container container) { return new ContainerEvent(source, container);
ContainerEvent generate(final ContainerDraft draft) { return new ContainerEvent(source, draft);
ContainerEvent generate(final Container container) { return new ContainerEvent(source, container); }
this(source, container, null, null);
this(source, container, null, null, null);
public ContainerEvent(final Source source, final Container container) { this(source, container, null, null); }
if (isExpanded(panel)) { browser.runApplyContainerFlagSeen( panel.getContainer().getId()); }
private TabPanel toDisplay( final Container container, final DraftView draftView, final ContainerVersion latestVersion, final List<ContainerVersion> versions, final Map<ContainerVersion, List<DocumentView>> documentViews, final Map<ContainerVersion, Map<User, ArtifactReceipt>> publishedTo, final Map<ContainerVersion, User> publishedBy, final List<TeamMember> team) { final ContainerPanel panel = new ContainerPanel(session); panel.setActionDelegate(actionDelegate); panel.setPanelData(container, readUser(container.getCreatedBy()), draftView, latestVersion, versions, documentViews, publishedTo, publishedBy, team); panel.setPopupDelegate(popupDelegate); panel.setExpanded(isExpanded(panel)); panel.setTabDelegate(this); return panel; }
logger.warn("Update is misleading. Only name, timestamp and flag information is being set.");
logger.warn("Update is misleading. Only name, state, timestamp and flag information is being set.");
public void update(final Document document) { logger.warn("Update is misleading. Only name, timestamp and flag information is being set."); final Session session = openSession(); try { artifactIO.setFlags(session, document.getId(), document.getFlags()); session.prepareStatement(SQL_UPDATE); session.setCalendar(1, document.getUpdatedOn()); session.setString(2, document.getName()); session.setLong(3, document.getId()); if(1 != session.executeUpdate()) throw new HypersonicException("Could not update document."); session.commit(); } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } }
session.setLong(3, document.getId());
session.setStateAsInteger(3, document.getState()); session.setLong(4, document.getId());
public void update(final Document document) { logger.warn("Update is misleading. Only name, timestamp and flag information is being set."); final Session session = openSession(); try { artifactIO.setFlags(session, document.getId(), document.getFlags()); session.prepareStatement(SQL_UPDATE); session.setCalendar(1, document.getUpdatedOn()); session.setString(2, document.getName()); session.setLong(3, document.getId()); if(1 != session.executeUpdate()) throw new HypersonicException("Could not update document."); session.commit(); } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } }
containerIO.updateComment(containerId, version.getVersionId(), event.getComment());
if (null != event.getComment() && 0 < event.getComment().trim().length()) containerIO.updateComment(containerId, version.getVersionId(), event.getComment());
void handlePublished(final ContainerPublishedEvent event) { logger.logApiId(); logger.logVariable("event", event); try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(event.getUniqueId()); // 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 : event.getPublishedTo()) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId); } publishedToUsers.add(userModel.read(publishedToId)); } // add the sender as well if (!contains(localTeam, event.getPublishedBy())) { artifactModel.addTeamMember(containerId, event.getPublishedBy()); } // delete draft final ContainerDraft draft = readDraft(containerId); if (null == draft) { logger.logWarning("Draft did not previously exist for {0}.", event.getName()); } else { for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); } // create published to list containerIO.createPublishedTo(containerId, event.getVersionId(), publishedToUsers); // calculate differences final ContainerVersion version = readVersion(containerId, event.getVersionId()); final ContainerVersion previous = readPreviousVersion(containerId, event.getVersionId()); final ContainerVersion next = readNextVersion(containerId, event.getVersionId()); if (null == previous) { logger.logInfo("First version of {0}.", event.getName()); } else { containerIO.deleteDelta(containerId, previous.getVersionId(), version.getVersionId()); containerIO.createDelta(calculateDelta(read(containerId), previous, version)); } if (null == next) { logger.logInfo("Latest version of {0}.", event.getName()); } else { containerIO.deleteDelta(containerId, version.getVersionId(), next.getVersionId()); containerIO.createDelta(calculateDelta(read(containerId), version, next)); } // apply comment containerIO.updateComment(containerId, version.getVersionId(), event.getComment()); // send confirmation getSessionModel().confirmArtifactReceipt(localUserId(), event.getUniqueId(), event.getVersionId(), localUserId(), currentDateTime()); // audit\fire event final Container postPublish = read(containerId); final ContainerDraft postPublishDraft = readDraft(containerId); final ContainerVersion postPublishVersion = readVersion(containerId, event.getVersionId()); auditContainerPublished(postPublish, postPublishDraft, postPublishVersion, event.getPublishedBy(), event.getPublishedTo(), event.getPublishedOn()); notifyContainerPublished(postPublish, postPublishDraft, postPublishVersion, remoteEventGenerator); } catch (final Throwable t) { throw translateError(t); } }
triggerExpand(mainCell);
void triggerDoubleClick(final MainCell mainCell) { debug(); }
"./src/test-config/repository/repository/nodetypes/custom_nodetypes.xml");
"./src/test-config/nodetypes/custom_nodetypes.xml");
protected void registerNodeTypes(Session session) throws InvalidNodeTypeDefException, javax.jcr.RepositoryException, IOException { InputStream xml = new FileInputStream( "./src/test-config/repository/repository/nodetypes/custom_nodetypes.xml"); // HINT: throws InvalidNodeTypeDefException, IOException NodeTypeDef[] types = NodeTypeReader.read(xml); Workspace workspace = session.getWorkspace(); NodeTypeManager ntMgr = workspace.getNodeTypeManager(); NodeTypeRegistry ntReg = ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry(); for (int j = 0; j < types.length; j++) { NodeTypeDef def = types[j]; try { ntReg.getNodeTypeDef(def.getName()); } catch (NoSuchNodeTypeException nsne) { // HINT: if not already registered than register custom node type ntReg.registerNodeType(def); } } }
public DigesterMapperImpl(String[] files) { this.mappingFiles = files;
public DigesterMapperImpl() {
public DigesterMapperImpl(String[] files) { this.mappingFiles = files; }
documentIO.updateContent(content);
final LocalFile localFile = getLocalFile(document); localFile.delete(); localFile.write(content.getContent());
private void receiveUpdate(final XMPPDocument xmppDocument, final Document document) throws FileNotFoundException, IOException, ParityException { final DocumentVersion version = new DocumentVersion(); version.setArtifactId(document.getId()); version.setArtifactType(document.getType()); version.setArtifactUniqueId(document.getUniqueId()); version.setCreatedBy(xmppDocument.getCreatedBy()); version.setCreatedOn(xmppDocument.getCreatedOn()); version.setName(document.getName()); version.setUpdatedBy(xmppDocument.getUpdatedBy()); version.setUpdatedOn(xmppDocument.getUpdatedOn()); version.setVersionId(xmppDocument.getVersionId()); final DocumentContent content = new DocumentContent(); content.setChecksum(MD5Util.md5Hex(xmppDocument.getContent())); content.setContent(xmppDocument.getContent()); content.setDocumentId(version.getArtifactId()); final DocumentVersionContent versionContent = new DocumentVersionContent(); versionContent.setDocumentContent(content); versionContent.setDocumentId(version.getArtifactId()); versionContent.setVersionId(version.getVersionId()); insertVersion(version.getArtifactId(), version, versionContent); if(isLatestLocalVersion(version)) { document.setUpdatedBy(xmppDocument.getUpdatedBy()); document.setUpdatedOn(xmppDocument.getUpdatedOn()); documentIO.update(document); documentIO.updateContent(content); } // flag the document flagAsNotSEEN(document); // notify notifyUpdate_objectReceived(document); }
final InternalSessionModel iSModel = getInternalSessionModel(); if(!iSModel.isLoggedInUserKeyHolder(document.getId())) lock(document.getId());
private void receiveUpdate(final XMPPDocument xmppDocument, final Document document) throws FileNotFoundException, IOException, ParityException { final DocumentVersion version = new DocumentVersion(); version.setArtifactId(document.getId()); version.setArtifactType(document.getType()); version.setArtifactUniqueId(document.getUniqueId()); version.setCreatedBy(xmppDocument.getCreatedBy()); version.setCreatedOn(xmppDocument.getCreatedOn()); version.setName(document.getName()); version.setUpdatedBy(xmppDocument.getUpdatedBy()); version.setUpdatedOn(xmppDocument.getUpdatedOn()); version.setVersionId(xmppDocument.getVersionId()); final DocumentContent content = new DocumentContent(); content.setChecksum(MD5Util.md5Hex(xmppDocument.getContent())); content.setContent(xmppDocument.getContent()); content.setDocumentId(version.getArtifactId()); final DocumentVersionContent versionContent = new DocumentVersionContent(); versionContent.setDocumentContent(content); versionContent.setDocumentId(version.getArtifactId()); versionContent.setVersionId(version.getVersionId()); insertVersion(version.getArtifactId(), version, versionContent); if(isLatestLocalVersion(version)) { document.setUpdatedBy(xmppDocument.getUpdatedBy()); document.setUpdatedOn(xmppDocument.getUpdatedOn()); documentIO.update(document); documentIO.updateContent(content); } // flag the document flagAsNotSEEN(document); // notify notifyUpdate_objectReceived(document); }
applySize(content, 459);
applySize(content, 465);
private Display createContent() { if(null == content) { content = new ContentDisplay(); // HEIGHT ContentDisplay 459 applySize(content, 459); } return content; }
mainWindowSize = new Dimension(350, 550);
mainWindowSize = new Dimension(350, 556);
public static Dimension getMainWindowSize() { if(null == mainWindowSize) { // DIMENSION BrowserWindow 350x550 mainWindowSize = new Dimension(350, 550); } return mainWindowSize; }
if (!checkSessionTime(now)) { return; }
return;
public synchronized void next(Message message) throws FieldNotFound, RejectLogon, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, IOException, InvalidMessage { state.setConnected(true); Date now = new Date(); if (!checkSessionTime(now)) { reset(); if (!checkSessionTime(now)) { return; } } try { String msgType = message.getHeader().getString(MsgType.FIELD); String beginString = message.getHeader().getString(BeginString.FIELD); if (!beginString.equals(sessionID.getBeginString())) { throw new UnsupportedVersion(); } if (dataDictionary != null) { dataDictionary.validate(message); } if (msgType.equals(MsgType.LOGON)) { nextLogon(message); } else if (msgType.equals(MsgType.HEARTBEAT)) { nextHeartBeat(message); } else if (msgType.equals(MsgType.TEST_REQUEST)) { nextTestRequest(message); } else if (msgType.equals(MsgType.SEQUENCE_RESET)) { nextSequenceRequest(message); } else if (msgType.equals(MsgType.LOGOUT)) { nextLogout(message); } else if (msgType.equals(MsgType.RESEND_REQUEST)) { nextResendRequest(message); } else if (msgType.equals(MsgType.REJECT)) { nextReject(message); } else { if (!verify(message)) { return; } state.incrNextTargetMsgSeqNum(); } } catch (FieldException e) { generateReject(message, e.getSessionRejectReason(), e.getField()); } catch (FieldNotFound e) { generateReject(message, SessionRejectReason.REQUIRED_TAG_MISSING, e.field); } catch (InvalidMessageType e) { generateReject(message, SessionRejectReason.INVALID_MSGTYPE, 0); } catch (InvalidMessage e) { state.logEvent("Skipping invalid message: " + e.getMessage()); } catch (RejectLogon e) { // TODO TEST need a test for RejectLogon exception String rejectMessage = e.getMessage() != null ? (": " + e.getMessage()) : ""; state.getLog().onEvent("Logon rejected" + rejectMessage); disconnect(); } catch (UnsupportedMessageType e) { if (sessionID.getBeginString().compareTo(FixVersions.BEGINSTRING_FIX42) >= 0) { generateBusinessReject(message, BUSINESS_REJECT_UNSUPPORTED_MSG_TYPE); } else { generateReject(message, "Unsupported message type"); } } catch (UnsupportedVersion e) { String msgType = message.getHeader().getString(MsgType.FIELD); if (msgType.equals(MsgType.LOGOUT)) { nextLogout(message); } else { generateLogout("Incorrect BeginString"); state.incrNextTargetMsgSeqNum(); // 1d_InvalidLogonWrongBeginString.def appears to require // a disconnect although the C++ didn't appear to be doing it. // ??? disconnect(); } } catch (IOException e) { LogUtil.logThrowable(sessionID, "error processing message", e); } nextQueued(); next(); }
String msgType = message.getHeader().getString(MsgType.FIELD);
public synchronized void next(Message message) throws FieldNotFound, RejectLogon, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, IOException, InvalidMessage { state.setConnected(true); Date now = new Date(); if (!checkSessionTime(now)) { reset(); if (!checkSessionTime(now)) { return; } } try { String msgType = message.getHeader().getString(MsgType.FIELD); String beginString = message.getHeader().getString(BeginString.FIELD); if (!beginString.equals(sessionID.getBeginString())) { throw new UnsupportedVersion(); } if (dataDictionary != null) { dataDictionary.validate(message); } if (msgType.equals(MsgType.LOGON)) { nextLogon(message); } else if (msgType.equals(MsgType.HEARTBEAT)) { nextHeartBeat(message); } else if (msgType.equals(MsgType.TEST_REQUEST)) { nextTestRequest(message); } else if (msgType.equals(MsgType.SEQUENCE_RESET)) { nextSequenceRequest(message); } else if (msgType.equals(MsgType.LOGOUT)) { nextLogout(message); } else if (msgType.equals(MsgType.RESEND_REQUEST)) { nextResendRequest(message); } else if (msgType.equals(MsgType.REJECT)) { nextReject(message); } else { if (!verify(message)) { return; } state.incrNextTargetMsgSeqNum(); } } catch (FieldException e) { generateReject(message, e.getSessionRejectReason(), e.getField()); } catch (FieldNotFound e) { generateReject(message, SessionRejectReason.REQUIRED_TAG_MISSING, e.field); } catch (InvalidMessageType e) { generateReject(message, SessionRejectReason.INVALID_MSGTYPE, 0); } catch (InvalidMessage e) { state.logEvent("Skipping invalid message: " + e.getMessage()); } catch (RejectLogon e) { // TODO TEST need a test for RejectLogon exception String rejectMessage = e.getMessage() != null ? (": " + e.getMessage()) : ""; state.getLog().onEvent("Logon rejected" + rejectMessage); disconnect(); } catch (UnsupportedMessageType e) { if (sessionID.getBeginString().compareTo(FixVersions.BEGINSTRING_FIX42) >= 0) { generateBusinessReject(message, BUSINESS_REJECT_UNSUPPORTED_MSG_TYPE); } else { generateReject(message, "Unsupported message type"); } } catch (UnsupportedVersion e) { String msgType = message.getHeader().getString(MsgType.FIELD); if (msgType.equals(MsgType.LOGOUT)) { nextLogout(message); } else { generateLogout("Incorrect BeginString"); state.incrNextTargetMsgSeqNum(); // 1d_InvalidLogonWrongBeginString.def appears to require // a disconnect although the C++ didn't appear to be doing it. // ??? disconnect(); } } catch (IOException e) { LogUtil.logThrowable(sessionID, "error processing message", e); } nextQueued(); next(); }
nextSequenceRequest(message);
nextSequenceReset(message);
public synchronized void next(Message message) throws FieldNotFound, RejectLogon, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, IOException, InvalidMessage { state.setConnected(true); Date now = new Date(); if (!checkSessionTime(now)) { reset(); if (!checkSessionTime(now)) { return; } } try { String msgType = message.getHeader().getString(MsgType.FIELD); String beginString = message.getHeader().getString(BeginString.FIELD); if (!beginString.equals(sessionID.getBeginString())) { throw new UnsupportedVersion(); } if (dataDictionary != null) { dataDictionary.validate(message); } if (msgType.equals(MsgType.LOGON)) { nextLogon(message); } else if (msgType.equals(MsgType.HEARTBEAT)) { nextHeartBeat(message); } else if (msgType.equals(MsgType.TEST_REQUEST)) { nextTestRequest(message); } else if (msgType.equals(MsgType.SEQUENCE_RESET)) { nextSequenceRequest(message); } else if (msgType.equals(MsgType.LOGOUT)) { nextLogout(message); } else if (msgType.equals(MsgType.RESEND_REQUEST)) { nextResendRequest(message); } else if (msgType.equals(MsgType.REJECT)) { nextReject(message); } else { if (!verify(message)) { return; } state.incrNextTargetMsgSeqNum(); } } catch (FieldException e) { generateReject(message, e.getSessionRejectReason(), e.getField()); } catch (FieldNotFound e) { generateReject(message, SessionRejectReason.REQUIRED_TAG_MISSING, e.field); } catch (InvalidMessageType e) { generateReject(message, SessionRejectReason.INVALID_MSGTYPE, 0); } catch (InvalidMessage e) { state.logEvent("Skipping invalid message: " + e.getMessage()); } catch (RejectLogon e) { // TODO TEST need a test for RejectLogon exception String rejectMessage = e.getMessage() != null ? (": " + e.getMessage()) : ""; state.getLog().onEvent("Logon rejected" + rejectMessage); disconnect(); } catch (UnsupportedMessageType e) { if (sessionID.getBeginString().compareTo(FixVersions.BEGINSTRING_FIX42) >= 0) { generateBusinessReject(message, BUSINESS_REJECT_UNSUPPORTED_MSG_TYPE); } else { generateReject(message, "Unsupported message type"); } } catch (UnsupportedVersion e) { String msgType = message.getHeader().getString(MsgType.FIELD); if (msgType.equals(MsgType.LOGOUT)) { nextLogout(message); } else { generateLogout("Incorrect BeginString"); state.incrNextTargetMsgSeqNum(); // 1d_InvalidLogonWrongBeginString.def appears to require // a disconnect although the C++ didn't appear to be doing it. // ??? disconnect(); } } catch (IOException e) { LogUtil.logThrowable(sessionID, "error processing message", e); } nextQueued(); next(); }