rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
else { artifactSubscriptionSql.delete(artifactId, username); } | else { artifactSubscriptionSql.delete(artifactId, username); final List<ArtifactSubscription> subscrtipions = getSubscription(artifact.getArtifactUUID()); for(final ArtifactSubscription subscription : subscrtipions) { final IQ iq = new IQNotifyTeamMemberRemoved( artifact.getArtifactUUID(), getContactModel().readContact(session.getJabberId())); iq.setTo(subscription.getJabberId().getJID()); iq.setFrom(session.getJabberId().getJID()); send(subscription.getJabberId(), iq); } } | void unsubscribe(final Artifact artifact) throws ParityServerModelException { logger.info("unsubscribe(User,Artifact)"); logger.debug(artifact); try { final Integer artifactId = artifact.getArtifactId(); final String username = session.getJID().getNode(); final Integer rowCount = artifactSubscriptionSql.selectCount(artifactId, username); if(0 == rowCount) { final StringBuffer warning = new StringBuffer("unsubscribe(User,Artifact): ") .append("User does not have a subscription."); logger.warn(warning); } else { artifactSubscriptionSql.delete(artifactId, username); } } catch(SQLException sqlx) { logger.error("unsubscribe(User,Artifact)", sqlx); throw ParityErrorTranslator.translate(sqlx); } catch(RuntimeException rx) { logger.error("unsubscribe(User,Artifact)", rx); throw ParityErrorTranslator.translate(rx); } } |
catch(SQLException sqlx) { logger.error("unsubscribe(User,Artifact)", sqlx); | catch(final UnauthorizedException ux) { logger.error("[RMODEL] [ARTIFACT] [UNSUBSCRIBE USER] [UNAUTHORIZED]", ux); throw ParityErrorTranslator.translate(ux); } catch(final SQLException sqlx) { logger.error("[RMODEL] [ARTIFACT] [UNSUBSCRIBE USER] [SQL ERROR]", sqlx); | void unsubscribe(final Artifact artifact) throws ParityServerModelException { logger.info("unsubscribe(User,Artifact)"); logger.debug(artifact); try { final Integer artifactId = artifact.getArtifactId(); final String username = session.getJID().getNode(); final Integer rowCount = artifactSubscriptionSql.selectCount(artifactId, username); if(0 == rowCount) { final StringBuffer warning = new StringBuffer("unsubscribe(User,Artifact): ") .append("User does not have a subscription."); logger.warn(warning); } else { artifactSubscriptionSql.delete(artifactId, username); } } catch(SQLException sqlx) { logger.error("unsubscribe(User,Artifact)", sqlx); throw ParityErrorTranslator.translate(sqlx); } catch(RuntimeException rx) { logger.error("unsubscribe(User,Artifact)", rx); throw ParityErrorTranslator.translate(rx); } } |
catch(RuntimeException rx) { logger.error("unsubscribe(User,Artifact)", rx); | catch(final RuntimeException rx) { logger.error("[RMODEL] [ARTIFACT] [UNSUBSCRIBE USER] [UNKNOWN ERROR]", rx); | void unsubscribe(final Artifact artifact) throws ParityServerModelException { logger.info("unsubscribe(User,Artifact)"); logger.debug(artifact); try { final Integer artifactId = artifact.getArtifactId(); final String username = session.getJID().getNode(); final Integer rowCount = artifactSubscriptionSql.selectCount(artifactId, username); if(0 == rowCount) { final StringBuffer warning = new StringBuffer("unsubscribe(User,Artifact): ") .append("User does not have a subscription."); logger.warn(warning); } else { artifactSubscriptionSql.delete(artifactId, username); } } catch(SQLException sqlx) { logger.error("unsubscribe(User,Artifact)", sqlx); throw ParityErrorTranslator.translate(sqlx); } catch(RuntimeException rx) { logger.error("unsubscribe(User,Artifact)", rx); throw ParityErrorTranslator.translate(rx); } } |
browser.fireContainerCreated(e.getContainer().getId(), e.isRemote()); | browser.fireContainerUpdated(e.getContainer().getId(), e.isRemote()); | private ContainerListener createContainerListener() { return new ContainerAdapter() { @Override public void containerCreated(final ContainerEvent e) { browser.fireContainerCreated(e.getContainer().getId(), e.isRemote()); } @Override public void containerDeleted(final ContainerEvent e) { browser.fireContainerDeleted(e.getContainer().getId(), Boolean.FALSE); } @Override public void documentAdded(final ContainerEvent e) { browser.fireContainerDocumentAdded( e.getContainer().getId(), e.getDocument().getId()); } @Override public void documentRemoved(final ContainerEvent e) { browser.fireContainerDocumentRemoved(e.getDocument().getId()); } @Override public void draftPublished(final ContainerEvent e) { browser.fireContainerCreated(e.getContainer().getId(), e.isRemote()); } @Override public void teamMemberAdded(final ContainerEvent e) { if(e.isRemote()) { browser.fireContainerTeamMemberAdded(e.getContainer().getId()); } } @Override public void teamMemberRemoved(ContainerEvent e) { if(e.isRemote()) { browser.fireContainerTeamMemberRemoved(e.getContainer().getId()); } } }; } |
browser.fireContainerCreated(e.getContainer().getId(), e.isRemote()); | browser.fireContainerUpdated(e.getContainer().getId(), e.isRemote()); | public void draftPublished(final ContainerEvent e) { browser.fireContainerCreated(e.getContainer().getId(), e.isRemote()); } |
public Boolean doesVersionExist(Long artifactId, Long versionId) { | public Boolean doesVersionExist(final Long artifactId, final Long versionId) { | public Boolean doesVersionExist(Long artifactId, Long versionId) { final Session session = openSession(); try { session.prepareStatement(SQL_DOES_VERSION_EXIST); session.setLong(1, artifactId); session.setLong(2, versionId); session.executeQuery(); session.nextResult(); if(0 == session.getInteger("COUNT")) { return Boolean.FALSE; } else { return Boolean.TRUE; } } finally { session.close(); } } |
if(0 == session.getInteger("COUNT")) { return Boolean.FALSE; } else { return Boolean.TRUE; } | if (0 == session.getInteger("COUNT")) { return Boolean.FALSE; } else { return Boolean.TRUE; } } finally { session.close(); | public Boolean doesVersionExist(Long artifactId, Long versionId) { final Session session = openSession(); try { session.prepareStatement(SQL_DOES_VERSION_EXIST); session.setLong(1, artifactId); session.setLong(2, versionId); session.executeQuery(); session.nextResult(); if(0 == session.getInteger("COUNT")) { return Boolean.FALSE; } else { return Boolean.TRUE; } } finally { session.close(); } } |
finally { session.close(); } | public Boolean doesVersionExist(Long artifactId, Long versionId) { final Session session = openSession(); try { session.prepareStatement(SQL_DOES_VERSION_EXIST); session.setLong(1, artifactId); session.setLong(2, versionId); session.executeQuery(); session.nextResult(); if(0 == session.getInteger("COUNT")) { return Boolean.FALSE; } else { return Boolean.TRUE; } } finally { session.close(); } } |
|
return new Double(n.intValue()); | return new Double(n.doubleValue()); | public Double toDouble(Object num) { Number n = toNumber(num); if (n == null) { return null; } return new Double(n.intValue()); } |
SmackException() { super(); } | SmackException(final String message, final Throwable cause) { super(message, cause); } | SmackException() { super(); } |
try { indexHits = datum.iModel.search(datum.criteria); } | try { indexHits = datum.iModel.searchArtifact(datum.criteria); } | public void testSearch() { List<IndexHit> indexHits; for(final Fixture datum : data) { try { indexHits = datum.iModel.search(datum.criteria); } catch(final ParityException px) { throw new RuntimeException(px); } assertNotNull("Index hits is null.", indexHits); Document searchHit; for(final IndexHit indexHit : indexHits) { try { searchHit = datum.dModel.get(indexHit.getId()); } catch(final ParityException px) { throw new RuntimeException(px); } } } } |
assertNotNull(searchHit); | public void testSearch() { List<IndexHit> indexHits; for(final Fixture datum : data) { try { indexHits = datum.iModel.search(datum.criteria); } catch(final ParityException px) { throw new RuntimeException(px); } assertNotNull("Index hits is null.", indexHits); Document searchHit; for(final IndexHit indexHit : indexHits) { try { searchHit = datum.dModel.get(indexHit.getId()); } catch(final ParityException px) { throw new RuntimeException(px); } } } } |
|
String actionMapping = RequestUtils.getActionMappingName(action); | String actionMapping = TagUtils.getInstance().getActionMappingName(action); | public static String getActionMappingURL(ServletContext application, HttpServletRequest request, String action) { StringBuffer value = new StringBuffer(request.getContextPath()); ModuleConfig config = (ModuleConfig)request.getAttribute(Globals.MODULE_KEY); if (config != null) { value.append(config.getPrefix()); } /* Use our servlet mapping, if one is specified */ String servletMapping = (String)application.getAttribute(Globals.SERVLET_KEY); if (servletMapping != null) { String queryString = null; int question = action.indexOf("?"); if (question >= 0) { queryString = action.substring(question); } String actionMapping = RequestUtils.getActionMappingName(action); if (servletMapping.startsWith("*.")) { value.append(actionMapping); value.append(servletMapping.substring(1)); } else if (servletMapping.endsWith("/*")) { value.append(servletMapping.substring (0, servletMapping.length() - 2)); value.append(actionMapping); } if (queryString != null) { value.append(queryString); } } else { /* Otherwise, assume extension mapping is in use and extension is * already included in the action property */ if (!action.startsWith("/")) { value.append("/"); } value.append(action); } /* Return the completed value */ return value.toString(); } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addBetween(String fieldAttributeName, Object value1, Object value2) { String jcrExpression = "( @" + this.getJcrFieldName(fieldAttributeName) + " >= " + this.getStringValue(value1) + " and @" + this.getJcrFieldName(fieldAttributeName) + " <= " + this.getStringValue(value2) + ")"; jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addContains(String scope, String fullTextSearch) { String jcrExpression = null; if (scope.equals(".")) { jcrExpression = "jcr:contains(., '" + fullTextSearch + "')"; } else { jcrExpression = "jcr:contains(@" + this.getJcrFieldName(scope) + ", '" + fullTextSearch + "')"; } jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addEqualTo(String fieldAttributeName, Object value) { String jcrExpression = "@" + this.getJcrFieldName(fieldAttributeName) + " = " + this.getStringValue(value); jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addGreaterOrEqualThan(String fieldAttributeName, Object value) { String jcrExpression = "@" + this.getJcrFieldName(fieldAttributeName) + " >= " + this.getStringValue(value); jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addGreaterThan(String fieldAttributeName, Object value) { String jcrExpression = "@" + this.getJcrFieldName(fieldAttributeName) + " > " + this.getStringValue(value); jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addIsNull(String fieldAttributeName) { String jcrExpression = "not(@" + this.getJcrFieldName(fieldAttributeName) + ")"; jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addJCRExpression(String jcrExpression) { jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addLessOrEqualThan(String fieldAttributeName, Object value) { String jcrExpression = "@" + this.getJcrFieldName(fieldAttributeName) + " <= " + this.getStringValue(value); jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addLessThan(String fieldAttributeName, Object value) { String jcrExpression = "@" + this.getJcrFieldName(fieldAttributeName) + " < " + this.getStringValue(value); jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addLike(String fieldAttributeName, Object value) { String jcrExpression = "jcr:like(" + "@" + this.getJcrFieldName(fieldAttributeName) + ", '" + value + "')"; jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addNotEqualTo(String fieldAttributeName, Object value) { String jcrExpression = "@" + this.getJcrFieldName(fieldAttributeName) + " != " + this.getStringValue(value); jcrExpressions.add(jcrExpression); return this; } |
jcrExpressions.add(jcrExpression); | addExpression(jcrExpression); | public Filter addNotNull(String fieldAttributeName) { String jcrExpression = "@" + this.getJcrFieldName(fieldAttributeName); jcrExpressions.add(jcrExpression); return this; } |
orJcrExpression = ((FilterImpl) filter).getJcrExpression(); | if ( null == jcrExpression || "".equals(jcrExpression) ) { jcrExpression = ((FilterImpl) filter).getJcrExpression() ; } else { jcrExpression = "(" + jcrExpression + ") or ( " + ((FilterImpl) filter).getJcrExpression() + ")"; } | public Filter addOrFilter(Filter filter) { orJcrExpression = ((FilterImpl) filter).getJcrExpression(); return this; } |
if ((orJcrExpression == null) || orJcrExpression.equals("")) { return buildJcrExpression(); } else { return "(" + buildJcrExpression() + ") or (" + this.orJcrExpression + ")"; } | return this.jcrExpression; | public String getJcrExpression() { if ((orJcrExpression == null) || orJcrExpression.equals("")) { return buildJcrExpression(); } else { return "(" + buildJcrExpression() + ") or (" + this.orJcrExpression + ")"; } } |
logger.logError(t, errorId); | logger.logError(t, "{0}", errorId); | protected RuntimeException translateError(final Throwable t) { if (ParityUncheckedException.class.isAssignableFrom(t.getClass())) { return (ParityUncheckedException) t; } else if (Assertion.class.isAssignableFrom(t.getClass())) { final String errorId = new ErrorHelper().getErrorId(t); logger.logError(t, errorId); return (Assertion) t; } else { final String errorId = new ErrorHelper().getErrorId(t); logger.logError(t, errorId); return ParityErrorTranslator.translateUnchecked(getContext(), errorId, t); } } |
this.facetMap.put("PANELS", panels); | this.getFacets().put("PANELS", panels); | public void addPanel(String panelID, UIComponent header, UIComponent content) { //get outerlayer (facet) Layer panels = (Layer)this.getFacet("PANELS"); if(panels==null){ panels = new Layer(); panels.setId(id); this.facetMap.put("PANELS", panels); } //add panel to outerlayer Layer l = new Layer(); l.setId(panelID); Layer h = new Layer(); h.setId(panelID+"Header"); h.setStyleClass("accordionTabTitleBar"); h.getChildren().add(header); Layer c = new Layer(); c.setId(panelID+"Content"); c.setStyleClass("accordionTabContentBox"); c.getChildren().add(content); l.add(h); l.add(c); panels.add(l); } |
logger.logTraceId(); | void handleReceived(final UUID uniqueId, final Long versionId, final JabberId receivedBy, final Calendar receivedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("receivedBy", receivedBy); logger.logVariable("receivedOn", receivedOn); final Long artifactId = artifactIO.readId(uniqueId); switch (artifactIO.readType(artifactId)) { case CONTAINER: getContainerModel().handleReceived(artifactId, versionId, receivedBy, receivedOn); break; default: Assert.assertUnreachable("UNSUPPORTED ARTIFACT TYPE"); } } |
|
getController().runCloseDocument(getDocumentId()); | getController().runDeleteDocument(getDocumentId()); | public void actionPerformed(final ActionEvent e) { getController().runCloseDocument(getDocumentId()); } |
getController().runDeleteDocument(getDocumentId()); | getController().runOpenDocument(getDocumentId()); | public void actionPerformed(final ActionEvent e) { getController().runDeleteDocument(getDocumentId()); } |
getController().runOpenDocument(getDocumentId()); | getController().runCloseDocument(getDocumentId()); | public void actionPerformed(final ActionEvent e) { getController().runOpenDocument(getDocumentId()); } |
getController().displaySessionSendKeyFormAvatar(); | getController().selectDocument(getDocumentId()); getController().displaySessionSendFormAvatar(); | public void actionPerformed(final ActionEvent e) { getController().displaySessionSendKeyFormAvatar(); } |
if(isKeyHolder) { jPopupMenu.add(getSendKeyMenuItem()); } else { jPopupMenu.add(getRequestKeyMenuItem()); } if(canClose(getDocumentId())) { | if(isKeyHolder) { | public void populateMenu(final JPopupMenu jPopupMenu) { jPopupMenu.add(getOpenMenuItem()); if(isClosed(getDocumentId())) { jPopupMenu.addSeparator(); jPopupMenu.add(getDeleteMenuItem()); } else { jPopupMenu.add(getSendMenuItem()); if(isKeyHolder) { jPopupMenu.add(getSendKeyMenuItem()); } else { jPopupMenu.add(getRequestKeyMenuItem()); } if(canClose(getDocumentId())) { jPopupMenu.addSeparator(); jPopupMenu.add(getCloseMenuItem()); } else { jPopupMenu.addSeparator(); } jPopupMenu.add(getDeleteMenuItem()); } } |
else { jPopupMenu.addSeparator(); } jPopupMenu.add(getDeleteMenuItem()); | else { jPopupMenu.add(getRequestKeyMenuItem()); jPopupMenu.addSeparator(); jPopupMenu.add(getDeleteMenuItem()); } | public void populateMenu(final JPopupMenu jPopupMenu) { jPopupMenu.add(getOpenMenuItem()); if(isClosed(getDocumentId())) { jPopupMenu.addSeparator(); jPopupMenu.add(getDeleteMenuItem()); } else { jPopupMenu.add(getSendMenuItem()); if(isKeyHolder) { jPopupMenu.add(getSendKeyMenuItem()); } else { jPopupMenu.add(getRequestKeyMenuItem()); } if(canClose(getDocumentId())) { jPopupMenu.addSeparator(); jPopupMenu.add(getCloseMenuItem()); } else { jPopupMenu.addSeparator(); } jPopupMenu.add(getDeleteMenuItem()); } } |
protected void renderComponent(final Cell cell, final int index, final javax.swing.JLabel iconJLabel, final javax.swing.JLabel textJLabel, final javax.swing.JLabel additionalTextJLabel) { this.cell = cell; iconJLabel.setIcon(cell.getIcon()); textJLabel.setText(cell.getText()); if (cell.isEnabled()) { textJLabel.setForeground(Colors.Browser.List.LIST_FG); } else { textJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); } if (cell.isSetAdditionalText()) { additionalTextJLabel.setText(cell.getAdditionalText()); } else { additionalTextJLabel.setText(""); } } | public abstract void renderComponent(final Cell cell, final int index); | protected void renderComponent(final Cell cell, final int index, final javax.swing.JLabel iconJLabel, final javax.swing.JLabel textJLabel, final javax.swing.JLabel additionalTextJLabel) { this.cell = cell; iconJLabel.setIcon(cell.getIcon()); textJLabel.setText(cell.getText()); if (cell.isEnabled()) { textJLabel.setForeground(Colors.Browser.List.LIST_FG); } else { textJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); } if (cell.isSetAdditionalText()) { additionalTextJLabel.setText(cell.getAdditionalText()); } else { additionalTextJLabel.setText(""); } } |
SwingUtilities.invokeLater(new Runnable() { public void run() { setVisible(true); applyRenderingHints(); debugGeometry(); debugLookAndFeel(); browser.displayTitleAvatar(); browser.displayInfoAvatar(); browser.displayDocumentListAvatar(); browser.displayStatusAvatar(); } }); | try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { setVisible(true); applyRenderingHints(); debugGeometry(); debugLookAndFeel(); browser.displayTitleAvatar(); browser.displayInfoAvatar(); browser.displayDocumentListAvatar(); browser.displayStatusAvatar(); } }); } catch(final InterruptedException ix) { throw new RuntimeException(ix); } catch(final InvocationTargetException itx) { throw new RuntimeException(itx); } | void open() { SwingUtilities.invokeLater(new Runnable() { public void run() { setVisible(true); applyRenderingHints(); debugGeometry(); debugLookAndFeel(); browser.displayTitleAvatar(); browser.displayInfoAvatar(); browser.displayDocumentListAvatar(); browser.displayStatusAvatar(); } }); } |
* thinkParity server and need not reset the configuration. */ | * thinkParity server and need not reset the configuration as well we * know that setting the root logger is incorrect - the side effect of * this is that the common code under com.thinkparity.codebase will log * to the server's output even if called from the archive client */ | private void bootstrapLog4J() { /* HACK if the logging root is set; we know we are being run within the * thinkParity server and need not reset the configuration. */ final String loggingRootProperty = System.getProperty("thinkparity.logging.root"); final boolean isDesktop = null == loggingRootProperty; final Properties logging = bootstrapLog4JConfig(mode); final File loggingRoot = bootstrapLog4JRoot(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "WARN, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty( "log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.util.xmpp.event.XMPPEvent", "com.thinkparity.codebase.model.util.logging.or.XMPPEventRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.container.Container", "com.thinkparity.codebase.model.util.logging.or.ContainerRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty( "log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); if (isDesktop) LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper("DEFAULT").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
final boolean isDesktop = null == loggingRootProperty; | final boolean desktop = null == loggingRootProperty; | private void bootstrapLog4J() { /* HACK if the logging root is set; we know we are being run within the * thinkParity server and need not reset the configuration. */ final String loggingRootProperty = System.getProperty("thinkparity.logging.root"); final boolean isDesktop = null == loggingRootProperty; final Properties logging = bootstrapLog4JConfig(mode); final File loggingRoot = bootstrapLog4JRoot(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "WARN, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty( "log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.util.xmpp.event.XMPPEvent", "com.thinkparity.codebase.model.util.logging.or.XMPPEventRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.container.Container", "com.thinkparity.codebase.model.util.logging.or.ContainerRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty( "log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); if (isDesktop) LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper("DEFAULT").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); | if (desktop) logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); | private void bootstrapLog4J() { /* HACK if the logging root is set; we know we are being run within the * thinkParity server and need not reset the configuration. */ final String loggingRootProperty = System.getProperty("thinkparity.logging.root"); final boolean isDesktop = null == loggingRootProperty; final Properties logging = bootstrapLog4JConfig(mode); final File loggingRoot = bootstrapLog4JRoot(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "WARN, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty( "log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.util.xmpp.event.XMPPEvent", "com.thinkparity.codebase.model.util.logging.or.XMPPEventRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.container.Container", "com.thinkparity.codebase.model.util.logging.or.ContainerRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty( "log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); if (isDesktop) LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper("DEFAULT").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); | if (desktop) logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); | private void bootstrapLog4J() { /* HACK if the logging root is set; we know we are being run within the * thinkParity server and need not reset the configuration. */ final String loggingRootProperty = System.getProperty("thinkparity.logging.root"); final boolean isDesktop = null == loggingRootProperty; final Properties logging = bootstrapLog4JConfig(mode); final File loggingRoot = bootstrapLog4JRoot(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "WARN, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty( "log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.util.xmpp.event.XMPPEvent", "com.thinkparity.codebase.model.util.logging.or.XMPPEventRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.container.Container", "com.thinkparity.codebase.model.util.logging.or.ContainerRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty( "log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); if (isDesktop) LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper("DEFAULT").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); | if (desktop) logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); | private void bootstrapLog4J() { /* HACK if the logging root is set; we know we are being run within the * thinkParity server and need not reset the configuration. */ final String loggingRootProperty = System.getProperty("thinkparity.logging.root"); final boolean isDesktop = null == loggingRootProperty; final Properties logging = bootstrapLog4JConfig(mode); final File loggingRoot = bootstrapLog4JRoot(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "WARN, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty( "log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.util.xmpp.event.XMPPEvent", "com.thinkparity.codebase.model.util.logging.or.XMPPEventRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.container.Container", "com.thinkparity.codebase.model.util.logging.or.ContainerRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty( "log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); if (isDesktop) LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper("DEFAULT").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
if (isDesktop) | if (desktop) | private void bootstrapLog4J() { /* HACK if the logging root is set; we know we are being run within the * thinkParity server and need not reset the configuration. */ final String loggingRootProperty = System.getProperty("thinkparity.logging.root"); final boolean isDesktop = null == loggingRootProperty; final Properties logging = bootstrapLog4JConfig(mode); final File loggingRoot = bootstrapLog4JRoot(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d{ISO8601} %x %t %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d{ISO8601} %x %t %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}{2}", loggingRoot, File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "WARN, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.com.thinkparity.ophelia", "INFO, DEFAULT"); logging.setProperty("log4j.additivity.com.thinkparity.ophelia", "false"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty( "log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.util.xmpp.event.XMPPEvent", "com.thinkparity.codebase.model.util.logging.or.XMPPEventRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.container.Container", "com.thinkparity.codebase.model.util.logging.or.ContainerRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty( "log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty( "log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); if (isDesktop) LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper("DEFAULT").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
try { properties.load(new FileInputStream(file)); } catch(final IOException iox) { throw new RuntimeException(iox); } | try { final InputStream stream = new FileInputStream(file); try { properties.load(new FileInputStream(file)); } finally { stream.close(); } } catch (final IOException iox) { throw new RuntimeException(iox); } | private Properties load(final File file) { try { init(file); } catch(final IOException iox) { throw new RuntimeException(iox); } final Properties properties = new Properties(); try { properties.load(new FileInputStream(file)); } catch(final IOException iox) { throw new RuntimeException(iox); } return properties; } |
try { properties.store(new FileOutputStream(file), ""); } catch(final IOException iox) { throw new RuntimeException(iox); } | try { final OutputStream stream = new FileOutputStream(file); try { properties.store(new FileOutputStream(file), ""); } finally { stream.flush(); stream.close(); } } catch (final IOException iox) { throw new RuntimeException(iox); } | private void store(final Properties properties, final File file) { try { properties.store(new FileOutputStream(file), ""); } catch(final IOException iox) { throw new RuntimeException(iox); } } |
final List<IndexHit> searchResult = getIndexModel().search(criteria); | final List<IndexHit> searchResult = getIndexModel().searchArtifact(criteria); | public void invoke(final Data data) throws Exception { final String criteria = (String) data.get(DataKey.CRITERIA); if(null == criteria || 1 > criteria.length()) { browser.removeSearchFilter(); } else { final List<IndexHit> searchResult = getIndexModel().search(criteria); browser.applySearchFilter(searchResult); } } |
final Long documentId = readArtifactId(uniqueId); return documentModel.readVersions(documentId); | return containerModel.readDocumentVersions(containerId, containerVersionId); | public List<DocumentVersion> readVersions(final UUID uniqueId) { // bit of a wierd workflow to ensure the container is archived final Long containerId = readArchivedArtifactId(containerUniqueId); if (null == containerId) { return Collections.emptyList(); } else { final Long documentId = readArtifactId(uniqueId); return documentModel.readVersions(documentId); } } |
public FullScreen(String moduleName) { super(moduleName); | public FullScreen(String moduleName, String hostname, Integer port) { super("FullScreen." + moduleName, hostname, port); | public FullScreen(String moduleName) { super(moduleName); JFrame main = new JFrame(); main.setSize(500, 500); /* * main = new JWindow(); * GraphicsEnvironment.getLocalGraphicsEnvironment() * .getDefaultScreenDevice().setFullScreenWindow(main); */ Container mainpane = main.getContentPane(); mainpane.setBackground(Color.black); JPanel list = new JPanel(); list.setLayout(new BoxLayout(list, BoxLayout.PAGE_AXIS)); list.setBackground(Color.black); JButton b = new JButton(); b.setText("Quit"); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); }; }); earthView = new EarthView(); earthView.setVisible(true); earthView.setStoryQueue(storyQueue); list.add(earthView); list.add(b); mainpane.add(list); main.setVisible(true); } |
public ShowOffObject(String moduleName) { super(moduleName); | public ShowOffObject(String moduleName, String hostname, Integer port) { super("ShowOff." + moduleName, hostname, port); | public ShowOffObject(String moduleName) { super(moduleName); storyQueue = new LinkedList<Story>(); } |
this.singleProviders = new SingleContentProvider[] {documentProvider}; | this.singleProviders = new SingleContentProvider[] {documentProvider, systemMessageProvider}; | public MainProvider(final ArtifactModel artifactModel, final DocumentModel documentModel, final SystemMessageModel systemMessageModel) { super(); this.documentProvider = new SingleContentProvider() { public Object getElement(final Object input) { final Long documentId = assertNotNullLong( "The main provider's document provider requires " + "non-null java.lang.Long input.", input); try { final Document document = documentModel.get(documentId); return toDisplay(document, artifactModel); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.documentsProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new RemoteUpdatedOnComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); final Collection<Document> documents = documentModel.list(sort); return toDisplay(documents, artifactModel); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.systemMessagesProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.readForNonArtifacts(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.flatProviders = new FlatContentProvider[] {documentsProvider, systemMessagesProvider}; this.singleProviders = new SingleContentProvider[] {documentProvider}; } |
final Long documentId = readArtifactId(uniqueId); return documentModel.readVersions(documentId); | return containerModel.readDocumentVersions(containerId, containerVersionId); | public List<DocumentVersion> readVersions(final UUID uniqueId) { // bit of a wierd workflow to ensure the container is backed up final Long containerId = readBackupArtifactId(containerUniqueId); if (null == containerId) { return Collections.emptyList(); } else { final Long documentId = readArtifactId(uniqueId); return documentModel.readVersions(documentId); } } |
public void run() { getTabContainerAvatar().syncContainer(containerId, remote, select); } | public void run() { getTabContainerAvatar().syncContainer(containerId, Boolean.FALSE, select); } | public void run() { getTabContainerAvatar().syncContainer(containerId, remote, select); } |
public void run() { getTabContainerAvatar().syncContainer(containerId, Boolean.FALSE, select); } | public void run() { getTabContainerAvatar().syncContainer(containerId, remote, select); } | public void run() { getTabContainerAvatar().syncContainer(containerId, Boolean.FALSE, select); } |
getTabContainerAvatar().syncContainer(containerId, remote, select); | getTabContainerAvatar().syncDocument(containerId, documentId, Boolean.FALSE); | public void run() { getTabContainerAvatar().syncContainer(containerId, remote, select); } |
getTabContainerAvatar().syncDocument(containerId, documentId, Boolean.FALSE); | getTabContainerAvatar().syncDocument(documentId, Boolean.FALSE); | public void run() { getTabContainerAvatar().syncDocument(containerId, documentId, Boolean.FALSE); } |
public void run() { getTabContainerAvatar().syncDocument(documentId, Boolean.FALSE); } | public void run() { getTabContainerAvatar().syncContainer(containerId, remote, select); } | public void run() { getTabContainerAvatar().syncDocument(documentId, Boolean.FALSE); } |
Assert.assertTrue("COULD NOT DELETE FROM INDEX", 1 == indexReader.deleteDocuments(term)); | indexReader.deleteDocuments(term); | protected void delete(final Term term) throws IOException { final IndexReader indexReader = openIndexReader(); try { Assert.assertTrue("COULD NOT DELETE FROM INDEX", 1 == indexReader.deleteDocuments(term)); } finally { closeIndexReader(indexReader); } } |
case 0: return SEEN; | case 0: return KEY; case 1: return SEEN; | public static ArtifactFlag fromId(final Integer id) { switch(id) { case 0: return SEEN; default: throw Assert.createUnreachable("Unknown artifact flag id: " + id); } } |
try { return documentModel.get((Long) input); } | try { return dModel.get((Long) input); } | public Object getElement(final Object input) { Assert.assertNotNull( "The history provider requries java.lang.Long input.", input); Assert.assertOfType( "The history provider requries java.lang.Long input.", Long.class, input); try { return documentModel.get((Long) input); } catch(final ParityException px) { throw new RuntimeException(px); } } |
try { return documentModel.readHistory((Long) input).toArray(new HistoryItem[] {}); } | try { return dModel.readHistory((Long) input).toArray(new HistoryItem[] {}); } | public Object[] getElements(final Object input) { Assert.assertNotNull( "The history provider requries java.lang.Long input.", input); Assert.assertOfType( "The history provider requries java.lang.Long input.", Long.class, input); try { return documentModel.readHistory((Long) input).toArray(new HistoryItem[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } |
setNameInfo(displayDocument.getUrgentInfo(this)); | DocumentListItem(final DisplayDocument displayDocument) { super("DocumentListItem"); this.displayDocument = displayDocument; setDocumentId(displayDocument.getDocumentId()); if(displayDocument.isUrgent()) { setBackgroundImage(BG_URGENT); setBackgroundImageSelected(BG_URGENT_SEL); setNameForeground(NAME_FOREGROUND_URGENT); setNameInfo(displayDocument.getUrgentInfo(this)); if(displayDocument.hasBeenSeen()) { setNameFont(BrowserConstants.DefaultFont); } else { setNameFont(BrowserConstants.DefaultFontBold); } } else { if(displayDocument.isClosed()) { setBackgroundImage(BG_CLOSED); setBackgroundImageSelected(BG_CLOSED_SEL); setNameForeground(NAME_FOREGROUND_CLOSED); if(displayDocument.hasBeenSeen()) { setNameFont(BrowserConstants.DefaultFont); } else { setNameFont(BrowserConstants.DefaultFontBold); } } else { setBackgroundImage(BG); setBackgroundImageSelected(BG_SEL); setNameForeground(NAME_FOREGROUND); if(displayDocument.hasBeenSeen()) { setNameFont(BrowserConstants.DefaultFont); } else { setNameFont(BrowserConstants.DefaultFontBold); } } } setName(displayDocument.getDisplay()); if(displayDocument.isKeyHolder()) { setInfoIcon(KEY_ICON); } } |
|
setNameInfo(displayDocument.getDisplayToolTip()); | DocumentListItem(final DisplayDocument displayDocument) { super("DocumentListItem"); this.displayDocument = displayDocument; setDocumentId(displayDocument.getDocumentId()); if(displayDocument.isUrgent()) { setBackgroundImage(BG_URGENT); setBackgroundImageSelected(BG_URGENT_SEL); setNameForeground(NAME_FOREGROUND_URGENT); setNameInfo(displayDocument.getUrgentInfo(this)); if(displayDocument.hasBeenSeen()) { setNameFont(BrowserConstants.DefaultFont); } else { setNameFont(BrowserConstants.DefaultFontBold); } } else { if(displayDocument.isClosed()) { setBackgroundImage(BG_CLOSED); setBackgroundImageSelected(BG_CLOSED_SEL); setNameForeground(NAME_FOREGROUND_CLOSED); if(displayDocument.hasBeenSeen()) { setNameFont(BrowserConstants.DefaultFont); } else { setNameFont(BrowserConstants.DefaultFontBold); } } else { setBackgroundImage(BG); setBackgroundImageSelected(BG_SEL); setNameForeground(NAME_FOREGROUND); if(displayDocument.hasBeenSeen()) { setNameFont(BrowserConstants.DefaultFont); } else { setNameFont(BrowserConstants.DefaultFontBold); } } } setName(displayDocument.getDisplay()); if(displayDocument.isKeyHolder()) { setInfoIcon(KEY_ICON); } } |
|
} | } catch(ClassNotFoundException clnf) { throw new PersistenceException("Impossible to instantiate the object at " + path, clnf); } | public Object getObject(Session session, Class clazz, String path) { try { if (!session.itemExists(path)) { return null; } ClassDescriptor classDescriptor = getClassDescriptor(clazz);// if (classDescriptor.isAbstract()) {// throw new PersistenceException("Cannot fetch declared abstract object of type "// + clazz.getName());// } checkNodeType(session, classDescriptor); Node node = (Node) session.getItem(path); checkCompatibleNodeTypes(session, node, classDescriptor, true); Object object = null; if (classDescriptor.usesNodeTypePerHierarchyStrategy()) { String discriminatorProperty = classDescriptor.getDiscriminatorFieldDescriptor().getJcrName(); if (!node.hasProperty(discriminatorProperty)) { throw new PersistenceException("Cannot fetch object of type '" + clazz.getName() + "' using NODETYPE_PER_HIERARCHY. Discriminator property is not present."); } String className = node.getProperty(discriminatorProperty).getValue().getString(); object = ReflectionUtils.newInstance(className); } else { object = ReflectionUtils.newInstance(clazz); } retrieveSimpleFields(session, classDescriptor, node, object); retrieveBeanFields(session, classDescriptor, node, path, object); retrieveCollectionFields(session, classDescriptor, node, object); return object; } catch(PathNotFoundException pnfe) { // HINT should never get here throw new PersistenceException("Impossible to get the object at " + path, pnfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Impossible to get the object at " + path, re); } } |
if (beanDescriptor.isInline()) { bean = ReflectionUtils.newInstance(beanClass); | if (beanDescriptor.isInline()) { | private void retrieveBeanFields(Session session, ClassDescriptor classDescriptor, Node node, String path, Object object) { Iterator beanDescriptorIterator = classDescriptor.getBeanDescriptors().iterator(); while (beanDescriptorIterator.hasNext()) { BeanDescriptor beanDescriptor = (BeanDescriptor) beanDescriptorIterator.next(); String beanName = beanDescriptor.getFieldName(); Class beanClass = ReflectionUtils.getPropertyType(object, beanName); Object bean = null; if (beanDescriptor.isInline()) { bean = ReflectionUtils.newInstance(beanClass); bean = this.retrieveSimpleFields(session, getClassDescriptor(beanClass), node, bean); } else if (null != beanDescriptor.getBeanConverter()) { bean = beanDescriptor.getBeanConverter().getObject(session, node, beanDescriptor, beanClass); } else { bean = this.getObject(session, beanClass, path + "/" + beanDescriptor.getJcrName()); } ReflectionUtils.setNestedProperty(object, beanName, bean); } } |
Object initializedBean = object; | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
|
if (null == initializedBean) { initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName()); } | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
|
ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); | ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
ReflectionUtils.setNestedProperty(object, fieldName, value); | ReflectionUtils.setNestedProperty(initializedBean, fieldName, value); | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
if (null != propValue && null == initializedBean) { initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName()); } | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
|
object, | initializedBean, | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); | ReflectionUtils.setNestedProperty(initializedBean, fieldName, fieldValue); | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
return object; | return initializedBean; | private Object retrieveSimpleFields(Session session, ClassDescriptor classDescriptor, Node node, Object object) { // Object initializedBean = object; try { Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator(); while (fieldDescriptorIterator.hasNext()) { FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next(); String fieldName = fieldDescriptor.getFieldName(); String propertyName = fieldDescriptor.getJcrName(); if (fieldDescriptor.isPath()) {// if (null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } // ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath()); ReflectionUtils.setNestedProperty(object, fieldName, node.getPath()); } else if (classDescriptor.usesNodeTypePerHierarchyStrategy() && fieldDescriptor.isDiscriminator()) { if (node.hasProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName())) {// if (null == initializedBean) {// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } String value = node.getProperty( classDescriptor.getDiscriminatorFieldDescriptor().getJcrName()).getValue().getString(); ReflectionUtils.setNestedProperty(object, fieldName, value); } else { throw new PersistenceException("Class '" + classDescriptor.getClassName() + "' have not a discriminator property."); } } else { if (node.hasProperty(propertyName)) { Value propValue = node.getProperty(propertyName).getValue();// if (null != propValue && null == initializedBean) { // HINT: lazy initialize target bean// initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());// } AtomicTypeConverter converter= getAtomicTypeConverter(fieldDescriptor, object, fieldName); Object fieldValue = converter.getObject(propValue); ReflectionUtils.setNestedProperty(object, fieldName, fieldValue); } else { log.warn("Class '" + classDescriptor.getClassName() + "' has an unmapped property : " + propertyName); } } } } catch(ValueFormatException vfe) { throw new PersistenceException( "Cannot retrieve properties of object " + object + " from node " + node, vfe); } catch(RepositoryException re) { throw new org.apache.portals.graffito.jcr.exception.RepositoryException( "Cannot retrieve properties of object " + object + " from node " + node, re); } return object; } |
Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { | boolean isComplete = false; while (false == isComplete) { | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleContactDeletedIQ query = new HandleContactDeletedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("deletedBy")) { query.deletedBy = readJabberId2(); } else if (isStartTag("deletedOn")) { query.deletedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
isComplete = Boolean.TRUE; | isComplete = true; | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleContactDeletedIQ query = new HandleContactDeletedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("deletedBy")) { query.deletedBy = readJabberId2(); } else if (isStartTag("deletedOn")) { query.deletedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { | boolean isComplete = false; while (false == isComplete) { | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleContactUpdatedIQ query = new HandleContactUpdatedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("contactId")) { query.contactId = readJabberId2(); } else if (isStartTag("updatedOn")) { query.updatedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
isComplete = Boolean.TRUE; | isComplete = true; | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleContactUpdatedIQ query = new HandleContactUpdatedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("contactId")) { query.contactId = readJabberId2(); } else if (isStartTag("updatedOn")) { query.updatedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { | boolean isComplete = false; while (false == isComplete) { | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleInvitationExtendedIQ query = new HandleInvitationExtendedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("extendedTo")) { query.invitedAs = readEMail2(); } else if (isStartTag("extendedBy")) { query.invitedBy = readJabberId2(); } else if (isStartTag("extendedOn")) { query.invitedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
isComplete = Boolean.TRUE; | isComplete = true; | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleInvitationExtendedIQ query = new HandleInvitationExtendedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("extendedTo")) { query.invitedAs = readEMail2(); } else if (isStartTag("extendedBy")) { query.invitedBy = readJabberId2(); } else if (isStartTag("extendedOn")) { query.invitedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { | boolean isComplete = false; while (false == isComplete) { | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleInvitationAcceptedIQ query = new HandleInvitationAcceptedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("acceptedBy")) { query.acceptedBy = readJabberId2(); } else if (isStartTag("acceptedOn")) { query.acceptedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
isComplete = Boolean.TRUE; | isComplete = true; | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleInvitationAcceptedIQ query = new HandleInvitationAcceptedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("acceptedBy")) { query.acceptedBy = readJabberId2(); } else if (isStartTag("acceptedOn")) { query.acceptedOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
Boolean isComplete = Boolean.FALSE; while (!isComplete) { | boolean isComplete = false; while (false == isComplete) { | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleInvitationDeletedIQ query = new HandleInvitationDeletedIQ(); Boolean isComplete = Boolean.FALSE; while (!isComplete) { if (isStartTag("deletedBy")) { query.deletedBy = readJabberId2(); } else if (isStartTag("deletedOn")) { query.deletedOn = readCalendar2(); } else if (isStartTag("invitedAs")) { query.invitedAs = readEMail2(); } else { isComplete = Boolean.TRUE; } } return query; } |
isComplete = Boolean.TRUE; | isComplete = true; | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleInvitationDeletedIQ query = new HandleInvitationDeletedIQ(); Boolean isComplete = Boolean.FALSE; while (!isComplete) { if (isStartTag("deletedBy")) { query.deletedBy = readJabberId2(); } else if (isStartTag("deletedOn")) { query.deletedOn = readCalendar2(); } else if (isStartTag("invitedAs")) { query.invitedAs = readEMail2(); } else { isComplete = Boolean.TRUE; } } return query; } |
Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { | boolean isComplete = false; while (false == isComplete) { | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser(parser); final HandleInvitationDeclinedIQ query = new HandleInvitationDeclinedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { next(1); if (isStartTag(Xml.Contact.INVITED_AS)) { next(1); query.invitedAs = readEMail(); next(1); } else if (isEndTag(Xml.Contact.INVITED_AS)) { next(1); } else if (isStartTag(Xml.Contact.DECLINED_BY)) { next(1); query.declinedBy = readJabberId(); next(1); } else if (isEndTag(Xml.Contact.DECLINED_BY)) { next(1); } else if (isStartTag(Xml.Contact.DECLINED_ON)) { next(1); query.declinedOn = readCalendar(); next(1); } else if (isEndTag(Xml.Contact.DECLINED_ON)) { next(1); } else { isComplete = Boolean.TRUE; } } return query; } |
isComplete = Boolean.TRUE; | isComplete = true; | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser(parser); final HandleInvitationDeclinedIQ query = new HandleInvitationDeclinedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { next(1); if (isStartTag(Xml.Contact.INVITED_AS)) { next(1); query.invitedAs = readEMail(); next(1); } else if (isEndTag(Xml.Contact.INVITED_AS)) { next(1); } else if (isStartTag(Xml.Contact.DECLINED_BY)) { next(1); query.declinedBy = readJabberId(); next(1); } else if (isEndTag(Xml.Contact.DECLINED_BY)) { next(1); } else if (isStartTag(Xml.Contact.DECLINED_ON)) { next(1); query.declinedOn = readCalendar(); next(1); } else if (isEndTag(Xml.Contact.DECLINED_ON)) { next(1); } else { isComplete = Boolean.TRUE; } } return query; } |
getTitleAvatar().reloadConnectionStatus(Connection.ONLINE); | public void fireSessionEstablished() { getStatusAvatar().reloadStatusMessage( Status.Area.CONNECTION, "ConnectionOnline"); } |
|
final TeamMember localTeamMember = localTeamMember(container.getId()); final List<JabberId> team = getArtifactModel().readTeamIds(container.getId()); team.remove(localUserId()); getSessionModel().removeTeamMember( container.getUniqueId(), team, localTeamMember.getId()); | if (isLocalTeamMember(container.getId())) { final TeamMember localTeamMember = localTeamMember(container.getId()); final List<JabberId> team = getArtifactModel().readTeamIds(container.getId()); team.remove(localUserId()); getSessionModel().removeTeamMember( container.getUniqueId(), team, localTeamMember.getId()); } | void delete(final Long containerId) { logger.logApiId(); logger.logVariable("containerId", containerId); try { final Container container = read(containerId); if (isDistributed(container.getId())) { final TeamMember localTeamMember = localTeamMember(container.getId()); final List<JabberId> team = getArtifactModel().readTeamIds(container.getId()); team.remove(localUserId()); getSessionModel().removeTeamMember( container.getUniqueId(), team, localTeamMember.getId()); deleteLocal(container.getId()); } else { deleteLocal(container.getId()); } // fire event notifyContainerDeleted(container, localEventGenerator); } catch (final Throwable t) { throw translateError(t); } } |
delete(container.getId()); | deleteLocal(container.getId()); | void restoreBackup() { logger.logApiId(); try { final List<Container> containers = read(); if (0 < containers.size()) { logger.logWarning("{0} containers will be deleted.", containers.size()); for (final Container container : containers) { delete(container.getId()); } } final InternalBackupModel backupModel = getBackupModel(); final List<Container> backupContainers = backupModel.readContainers(); logger.logVariable("backupContainers.size()", backupContainers.size()); for (final Container backupContainer : backupContainers) { restore(backupContainer, new RestoreModel() { public InputStream openDocumentVersion(final UUID uniqueId, final Long versionId) { return backupModel.openDocumentVersion(uniqueId, versionId); } public List<ContainerVersion> readContainerVersions( final UUID uniqueId) { return backupModel.readContainerVersions(uniqueId); } public List<Document> readDocuments(final UUID uniqueId, final Long versionId) { return backupModel.readDocuments(uniqueId, versionId); } public List<DocumentVersion> readDocumentVersions( final UUID uniqueId, final Long versionId) { return backupModel.readDocumentVersions(uniqueId, versionId); } public Map<User, ArtifactReceipt> readPublishedTo( final UUID uniqueId, final Long versionId) { return backupModel.readPublishedTo(uniqueId, versionId); } public List<JabberId> readTeamIds(final UUID uniqueId) { return backupModel.readTeamIds(uniqueId); } }); } } catch (final Throwable t) { throw translateError(t); } } |
document.add(ParityObjectFlag.SEEN); | document.add(ParityObjectFlag.KEY); | private void flagKey(final Document document) throws ParityException { Assert.assertNotTrue( "flagKey(Document)", document.contains(ParityObjectFlag.KEY)); document.add(ParityObjectFlag.SEEN); update(document); } |
final LocalFile documentLocalFile = getLocalFile(document); documentLocalFile.read(); | final LocalFile localFile = getLocalFile(document); localFile.read(); content.setChecksum(localFile.getFileChecksum()); content.setContent(localFile.getFileBytes()); | DocumentVersion createVersion(final Long documentId) throws ParityException { logger.info("createVersion(Long)"); logger.debug(documentId); assertLoggedInUserIsKeyHolder(documentId); try { final Document document = get(documentId); final DocumentContent content = getContent(documentId); // read the document local file final LocalFile documentLocalFile = getLocalFile(document); documentLocalFile.read(); // create a new version\version content final DocumentVersion version = new DocumentVersion(); version.setArtifactId(documentId); version.setArtifactType(document.getType()); version.setArtifactUniqueId(document.getUniqueId()); version.setCreatedBy(document.getCreatedBy()); version.setCreatedOn(document.getCreatedOn()); version.setName(document.getName()); version.setUpdatedBy(document.getUpdatedBy()); version.setUpdatedOn(document.getUpdatedOn()); final DocumentVersionContent versionContent = new DocumentVersionContent(); versionContent.setDocumentContent(content); versionContent.setDocumentId(documentId); versionContent.setVersionId(version.getVersionId()); documentIO.createVersion(version, versionContent); // create the version local file final LocalFile versionLocalFile = getLocalFile(document, version); versionLocalFile.write(content.getContent()); versionLocalFile.lock(); // update the document updated by\on document.setUpdatedBy(preferences.getUsername()); document.setUpdatedOn(getTimestamp()); documentIO.update(document); // update the content bytes\checksum content.setContent(documentLocalFile.getFileBytes()); content.setChecksum(documentLocalFile.getFileChecksum()); documentIO.updateContent(content); // fire the object version event notification notifyCreation_objectVersionCreated(version); return version; } catch(IOException iox) { logger.error("createVersion(Document,DocumentAction,DocumentActionData)", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("createVersion(Document,DocumentAction,DocumentActionData)", rx); throw ParityErrorTranslator.translate(rx); } } |
content.setContent(documentLocalFile.getFileBytes()); content.setChecksum(documentLocalFile.getFileChecksum()); | content.setContent(localFile.getFileBytes()); content.setChecksum(localFile.getFileChecksum()); | DocumentVersion createVersion(final Long documentId) throws ParityException { logger.info("createVersion(Long)"); logger.debug(documentId); assertLoggedInUserIsKeyHolder(documentId); try { final Document document = get(documentId); final DocumentContent content = getContent(documentId); // read the document local file final LocalFile documentLocalFile = getLocalFile(document); documentLocalFile.read(); // create a new version\version content final DocumentVersion version = new DocumentVersion(); version.setArtifactId(documentId); version.setArtifactType(document.getType()); version.setArtifactUniqueId(document.getUniqueId()); version.setCreatedBy(document.getCreatedBy()); version.setCreatedOn(document.getCreatedOn()); version.setName(document.getName()); version.setUpdatedBy(document.getUpdatedBy()); version.setUpdatedOn(document.getUpdatedOn()); final DocumentVersionContent versionContent = new DocumentVersionContent(); versionContent.setDocumentContent(content); versionContent.setDocumentId(documentId); versionContent.setVersionId(version.getVersionId()); documentIO.createVersion(version, versionContent); // create the version local file final LocalFile versionLocalFile = getLocalFile(document, version); versionLocalFile.write(content.getContent()); versionLocalFile.lock(); // update the document updated by\on document.setUpdatedBy(preferences.getUsername()); document.setUpdatedOn(getTimestamp()); documentIO.update(document); // update the content bytes\checksum content.setContent(documentLocalFile.getFileBytes()); content.setChecksum(documentLocalFile.getFileChecksum()); documentIO.updateContent(content); // fire the object version event notification notifyCreation_objectVersionCreated(version); return version; } catch(IOException iox) { logger.error("createVersion(Document,DocumentAction,DocumentActionData)", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("createVersion(Document,DocumentAction,DocumentActionData)", rx); throw ParityErrorTranslator.translate(rx); } } |
if ( o == null && session != null ) | if ( o == null ) | public Object internalGet( String key ) { // make the four scopes of the Apocalypse Read only if ( key.equals( REQUEST )) { return request; } else if( key.equals(RESPONSE) ) { return response; } else if ( key.equals(SESSION) ) { return session; } else if ( key.equals(APPLICATION)) { return application; } // search the toolbox Object o = null; if ( toolboxContext != null) { o = toolboxContext.get( key ); if ( o != null ) { return o; } } // try the local hashtable o = super.internalGet( key ); // if not found, wander down the scopes... if (o == null) { o = request.getAttribute( key ); if ( o == null && session != null ) { o = session.getAttribute( key ); if ( o == null ) { o = application.getAttribute( key ); } } } return o; } |
o = session.getAttribute( key ); | if ( session != null ) { o = session.getAttribute( key ); } | public Object internalGet( String key ) { // make the four scopes of the Apocalypse Read only if ( key.equals( REQUEST )) { return request; } else if( key.equals(RESPONSE) ) { return response; } else if ( key.equals(SESSION) ) { return session; } else if ( key.equals(APPLICATION)) { return application; } // search the toolbox Object o = null; if ( toolboxContext != null) { o = toolboxContext.get( key ); if ( o != null ) { return o; } } // try the local hashtable o = super.internalGet( key ); // if not found, wander down the scopes... if (o == null) { o = request.getAttribute( key ); if ( o == null && session != null ) { o = session.getAttribute( key ); if ( o == null ) { o = application.getAttribute( key ); } } } return o; } |
redirectStreams(); | public WorkspaceImpl(final File workspace) { super(); this.logger = Logger.getLogger(getClass()); this.mode = Mode.valueOf(System.getProperty("thinkparity.mode")); this.workspace = initRoot(workspace); bootstrapLog4J(); } |
|
logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d %p %m%n"); | logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d %t %p %m%n"); | private void bootstrapLog4J() { final Properties logging = bootstrapLog4JConfig(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty("log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty("log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper(getClass()).logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d %p %m%n"); | logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d %t %p %m%n"); | private void bootstrapLog4J() { final Properties logging = bootstrapLog4JConfig(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty("log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty("log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper(getClass()).logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d %m%n"); | logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d %t %m%n"); | private void bootstrapLog4J() { final Properties logging = bootstrapLog4JConfig(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty("log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty("log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper(getClass()).logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d %m%n"); | logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d %t %m%n"); | private void bootstrapLog4J() { final Properties logging = bootstrapLog4JConfig(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty("log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty("log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper(getClass()).logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
"com.thinkparity.codebase.log4j.or.CalendarRenderer"); | "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.util.xmpp.event.XMPPEvent", "com.thinkparity.codebase.model.util.logging.or.XMPPEventRenderer"); | private void bootstrapLog4J() { final Properties logging = bootstrapLog4JConfig(mode); // console appender logging.setProperty("log4j.appender.CONSOLE", "org.apache.log4j.ConsoleAppender"); logging.setProperty("log4j.appender.CONSOLE.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern", "%d %p %m%n"); // default appender logging.setProperty("log4j.appender.DEFAULT", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.DEFAULT.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.DEFAULT.layout.ConversionPattern", "%d %p %m%n"); logging.setProperty("log4j.appender.DEFAULT.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity.log")); // sql appender logging.setProperty("log4j.appender.SQL_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.SQL_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.SQL_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity SQL.log")); // xmpp appender logging.setProperty("log4j.appender.XMPP_DEBUGGER", "org.apache.log4j.RollingFileAppender"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout", "org.apache.log4j.PatternLayout"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.layout.ConversionPattern", "%d %m%n"); logging.setProperty("log4j.appender.XMPP_DEBUGGER.File", MessageFormat.format("{0}{1}logs{1}{2}", workspace.getRoot().getAbsolutePath(), File.separatorChar, "thinkParity XMPP.log")); // loggers switch (mode) { case DEMO: case PRODUCTION: logging.setProperty("log4j.rootLogger", "WARN, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "NONE"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case DEVELOPMENT: logging.setProperty("log4j.rootLogger", "INFO, CONSOLE, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; case TESTING: logging.setProperty("log4j.rootLogger", "INFO, DEFAULT"); logging.setProperty("log4j.logger.SQL_DEBUGGER", "DEBUG, SQL_DEBUGGER"); logging.setProperty("log4j.additivity.SQL_DEBUGGER", "false"); logging.setProperty("log4j.logger.XMPP_DEBUGGER", "DEBUG, XMPP_DEBUGGER"); logging.setProperty("log4j.additivity.XMPP_DEBUGGER", "false"); break; default: throw Assert.createUnreachable("Unknown operating mode."); } // renderers logging.setProperty("log4j.renderer.java.util.Calendar", "com.thinkparity.codebase.log4j.or.CalendarRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.Document", "com.thinkparity.codebase.model.util.logging.or.DocumentRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.document.DocumentVersion", "com.thinkparity.codebase.model.util.logging.or.DocumentVersionRenderer"); logging.setProperty("log4j.renderer.com.thinkparity.codebase.model.user.User", "com.thinkparity.codebase.model.util.logging.or.UserRenderer"); logging.setProperty("log4j.renderer.org.jivesoftware.smack.packet.Packet", "com.thinkparity.ophelia.model.util.logging.or.PacketRenderer"); LogManager.resetConfiguration(); PropertyConfigurator.configure(logging); new Log4JWrapper(getClass()).logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("SQL_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); new Log4JWrapper("XMPP_DEBUGGER").logInfo("{0} - {1}", "thinkParity", "1.0"); } |
doInititializeLogging(testSession); | bootstrapLog4J(testSession.getOutputDirectory()); | private void doInitialize(final TestSession testSession) { doInititializeLogging(testSession); doInitializeStreams(testSession); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.