bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public Collection getProperties(String ns) throws WebdavIntfException { init(true); Vector v = new Vector(); getVevent(); // init comp if (comp == null) { throw new WebdavIntfException("getProperties, comp == null"); } addProp(v, ICalTags.summary, name); addProp(v, ICalTags.dtstart, comp.getDtstart()); addProp(v, ICalTags.dtend, comp.getDtend()); addProp(v, ICalTags.duration, comp.getDuration()); addProp(v, ICalTags.transp, comp.getTransp()); addProp(v, ICalTags.due, comp.getDue());// addProp(v, ICalTags.completed, | date-time from RFC2518 addProp(v, ICalTags.status, comp.getStatus());// addProp(v, ICalTags.priority, | integer// addProp(v, ICalTags.percentComplete, | integer addProp(v, ICalTags.uid, comp.getUid()); addProp(v, ICalTags.sequence, comp.getSequence());// addProp(v, ICalTags.recurrenceId, | date-time from RFC2518// addProp(v, ICalTags.trigger, | see below TODO// FIXME FIX FIX addProp(v, ICalTags.hasRecurrence, "0"); addProp(v, ICalTags.hasAlarm, "0"); addProp(v, ICalTags.hasAttachment, "0"); return v; }
public Collection getProperties(String ns) throws WebdavIntfException { init(true); Vector v = new Vector(); getVevent(); // init comp if (comp == null) { throw new WebdavIntfException("getProperties, comp == null"); } addProp(v, ICalTags.summary, name); addProp(v, ICalTags.dtstart, comp.getDtstart()); addProp(v, ICalTags.dtend, comp.getDtend()); addProp(v, ICalTags.duration, comp.getDuration()); addProp(v, ICalTags.transp, comp.getTransp()); addProp(v, ICalTags.due, comp.getDue());// addProp(v, ICalTags.completed, | date-time from RFC2518 addProp(v, ICalTags.status, comp.getStatus());// addProp(v, ICalTags.priority, | integer// addProp(v, ICalTags.percentComplete, | integer addProp(v, ICalTags.uid, comp.getUid()); addProp(v, ICalTags.sequence, comp.getSequence());// addProp(v, ICalTags.recurrenceId, | date-time from RFC2518// addProp(v, ICalTags.trigger, | see below TODO// FIXME FIX FIX addProp(v, ICalTags.hasRecurrence, "0"); addProp(v, ICalTags.hasAlarm, "0"); addProp(v, ICalTags.hasAttachment, "0"); return v; }
1,120,612
public Collection getProperties(String ns) throws WebdavIntfException { init(true); Vector v = new Vector(); getVevent(); // init comp if (comp == null) { throw new WebdavIntfException("getProperties, comp == null"); } addProp(v, ICalTags.summary, name); addProp(v, ICalTags.dtstart, comp.getDtstart()); addProp(v, ICalTags.dtend, comp.getDtend()); addProp(v, ICalTags.duration, comp.getDuration()); addProp(v, ICalTags.transp, comp.getTransp()); addProp(v, ICalTags.due, comp.getDue());// addProp(v, ICalTags.completed, | date-time from RFC2518 addProp(v, ICalTags.status, comp.getStatus());// addProp(v, ICalTags.priority, | integer// addProp(v, ICalTags.percentComplete, | integer addProp(v, ICalTags.uid, comp.getUid()); addProp(v, ICalTags.sequence, comp.getSequence());// addProp(v, ICalTags.recurrenceId, | date-time from RFC2518// addProp(v, ICalTags.trigger, | see below TODO// FIXME FIX FIX addProp(v, ICalTags.hasRecurrence, "0"); addProp(v, ICalTags.hasAlarm, "0"); addProp(v, ICalTags.hasAttachment, "0"); return v; }
public Collection getProperties(String ns) throws WebdavIntfException { init(true); Vector v = new Vector(); getVevent(); // init comp if (comp == null) { throw new WebdavIntfException("getProperties, comp == null"); } addProp(v, ICalTags.summary, name); addProp(v, ICalTags.dtstart, comp.getDtstart()); addProp(v, ICalTags.dtend, comp.getDtend()); addProp(v, ICalTags.duration, comp.getDuration()); addProp(v, ICalTags.transp, comp.getTransp()); addProp(v, ICalTags.due, comp.getDue());// addProp(v, ICalTags.completed, | date-time from RFC2518 addProp(v, ICalTags.status, comp.getStatus());// addProp(v, ICalTags.priority, | integer// addProp(v, ICalTags.percentComplete, | integer addProp(v, ICalTags.uid, comp.getUid()); addProp(v, ICalTags.sequence, comp.getSequence());// addProp(v, ICalTags.recurrenceId, | date-time from RFC2518// addProp(v, ICalTags.trigger, | see below TODO// FIXME FIX FIX addProp(v, ICalTags.hasRecurrence, "0"); addProp(v, ICalTags.hasAlarm, "0"); addProp(v, ICalTags.hasAttachment, "0"); return v; }
1,120,613
public Collection getProperties(String ns) throws WebdavIntfException { init(true); Vector v = new Vector(); getVevent(); // init comp if (comp == null) { throw new WebdavIntfException("getProperties, comp == null"); } addProp(v, ICalTags.summary, name); addProp(v, ICalTags.dtstart, comp.getDtstart()); addProp(v, ICalTags.dtend, comp.getDtend()); addProp(v, ICalTags.duration, comp.getDuration()); addProp(v, ICalTags.transp, comp.getTransp()); addProp(v, ICalTags.due, comp.getDue());// addProp(v, ICalTags.completed, | date-time from RFC2518 addProp(v, ICalTags.status, comp.getStatus());// addProp(v, ICalTags.priority, | integer// addProp(v, ICalTags.percentComplete, | integer addProp(v, ICalTags.uid, comp.getUid()); addProp(v, ICalTags.sequence, comp.getSequence());// addProp(v, ICalTags.recurrenceId, | date-time from RFC2518// addProp(v, ICalTags.trigger, | see below TODO// FIXME FIX FIX addProp(v, ICalTags.hasRecurrence, "0"); addProp(v, ICalTags.hasAlarm, "0"); addProp(v, ICalTags.hasAttachment, "0"); return v; }
public Collection getProperties(String ns) throws WebdavIntfException { init(true); Vector v = new Vector(); getVevent(); // init comp if (comp == null) { throw new WebdavIntfException("getProperties, comp == null"); } addProp(v, ICalTags.summary, name); addProp(v, ICalTags.dtstart, comp.getDtstart()); addProp(v, ICalTags.dtend, comp.getDtend()); addProp(v, ICalTags.duration, comp.getDuration()); addProp(v, ICalTags.transp, comp.getTransp()); addProp(v, ICalTags.due, comp.getDue());// addProp(v, ICalTags.completed, | date-time from RFC2518 addProp(v, ICalTags.status, comp.getStatus());// addProp(v, ICalTags.priority, | integer// addProp(v, ICalTags.percentComplete, | integer addProp(v, ICalTags.uid, comp.getUid()); addProp(v, ICalTags.sequence, comp.getSequence());// addProp(v, ICalTags.recurrenceId, | date-time from RFC2518// addProp(v, ICalTags.trigger, | see below TODO// FIXME FIX FIX addProp(v, ICalTags.hasRecurrence, "0"); addProp(v, ICalTags.hasAlarm, "0"); addProp(v, ICalTags.hasAttachment, "0"); return al; }
1,120,614
public NATText meta_print() throws XTypeMismatch { return NATText.atValue("<native closure:"+base_getMethod().base_getName().getText().asNativeText().javaValue+">"); }
public NATText meta_print() throws XTypeMismatch { return NATText.atValue("<native closure:"+base_getMethod().base_getName().base_getText().asNativeText().javaValue+">"); }
1,120,615
public void dumpSection(Iterator it) throws Throwable { if (annotations) { tagStart(sectionEventAnnotations); } else { tagStart(sectionEvents); } long ct = 0; while (it.hasNext()) { dumpEvent((BwEvent)it.next()); ct++; if ((ct % 100) == 0) { info(" ... " + ct); } } if (annotations) { tagEnd(sectionEventAnnotations); } else { tagEnd(sectionEvents); } }
public void dumpSection(Iterator it) throws Throwable { if (annotations) { tagStart(sectionEventAnnotations); } else { tagStart(sectionEvents); } while (it.hasNext()) { dumpEvent((BwEvent)it.next()); ct++; if ((ct % 100) == 0) { info(" ... " + ct); } } if (annotations) { tagEnd(sectionEventAnnotations); } else { tagEnd(sectionEvents); } }
1,120,616
public void dumpSection(Iterator it) throws Throwable { if (annotations) { tagStart(sectionEventAnnotations); } else { tagStart(sectionEvents); } long ct = 0; while (it.hasNext()) { dumpEvent((BwEvent)it.next()); ct++; if ((ct % 100) == 0) { info(" ... " + ct); } } if (annotations) { tagEnd(sectionEventAnnotations); } else { tagEnd(sectionEvents); } }
public void dumpSection(Iterator it) throws Throwable { if (annotations) { tagStart(sectionEventAnnotations); } else { tagStart(sectionEvents); } long ct = 0; while (it.hasNext()) { dumpEvent((BwEvent)it.next()); if ((ct % 100) == 0) { info(" ... " + ct); } } if (annotations) { tagEnd(sectionEventAnnotations); } else { tagEnd(sectionEvents); } }
1,120,617
public void dumpSection(Iterator it) throws Throwable { if (annotations) { tagStart(sectionEventAnnotations); } else { tagStart(sectionEvents); } long ct = 0; while (it.hasNext()) { dumpEvent((BwEvent)it.next()); ct++; if ((ct % 100) == 0) { info(" ... " + ct); } } if (annotations) { tagEnd(sectionEventAnnotations); } else { tagEnd(sectionEvents); } }
public void dumpSection(Iterator it) throws Throwable { if (annotations) { tagStart(sectionEventAnnotations); } else { tagStart(sectionEvents); } long ct = 0; while (it.hasNext()) { dumpEvent((BwEvent)it.next()); ct++; if ((ct % 100) == 0) { info(" ... " + ct); } } if (annotations) { tagEnd(sectionEventAnnotations); } else { tagEnd(sectionEvents); } }
1,120,618
private void appendIdea(Document document, Element element, Idea idea) throws IOException { Element ideaElement = document.createElement("outline"); ideaElement.setAttribute("text", idea.getText()); ideaElement.setAttribute("angle", "" + idea.getAngle()); String notes = idea.getNotes(); System.out.println("notes = " + notes); if ((notes != null) && (notes.length() != 0)) { ideaElement.setAttribute("notes", idea.getNotes()); } element.appendChild(ideaElement); for (Idea subIdea: idea.getSubIdeas()) { appendIdea(document, ideaElement, subIdea); } }
private void appendIdea(Document document, Element element, Idea idea) throws IOException { Element ideaElement = document.createElement("outline"); ideaElement.setAttribute("text", idea.getText()); ideaElement.setAttribute("angle", "" + idea.getAngle()); String notes = idea.getNotes(); if ((notes != null) && (notes.length() != 0)) { ideaElement.setAttribute("notes", idea.getNotes()); } element.appendChild(ideaElement); for (Idea subIdea: idea.getSubIdeas()) { appendIdea(document, ideaElement, subIdea); } }
1,120,619
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } int calId = getIntReqPar(request, "calId", -1); String calUri = null; BwCalendar cal = null; CalSvcI svc = form.getCalSvcI(); BwSubscription sub; if (calId < 0) { calUri = request.getParameter("calUri"); if (calUri == null) { return "error"; } sub = BwSubscription.makeSubscription(calUri, null, false, false, false); } else { cal = svc.getCalendar(calId); if (cal == null) { // Assume no access form.getErr().emit("org.bedework.client.noaccess"); return "noAccess"; } sub = BwSubscription.makeSubscription(cal, cal.getName(), false, false, false); } form.assignAddingSubscription(true); form.setSubscription(sub); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } int calId = getIntReqPar(request, "calId", -1); String calUri = null; BwCalendar cal = null; CalSvcI svc = form.getCalSvcI(); BwSubscription sub; if (calId < 0) { calUri = request.getParameter("calUri"); if (calUri == null) { return "error"; } sub = BwSubscription.makeSubscription(calUri, null, false, false, false); } else { cal = svc.getCalendar(calId); if (cal == null) { // Assume no access form.getErr().emit("org.bedework.client.error.noaccess"); return "noAccess"; } sub = BwSubscription.makeSubscription(cal, cal.getName(), false, false, false); } form.assignAddingSubscription(true); form.setSubscription(sub); return "success"; }
1,120,620
public boolean validate(MessageEmit err) { goodValue = true; if (!getShow()) { return true; } try { setIntVal(Integer.parseInt(getValue())); } catch (Throwable t) { err.emit("org.bedework.config.badvalue", getName(), getValue()); goodValue = false; } return goodValue; }
public boolean validate(MessageEmit err) { goodValue = true; if (!getShow()) { return true; } try { setIntVal(Integer.parseInt(getValue())); } catch (Throwable t) { err.emit("org.bedework.config.error.badvalue", getName(), getValue()); goodValue = false; } return goodValue; }
1,120,621
public CalTimezones getTzcache() throws Throwable { if (tzcache != null) { return tzcache; } if (syspars.getTzid() == null) { throw new Exception("syspars.tzid not initialised"); } tzcache = new TimezonesImpl(debug, getPublicUser(), rintf); tzcache.setDefaultTimeZoneId(syspars.getTzid()); if (timezonesFilename != null) { TimeZonesParser tzp = new TimeZonesParser( new FileInputStream(timezonesFilename), debug); Collection tzis = tzp.getTimeZones(); Iterator it = tzis.iterator(); while (it.hasNext()) { TimeZonesParser.TimeZoneInfo tzi = (TimeZonesParser.TimeZoneInfo)it.next(); tzcache.saveTimeZone(tzi.tzid, tzi.timezone); } } return tzcache; }
public CalTimezones getTzcache() throws Throwable { if (tzcache != null) { return tzcache; } if (syspars.getTzid() == null) { throw new Exception("syspars.tzid not initialised"); } tzcache = new TimezonesImpl(debug, getPublicUser(), rintf); tzcache.setDefaultTimeZoneId(syspars.getTzid()); if (from2p3px && (timezonesFilename != null)) { TimeZonesParser tzp = new TimeZonesParser( new FileInputStream(timezonesFilename), debug); Collection tzis = tzp.getTimeZones(); Iterator it = tzis.iterator(); while (it.hasNext()) { TimeZonesParser.TimeZoneInfo tzi = (TimeZonesParser.TimeZoneInfo)it.next(); tzcache.saveTimeZone(tzi.tzid, tzi.timezone); } } return tzcache; }
1,120,622
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResultSession sessionBean = (QueryResultSession) IBOLookup.getSessionInstance(iwc, QueryResultSession.class); QueryResult queryResult = null; if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { // use the already existing result that was stored in the session but only if the // values of the variables have not changed Map identifierValueMap = sqlQuery.getIdentifierValueMap(); queryResult = sessionBean.getQueryResult(identifierValueMap); if (queryResult != null) { queryResult.setDesiredNumberOfRows(numberOfRows); } } if (queryResult == null) { queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); } // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); // store the already calculated result in the session // the user is now asked how many rows he wants to see and he can also change the values of the variables // therefore store the result and the used values for the inputfields. // if the current values are different (the user has changed some) the existing result can not be used. Map identifierMap = sqlQuery.getIdentifierValueMap(); sessionBean.storeQueryResult(identifierMap, queryResult); return buffer.toString(); } // destroy stored query result in session bean (if it was stored) sessionBean.deleteQueryResult(); resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResultSession sessionBean = (QueryResultSession) IBOLookup.getSessionInstance(iwc, QueryResultSession.class); QueryResult queryResult = null; if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { // use the already existing result that was stored in the session but only if the // values of the variables have not changed Map identifierValueMap = sqlQuery.getIdentifierValueMap(); queryResult = sessionBean.getQueryResult(identifierValueMap); if (queryResult != null) { queryResult.setDesiredNumberOfRows(numberOfRows); } } if (queryResult == null) { queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); } // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); // store the already calculated result in the session // the user is now asked how many rows he wants to see and he can also change the values of the variables // therefore store the result and the used values for the inputfields. // if the current values are different (the user has changed some) the existing result can not be used. Map identifierMap = sqlQuery.getIdentifierValueMap(); sessionBean.storeQueryResult(identifierMap, queryResult); return buffer.toString(); } // destroy stored query result in session bean (if it was stored) sessionBean.deleteQueryResult(); resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
1,120,624
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResultSession sessionBean = (QueryResultSession) IBOLookup.getSessionInstance(iwc, QueryResultSession.class); QueryResult queryResult = null; if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { // use the already existing result that was stored in the session but only if the // values of the variables have not changed Map identifierValueMap = sqlQuery.getIdentifierValueMap(); queryResult = sessionBean.getQueryResult(identifierValueMap); if (queryResult != null) { queryResult.setDesiredNumberOfRows(numberOfRows); } } if (queryResult == null) { queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); } // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); // store the already calculated result in the session // the user is now asked how many rows he wants to see and he can also change the values of the variables // therefore store the result and the used values for the inputfields. // if the current values are different (the user has changed some) the existing result can not be used. Map identifierMap = sqlQuery.getIdentifierValueMap(); sessionBean.storeQueryResult(identifierMap, queryResult); return buffer.toString(); } // destroy stored query result in session bean (if it was stored) sessionBean.deleteQueryResult(); resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResultSession sessionBean = (QueryResultSession) IBOLookup.getSessionInstance(iwc, QueryResultSession.class); QueryResult queryResult = null; if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { // use the already existing result that was stored in the session but only if the // values of the variables have not changed Map identifierValueMap = sqlQuery.getIdentifierValueMap(); queryResult = sessionBean.getQueryResult(identifierValueMap); if (queryResult != null) { queryResult.setDesiredNumberOfRows(numberOfRows); } } if (queryResult == null) { queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); } // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); // store the already calculated result in the session // the user is now asked how many rows he wants to see and he can also change the values of the variables // therefore store the result and the used values for the inputfields. // if the current values are different (the user has changed some) the existing result can not be used. Map identifierMap = sqlQuery.getIdentifierValueMap(); sessionBean.storeQueryResult(identifierMap, queryResult); return buffer.toString(); } // destroy stored query result in session bean (if it was stored) sessionBean.deleteQueryResult(); resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
1,120,625
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResultSession sessionBean = (QueryResultSession) IBOLookup.getSessionInstance(iwc, QueryResultSession.class); QueryResult queryResult = null; if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { // use the already existing result that was stored in the session but only if the // values of the variables have not changed Map identifierValueMap = sqlQuery.getIdentifierValueMap(); queryResult = sessionBean.getQueryResult(identifierValueMap); if (queryResult != null) { queryResult.setDesiredNumberOfRows(numberOfRows); } } if (queryResult == null) { queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); } // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); // store the already calculated result in the session // the user is now asked how many rows he wants to see and he can also change the values of the variables // therefore store the result and the used values for the inputfields. // if the current values are different (the user has changed some) the existing result can not be used. Map identifierMap = sqlQuery.getIdentifierValueMap(); sessionBean.storeQueryResult(identifierMap, queryResult); return buffer.toString(); } // destroy stored query result in session bean (if it was stored) sessionBean.deleteQueryResult(); resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
private String executeQueries(SQLQuery sqlQuery, int numberOfRows, QueryToSQLBridge sqlBridge, List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { QueryResultSession sessionBean = (QueryResultSession) IBOLookup.getSessionInstance(iwc, QueryResultSession.class); QueryResult queryResult = null; if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { // use the already existing result that was stored in the session but only if the // values of the variables have not changed Map identifierValueMap = sqlQuery.getIdentifierValueMap(); queryResult = sessionBean.getQueryResult(identifierValueMap); if (queryResult != null) { queryResult.setDesiredNumberOfRows(numberOfRows); } } if (queryResult == null) { queryResult = sqlBridge.executeQueries(sqlQuery, numberOfRows, executedSQLStatements); } // check if everything is fine if (queryResult == null) { // serious error. // It's very likely that the server has chrashed before without removing all created views. // In that case a new view with the same name can't be created - the database will throw an error. return resourceBundle.getLocalizedString("ro_execution_of_query_failed", "Execution of query failed."); } if (queryResult.isEmpty()) { // nothing to do, result is empty, that is not an error return resourceBundle.getLocalizedString("ro_result_of_query_is_empty", "Result of query is empty"); } resultNumberOfRows = queryResult.getNumberOfRows(); // that means: if the user has set number of rows to 12 000 and the result contains 11 000 rows // nothing happens even if MAX_NUMBER_OF_ROWS_IN_RESULT is only set to 500 if (resultNumberOfRows > numberOfRows && resultNumberOfRows > QueryConstants.MAX_NUMBER_OF_ROWS_IN_RESULT) { String error = resourceBundle.getLocalizedString("ro_number_of_rows_in result _might_be_too_large", "Number of rows might be too large"); String rows = resourceBundle.getLocalizedString("ro_rows","rows"); StringBuffer buffer = new StringBuffer(error); buffer.append(": ").append(resultNumberOfRows).append(" ").append(rows); // store the already calculated result in the session // the user is now asked how many rows he wants to see and he can also change the values of the variables // therefore store the result and the used values for the inputfields. // if the current values are different (the user has changed some) the existing result can not be used. Map identifierMap = sqlQuery.getIdentifierValueMap(); sessionBean.storeQueryResult(identifierMap, queryResult); return buffer.toString(); } // destroy stored query result in session bean (if it was stored) sessionBean.deleteQueryResult(); resultNumberOfRows = -1; // get design JasperReportBusiness reportBusiness = getReportBusiness(); DesignBox designBox = getDesignBox(sqlQuery, reportBusiness, resourceBundle, iwc); // check if the design is fine if (designBox == null) { return resourceBundle.getLocalizedString("ro_design_is_not available", "Problems with the chosen layout occurred."); } // synchronize design and result Map designParameters = new HashMap(); designParameters.put(REPORT_HEADLINE_KEY, sqlQuery.getName()); JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designParameters, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } // create html report String uri; if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else if (EXCEL_KEY.equals(outputFormat)) { uri = reportBusiness.getExcelReport(print, "report"); } else { JasperPrint print = reportBusiness.printSynchronizedReport(queryResult, designBox); if (print == null) { return resourceBundle.getLocalizedString("ro_could_not_use_layout", "Layout can't be used"); } if (PDF_KEY.equals(outputFormat)) { uri = reportBusiness.getPdfReport(print, "report"); } else { uri = reportBusiness.getHtmlReport(print, "report"); } } Page parentPage = getParentPage(); if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); add(new Text("ADD_QUERY_SQL_FOR_DEBUG is true, result is shown in pop up window!")); parentPage.setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); } else { parentPage.setToRedirect(uri); } // open an extra window with scrollbars //getParentPage().setOnLoad("window.open('" + uri + "' , 'newWin', 'width=600,height=400,scrollbars=yes')"); //openwindow(Address,Name,ToolBar,Location,Directories,Status,Menubar,Titlebar,Scrollbars,Resizable,Width,Height) //getParentPage().setOnLoad(" openwindow('" + uri + "','IdegaWeb Generated Report','0','0','0','0','0','1','1','1','800','600') "); return null; }
1,120,626
private DesignBox getDesignBox(SQLQuery sqlQuery, JasperReportBusiness reportBusiness, IWResourceBundle resourceBundle, IWContext iwc) { DesignBox design = null; try { if (designId > 0) { design = reportBusiness.getDesignBox(designId); } else { design = reportBusiness.getDynamicDesignBox(sqlQuery, resourceBundle, iwc); } } catch (IOException ioEx) { logError("[ReportQueryOverview] Couldn't retrieve design."); log(ioEx); } catch (JRException jrEx) { logError("[ReportQueryOverview] Couldn't retrieve design."); log(jrEx); } return design; }
private DesignBox getDesignBox(SQLQuery sqlQuery, JasperReportBusiness reportBusiness, IWResourceBundle resourceBundle, IWContext iwc) { DesignBox design = null; try { if (designId > 0) { design = reportBusiness.getDesignBox(designId); } else { design = reportBusiness.getDynamicDesignBox(sqlQuery, resourceBundle, iwc); } } catch (IOException ioEx) { logError("[QueryResultViewer] Couldn't retrieve design."); log(ioEx); } catch (JRException jrEx) { logError("[QueryResultViewer] Couldn't retrieve design."); log(jrEx); } return design; }
1,120,627
public GroupBusiness getGroupBusiness() { try { return (GroupBusiness) IBOLookup.getServiceInstance(getIWApplicationContext(), GroupBusiness.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve GroupBusiness. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve GroupBusiness"); } }
public GroupBusiness getGroupBusiness() { try { return (GroupBusiness) IBOLookup.getServiceInstance(getIWApplicationContext(), GroupBusiness.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve GroupBusiness. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve GroupBusiness"); } }
1,120,629
private InputHandler getInputHandler(String className) { if (className == null) { return null; } InputHandler inputHandler = null; try { inputHandler = (InputHandler) RefactorClassRegistry.forName(className).newInstance(); } catch (ClassNotFoundException ex) { log(ex); logError("[ReportOverview] Could not retrieve handler class"); } catch (InstantiationException ex) { log(ex); logError("[ReportOverview] Could not instanciate handler class"); } catch (IllegalAccessException ex) { log(ex); logError("[ReportOverview] Could not instanciate handler class"); } return inputHandler; }
private InputHandler getInputHandler(String className) { if (className == null) { return null; } InputHandler inputHandler = null; try { inputHandler = (InputHandler) RefactorClassRegistry.forName(className).newInstance(); } catch (ClassNotFoundException ex) { log(ex); logError("[QueryResultViewer] Could not retrieve handler class"); } catch (InstantiationException ex) { log(ex); logError("[ReportOverview] Could not instanciate handler class"); } catch (IllegalAccessException ex) { log(ex); logError("[ReportOverview] Could not instanciate handler class"); } return inputHandler; }
1,120,630
private InputHandler getInputHandler(String className) { if (className == null) { return null; } InputHandler inputHandler = null; try { inputHandler = (InputHandler) RefactorClassRegistry.forName(className).newInstance(); } catch (ClassNotFoundException ex) { log(ex); logError("[ReportOverview] Could not retrieve handler class"); } catch (InstantiationException ex) { log(ex); logError("[ReportOverview] Could not instanciate handler class"); } catch (IllegalAccessException ex) { log(ex); logError("[ReportOverview] Could not instanciate handler class"); } return inputHandler; }
private InputHandler getInputHandler(String className) { if (className == null) { return null; } InputHandler inputHandler = null; try { inputHandler = (InputHandler) RefactorClassRegistry.forName(className).newInstance(); } catch (ClassNotFoundException ex) { log(ex); logError("[ReportOverview] Could not retrieve handler class"); } catch (InstantiationException ex) { log(ex); logError("[QueryResultViewer] Could not instanciate handler class"); } catch (IllegalAccessException ex) { log(ex); logError("[QueryResultViewer] Could not instanciate handler class"); } return inputHandler; }
1,120,631
public QueryService getQueryService() { try { return (QueryService) IBOLookup.getServiceInstance( getIWApplicationContext() ,QueryService.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve QueryService. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve QueryService"); } }
public QueryService getQueryService() { try { return (QueryService) IBOLookup.getServiceInstance( getIWApplicationContext() ,QueryService.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve QueryService. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve QueryService"); } }
1,120,632
public QueryToSQLBridge getQueryToSQLBridge() { try { return (QueryToSQLBridge) IBOLookup.getServiceInstance( getIWApplicationContext() ,QueryToSQLBridge.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve QueryToSqlBridge. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve QueryToSQLBridge"); } }
public QueryToSQLBridge getQueryToSQLBridge() { try { return (QueryToSQLBridge) IBOLookup.getServiceInstance( getIWApplicationContext() ,QueryToSQLBridge.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve QueryToSqlBridge. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve QueryToSQLBridge"); } }
1,120,633
public JasperReportBusiness getReportBusiness() { try { return (JasperReportBusiness) IBOLookup.getServiceInstance( getIWApplicationContext(), JasperReportBusiness.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve JasperReportBusiness. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve ReportBusiness"); } }
public JasperReportBusiness getReportBusiness() { try { return (JasperReportBusiness) IBOLookup.getServiceInstance( getIWApplicationContext(), JasperReportBusiness.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve JasperReportBusiness. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve ReportBusiness"); } }
1,120,634
public UserBusiness getUserBusiness() { try { return (UserBusiness) IBOLookup.getServiceInstance(getIWApplicationContext(), UserBusiness.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve UserBusiness. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve UserBusiness"); } }
public UserBusiness getUserBusiness() { try { return (UserBusiness) IBOLookup.getServiceInstance(getIWApplicationContext(), UserBusiness.class); } catch (RemoteException ex) { System.err.println("[ReportOverview]: Can't retrieve UserBusiness. Message is: " + ex.getMessage()); throw new RuntimeException("[ReportOverview]: Can't retrieve UserBusiness"); } }
1,120,635
private String initializeByParsing(IWContext iwc, IWResourceBundle resourceBundle) throws NumberFormatException, RemoteException, FinderException, IOException { // request from self if (iwc.isParameterSet(QUERY_ID_KEY)) { queryId = Integer.parseInt(iwc.getParameter(QUERY_ID_KEY)); designId = Integer.parseInt(iwc.getParameter(DESIGN_ID_KEY)); outputFormat = iwc.getParameter(OUTPUT_FORMAT_KEY); if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { numberOfRowsLimit = Integer.parseInt(iwc.getParameter(NUMBER_OF_ROWS_KEY)); } } else { // request from overview EntityPathValueContainer executeContainer = ButtonConverter.getResultByParsing(iwc); if (executeContainer.isValid()) { // get the chosen output format outputFormat = executeContainer.getEntityPathShortKey(); // get the chosen query Integer queryIdInteger = executeContainer.getEntityIdConvertToInteger(); queryId = queryIdInteger.intValue(); //get the chosen layout EntityPathValueContainer layoutContainer = DropDownMenuConverter.getResultByEntityIdAndEntityPathShortKey(queryIdInteger, DESIGN_CHOOSER_KEY, iwc); if (layoutContainer.isValid()){ try { designId = Integer.parseInt(layoutContainer.getValue().toString()); } catch (NumberFormatException ex) { logError("[ReportOverview]: Can't retrieve id of layout"); log(ex); return resourceBundle.getLocalizedString("ro_design_id_could_not_be_fetched", "Design id could not be fetched"); } } else { return resourceBundle.getLocalizedString("ro_design_id_could_not_be_fetched", "Design id could not be fetched"); } } else { return resourceBundle.getLocalizedString("ro_query_id_could_not_be_fetched", "Query id could not be fetched"); } } QueryService queryService = getQueryService(); QueryHelper queryHelper = queryService.getQueryHelper(queryId, iwc); bridge = getQueryToSQLBridge(); query = null; try { query = bridge.createQuerySQL(queryHelper, iwc); } catch (QueryGenerationException ex) { logError("[QueryResultViewer] Can't create query"); log(ex); return resourceBundle.getLocalizedString("ro_query_could_not_be_created", "Query could not be created"); } return null; }
private String initializeByParsing(IWContext iwc, IWResourceBundle resourceBundle) throws NumberFormatException, RemoteException, FinderException, IOException { // request from self if (iwc.isParameterSet(QUERY_ID_KEY)) { queryId = Integer.parseInt(iwc.getParameter(QUERY_ID_KEY)); designId = Integer.parseInt(iwc.getParameter(DESIGN_ID_KEY)); outputFormat = iwc.getParameter(OUTPUT_FORMAT_KEY); if (iwc.isParameterSet(NUMBER_OF_ROWS_KEY)) { numberOfRowsLimit = Integer.parseInt(iwc.getParameter(NUMBER_OF_ROWS_KEY)); } } else { // request from overview EntityPathValueContainer executeContainer = ButtonConverter.getResultByParsing(iwc); if (executeContainer.isValid()) { // get the chosen output format outputFormat = executeContainer.getEntityPathShortKey(); // get the chosen query Integer queryIdInteger = executeContainer.getEntityIdConvertToInteger(); queryId = queryIdInteger.intValue(); //get the chosen layout EntityPathValueContainer layoutContainer = DropDownMenuConverter.getResultByEntityIdAndEntityPathShortKey(queryIdInteger, DESIGN_CHOOSER_KEY, iwc); if (layoutContainer.isValid()){ try { designId = Integer.parseInt(layoutContainer.getValue().toString()); } catch (NumberFormatException ex) { logError("[QueryResultViewer]: Can't retrieve id of layout"); log(ex); return resourceBundle.getLocalizedString("ro_design_id_could_not_be_fetched", "Design id could not be fetched"); } } else { return resourceBundle.getLocalizedString("ro_design_id_could_not_be_fetched", "Design id could not be fetched"); } } else { return resourceBundle.getLocalizedString("ro_query_id_could_not_be_fetched", "Query id could not be fetched"); } } QueryService queryService = getQueryService(); QueryHelper queryHelper = queryService.getQueryHelper(queryId, iwc); bridge = getQueryToSQLBridge(); query = null; try { query = bridge.createQuerySQL(queryHelper, iwc); } catch (QueryGenerationException ex) { logError("[QueryResultViewer] Can't create query"); log(ex); return resourceBundle.getLocalizedString("ro_query_could_not_be_created", "Query could not be created"); } return null; }
1,120,636
public void sample(int generation, Population population) { int[] sample = getSample(generation, population); List<Taxon> taxa = new ArrayList<Taxon>(); for (int i = 0; i < sample.length; i++) { taxa.add(Taxon.getTaxon(substituteVariables(label, generation, i + 1))); } if (sample != null) { RootedTree tree = population.getPhylogeny().reconstructPhylogeny(sample, taxa); if (tree != null) { try { exporter.exportTree(tree); } catch (IOException e) { e.printStackTrace(); } } } }
public void sample(int generation, Population population) { int[] sample = getSample(generation, population); List<Taxon> taxa = new ArrayList<Taxon>(); for (int i = 0; i < sample.length; i++) { taxa.add(Taxon.getTaxon(substituteVariables(label, generation, i + 1))); } if (sample != null) { RootedTree tree = population.getPhylogeny().reconstructPhylogeny(sample, taxa); if (tree != null) { try { exporter.exportTree(tree); } catch (IOException e) { e.printStackTrace(); } } } }
1,120,638
private DropdownMenu getDataEntityDrop(String name, String selected) { List L = ReportFinder.listOfDataClasses(); DropdownMenu drp = new DropdownMenu(name); drp.addMenuElementFirst("-", "-1"); java.util.Iterator I = L.iterator(); while (I.hasNext()) { ICObject obj = (ICObject) I.next(); drp.addMenuElement(obj.getClassName(), obj.getName()); } drp.setSelectedElement(selected); return drp; }
private DropdownMenu getDataEntityDrop(String name, String selected) { Collection L = ReportFinder.listOfDataClasses(); DropdownMenu drp = new DropdownMenu(name); drp.addMenuElementFirst("-", "-1"); java.util.Iterator I = L.iterator(); while (I.hasNext()) { ICObject obj = (ICObject) I.next(); drp.addMenuElement(obj.getClassName(), obj.getName()); } drp.setSelectedElement(selected); return drp; }
1,120,639
public NATText meta_print() throws XTypeMismatch { return NATText.atValue("<native method:"+base_getName().getText().asNativeText().javaValue+">"); }
public NATText meta_print() throws XTypeMismatch { return NATText.atValue("<native method:"+base_getName().base_getText().asNativeText().javaValue+">"); }
1,120,640
public String getTitle() { return "AudioPlayer"; }
public String getTitle() { return "Audio"; }
1,120,642
public String getXmlAccess() { try { if (xmlAccess == null) { Acl acl = svci.getAcl(getEvent()); xmlAccess = AccessUtil.getXmlString(acl); } } catch (Throwable t) { error(t); } return xmlAccess; }
public String getXmlAccess() { try { if (xmlAccess == null) { Acl acl = svci.getAcl(getEvent()); xmlAccess = AccessAppUtil.getXmlAclString(acl); } } catch (Throwable t) { error(t); } return xmlAccess; }
1,120,643
public void field(String name) throws java.lang.Exception{ BwPreferences p = (BwPreferences)top(); if (ownedEntityTags(p, name)) { return; } if (name.equals("email")) { p.setEmail(stringFld()); } else if (name.equals("defaultCalendar")) { p.setDefaultCalendar(calendarFld()); } else if (name.equals("skinName")) { p.setSkinName(stringFld()); } else if (name.equals("skinStyle")) { p.setSkinStyle(stringFld()); } else if (name.equals("preferredView")) { p.setPreferredView(stringFld()); } else if (name.equals("subscriptions")) { // Nothing to do now } else if (name.equals("workDays")) { p.setWorkDays(stringFld()); } else if (name.equals("workdayStart")) { p.setWorkdayStart(intFld()); } else if (name.equals("workdayEnd")) { p.setWorkdayEnd(intFld()); } else if (name.equals("preferredEndType")) { p.setPreferredEndType(stringFld()); } else if (name.equals("userMode")) { p.setUserMode(intFld()); // subscription fields } else if (name.equals("subscription")) { globals.subscriptionsTbl.put(p.getOwner(), globals.curSub); p.addSubscription(globals.curSub); globals.curSub = null; } else if (name.equals("sub-id")) { globals.curSub = new BwSubscription(); globals.curSub.setId(intFld()); } else if (name.equals("sub-seq")) { globals.curSub.setSeq(intFld()); } else if (name.equals("sub-name")) { globals.curSub.setName(stringFld()); } else if (name.equals("sub-owner")) { BwUser sowner = userFld(); if (!p.getOwner().equals(sowner)) { error("Subscription owners don't match for " + globals.curSub); error(" Found owner " + sowner + " expected " + p.getOwner()); } globals.curSub.setOwner(p.getOwner()); } else if (name.equals("sub-uri")) { globals.curSub.setUri(stringFld()); } else if (name.equals("sub-affectsFreeBusy")) { globals.curSub.setAffectsFreeBusy(booleanFld()); } else if (name.equals("sub-ignoreTransparency")) { globals.curSub.setIgnoreTransparency(booleanFld()); } else if (name.equals("sub-display")) { globals.curSub.setDisplay(booleanFld()); } else if (name.equals("sub-style")) { globals.curSub.setStyle(stringFld()); } else if (name.equals("sub-internalSubscription")) { globals.curSub.setInternalSubscription(booleanFld()); } else if (name.equals("sub-emailNotifications")) { globals.curSub.setEmailNotifications(booleanFld()); } else if (name.equals("sub-calendarDeleted")) { globals.curSub.setCalendarDeleted(booleanFld()); } else if (name.equals("sub-unremoveable")) { globals.curSub.setUnremoveable(booleanFld()); // view fields } else if (name.equals("view")) { p.addView(globals.curView); globals.curView = null; } else if (name.equals("view-id")) { globals.curView = new BwView(); globals.curView.setId(intFld()); } else if (name.equals("view-seq")) { globals.curView.setSeq(intFld()); } else if (name.equals("view-name")) { globals.curView.setName(stringFld()); } else if (name.equals("view-owner")) { BwUser vowner = userFld(); if (!p.getOwner().equals(vowner)) { error("View owners don't match for " + globals.curView); error(" Found owner " + vowner + " expected " + p.getOwner()); } globals.curView.setOwner(p.getOwner()); } else if (name.equals("view-subscriptions")) { } else if (name.equals("view-sub-id")) { // pre 3.1 BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), intFld()); if (sub == null) { error(" Missing subscription " + intFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } else if (name.equals("view-sub-name")) { BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), stringFld()); if (sub == null) { error(" Missing subscription " + stringFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } }
public void field(String name) throws java.lang.Exception{ BwPreferences p = (BwPreferences)top(); if (ownedEntityTags(p, name)) { return; } if (name.equals("email")) { p.setEmail(stringFld()); } else if (name.equals("defaultCalendar")) { p.setDefaultCalendar(calendarFld()); } else if (name.equals("skinName")) { p.setSkinName(stringFld()); } else if (name.equals("skinStyle")) { p.setSkinStyle(stringFld()); } else if (name.equals("preferredView")) { p.setPreferredView(stringFld()); } else if (name.equals("subscriptions")) { // Nothing to do now } else if (name.equals("workDays")) { p.setWorkDays(stringFld()); } else if (name.equals("workdayStart")) { p.setWorkdayStart(intFld()); } else if (name.equals("workdayEnd")) { p.setWorkdayEnd(intFld()); } else if (name.equals("preferredEndType")) { p.setPreferredEndType(stringFld()); } else if (name.equals("userMode")) { p.setUserMode(intFld()); // subscription fields } else if (name.equals("subscription")) { globals.subscriptionsTbl.put(p.getOwner(), globals.curSub); p.addSubscription(globals.curSub); globals.curSub = null; } else if (name.equals("sub-id")) { globals.curSub = new BwSubscription(); globals.curSub.setId(intFld()); } else if (name.equals("sub-seq")) { globals.curSub.setSeq(intFld()); } else if (name.equals("sub-name")) { globals.curSub.setName(stringFld()); } else if (name.equals("sub-owner")) { BwUser sowner = userFld(); if (!p.getOwner().equals(sowner)) { error("Subscription owners don't match for " + globals.curSub); error(" Found owner " + sowner + " expected " + p.getOwner()); } globals.curSub.setOwner(p.getOwner()); } else if (name.equals("sub-uri")) { globals.curSub.setUri(stringFld()); } else if (name.equals("sub-affectsFreeBusy")) { globals.curSub.setAffectsFreeBusy(booleanFld()); } else if (name.equals("sub-ignoreTransparency")) { globals.curSub.setIgnoreTransparency(booleanFld()); } else if (name.equals("sub-display")) { globals.curSub.setDisplay(booleanFld()); } else if (name.equals("sub-style")) { globals.curSub.setStyle(stringFld()); } else if (name.equals("sub-internalSubscription")) { globals.curSub.setInternalSubscription(booleanFld()); } else if (name.equals("sub-emailNotifications")) { globals.curSub.setEmailNotifications(booleanFld()); } else if (name.equals("sub-calendarDeleted")) { globals.curSub.setCalendarDeleted(booleanFld()); } else if (name.equals("sub-unremoveable")) { globals.curSub.setUnremoveable(booleanFld()); // view fields } else if (name.equals("view")) { p.addView(globals.curView); globals.curView = null; } else if (name.equals("view-id")) { globals.curView = new BwView(); globals.curView.setId(intFld()); } else if (name.equals("view-seq")) { globals.curView.setSeq(intFld()); } else if (name.equals("view-name")) { globals.curView.setName(stringFld()); } else if (name.equals("view-owner")) { BwUser vowner = userFld(); if (!p.getOwner().equals(vowner)) { error("View owners don't match for " + globals.curView); error(" Found owner " + vowner + " expected " + p.getOwner()); } globals.curView.setOwner(p.getOwner()); } else if (name.equals("view-subscriptions")) { } else if (name.equals("view-sub-id")) { // pre 3.1 BwSubscription sub = globals.subscriptionsTbl.getSub( OwnerInfo.makeOwnerInfo(p.getOwner()), intFld()); if (sub == null) { error(" Missing subscription " + intFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } else if (name.equals("view-sub-name")) { BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), stringFld()); if (sub == null) { error(" Missing subscription " + stringFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } }
1,120,644
public void field(String name) throws java.lang.Exception{ BwPreferences p = (BwPreferences)top(); if (ownedEntityTags(p, name)) { return; } if (name.equals("email")) { p.setEmail(stringFld()); } else if (name.equals("defaultCalendar")) { p.setDefaultCalendar(calendarFld()); } else if (name.equals("skinName")) { p.setSkinName(stringFld()); } else if (name.equals("skinStyle")) { p.setSkinStyle(stringFld()); } else if (name.equals("preferredView")) { p.setPreferredView(stringFld()); } else if (name.equals("subscriptions")) { // Nothing to do now } else if (name.equals("workDays")) { p.setWorkDays(stringFld()); } else if (name.equals("workdayStart")) { p.setWorkdayStart(intFld()); } else if (name.equals("workdayEnd")) { p.setWorkdayEnd(intFld()); } else if (name.equals("preferredEndType")) { p.setPreferredEndType(stringFld()); } else if (name.equals("userMode")) { p.setUserMode(intFld()); // subscription fields } else if (name.equals("subscription")) { globals.subscriptionsTbl.put(p.getOwner(), globals.curSub); p.addSubscription(globals.curSub); globals.curSub = null; } else if (name.equals("sub-id")) { globals.curSub = new BwSubscription(); globals.curSub.setId(intFld()); } else if (name.equals("sub-seq")) { globals.curSub.setSeq(intFld()); } else if (name.equals("sub-name")) { globals.curSub.setName(stringFld()); } else if (name.equals("sub-owner")) { BwUser sowner = userFld(); if (!p.getOwner().equals(sowner)) { error("Subscription owners don't match for " + globals.curSub); error(" Found owner " + sowner + " expected " + p.getOwner()); } globals.curSub.setOwner(p.getOwner()); } else if (name.equals("sub-uri")) { globals.curSub.setUri(stringFld()); } else if (name.equals("sub-affectsFreeBusy")) { globals.curSub.setAffectsFreeBusy(booleanFld()); } else if (name.equals("sub-ignoreTransparency")) { globals.curSub.setIgnoreTransparency(booleanFld()); } else if (name.equals("sub-display")) { globals.curSub.setDisplay(booleanFld()); } else if (name.equals("sub-style")) { globals.curSub.setStyle(stringFld()); } else if (name.equals("sub-internalSubscription")) { globals.curSub.setInternalSubscription(booleanFld()); } else if (name.equals("sub-emailNotifications")) { globals.curSub.setEmailNotifications(booleanFld()); } else if (name.equals("sub-calendarDeleted")) { globals.curSub.setCalendarDeleted(booleanFld()); } else if (name.equals("sub-unremoveable")) { globals.curSub.setUnremoveable(booleanFld()); // view fields } else if (name.equals("view")) { p.addView(globals.curView); globals.curView = null; } else if (name.equals("view-id")) { globals.curView = new BwView(); globals.curView.setId(intFld()); } else if (name.equals("view-seq")) { globals.curView.setSeq(intFld()); } else if (name.equals("view-name")) { globals.curView.setName(stringFld()); } else if (name.equals("view-owner")) { BwUser vowner = userFld(); if (!p.getOwner().equals(vowner)) { error("View owners don't match for " + globals.curView); error(" Found owner " + vowner + " expected " + p.getOwner()); } globals.curView.setOwner(p.getOwner()); } else if (name.equals("view-subscriptions")) { } else if (name.equals("view-sub-id")) { // pre 3.1 BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), intFld()); if (sub == null) { error(" Missing subscription " + intFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } else if (name.equals("view-sub-name")) { BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), stringFld()); if (sub == null) { error(" Missing subscription " + stringFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } }
public void field(String name) throws java.lang.Exception{ BwPreferences p = (BwPreferences)top(); if (ownedEntityTags(p, name)) { return; } if (name.equals("email")) { p.setEmail(stringFld()); } else if (name.equals("defaultCalendar")) { p.setDefaultCalendar(calendarFld()); } else if (name.equals("skinName")) { p.setSkinName(stringFld()); } else if (name.equals("skinStyle")) { p.setSkinStyle(stringFld()); } else if (name.equals("preferredView")) { p.setPreferredView(stringFld()); } else if (name.equals("subscriptions")) { // Nothing to do now } else if (name.equals("workDays")) { p.setWorkDays(stringFld()); } else if (name.equals("workdayStart")) { p.setWorkdayStart(intFld()); } else if (name.equals("workdayEnd")) { p.setWorkdayEnd(intFld()); } else if (name.equals("preferredEndType")) { p.setPreferredEndType(stringFld()); } else if (name.equals("userMode")) { p.setUserMode(intFld()); // subscription fields } else if (name.equals("subscription")) { globals.subscriptionsTbl.put(p.getOwner(), globals.curSub); p.addSubscription(globals.curSub); globals.curSub = null; } else if (name.equals("sub-id")) { globals.curSub = new BwSubscription(); globals.curSub.setId(intFld()); } else if (name.equals("sub-seq")) { globals.curSub.setSeq(intFld()); } else if (name.equals("sub-name")) { globals.curSub.setName(stringFld()); } else if (name.equals("sub-owner")) { BwUser sowner = userFld(); if (!p.getOwner().equals(sowner)) { error("Subscription owners don't match for " + globals.curSub); error(" Found owner " + sowner + " expected " + p.getOwner()); } globals.curSub.setOwner(p.getOwner()); } else if (name.equals("sub-uri")) { globals.curSub.setUri(stringFld()); } else if (name.equals("sub-affectsFreeBusy")) { globals.curSub.setAffectsFreeBusy(booleanFld()); } else if (name.equals("sub-ignoreTransparency")) { globals.curSub.setIgnoreTransparency(booleanFld()); } else if (name.equals("sub-display")) { globals.curSub.setDisplay(booleanFld()); } else if (name.equals("sub-style")) { globals.curSub.setStyle(stringFld()); } else if (name.equals("sub-internalSubscription")) { globals.curSub.setInternalSubscription(booleanFld()); } else if (name.equals("sub-emailNotifications")) { globals.curSub.setEmailNotifications(booleanFld()); } else if (name.equals("sub-calendarDeleted")) { globals.curSub.setCalendarDeleted(booleanFld()); } else if (name.equals("sub-unremoveable")) { globals.curSub.setUnremoveable(booleanFld()); // view fields } else if (name.equals("view")) { p.addView(globals.curView); globals.curView = null; } else if (name.equals("view-id")) { globals.curView = new BwView(); globals.curView.setId(intFld()); } else if (name.equals("view-seq")) { globals.curView.setSeq(intFld()); } else if (name.equals("view-name")) { globals.curView.setName(stringFld()); } else if (name.equals("view-owner")) { BwUser vowner = userFld(); if (!p.getOwner().equals(vowner)) { error("View owners don't match for " + globals.curView); error(" Found owner " + vowner + " expected " + p.getOwner()); } globals.curView.setOwner(p.getOwner()); } else if (name.equals("view-subscriptions")) { } else if (name.equals("view-sub-id")) { // pre 3.1 BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), intFld()); if (sub == null) { error(" Missing subscription " + intFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } else if (name.equals("view-sub-name")) { BwSubscription sub = globals.subscriptionsTbl.getSub( OwnerInfo.makeOwnerInfo(p.getOwner()), stringFld()); if (sub == null) { error(" Missing subscription " + stringFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } }
1,120,645
public void init(WebdavServlet servlet, HttpServletRequest req, Properties props, boolean debug) throws WebdavIntfException { super.init(servlet, req, props, debug); namespacePrefix = WebdavUtils.getUrlPrefix(req); namespace = namespacePrefix + "/schema"; try { /* if (anonymous) { env = new CalEnv(CalEnv.caldavPublicAppPrefix, debug); } else { env = new CalEnv(CalEnv.caldavPersonalAppPrefix, debug); } */ publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); } catch (Throwable t) { throw new WebdavIntfException(t); }// uriGen = new UWCalWebURIgen(namespace); }
public void init(WebdavServlet servlet, HttpServletRequest req, Properties props, boolean debug) throws WebdavIntfException { super.init(servlet, req, props, debug); namespacePrefix = WebdavUtils.getUrlPrefix(req); namespace = namespacePrefix + "/schema"; try { /* if (anonymous) { env = new CalEnv(CalEnv.caldavPublicAppPrefix, debug); } else { env = new CalEnv(CalEnv.caldavPersonalAppPrefix, debug); } */ publicCalendarRoot = CalEnv.getGlobalProperty("public.calroot"); userCalendarRoot = CalEnv.getGlobalProperty("user.calroot"); } catch (Throwable t) { throw new WebdavIntfException(t); }// uriGen = new UWCalWebURIgen(namespace); }
1,120,646
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } FormFile upFile = form.getUploadFile(); if (upFile == null) { // Just forget it return "success"; } TimeZonesParser tzp = new TimeZonesParser(upFile.getInputStream(), debug); Collection tzis = tzp.getTimeZones(); CalSvcI svci = form.getCalSvcI(); Iterator it = tzis.iterator(); while (it.hasNext()) { TimeZonesParser.TimeZoneInfo tzi = (TimeZonesParser.TimeZoneInfo)it.next(); svci.saveTimeZone(tzi.tzid, tzi.timezone); } form.getMsg().emit("org.bedework.pubevents.message.timezones.imported"); return "success"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } FormFile upFile = form.getUploadFile(); if (upFile == null) { // Just forget it return "success"; } TimeZonesParser tzp = new TimeZonesParser(upFile.getInputStream(), debug); Collection tzis = tzp.getTimeZones(); CalSvcI svci = form.getCalSvcI(); Iterator it = tzis.iterator(); while (it.hasNext()) { TimeZonesParser.TimeZoneInfo tzi = (TimeZonesParser.TimeZoneInfo)it.next(); svci.saveTimeZone(tzi.tzid, tzi.timezone); } form.getMsg().emit("org.bedework.client.message.timezones.imported"); return "success"; }
1,120,647
private CompFilter parseCompFilter(Node nd) throws WebdavException { String name = getOnlyAttrVal(nd, "name"); if (name == null) { throw new WebdavBadRequest(); } CompFilter cf = new CompFilter(name); Element[] children = getChildren(nd); try { for (int i = 0; i < children.length; i++) { Node curnode = children[i]; if (debug) { trace("compFilter element: " + curnode.getNamespaceURI() + " " + curnode.getLocalName()); } if (MethodBase.nodeMatches(curnode, CaldavTags.isNotDefined)) { if (cf.getTimeRange() != null) { throw new WebdavBadRequest(); } cf.setIsNotDefined(true); } else if (MethodBase.nodeMatches(curnode, CaldavTags.timeRange)) { if (cf.getIsNotDefined()) { throw new WebdavBadRequest(); } cf.setTimeRange(CalDavParseUtil.parseTimeRange(curnode, intf.getSvci().getTimezones())); if (cf.getTimeRange() == null) { return null; } } else if (MethodBase.nodeMatches(curnode, CaldavTags.compFilter)) { CompFilter chcf = parseCompFilter(curnode); if (chcf == null) { return null; } cf.addCompFilter(chcf); } else if (MethodBase.nodeMatches(curnode, CaldavTags.propFilter)) { PropFilter chpf = parsePropFilter(curnode); if (chpf == null) { return null; } cf.addPropFilter(chpf); } else { throw new WebdavBadRequest(); } } } catch (WebdavBadRequest wbr) { throw wbr; } catch (Throwable t) { throw new WebdavBadRequest(); } return cf; }
private CompFilter parseCompFilter(Node nd) throws WebdavException { String name = getOnlyAttrVal(nd, "name"); if (name == null) { throw new WebdavBadRequest(); } CompFilter cf = new CompFilter(name); Element[] children = getChildren(nd); try { for (int i = 0; i < children.length; i++) { Node curnode = children[i]; if (debug) { trace("compFilter element: " + curnode.getNamespaceURI() + " " + curnode.getLocalName()); } if (MethodBase.nodeMatches(curnode, CaldavTags.isNotDefined)) { if (cf.getTimeRange() != null) { throw new WebdavBadRequest(); } cf.setIsNotDefined(true); } else if (MethodBase.nodeMatches(curnode, CaldavTags.timeRange)) { if (cf.getIsNotDefined()) { throw new WebdavBadRequest(); } cf.setTimeRange(CalDavParseUtil.parseTimeRange(curnode, intf.getSvci().getTimezones())); if (cf.getTimeRange() == null) { return null; } } else if (MethodBase.nodeMatches(curnode, CaldavTags.compFilter)) { CompFilter chcf = parseCompFilter(curnode); if (chcf == null) { return null; } cf.addCompFilter(chcf); } else if (MethodBase.nodeMatches(curnode, CaldavTags.propFilter)) { PropFilter chpf = parsePropFilter(curnode); if (chpf == null) { return null; } cf.addPropFilter(chpf); } else { throw new WebdavBadRequest(); } } } catch (WebdavBadRequest wbr) { throw wbr; } catch (Throwable t) { throw new WebdavBadRequest(); } return cf; }
1,120,649
public void testDelegatedMethodInvocation() { try { NATObject parent = new NATObject(lexicalRoot_); NATObject child = new NATObject(parent, lexicalRoot_, NATObject._IS_A_); ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGScopeTest(parent, child, parent.getDynamicParent())); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); ATMethod superSemanticsTestMethod = new NATMethod( superSemantics, NATTable.EMPTY,// new AGEqualityTest() {// public Object getExpectedResult(ATContext ctx) {// return ctx.getLexicalEnvironment().getDynamicParent();// }// // public Object getActualValue(ATContext ctx) {// return ctx.getParentObject();// }// } new AGScopeTest(child, child, parent)); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_addMethod(superSemanticsTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
public void testDelegatedMethodInvocation() { try { NATObject parent = new NATObject(lexicalRoot_); NATObject child = new NATObject(parent, lexicalRoot_, NATObject._IS_A_); ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGBegin(new NATTable(new ATObject[] { new AGScopeTest(parent, child, parent.getDynamicParent())}))); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); ATMethod superSemanticsTestMethod = new NATMethod( superSemantics, NATTable.EMPTY,// new AGEqualityTest() {// public Object getExpectedResult(ATContext ctx) {// return ctx.getLexicalEnvironment().getDynamicParent();// }// // public Object getActualValue(ATContext ctx) {// return ctx.getParentObject();// }// } new AGScopeTest(child, child, parent)); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_addMethod(superSemanticsTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
1,120,650
public void testDelegatedMethodInvocation() { try { NATObject parent = new NATObject(lexicalRoot_); NATObject child = new NATObject(parent, lexicalRoot_, NATObject._IS_A_); ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGScopeTest(parent, child, parent.getDynamicParent())); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); ATMethod superSemanticsTestMethod = new NATMethod( superSemantics, NATTable.EMPTY,// new AGEqualityTest() {// public Object getExpectedResult(ATContext ctx) {// return ctx.getLexicalEnvironment().getDynamicParent();// }// // public Object getActualValue(ATContext ctx) {// return ctx.getParentObject();// }// } new AGScopeTest(child, child, parent)); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_addMethod(superSemanticsTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
public void testDelegatedMethodInvocation() { try { NATObject parent = new NATObject(lexicalRoot_); NATObject child = new NATObject(parent, lexicalRoot_, NATObject._IS_A_); ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGScopeTest(parent, child, parent.getDynamicParent())); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); ATMethod superSemanticsTestMethod = new NATMethod( superSemantics, NATTable.EMPTY,// new AGEqualityTest() {// public Object getExpectedResult(ATContext ctx) {// return ctx.getLexicalEnvironment().getDynamicParent();// }// // public Object getActualValue(ATContext ctx) {// return ctx.getParentObject();// }// } new AGBegin(new NATTable(new ATObject[] { new AGScopeTest(child, child, parent)}))); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_addMethod(superSemanticsTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
1,120,651
public void testExtend() { try { NATObject parent = new NATObject(lexicalRoot_); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); AGScopeTest test = new AGScopeTest(null, null, parent); NATObject child = (NATObject)parent.meta_extend( new NATClosure( new NATMethod(AGSymbol.alloc(NATText.atValue("lambda")), NATTable.EMPTY, new AGDefFunction(superSemantics, NATTable.EMPTY, new AGBegin( new NATTable( new ATObject[] { test } )))), lexicalRoot_, lexicalRoot_)); test.scope_ = child; test.self_ = child; ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGScopeTest(parent, child, parent.getDynamicParent())); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
public void testExtend() { try { NATObject parent = new NATObject(lexicalRoot_); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); AGScopeTest test = new AGScopeTest(null, null, parent); NATObject child = (NATObject)parent.meta_extend( new NATClosure( new NATMethod(AGSymbol.alloc(NATText.atValue("lambda")), NATTable.EMPTY, new AGDefFunction(superSemantics, NATTable.EMPTY, new AGBegin( new NATTable( new ATObject[] { test } )))), lexicalRoot_, lexicalRoot_)); test.scope_ = child; test.self_ = child; ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGScopeTest(parent, child, parent.getDynamicParent())); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
1,120,652
public void testExtend() { try { NATObject parent = new NATObject(lexicalRoot_); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); AGScopeTest test = new AGScopeTest(null, null, parent); NATObject child = (NATObject)parent.meta_extend( new NATClosure( new NATMethod(AGSymbol.alloc(NATText.atValue("lambda")), NATTable.EMPTY, new AGDefFunction(superSemantics, NATTable.EMPTY, new AGBegin( new NATTable( new ATObject[] { test } )))), lexicalRoot_, lexicalRoot_)); test.scope_ = child; test.self_ = child; ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGScopeTest(parent, child, parent.getDynamicParent())); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
public void testExtend() { try { NATObject parent = new NATObject(lexicalRoot_); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); AGScopeTest test = new AGScopeTest(null, null, parent); NATObject child = (NATObject)parent.meta_extend( new NATClosure( new NATMethod(AGSymbol.alloc(NATText.atValue("lambda")), NATTable.EMPTY, new AGDefFunction(superSemantics, NATTable.EMPTY, new AGBegin( new NATTable( new ATObject[] { test } )))), lexicalRoot_, lexicalRoot_)); test.scope_ = child; test.self_ = child; ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGBegin(new NATTable(new ATObject[] { new AGScopeTest(parent, child, parent.getDynamicParent())}))); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
1,120,653
public void testMethodInvocation() { try { NATObject object = new NATObject(lexicalRoot_); ATSymbol scopeTest = AGSymbol.alloc(NATText.atValue("scopeTest")); ATMethod scopeTestMethod = new NATMethod( scopeTest, NATTable.EMPTY, new AGScopeTest(object, object, object.getDynamicParent())); object.meta_addMethod(scopeTestMethod); object.meta_invoke(object, scopeTest, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
public void testMethodInvocation() { try { NATObject object = new NATObject(lexicalRoot_); ATSymbol scopeTest = AGSymbol.alloc(NATText.atValue("scopeTest")); ATMethod scopeTestMethod = new NATMethod( scopeTest, NATTable.EMPTY, new AGBegin(new NATTable(new ATObject[] { new AGScopeTest(object, object, object.getDynamicParent())}))); object.meta_addMethod(scopeTestMethod); object.meta_invoke(object, scopeTest, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } }
1,120,654
public NATText asNativeText() throws InterpreterException { return this.meta_print(); // throw new XTypeMismatch("Expected a native text, given: " + this.getClass().getName(), this); }
public NATText asNativeText() throws InterpreterException { throw new XTypeMismatch(NATText.class, this); // throw new XTypeMismatch("Expected a native text, given: " + this.getClass().getName(), this); }
1,120,655
public Selection (MicroSecondDate begin, MicroSecondDate end, TimeRangeConfig tr, HashMap plotters){ this.begin = begin; this.end = end; this.timeConfig = tr; this.plotters = plotters; internalTimeConfig = new BoundedTimeConfig(); Iterator e = plotters.keySet().iterator(); while(e.hasNext()) internalTimeConfig.addSeismogram(((SeismogramPlotter)e.next()).getSeismogram(), begin); internalTimeConfig.setDisplayInterval(begin.difference(end)); }
public Selection (MicroSecondDate begin, MicroSecondDate end, TimeRangeConfig tr, HashMap plotters){ this.begin = begin; this.end = end; this.timeConfig = tr; this.plotters = plotters; internalTimeConfig = new BoundedTimeConfig(); Iterator e = plotters.keySet().iterator(); while(e.hasNext()) internalTimeConfig.addSeismogram(((SeismogramPlotter)e.next()).getSeismogram(), begin); internalTimeConfig.setDisplayInterval(begin.difference(end)); }
1,120,657
public boolean adjustRange(MicroSecondDate selectionBegin, MicroSecondDate selectionEnd){ double timeWidth = timeConfig.getTimeRange().getInterval().getValue(); double beginDistance = Math.abs(begin.getMicroSecondTime() - selectionEnd.getMicroSecondTime())/timeWidth; double endDistance = Math.abs(end.getMicroSecondTime() - selectionBegin.getMicroSecondTime())/timeWidth; if(beginDistance < .05 || endDistance < .05){ if(beginDistance < endDistance){ this.begin = selectionBegin; internalTimeConfig.setAllBeginTime(selectionBegin); internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; }else{ this.end = selectionEnd; internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; } } return false; }
public boolean adjustRange(MicroSecondDate selectionBegin, MicroSecondDate selectionEnd){ double timeWidth = timeConfig.getTimeRange().getInterval().getValue(); double beginDistance = Math.abs(begin.getMicroSecondTime() - selectionEnd.getMicroSecondTime())/timeWidth; double endDistance = Math.abs(end.getMicroSecondTime() - selectionBegin.getMicroSecondTime())/timeWidth; if(beginDistance < .05 || endDistance < .05){ if(beginDistance < endDistance){ this.begin = selectionBegin; internalTimeConfig.setAllBeginTime(selectionBegin); internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; }else{ this.end = selectionEnd; internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; } } return false; }
1,120,658
public boolean adjustRange(MicroSecondDate selectionBegin, MicroSecondDate selectionEnd){ double timeWidth = timeConfig.getTimeRange().getInterval().getValue(); double beginDistance = Math.abs(begin.getMicroSecondTime() - selectionEnd.getMicroSecondTime())/timeWidth; double endDistance = Math.abs(end.getMicroSecondTime() - selectionBegin.getMicroSecondTime())/timeWidth; if(beginDistance < .05 || endDistance < .05){ if(beginDistance < endDistance){ this.begin = selectionBegin; internalTimeConfig.setAllBeginTime(selectionBegin); internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; }else{ this.end = selectionEnd; internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; } } return false; }
public boolean adjustRange(MicroSecondDate selectionBegin, MicroSecondDate selectionEnd){ double timeWidth = timeConfig.getTimeRange().getInterval().getValue(); double beginDistance = Math.abs(begin.getMicroSecondTime() - selectionEnd.getMicroSecondTime())/timeWidth; double endDistance = Math.abs(end.getMicroSecondTime() - selectionBegin.getMicroSecondTime())/timeWidth; if(beginDistance < .05 || endDistance < .05){ if(beginDistance < endDistance){ this.begin = selectionBegin; internalTimeConfig.setAllBeginTime(selectionBegin); internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; }else{ this.end = selectionEnd; internalTimeConfig.setDisplayInterval(end.difference(begin)); return true; } } }
1,120,659
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { form.refreshIsNeeded(); String date = getReqPar(request, "startdate"); if (date != null) { if (CalFacadeUtil.isISODate(date)) { Date jdt = CalFacadeUtil.fromISODate(date); form.assignEventDates(jdt); } else if (CalFacadeUtil.isISODateTime(date)) { Date jdt = CalFacadeUtil.fromISODateTime(date); form.assignEventDates(jdt); } } return "success"; }
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { form.refreshIsNeeded(); String date = getReqPar(request, "startdate"); if (date != null) { if (CalFacadeUtil.isISODate(date)) { Date jdt = CalFacadeUtil.fromISODate(date); form.assignEventDates(jdt); } else if (CalFacadeUtil.isISODateTime(date)) { Date jdt = CalFacadeUtil.fromISODateTime(date); form.assignEventDates(jdt); } } return "success"; }
1,120,660
public UIViewRoot createView(FacesContext context, String viewId) { ViewNode node = getNode(context); String newViewId=viewId; //if(node.isResourceBased() && nodeCorrespondsToViewId(node, viewId, context)){ // newViewId=node.getResourceURI(); //} if(node.isResourceBased()){ if(!viewId.endsWith(JSP_EXT)){ newViewId=node.getResourceURI(); } } return super.createView(context, newViewId); }
public UIViewRoot createView(FacesContext context, String viewId) { ViewNode node = getNode(context); String newViewId=viewId; //if(node.isResourceBased() && nodeCorrespondsToViewId(node, viewId, context)){ // newViewId=node.getResourceURI(); //} if(node.isResourceBased()){ if(!viewId.endsWith(JSP_EXT)){ newViewId=node.getResourceURI(); } } return super.createView(context, newViewId); }
1,120,662
public void init(EObject instance) { for (java.util.Iterator it = featureInitializers.iterator(); it.hasNext();) { IFeatureInitializer nextExpr = (IFeatureInitializer) it.next(); try { nextExpr.init(instance); } catch (RuntimeException e) { UMLDiagramEditorPlugin.getInstance().logError("Feature initialization failed", e); //$NON-NLS-1$ } } }
public void init(EObject instance) { for (java.util.Iterator it = featureInitializers.iterator(); it.hasNext();) { IFeatureInitializer nextExpr = (IFeatureInitializer) it.next(); try { nextExpr.init(instance); } catch (RuntimeException e) { UMLDiagramEditorPlugin.getInstance().logError("Feature initialization failed", e); //$NON-NLS-1$ } } }
1,120,664
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { BwEvent ev = form.retrieveCurrentEvent(); if (ev == null) { return "noevent"; } String recipient = form.getLastEmail(); if (recipient == null) { form.getErr().emit("org.bedework.error.mail.norecipient", 1); return "retry"; } String subject = form.getLastSubject(); if (!Util.present(subject)) { subject = ev.getSummary(); } Message emsg = new Message(); String[] to = new String[]{recipient}; CalSvcI svci = form.getCalSvcI(); emsg.setMailTo(to); emsg.setSubject(ev.getSummary()); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); mailMessage(emsg, trans.toStringIcal(ev), "event.ics", "text/calendar", form); form.getMsg().emit("org.bedework.message.event.mailed"); return "success"; }
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { BwEvent ev = form.retrieveCurrentEvent(); if (ev == null) { return "noevent"; } String recipient = form.getLastEmail(); if (recipient == null) { form.getErr().emit("org.bedework.client.error.mail.norecipient", 1); return "retry"; } String subject = form.getLastSubject(); if (!Util.present(subject)) { subject = ev.getSummary(); } Message emsg = new Message(); String[] to = new String[]{recipient}; CalSvcI svci = form.getCalSvcI(); emsg.setMailTo(to); emsg.setSubject(ev.getSummary()); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); mailMessage(emsg, trans.toStringIcal(ev), "event.ics", "text/calendar", form); form.getMsg().emit("org.bedework.message.event.mailed"); return "success"; }
1,120,665
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { BwEvent ev = form.retrieveCurrentEvent(); if (ev == null) { return "noevent"; } String recipient = form.getLastEmail(); if (recipient == null) { form.getErr().emit("org.bedework.error.mail.norecipient", 1); return "retry"; } String subject = form.getLastSubject(); if (!Util.present(subject)) { subject = ev.getSummary(); } Message emsg = new Message(); String[] to = new String[]{recipient}; CalSvcI svci = form.getCalSvcI(); emsg.setMailTo(to); emsg.setSubject(ev.getSummary()); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); mailMessage(emsg, trans.toStringIcal(ev), "event.ics", "text/calendar", form); form.getMsg().emit("org.bedework.message.event.mailed"); return "success"; }
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { BwEvent ev = form.retrieveCurrentEvent(); if (ev == null) { return "noevent"; } String recipient = form.getLastEmail(); if (recipient == null) { form.getErr().emit("org.bedework.error.mail.norecipient", 1); return "retry"; } String subject = form.getLastSubject(); if (!Util.present(subject)) { subject = ev.getSummary(); } Message emsg = new Message(); String[] to = new String[]{recipient}; CalSvcI svci = form.getCalSvcI(); emsg.setMailTo(to); emsg.setSubject(ev.getSummary()); IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); mailMessage(emsg, trans.toStringIcal(ev), "event.ics", "text/calendar", form); form.getMsg().emit("org.bedework.client.message.event.mailed"); return "success"; }
1,120,666
public void show() { initData(); FileOutputStream fileOutputStream = null; try { File file = new File("outputShow.txt"); fileOutputStream = new FileOutputStream(file); } catch (FileNotFoundException e) { } for (ReviewMessage reviewMessage : reviewMessages) { try { fileOutputStream.write(charset.encode("" + reviewMessage.getType() + ", " + reviewMessage + "\n").array()); } catch (IOException e) { } switch (reviewMessage.getType()) { case ReviewMessage.TYPE_ReviewGameBoard: handleReviewGameBoard((ReviewGameBoard)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetCaption: handleReviewScoreSheetCaption((ReviewScoreSheetCaption)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetHoteltype: handleReviewScoreSheetHoteltype((ReviewScoreSheetHoteltype)reviewMessage); break; case ReviewMessage.TYPE_ReviewLobbyMessage: handleReviewLobbyMessage((ReviewLobbyMessage)reviewMessage); break; case ReviewMessage.TYPE_ReviewGameRoomMessage: handleReviewGameRoomMessage((ReviewGameRoomMessage)reviewMessage); break; } } if (gameBoardData.isDirty()) { Main.getMainFrame().gameBoard.sync(gameBoardData); gameBoardData.clean(); } if (scoreSheetCaptionData.isDirty() || scoreSheetHoteltypeData.isDirty()) { if (scoreSheetCaptionData.isDirty()) { Util.updateNetWorths(scoreSheetCaptionData, gameBoardData); } Main.getMainFrame().scoreSheet.sync(scoreSheetCaptionData, scoreSheetHoteltypeData); scoreSheetCaptionData.clean(); scoreSheetHoteltypeData.clean(); } try { fileOutputStream.close(); } catch (IOException e) { } }
public void show() { initData(); FileOutputStream fileOutputStream = null; try { File file = new File("outputShow.txt"); fileOutputStream = new FileOutputStream(file); } catch (FileNotFoundException e) { } for (ReviewMessage reviewMessage : reviewMessages) { try { fileOutputStream.write(charset.encode("" + reviewMessage.getType() + ", " + reviewMessage + "\n").array()); } catch (IOException e) { } switch (reviewMessage.getType()) { case ReviewMessage.TYPE_ReviewGameBoard: handleReviewGameBoard((ReviewGameBoard)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetCaption: handleReviewScoreSheetCaption((ReviewScoreSheetCaption)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetHoteltype: handleReviewScoreSheetHoteltype((ReviewScoreSheetHoteltype)reviewMessage); break; case ReviewMessage.TYPE_ReviewLobbyMessage: handleReviewLobbyMessage((ReviewLobbyMessage)reviewMessage); break; case ReviewMessage.TYPE_ReviewGameRoomMessage: handleReviewGameRoomMessage((ReviewGameRoomMessage)reviewMessage); break; } } if (gameBoardData.isDirty()) { Main.getMainFrame().gameBoard.sync(gameBoardData); gameBoardData.clean(); } if (scoreSheetCaptionData.isDirty() || scoreSheetHoteltypeData.isDirty()) { if (scoreSheetCaptionData.isDirty()) { Util.updateNetWorths(scoreSheetCaptionData, gameBoardData); } Main.getMainFrame().scoreSheet.sync(scoreSheetCaptionData, scoreSheetHoteltypeData); scoreSheetCaptionData.clean(); scoreSheetHoteltypeData.clean(); } try { fileOutputStream.close(); } catch (IOException e) { } }
1,120,667
public void show() { initData(); FileOutputStream fileOutputStream = null; try { File file = new File("outputShow.txt"); fileOutputStream = new FileOutputStream(file); } catch (FileNotFoundException e) { } for (ReviewMessage reviewMessage : reviewMessages) { try { fileOutputStream.write(charset.encode("" + reviewMessage.getType() + ", " + reviewMessage + "\n").array()); } catch (IOException e) { } switch (reviewMessage.getType()) { case ReviewMessage.TYPE_ReviewGameBoard: handleReviewGameBoard((ReviewGameBoard)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetCaption: handleReviewScoreSheetCaption((ReviewScoreSheetCaption)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetHoteltype: handleReviewScoreSheetHoteltype((ReviewScoreSheetHoteltype)reviewMessage); break; case ReviewMessage.TYPE_ReviewLobbyMessage: handleReviewLobbyMessage((ReviewLobbyMessage)reviewMessage); break; case ReviewMessage.TYPE_ReviewGameRoomMessage: handleReviewGameRoomMessage((ReviewGameRoomMessage)reviewMessage); break; } } if (gameBoardData.isDirty()) { Main.getMainFrame().gameBoard.sync(gameBoardData); gameBoardData.clean(); } if (scoreSheetCaptionData.isDirty() || scoreSheetHoteltypeData.isDirty()) { if (scoreSheetCaptionData.isDirty()) { Util.updateNetWorths(scoreSheetCaptionData, gameBoardData); } Main.getMainFrame().scoreSheet.sync(scoreSheetCaptionData, scoreSheetHoteltypeData); scoreSheetCaptionData.clean(); scoreSheetHoteltypeData.clean(); } try { fileOutputStream.close(); } catch (IOException e) { } }
public void show() { initData(); FileOutputStream fileOutputStream = null; try { File file = new File("outputShow.txt"); fileOutputStream = new FileOutputStream(file); } catch (FileNotFoundException e) { } for (ReviewMessage reviewMessage : reviewMessages) { try { fileOutputStream.write(charset.encode("" + reviewMessage.getType() + ", " + reviewMessage + "\n").array()); } catch (IOException e) { } switch (reviewMessage.getType()) { case ReviewMessage.TYPE_ReviewGameBoard: handleReviewGameBoard((ReviewGameBoard)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetCaption: handleReviewScoreSheetCaption((ReviewScoreSheetCaption)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetHoteltype: handleReviewScoreSheetHoteltype((ReviewScoreSheetHoteltype)reviewMessage); break; case ReviewMessage.TYPE_ReviewLobbyMessage: handleReviewLobbyMessage((ReviewLobbyMessage)reviewMessage); break; case ReviewMessage.TYPE_ReviewGameRoomMessage: handleReviewGameRoomMessage((ReviewGameRoomMessage)reviewMessage); break; } } if (gameBoardData.isDirty()) { Main.getMainFrame().gameBoard.sync(gameBoardData); gameBoardData.clean(); } if (scoreSheetCaptionData.isDirty() || scoreSheetHoteltypeData.isDirty()) { if (scoreSheetCaptionData.isDirty()) { Util.updateNetWorths(scoreSheetCaptionData, gameBoardData); } Main.getMainFrame().scoreSheet.sync(scoreSheetCaptionData, scoreSheetHoteltypeData); scoreSheetCaptionData.clean(); scoreSheetHoteltypeData.clean(); } try { fileOutputStream.close(); } catch (IOException e) { } }
1,120,668
public void show() { initData(); FileOutputStream fileOutputStream = null; try { File file = new File("outputShow.txt"); fileOutputStream = new FileOutputStream(file); } catch (FileNotFoundException e) { } for (ReviewMessage reviewMessage : reviewMessages) { try { fileOutputStream.write(charset.encode("" + reviewMessage.getType() + ", " + reviewMessage + "\n").array()); } catch (IOException e) { } switch (reviewMessage.getType()) { case ReviewMessage.TYPE_ReviewGameBoard: handleReviewGameBoard((ReviewGameBoard)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetCaption: handleReviewScoreSheetCaption((ReviewScoreSheetCaption)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetHoteltype: handleReviewScoreSheetHoteltype((ReviewScoreSheetHoteltype)reviewMessage); break; case ReviewMessage.TYPE_ReviewLobbyMessage: handleReviewLobbyMessage((ReviewLobbyMessage)reviewMessage); break; case ReviewMessage.TYPE_ReviewGameRoomMessage: handleReviewGameRoomMessage((ReviewGameRoomMessage)reviewMessage); break; } } if (gameBoardData.isDirty()) { Main.getMainFrame().gameBoard.sync(gameBoardData); gameBoardData.clean(); } if (scoreSheetCaptionData.isDirty() || scoreSheetHoteltypeData.isDirty()) { if (scoreSheetCaptionData.isDirty()) { Util.updateNetWorths(scoreSheetCaptionData, gameBoardData); } Main.getMainFrame().scoreSheet.sync(scoreSheetCaptionData, scoreSheetHoteltypeData); scoreSheetCaptionData.clean(); scoreSheetHoteltypeData.clean(); } try { fileOutputStream.close(); } catch (IOException e) { } }
public void show() { initData(); FileOutputStream fileOutputStream = null; try { File file = new File("outputShow.txt"); fileOutputStream = new FileOutputStream(file); } catch (FileNotFoundException e) { } for (ReviewMessage reviewMessage : reviewMessages) { try { fileOutputStream.write(charset.encode("" + reviewMessage.getType() + ", " + reviewMessage + "\n").array()); } catch (IOException e) { } switch (reviewMessage.getType()) { case ReviewMessage.TYPE_ReviewGameBoard: handleReviewGameBoard((ReviewGameBoard)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetCaption: handleReviewScoreSheetCaption((ReviewScoreSheetCaption)reviewMessage); break; case ReviewMessage.TYPE_ReviewScoreSheetHoteltype: handleReviewScoreSheetHoteltype((ReviewScoreSheetHoteltype)reviewMessage); break; case ReviewMessage.TYPE_ReviewLobbyMessage: handleReviewLobbyMessage((ReviewLobbyMessage)reviewMessage); break; case ReviewMessage.TYPE_ReviewGameRoomMessage: handleReviewGameRoomMessage((ReviewGameRoomMessage)reviewMessage); break; } } if (gameBoardData.isDirty()) { Main.getMainFrame().gameBoard.sync(gameBoardData); gameBoardData.clean(); } if (scoreSheetCaptionData.isDirty() || scoreSheetHoteltypeData.isDirty()) { if (scoreSheetCaptionData.isDirty()) { Util.updateNetWorths(scoreSheetCaptionData, gameBoardData); } Main.getMainFrame().scoreSheet.sync(scoreSheetCaptionData, scoreSheetHoteltypeData); scoreSheetCaptionData.clean(); scoreSheetHoteltypeData.clean(); } try { fileOutputStream.close(); } catch (IOException e) { } }
1,120,669
public void changeAccess(BwShareableDbentity ent, Collection aces) throws CalFacadeException { try { Acl acl = checkAccess(ent, privWriteAcl, false).acl; Iterator it = aces.iterator(); while (it.hasNext()) { Ace ace = (Ace)it.next(); acl.removeAccess(ace); acl.addAce(ace); } ent.setAccess(new String(acl.encode())); if (ent instanceof BwCalendar) { updatePathInfo((BwCalendar)ent, acl); } } catch (Throwable t) { throw new CalFacadeException(t); } }
public void changeAccess(BwShareableDbentity ent, Collection aces) throws CalFacadeException { try { Acl acl = checkAccess(ent, privWriteAcl, false).acl; Iterator it = aces.iterator(); while (it.hasNext()) { Ace ace = (Ace)it.next(); acl.removeWho(ace); } it = aces.iterator(); while (it.hasNext()) { Ace ace = (Ace)it.next(); acl.addAce(ace); } ent.setAccess(new String(acl.encode())); if (ent instanceof BwCalendar) { updatePathInfo((BwCalendar)ent, acl); } } catch (Throwable t) { throw new CalFacadeException(t); } }
1,120,670
public void changeAccess(BwShareableDbentity ent, Collection aces) throws CalFacadeException { try { Acl acl = checkAccess(ent, privWriteAcl, false).acl; Iterator it = aces.iterator(); while (it.hasNext()) { Ace ace = (Ace)it.next(); acl.removeAccess(ace); acl.addAce(ace); } ent.setAccess(new String(acl.encode())); if (ent instanceof BwCalendar) { updatePathInfo((BwCalendar)ent, acl); } } catch (Throwable t) { throw new CalFacadeException(t); } }
public void changeAccess(BwShareableDbentity ent, Collection aces) throws CalFacadeException { try { Acl acl = checkAccess(ent, privWriteAcl, false).acl; Iterator it = aces.iterator(); while (it.hasNext()) { Ace ace = (Ace)it.next(); acl.removeAccess(ace); acl.addAce(ace); } ent.setAccess(new String(acl.encode())); if (ent instanceof BwCalendar) { updatePathInfo((BwCalendar)ent, acl); } } catch (Throwable t) { throw new CalFacadeException(t); } }
1,120,671
private char[] getAclChars(BwShareableDbentity ent) throws CalFacadeException { if (ent instanceof BwShareableContainedDbentity) { BwCalendar container; if (ent instanceof BwCalendar) { container = (BwCalendar)ent; } else { container = ((BwShareableContainedDbentity)ent).getCalendar(); } String path = container.getPath(); PathInfo pi = (PathInfo)pathInfoTable.get(path); if (pi == null) { pi = getPathInfo(container); pathInfoTable.put(path, pi); } char[] aclChars = pi.encoded; if (ent instanceof BwCalendar) { return aclChars; } /* Create a merged access string from the entity access and the * container access */ String entAccess = ent.getAccess(); if (entAccess == null) { // Nomerge needed return aclChars; } try { Acl acl = new Acl(); acl.decode(aclChars); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } /* This is a way of making other objects sort of shareable. * The objects are locations, sponsors and categories. * * We store the default access in the owner principal and manipulate that to give * us some degree of sharing. * * In effect, the owner becomes the container for the object. */ String aclString = null; String entAccess = ent.getAccess(); BwUser owner = ent.getOwner(); if (ent instanceof BwCategory) { aclString = owner.getCategoryAccess(); } else if (ent instanceof BwLocation) { aclString = owner.getLocationAccess(); } else if (ent instanceof BwSponsor) { aclString = owner.getSponsorAccess(); } if (aclString == null) { if (entAccess == null) { if (ent.getPublick()) { return access.getDefaultPublicAccess().toCharArray(); } return access.getDefaultPersonalAccess().toCharArray(); } return entAccess.toCharArray(); } if (entAccess == null) { return aclString.toCharArray(); } try { Acl acl = new Acl(); acl.decode(aclString.toCharArray()); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } }
private char[] getAclChars(BwShareableDbentity ent) throws CalFacadeException { if (ent instanceof BwShareableContainedDbentity) { BwCalendar container; if (ent instanceof BwCalendar) { container = (BwCalendar)ent; } else { container = ((BwShareableContainedDbentity)ent).getCalendar(); } String path = container.getPath(); PathInfo pi = pathInfoMap.getInfo(path); if (pi == null) { pi = getPathInfo(container); pathInfoTable.put(path, pi); } char[] aclChars = pi.encoded; if (ent instanceof BwCalendar) { return aclChars; } /* Create a merged access string from the entity access and the * container access */ String entAccess = ent.getAccess(); if (entAccess == null) { // Nomerge needed return aclChars; } try { Acl acl = new Acl(); acl.decode(aclChars); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } /* This is a way of making other objects sort of shareable. * The objects are locations, sponsors and categories. * * We store the default access in the owner principal and manipulate that to give * us some degree of sharing. * * In effect, the owner becomes the container for the object. */ String aclString = null; String entAccess = ent.getAccess(); BwUser owner = ent.getOwner(); if (ent instanceof BwCategory) { aclString = owner.getCategoryAccess(); } else if (ent instanceof BwLocation) { aclString = owner.getLocationAccess(); } else if (ent instanceof BwSponsor) { aclString = owner.getSponsorAccess(); } if (aclString == null) { if (entAccess == null) { if (ent.getPublick()) { return access.getDefaultPublicAccess().toCharArray(); } return access.getDefaultPersonalAccess().toCharArray(); } return entAccess.toCharArray(); } if (entAccess == null) { return aclString.toCharArray(); } try { Acl acl = new Acl(); acl.decode(aclString.toCharArray()); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } }
1,120,672
private char[] getAclChars(BwShareableDbentity ent) throws CalFacadeException { if (ent instanceof BwShareableContainedDbentity) { BwCalendar container; if (ent instanceof BwCalendar) { container = (BwCalendar)ent; } else { container = ((BwShareableContainedDbentity)ent).getCalendar(); } String path = container.getPath(); PathInfo pi = (PathInfo)pathInfoTable.get(path); if (pi == null) { pi = getPathInfo(container); pathInfoTable.put(path, pi); } char[] aclChars = pi.encoded; if (ent instanceof BwCalendar) { return aclChars; } /* Create a merged access string from the entity access and the * container access */ String entAccess = ent.getAccess(); if (entAccess == null) { // Nomerge needed return aclChars; } try { Acl acl = new Acl(); acl.decode(aclChars); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } /* This is a way of making other objects sort of shareable. * The objects are locations, sponsors and categories. * * We store the default access in the owner principal and manipulate that to give * us some degree of sharing. * * In effect, the owner becomes the container for the object. */ String aclString = null; String entAccess = ent.getAccess(); BwUser owner = ent.getOwner(); if (ent instanceof BwCategory) { aclString = owner.getCategoryAccess(); } else if (ent instanceof BwLocation) { aclString = owner.getLocationAccess(); } else if (ent instanceof BwSponsor) { aclString = owner.getSponsorAccess(); } if (aclString == null) { if (entAccess == null) { if (ent.getPublick()) { return access.getDefaultPublicAccess().toCharArray(); } return access.getDefaultPersonalAccess().toCharArray(); } return entAccess.toCharArray(); } if (entAccess == null) { return aclString.toCharArray(); } try { Acl acl = new Acl(); acl.decode(aclString.toCharArray()); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } }
private char[] getAclChars(BwShareableDbentity ent) throws CalFacadeException { if (ent instanceof BwShareableContainedDbentity) { BwCalendar container; if (ent instanceof BwCalendar) { container = (BwCalendar)ent; } else { container = ((BwShareableContainedDbentity)ent).getCalendar(); } String path = container.getPath(); PathInfo pi = (PathInfo)pathInfoTable.get(path); if (pi == null) { pi = getPathInfo(container); pathInfoMap.putInfo(path, pi); } char[] aclChars = pi.encoded; if (ent instanceof BwCalendar) { return aclChars; } /* Create a merged access string from the entity access and the * container access */ String entAccess = ent.getAccess(); if (entAccess == null) { // Nomerge needed return aclChars; } try { Acl acl = new Acl(); acl.decode(aclChars); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } /* This is a way of making other objects sort of shareable. * The objects are locations, sponsors and categories. * * We store the default access in the owner principal and manipulate that to give * us some degree of sharing. * * In effect, the owner becomes the container for the object. */ String aclString = null; String entAccess = ent.getAccess(); BwUser owner = ent.getOwner(); if (ent instanceof BwCategory) { aclString = owner.getCategoryAccess(); } else if (ent instanceof BwLocation) { aclString = owner.getLocationAccess(); } else if (ent instanceof BwSponsor) { aclString = owner.getSponsorAccess(); } if (aclString == null) { if (entAccess == null) { if (ent.getPublick()) { return access.getDefaultPublicAccess().toCharArray(); } return access.getDefaultPersonalAccess().toCharArray(); } return entAccess.toCharArray(); } if (entAccess == null) { return aclString.toCharArray(); } try { Acl acl = new Acl(); acl.decode(aclString.toCharArray()); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } }
1,120,673
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.assignAddingSponsor(false); return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ initFields(form); form.assignAddingSponsor(false); return "continue"; }
1,120,674
private void dumpUserPrefs(BwPreferences p) throws Throwable { tagStart(objectUserPrefs); ownedEntityTags(p); Collection s = p.getSubscriptions(); if (s.size() > 0) { tagStart("subscriptions"); Iterator si = s.iterator(); while (si.hasNext()) { BwSubscription sub = (BwSubscription)si.next(); tagStart("subscription"); taggedVal("sub-id", sub.getId()); taggedVal("sub-seq", sub.getSeq()); taggedVal("sub-name", sub.getName()); taggedVal("sub-owner", sub.getOwner().getId()); taggedVal("sub-uri", sub.getUri()); taggedVal("sub-affectsFreeBusy", sub.getAffectsFreeBusy()); taggedVal("sub-display", sub.getDisplay()); taggedVal("sub-style", sub.getStyle()); taggedVal("sub-internalSubscription", sub.getInternalSubscription()); taggedVal("sub-emailNotifications", sub.getEmailNotifications()); taggedVal("sub-calendarDeleted", sub.getCalendarDeleted()); taggedVal("sub-unremoveable=", sub.getUnremoveable()); tagEnd("subscription"); globals.subscriptions++; } globals.subscribedUsers++; tagEnd("subscriptions"); } Collection v = p.getViews(); if (v.size() > 0) { tagStart("views"); Iterator vi = v.iterator(); while (vi.hasNext()) { BwView view = (BwView)vi.next(); tagStart("view"); taggedVal("view-id", view.getId()); taggedVal("view-seq", view.getSeq()); taggedVal("view-name", view.getName()); taggedVal("view-owner", view.getOwner().getId()); Collection vs = view.getSubscriptions(); if (vs.size() > 0) { tagStart("view-subscriptions"); Iterator vsi = vs.iterator(); while (vsi.hasNext()) { BwSubscription sub = (BwSubscription)vsi.next(); taggedVal("view-sub-id", sub.getId()); } tagEnd("view-subscriptions"); } tagEnd("view"); } tagEnd("views"); } taggedVal("email", p.getEmail()); if (p.getDefaultCalendar() != null) { taggedVal("default-calendar", p.getDefaultCalendar().getId()); } taggedVal("skinName", p.getSkinName()); taggedVal("skinStyle", p.getSkinStyle()); taggedVal("preferredView", p.getPreferredView()); taggedVal("preferredViewPeriod", p.getPreferredViewPeriod()); taggedVal("workDays", p.getWorkDays()); taggedVal("workdayStart", p.getWorkdayStart()); taggedVal("workdayEnd", p.getWorkdayEnd()); tagEnd(objectUserPrefs); }
private void dumpUserPrefs(BwPreferences p) throws Throwable { tagStart(objectUserPrefs); ownedEntityTags(p); Collection s = p.getSubscriptions(); if (s.size() > 0) { tagStart("subscriptions"); Iterator si = s.iterator(); while (si.hasNext()) { BwSubscription sub = (BwSubscription)si.next(); tagStart("subscription"); taggedVal("sub-id", sub.getId()); taggedVal("sub-seq", sub.getSeq()); taggedVal("sub-name", sub.getName()); taggedVal("sub-owner", sub.getOwner().getId()); taggedVal("sub-uri", sub.getUri()); taggedVal("sub-affectsFreeBusy", sub.getAffectsFreeBusy()); taggedVal("sub-display", sub.getDisplay()); taggedVal("sub-style", sub.getStyle()); taggedVal("sub-internalSubscription", sub.getInternalSubscription()); taggedVal("sub-emailNotifications", sub.getEmailNotifications()); taggedVal("sub-calendarDeleted", sub.getCalendarDeleted()); taggedVal("sub-unremoveable", sub.getUnremoveable()); tagEnd("subscription"); globals.subscriptions++; } globals.subscribedUsers++; tagEnd("subscriptions"); } Collection v = p.getViews(); if (v.size() > 0) { tagStart("views"); Iterator vi = v.iterator(); while (vi.hasNext()) { BwView view = (BwView)vi.next(); tagStart("view"); taggedVal("view-id", view.getId()); taggedVal("view-seq", view.getSeq()); taggedVal("view-name", view.getName()); taggedVal("view-owner", view.getOwner().getId()); Collection vs = view.getSubscriptions(); if (vs.size() > 0) { tagStart("view-subscriptions"); Iterator vsi = vs.iterator(); while (vsi.hasNext()) { BwSubscription sub = (BwSubscription)vsi.next(); taggedVal("view-sub-id", sub.getId()); } tagEnd("view-subscriptions"); } tagEnd("view"); } tagEnd("views"); } taggedVal("email", p.getEmail()); if (p.getDefaultCalendar() != null) { taggedVal("default-calendar", p.getDefaultCalendar().getId()); } taggedVal("skinName", p.getSkinName()); taggedVal("skinStyle", p.getSkinStyle()); taggedVal("preferredView", p.getPreferredView()); taggedVal("preferredViewPeriod", p.getPreferredViewPeriod()); taggedVal("workDays", p.getWorkDays()); taggedVal("workdayStart", p.getWorkdayStart()); taggedVal("workdayEnd", p.getWorkdayEnd()); tagEnd(objectUserPrefs); }
1,120,675
public Collection findEventsByName(BwCalendar cal, String val) throws CalFacadeException { return getCal().getEventsByName(cal, val); }
public Collection findEventsByName(BwCalendar cal, String val) throws CalFacadeException { return postProcess(getCal().getEventsByName(cal, val), (BwSubscription)null); }
1,120,676
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ System.out.println("redetermining current selection"); Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ System.out.println("selected an already existing range"); currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ System.out.println("selected an already existing range"); currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
1,120,677
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ System.out.println("redetermining current selection"); Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ System.out.println("selected an already existing range"); currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
public void selectRegion(MouseEvent one, MouseEvent two){ Insets insets = this.getInsets(); Dimension dim = getSize(); double x1percent, x2percent; if(one.getX() < two.getX()){ x1percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x2percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); }else{ x2percent = (one.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); x1percent = (two.getX() - insets.left)/(double)(dim.getWidth() - insets.left - insets.right); } MicroSecondDate current = timeConfig.getTimeRange().getBeginTime(); MicroSecondDate selectionBegin = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x1percent + current.getMicroSecondTime())); MicroSecondDate selectionEnd = new MicroSecondDate((long)(imagePainter.displayInterval.getValue() * x2percent + current.getMicroSecondTime())); if(currentSelection == null){ System.out.println("redetermining current selection"); Iterator e = selections.iterator(); while(e.hasNext()){ Selection curr = ((Selection)e.next()); if(curr.borders(selectionBegin, selectionEnd)){ currentSelection = curr; break; } } if(currentSelection == null){ selections.add(new Selection(selectionBegin, selectionEnd, timeConfig, plotters)); currentSelection = ((Selection)selections.getFirst()); repaint(); return; } } currentSelection.adjustRange(selectionBegin, selectionEnd); repaint(); }
1,120,678
private String doAuth(String cardnumber, String monthExpires, String yearExpires, double amount, String currency, String transactionType, Object parentDataPK, String authIDRsp) throws TPosException { if(_client != null) { _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); String encodedCardNumber = CreditCardBusinessBean.encodeCreditCardNumber(cardnumber); _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); if (authIDRsp != null) { _client.setProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP, authIDRsp); } //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); amount *= amountMultiplier; String stringAmount = Integer.toString((int)amount); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } boolean valid = false; try { valid = _client.sendAuthorisationReq(); } catch (IllegalArgumentException e) { getKeys(); createNewBatch(); _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); if (authIDRsp == null) { _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); } else { // Setting authID, _client should by created already _client.setProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP, authIDRsp); } //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } valid = _client.sendAuthorisationReq(); } boolean inserted = false; TPosAuthorisationEntriesBean entry; try { TPosAuthorisationEntriesBeanHome home = (TPosAuthorisationEntriesBeanHome) IDOLookup.getHome(TPosAuthorisationEntriesBeanHome.class); entry = home.create();// entry = TPosAuthorisationEntriesHome.getInstance().getNewElement(); // entry.setAttachmentCount(_client.getProperty(TPOS3Client.pn)); entry.setAuthorisationAmount(_client.getProperty(TPOS3Client.PN_AUTHORAMOUNT)); entry.setAuthorisationCode(_client.getProperty(TPOS3Client.PN_AUTHORISATIONCODE)); entry.setAuthorisationCurrency(_client.getProperty(TPOS3Client.PN_AUTHORCURRENCY)); entry.setAuthorisationIdRsp(_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); entry.setAuthorisationPathReasonCode(_client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE)); entry.setBatchNumber(_client.getProperty(TPOS3Client.PN_BATCHNUMBER)); entry.setBrandId(_client.getProperty(TPOS3Client.PN_CARDBRANDID)); entry.setBrandName(_client.getProperty(TPOS3Client.PN_CARDBRANDNAME)); entry.setCardCharacteristics(_client.getProperty(TPOS3Client.PN_CARDCHARACTER)); entry.setCardExpires(_client.getProperty(TPOS3Client.PN_EXPIRE)); entry.setCardName(_client.getProperty(TPOS3Client.PN_CARDTYPENAME)); entry.setCardType(_client.getProperty(TPOS3Client.PN_CARDTYPEID)); entry.setDetailExpected(_client.getProperty(TPOS3Client.PN_DETAILEXPECTED)); entry.setEntryDate(_client.getProperty(TPOS3Client.PN_DATE)); entry.setEntryTime(_client.getProperty(TPOS3Client.PN_TIME)); entry.setErrorNo(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); entry.setErrorText(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); entry.setLocationNr(_client.getProperty(TPOS3Client.PN_LOCATIONNUMBER)); entry.setMerchantNrAuthorisation(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR)); entry.setMerchantNrOtherServices(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES)); entry.setMerchantNrSubmission(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION)); // entry.setPan("***********"); entry.setPosNr(_client.getProperty(TPOS3Client.PN_POSNUMBER)); entry.setPosSerialNr(_client.getProperty(TPOS3Client.PN_POSSERIAL)); // entry.setPrintData(_client.getProperty(TPOS3Client.pn_p)); entry.setSubmissionAmount(_client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT)); entry.setSubmissionCurrency(_client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY)); entry.setTotalResponseCode(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE)); entry.setTransactionNr(_client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER)); entry.setVoidedAuthorisationIdResponse(_client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP)); entry.setVoidedTransactionNr(_client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER)); // entry.setXMLAttachment(_client.getProperty(TPOS3Client.)); entry.setCardNumber(encodedCardNumber); if (parentDataPK != null) { try { entry.setParentID(((Integer) parentDataPK).intValue()); } catch (Exception e) { System.out.println("TPosClient : could not set parentID : "+parentDataPK); } } entry.store();// inserted = TPosAuthorisationEntriesHome.getInstance().insert(entry);// String tmpTest;// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHORAMOUNT);// System.out.println("PN_AUTHORAMOUNT : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHORCURRENCY);// System.out.println("PN_AUTHORCURRENCY : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP);// System.out.println("PN_AUTHORIDENTIFYRSP : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE);// System.out.println("PN_AUTHPATHREASONCODE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_BATCHNUMBER);// System.out.println("PN_BATCHNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDBRANDID);// System.out.println("PN_CARDBRANDNAME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDBRANDNAME);// System.out.println("PN_CARDBRANDNAME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDCHARACTER);// System.out.println("PN_CARDCHARACTER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_EXPIRE);// System.out.println("PN_EXPIRE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDTYPENAME);// System.out.println("PN_CARDTYPENAME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDTYPEID);// System.out.println("PN_CARDTYPEID : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_DETAILEXPECTED);// System.out.println("PN_DETAILEXPECTED : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_DATE);// System.out.println("PN_DATE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_TIME);// System.out.println("PN_TIME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_ERRORNUMBER);// System.out.println("PN_ERRORNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_ERRORTEXT);// System.out.println("PN_ERRORTEXT : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_LOCATIONNUMBER);// System.out.println("PN_LOCATIONNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR);// System.out.println("PN_MERCHANTNUMBEROTHERSERVICES : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES);// System.out.println("PN_MERCHANTNUMBEROTHERSERVICES : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION);// System.out.println("PN_MERCHANTNUMBERSUBMISSION : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_POSNUMBER);// System.out.println("PN_POSNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_POSSERIAL);// System.out.println("PN_POSSERIAL : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT);// System.out.println("PN_SUBMISSIONAMOUNT : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY);// System.out.println("PN_SUBMISSIONCURRENCY : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE);// System.out.println("PN_TOTALRESPONSECODE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER);// System.out.println("PN_TRANSACTIONNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP);// System.out.println("PN_VOIDEDAUTHIDRSP : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER);// System.out.println("PN_VOIDEDTRANSNUMBER : "+tmpTest.length()); inserted = true; } catch (Exception e) { inserted = false; e.printStackTrace(); } if (!inserted) { System.err.println("Unable to save entry to database"); } if (!valid) { TPosException e = new TPosException("Error in authorisation"); e.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); e.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); e.setDisplayError("Error in authorisation (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw e; } TPosException tposEx = null; switch (Integer.parseInt(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE), 10)) { case 0: return (_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); case 1: tposEx = new TPosException("Authorisation denied"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 2: tposEx = new TPosException("Authorisation denied, pick up card"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 3: tposEx = new TPosException("Authorisation denied, call for manual authorisation"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; } } return ("-1"); }
private String doAuth(String cardnumber, String monthExpires, String yearExpires, double amount, String currency, String transactionType, Object parentDataPK, String authIDRsp) throws TPosException { if(_client != null) { _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); String encodedCardNumber = CreditCardBusinessBean.encodeCreditCardNumber(cardnumber); _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); if (authIDRsp != null) { _client.setProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP, authIDRsp); } //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); amount *= amountMultiplier; String stringAmount = Integer.toString((int)amount); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } boolean valid = false; try { valid = _client.sendAuthorisationReq(); } catch (IllegalArgumentException e) { getKeys(); createNewBatch(); _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); if (authIDRsp == null) { _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); } else { // Setting authID, _client should by created already _client.setProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP, authIDRsp); } //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } valid = _client.sendAuthorisationReq(); } boolean inserted = false; TPosAuthorisationEntriesBean entry; try { TPosAuthorisationEntriesBeanHome home = (TPosAuthorisationEntriesBeanHome) IDOLookup.getHome(TPosAuthorisationEntriesBean.class); entry = home.create();// entry = TPosAuthorisationEntriesHome.getInstance().getNewElement(); // entry.setAttachmentCount(_client.getProperty(TPOS3Client.pn)); entry.setAuthorisationAmount(_client.getProperty(TPOS3Client.PN_AUTHORAMOUNT)); entry.setAuthorisationCode(_client.getProperty(TPOS3Client.PN_AUTHORISATIONCODE)); entry.setAuthorisationCurrency(_client.getProperty(TPOS3Client.PN_AUTHORCURRENCY)); entry.setAuthorisationIdRsp(_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); entry.setAuthorisationPathReasonCode(_client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE)); entry.setBatchNumber(_client.getProperty(TPOS3Client.PN_BATCHNUMBER)); entry.setBrandId(_client.getProperty(TPOS3Client.PN_CARDBRANDID)); entry.setBrandName(_client.getProperty(TPOS3Client.PN_CARDBRANDNAME)); entry.setCardCharacteristics(_client.getProperty(TPOS3Client.PN_CARDCHARACTER)); entry.setCardExpires(_client.getProperty(TPOS3Client.PN_EXPIRE)); entry.setCardName(_client.getProperty(TPOS3Client.PN_CARDTYPENAME)); entry.setCardType(_client.getProperty(TPOS3Client.PN_CARDTYPEID)); entry.setDetailExpected(_client.getProperty(TPOS3Client.PN_DETAILEXPECTED)); entry.setEntryDate(_client.getProperty(TPOS3Client.PN_DATE)); entry.setEntryTime(_client.getProperty(TPOS3Client.PN_TIME)); entry.setErrorNo(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); entry.setErrorText(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); entry.setLocationNr(_client.getProperty(TPOS3Client.PN_LOCATIONNUMBER)); entry.setMerchantNrAuthorisation(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR)); entry.setMerchantNrOtherServices(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES)); entry.setMerchantNrSubmission(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION)); // entry.setPan("***********"); entry.setPosNr(_client.getProperty(TPOS3Client.PN_POSNUMBER)); entry.setPosSerialNr(_client.getProperty(TPOS3Client.PN_POSSERIAL)); // entry.setPrintData(_client.getProperty(TPOS3Client.pn_p)); entry.setSubmissionAmount(_client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT)); entry.setSubmissionCurrency(_client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY)); entry.setTotalResponseCode(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE)); entry.setTransactionNr(_client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER)); entry.setVoidedAuthorisationIdResponse(_client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP)); entry.setVoidedTransactionNr(_client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER)); // entry.setXMLAttachment(_client.getProperty(TPOS3Client.)); entry.setCardNumber(encodedCardNumber); if (parentDataPK != null) { try { entry.setParentID(((Integer) parentDataPK).intValue()); } catch (Exception e) { System.out.println("TPosClient : could not set parentID : "+parentDataPK); } } entry.store();// inserted = TPosAuthorisationEntriesHome.getInstance().insert(entry);// String tmpTest;// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHORAMOUNT);// System.out.println("PN_AUTHORAMOUNT : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHORCURRENCY);// System.out.println("PN_AUTHORCURRENCY : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP);// System.out.println("PN_AUTHORIDENTIFYRSP : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE);// System.out.println("PN_AUTHPATHREASONCODE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_BATCHNUMBER);// System.out.println("PN_BATCHNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDBRANDID);// System.out.println("PN_CARDBRANDNAME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDBRANDNAME);// System.out.println("PN_CARDBRANDNAME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDCHARACTER);// System.out.println("PN_CARDCHARACTER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_EXPIRE);// System.out.println("PN_EXPIRE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDTYPENAME);// System.out.println("PN_CARDTYPENAME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_CARDTYPEID);// System.out.println("PN_CARDTYPEID : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_DETAILEXPECTED);// System.out.println("PN_DETAILEXPECTED : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_DATE);// System.out.println("PN_DATE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_TIME);// System.out.println("PN_TIME : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_ERRORNUMBER);// System.out.println("PN_ERRORNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_ERRORTEXT);// System.out.println("PN_ERRORTEXT : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_LOCATIONNUMBER);// System.out.println("PN_LOCATIONNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR);// System.out.println("PN_MERCHANTNUMBEROTHERSERVICES : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES);// System.out.println("PN_MERCHANTNUMBEROTHERSERVICES : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION);// System.out.println("PN_MERCHANTNUMBERSUBMISSION : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_POSNUMBER);// System.out.println("PN_POSNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_POSSERIAL);// System.out.println("PN_POSSERIAL : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT);// System.out.println("PN_SUBMISSIONAMOUNT : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY);// System.out.println("PN_SUBMISSIONCURRENCY : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE);// System.out.println("PN_TOTALRESPONSECODE : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER);// System.out.println("PN_TRANSACTIONNUMBER : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP);// System.out.println("PN_VOIDEDAUTHIDRSP : "+tmpTest.length());// tmpTest = _client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER);// System.out.println("PN_VOIDEDTRANSNUMBER : "+tmpTest.length()); inserted = true; } catch (Exception e) { inserted = false; e.printStackTrace(); } if (!inserted) { System.err.println("Unable to save entry to database"); } if (!valid) { TPosException e = new TPosException("Error in authorisation"); e.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); e.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); e.setDisplayError("Error in authorisation (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw e; } TPosException tposEx = null; switch (Integer.parseInt(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE), 10)) { case 0: return (_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); case 1: tposEx = new TPosException("Authorisation denied"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 2: tposEx = new TPosException("Authorisation denied, pick up card"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 3: tposEx = new TPosException("Authorisation denied, call for manual authorisation"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; } } return ("-1"); }
1,120,680
private int calculateTextFieldWidthForString(String str){ int fontSize = 9; return (int)( 5+(str.length()*fontSize*0.58)); }
private int calculateTextFieldWidthForString(String str){ int fontSize = 9; return (int)( 5+(str.length()*fontSize*0.58)); }
1,120,681
public DesignBox getDynamicDesignBox(SQLQuery query, IWResourceBundle resourceBundle, IWContext iwc) throws IOException, JRException { final int columnSpacing = 15; int columnWidth = 120; final int labelWidth = 95; final int valueWidth = 55; Map parameterMap = new HashMap(); DynamicReportDesign design = DynamicReportDesign.getInstanceThatShowsDateAndUser("GeneratedDesign"); // add date Date date = new Date(); String pattern = "dd.MM.yyyy, HH:mm"; SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); String formatedDate = dateFormat.format(date); parameterMap.put(DynamicReportDesign.PRM_DATE, formatedDate); // add user User user = iwc.getCurrentUser(); String userName = user.getName(); parameterMap.put(DynamicReportDesign.PRM_USER, userName); //set title String queryName = query.getName(); parameterMap.put(DynamicReportDesign.PRM_REPORT_NAME, queryName); // set total width List fields = query.getFields(); int totalWidth = 0; if (! fields.isEmpty()) { //TODO thi: solve problem with the width of columns avoiding merging of vertical cells in excel outputs // stretch with overflow merges two vertical cells, excel file can't be sorted // see also and fix also ReportGenerator // this is a hack --------------------------------------------------------------------------------------------------------------------------------------------------------------- int numberOfFields = fields.size(); columnWidth = DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_PORTRAIT_A4 / numberOfFields; columnWidth -= columnSpacing; // end of hack ------------------------------------------------------------------------------------------------------------------------------------------------------------------ totalWidth = ((columnSpacing + columnWidth) * fields.size()) - columnSpacing; } design.setColumnWidth(totalWidth); // does the width fit the page width? if (totalWidth > DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_PORTRAIT_A4) { // change to landscape! design.setOrientationLandscape(); // does the the width now fit the page width? int landscapeWidth = (totalWidth > DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_LANDSCAPE_A4) ? totalWidth + DynamicReportDesign.PAGE_LEFT_MARGIN + DynamicReportDesign.PAGE_RIGHT_MARGIN : DynamicReportDesign.PAGE_WIDTH_LANDSCAPE_A4; design.setPageWidth(landscapeWidth); design.setPageHeight(DynamicReportDesign.PAGE_HEIGHT_LANDSCAPE_A4); } // set fields int orderNumber = 1; Iterator fieldIterator = fields.iterator(); while (fieldIterator.hasNext()) { QueryFieldPart fieldPart = (QueryFieldPart) fieldIterator.next(); String fieldName = fieldPart.getName(); String localizedFieldName = resourceBundle.getLocalizedString(fieldName, fieldName); //String type = fieldPart.getTypeClass(); //TODO: thi think about that String type = String.class.getName(); String displayParameter = getColumnParameter(orderNumber); // !!! do not store it with the key field name but with the alias name String aliasName = fieldPart.getAliasName(); parameterMap.put(displayParameter, localizedFieldName); design.addField(aliasName, displayParameter, type, columnWidth); orderNumber++; } // add fields for values and descriptions of the dynamic fields to header Map identifierInputDescriptionMap = query.getIdentifierInputDescriptionMap(); Map identifierValueMap = query.getIdentifierValueMap(); Iterator iterator = identifierInputDescriptionMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String identifier = entry.getKey().toString(); if ( ! (DirectSQLStatement.USER_ACCESS_VARIABLE.equals(identifier) || DirectSQLStatement.GROUP_ACCESS_VARIABLE.equals(identifier) || DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE.equals(identifier) ) ) { InputDescription inputDescription = (InputDescription) entry.getValue(); List inputValues = (List) identifierValueMap.get(identifier); // get handler String inputHandlerClassName = inputDescription.getHandlerDescription(); String inputValueDisplay = null; if (inputHandlerClassName != null) { try { Class inputHandlerClass = RefactorClassRegistry.forName(inputHandlerClassName); InputHandler inputHandler = (InputHandler) inputHandlerClass.newInstance(); String[] inputValuesAsArray = (String[]) inputValues.toArray(new String[0]); // method below throws Exception Object resultingObject = inputHandler.getResultingObject(inputValuesAsArray, iwc); inputValueDisplay = inputHandler.getDisplayForResultingObject(resultingObject, iwc); } catch (ClassNotFoundException classEx) { logError("[JasperReportBusiness] Inputhandler class could not be found"); log(classEx); inputValueDisplay = inputValues.toString(); } catch (InstantiationException insEx) { logError("[JasperReportBusiness] Inputhandler class could not be instanciated"); log(insEx); inputValueDisplay = inputValues.toString(); } catch (IllegalAccessException accEx) { logError("[JasperReportBusiness] Inputhandler class could not be instanciated"); log(accEx); inputValueDisplay = inputValues.toString(); } catch (Exception ex) { logError("[JasperReportBusiness] Resulting object could not be fetched"); log(ex); inputValueDisplay = inputValues.toString(); } } else { StringBuffer buffer = new StringBuffer(); Iterator inputIterator = inputValues.iterator(); boolean firstTime = true; while (inputIterator.hasNext()) { if (! firstTime) { buffer.append(", "); } else { firstTime = false; } buffer.append(inputIterator.next().toString()); } inputValueDisplay = buffer.toString(); } String description = inputDescription.getDescription(); int descriptionWidth = (description == null) ? labelWidth : calculateTextFieldWidthForString(description); int inputValueDisplayWidth = (inputValueDisplay == null) ? valueWidth : calculateTextFieldWidthForString(inputValueDisplay); String descriptionWithPrefix = StringHandler.concat(SQLQuery.DYNAMIC_FIELD_DESCRIPTION_PREFIX, identifier); String inputValueDisplayWithPrefix = StringHandler.concat(SQLQuery.DYNAMIC_FIELD_VALUE_PREFIX, identifier); parameterMap.put(descriptionWithPrefix, description); parameterMap.put(inputValueDisplayWithPrefix, inputValueDisplay); design.addHeaderParameter(descriptionWithPrefix, descriptionWidth, inputValueDisplayWithPrefix, String.class, inputValueDisplayWidth); } } design.close(); JasperDesign jasperDesign = design.getJasperDesign(iwc); DesignBox designBox = new DesignBox(); designBox.setDesign(jasperDesign); designBox.setParameterMap(parameterMap); return designBox; }
public DesignBox getDynamicDesignBox(SQLQuery query, IWResourceBundle resourceBundle, IWContext iwc) throws IOException, JRException { final int columnSpacing = 15; int columnWidth = 120; final int labelWidth = 95; final int valueWidth = 55; Map parameterMap = new HashMap(); DynamicReportDesign design = DynamicReportDesign.getInstanceThatShowsDateAndUser("GeneratedDesign"); // add date Date date = new Date(); String pattern = "dd.MM.yyyy, HH:mm"; SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); String formatedDate = dateFormat.format(date); parameterMap.put(DynamicReportDesign.PRM_DATE, formatedDate); // add user User user = iwc.getCurrentUser(); String userName = user.getName(); parameterMap.put(DynamicReportDesign.PRM_USER, userName); //set title String queryName = query.getName(); parameterMap.put(DynamicReportDesign.PRM_REPORT_NAME, queryName); // set total width List fields = query.getFields(); int totalWidth = 0; if (! fields.isEmpty()) { //TODO thi: solve problem with the width of columns avoiding merging of vertical cells in excel outputs // stretch with overflow merges two vertical cells, excel file can't be sorted // see also and fix also ReportGenerator // this is a hack --------------------------------------------------------------------------------------------------------------------------------------------------------------- int numberOfFields = fields.size(); columnWidth = DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_PORTRAIT_A4 / numberOfFields; columnWidth -= columnSpacing; // end of hack ------------------------------------------------------------------------------------------------------------------------------------------------------------------ totalWidth = ((columnSpacing + columnWidth) * fields.size()) - columnSpacing; } design.setColumnWidth(totalWidth); // does the width fit the page width? if (totalWidth > DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_PORTRAIT_A4) { // change to landscape! design.setOrientationLandscape(); // does the the width now fit the page width? int landscapeWidth = (totalWidth > DynamicReportDesign.PAGE_WIDTH_WITHOUT_MARGINS_LANDSCAPE_A4) ? totalWidth + DynamicReportDesign.PAGE_LEFT_MARGIN + DynamicReportDesign.PAGE_RIGHT_MARGIN : DynamicReportDesign.PAGE_WIDTH_LANDSCAPE_A4; design.setPageWidth(landscapeWidth); design.setPageHeight(DynamicReportDesign.PAGE_HEIGHT_LANDSCAPE_A4); } // set fields int orderNumber = 1; Iterator fieldIterator = fields.iterator(); while (fieldIterator.hasNext()) { QueryFieldPart fieldPart = (QueryFieldPart) fieldIterator.next(); String fieldName = fieldPart.getName(); String localizedFieldName = resourceBundle.getLocalizedString(fieldName, fieldName); //String type = fieldPart.getTypeClass(); //TODO: thi think about that String type = String.class.getName(); String displayParameter = getColumnParameter(orderNumber); // !!! do not store it with the key field name but with the alias name String aliasName = fieldPart.getAliasName(); parameterMap.put(displayParameter, localizedFieldName); design.addField(aliasName, displayParameter, type, columnWidth); orderNumber++; } // add fields for values and descriptions of the dynamic fields to header Map identifierInputDescriptionMap = query.getIdentifierInputDescriptionMap(); Map identifierValueMap = query.getIdentifierValueMap(); Iterator iterator = identifierInputDescriptionMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String identifier = entry.getKey().toString(); if ( ! (DirectSQLStatement.USER_ACCESS_VARIABLE.equals(identifier) || DirectSQLStatement.GROUP_ACCESS_VARIABLE.equals(identifier) || DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE.equals(identifier) ) ) { InputDescription inputDescription = (InputDescription) entry.getValue(); List inputValues = (List) identifierValueMap.get(identifier); // get handler String inputHandlerClassName = inputDescription.getHandlerDescription(); String inputValueDisplay = null; if (inputHandlerClassName != null) { try { Class inputHandlerClass = RefactorClassRegistry.forName(inputHandlerClassName); InputHandler inputHandler = (InputHandler) inputHandlerClass.newInstance(); String[] inputValuesAsArray = (String[]) inputValues.toArray(new String[0]); // method below throws Exception Object resultingObject = inputHandler.getResultingObject(inputValuesAsArray, iwc); inputValueDisplay = inputHandler.getDisplayForResultingObject(resultingObject, iwc); } catch (ClassNotFoundException classEx) { logError("[JasperReportBusiness] Inputhandler class could not be found"); log(classEx); inputValueDisplay = inputValues.toString(); } catch (InstantiationException insEx) { logError("[JasperReportBusiness] Inputhandler class could not be instanciated"); log(insEx); inputValueDisplay = inputValues.toString(); } catch (IllegalAccessException accEx) { logError("[JasperReportBusiness] Inputhandler class could not be instanciated"); log(accEx); inputValueDisplay = inputValues.toString(); } catch (Exception ex) { logError("[JasperReportBusiness] Resulting object could not be fetched"); log(ex); inputValueDisplay = inputValues.toString(); } } else { StringBuffer buffer = new StringBuffer(); Iterator inputIterator = inputValues.iterator(); boolean firstTime = true; while (inputIterator.hasNext()) { if (! firstTime) { buffer.append(", "); } else { firstTime = false; } buffer.append(inputIterator.next().toString()); } inputValueDisplay = buffer.toString(); } String description = inputDescription.getDescription(); int descriptionWidth = (description == null) ? labelWidth : calculateTextFieldWidthForString(description); int inputValueDisplayWidth = (inputValueDisplay == null) ? valueWidth : calculateTextFieldWidthForString(inputValueDisplay); String descriptionWithPrefix = StringHandler.concat(SQLQuery.DYNAMIC_FIELD_DESCRIPTION_PREFIX, identifier); String inputValueDisplayWithPrefix = StringHandler.concat(SQLQuery.DYNAMIC_FIELD_VALUE_PREFIX, identifier); parameterMap.put(descriptionWithPrefix, description); parameterMap.put(inputValueDisplayWithPrefix, inputValueDisplay); design.addHeaderParameter(descriptionWithPrefix, descriptionWidth, inputValueDisplayWithPrefix, String.class, inputValueDisplayWidth); } } design.close(); JasperDesign jasperDesign = design.getJasperDesign(iwc); DesignBox designBox = new DesignBox(); designBox.setDesign(jasperDesign); designBox.setParameterMap(parameterMap); return designBox; }
1,120,682
public String getSimpleExcelReport(JRDataSource reportData, String nameOfReport, ReportDescription description) { // prepare path long folderIdentifier = System.currentTimeMillis(); String path = getRealPathToReportFile("report", EXCEL_FILE_EXTENSION,folderIdentifier); try { SimpleReportBusiness srBusiness = (SimpleReportBusiness) IBOLookup.getServiceInstance(getIWApplicationContext(),SimpleReportBusiness.class); srBusiness.writeSimpleExcelFile(reportData,nameOfReport,path, description); } catch (IBOLookupException e) { logError("[ReportBusiness]: The Simple Report could not be generated."); log(e); return null; } catch (IOException e) { logError("[ReportBusiness]: The Simple Report could not be generated."); log(e); return null; } return getURIToReport("report", EXCEL_FILE_EXTENSION,folderIdentifier); }
public String getSimpleExcelReport(JRDataSource reportData, String nameOfReport, ReportDescription description) { // prepare path long folderIdentifier = System.currentTimeMillis(); String path = getRealPathToReportFile("report", EXCEL_FILE_EXTENSION,folderIdentifier); try { SimpleReportBusiness srBusiness = (SimpleReportBusiness) IBOLookup.getServiceInstance(getIWApplicationContext(),SimpleReportBusiness.class); srBusiness.writeSimpleExcelFile(reportData,nameOfReport,path, description); } catch (IBOLookupException e) { logError("[ReportBusiness]: The Simple Report could not be generated."); log(e); return null; } catch (IOException e) { logError("[ReportBusiness]: The Simple Report could not be generated."); log(e); return null; } return getURIToReport("report", EXCEL_FILE_EXTENSION,folderIdentifier); }
1,120,683
public JasperPrint printSynchronizedReport(QueryResult dataSource, Map parameterMap, DesignBox designBox) { JasperPrint print; synchronizeResultAndDesign(dataSource, parameterMap, designBox); // henceforth we treat the QueryResult as a JRDataSource, // therefore we reset the QueryResult to prepare it dataSource.resetDataSource(); // resets only the DataSource functionality (sets the pointer to the first row) try { Map map = designBox.getParameterMap(); map.putAll(parameterMap); JasperDesign design = designBox.getDesign(); print = getReport(dataSource, map, design); } catch (JRException ex) { logError("[ReportBusiness]: Jasper print could not be generated."); log(ex); return null; } return print; }
public JasperPrint printSynchronizedReport(QueryResult dataSource, Map parameterMap, DesignBox designBox) { JasperPrint print; synchronizeResultAndDesign(dataSource, parameterMap, designBox); // henceforth we treat the QueryResult as a JRDataSource, // therefore we reset the QueryResult to prepare it dataSource.resetDataSource(); // resets only the DataSource functionality (sets the pointer to the first row) try { Map map = designBox.getParameterMap(); map.putAll(parameterMap); JasperDesign design = designBox.getDesign(); print = getReport(dataSource, map, design); } catch (JRException ex) { logError("[ReportBusiness]: Jasper print could not be generated."); log(ex); return null; } return print; }
1,120,684
public JasperPrint printSynchronizedReport(QueryResult dataSource, Map parameterMap, DesignBox designBox) { JasperPrint print; synchronizeResultAndDesign(dataSource, parameterMap, designBox); // henceforth we treat the QueryResult as a JRDataSource, // therefore we reset the QueryResult to prepare it dataSource.resetDataSource(); // resets only the DataSource functionality (sets the pointer to the first row) try { Map map = designBox.getParameterMap(); map.putAll(parameterMap); JasperDesign design = designBox.getDesign(); print = getReport(dataSource, map, design); } catch (JRException ex) { logError("[ReportBusiness]: Jasper print could not be generated."); log(ex); return null; } return print; }
public JasperPrint printSynchronizedReport(QueryResult dataSource, Map parameterMap, DesignBox designBox) { JasperPrint print; synchronizeResultAndDesign(dataSource, parameterMap, designBox); // henceforth we treat the QueryResult as a JRDataSource, // therefore we reset the QueryResult to prepare it dataSource.resetDataSource(); // resets only the DataSource functionality (sets the pointer to the first row) try { Map map = designBox.getParameterMap(); JasperDesign design = designBox.getDesign(); print = getReport(dataSource, map, design); } catch (JRException ex) { logError("[ReportBusiness]: Jasper print could not be generated."); log(ex); return null; } return print; }
1,120,685
public void synchronizeResultAndDesign(QueryResult result, Map parameterMap, DesignBox designBox) { JasperDesign reportDesign = designBox.getDesign(); Map designParameterMap = designBox.getParameterMap(); List designFieldsToRemove = new ArrayList(); // get fields of the report design List fields = reportDesign.getFieldsList(); int orderNumber = 1; Iterator iterator = fields.iterator(); while (iterator.hasNext()) { JRField jrField = (JRField) iterator.next(); String designFieldId = jrField.getName(); QueryResultField field = result.getFieldByOrderNumber(orderNumber); // sometimes the design provides more fields than necessary if (field == null) { // note the design field designFieldsToRemove.add(designFieldId); } else { result.mapDesignIdToFieldId(designFieldId, field.getId()); String display = field.getValue(QueryResultField.DISPLAY); String displayKey = getColumnParameter(orderNumber); // be sure that the display key is set. Usually a default value is set by the design box! If not, set it now. if (display == null || display.length() == 0) { if (! designParameterMap.containsKey(displayKey)) { parameterMap.put(displayKey, ""); } } else { parameterMap.put(displayKey, display); } } orderNumber++; } removeFields(designFieldsToRemove, reportDesign); }
private void synchronizeResultAndDesign(QueryResult result, DesignBox designBox) { JasperDesign reportDesign = designBox.getDesign(); Map designParameterMap = designBox.getParameterMap(); List designFieldsToRemove = new ArrayList(); // get fields of the report design List fields = reportDesign.getFieldsList(); int orderNumber = 1; Iterator iterator = fields.iterator(); while (iterator.hasNext()) { JRField jrField = (JRField) iterator.next(); String designFieldId = jrField.getName(); QueryResultField field = result.getFieldByOrderNumber(orderNumber); // sometimes the design provides more fields than necessary if (field == null) { // note the design field designFieldsToRemove.add(designFieldId); } else { result.mapDesignIdToFieldId(designFieldId, field.getId()); String display = field.getValue(QueryResultField.DISPLAY); String displayKey = getColumnParameter(orderNumber); // be sure that the display key is set. Usually a default value is set by the design box! If not, set it now. if (display == null || display.length() == 0) { if (! designParameterMap.containsKey(displayKey)) { parameterMap.put(displayKey, ""); } } else { parameterMap.put(displayKey, display); } } orderNumber++; } removeFields(designFieldsToRemove, reportDesign); }
1,120,686
public void synchronizeResultAndDesign(QueryResult result, Map parameterMap, DesignBox designBox) { JasperDesign reportDesign = designBox.getDesign(); Map designParameterMap = designBox.getParameterMap(); List designFieldsToRemove = new ArrayList(); // get fields of the report design List fields = reportDesign.getFieldsList(); int orderNumber = 1; Iterator iterator = fields.iterator(); while (iterator.hasNext()) { JRField jrField = (JRField) iterator.next(); String designFieldId = jrField.getName(); QueryResultField field = result.getFieldByOrderNumber(orderNumber); // sometimes the design provides more fields than necessary if (field == null) { // note the design field designFieldsToRemove.add(designFieldId); } else { result.mapDesignIdToFieldId(designFieldId, field.getId()); String display = field.getValue(QueryResultField.DISPLAY); String displayKey = getColumnParameter(orderNumber); // be sure that the display key is set. Usually a default value is set by the design box! If not, set it now. if (display == null || display.length() == 0) { if (! designParameterMap.containsKey(displayKey)) { parameterMap.put(displayKey, ""); } } else { parameterMap.put(displayKey, display); } } orderNumber++; } removeFields(designFieldsToRemove, reportDesign); }
public void synchronizeResultAndDesign(QueryResult result, Map parameterMap, DesignBox designBox) { JasperDesign reportDesign = designBox.getDesign(); Map designParameterMap = designBox.getParameterMap(); List designFieldsToRemove = new ArrayList(); // get fields of the report design List fields = reportDesign.getFieldsList(); int orderNumber = 1; Iterator iterator = fields.iterator(); while (iterator.hasNext()) { JRField jrField = (JRField) iterator.next(); String designFieldId = jrField.getName(); QueryResultField field = result.getFieldByOrderNumber(orderNumber); // sometimes the design provides more fields than necessary if (field == null) { // note the design field designFieldsToRemove.add(designFieldId); } else { result.mapDesignIdToFieldId(designFieldId, field.getId()); String display = field.getValue(QueryResultField.DISPLAY); String displayKey = getColumnParameter(orderNumber); // be sure that the display key is set. Usually a default value is set by the design box! If not, set it now. if (display == null || display.length() == 0) { if (! designParameterMap.containsKey(displayKey)) { designParameterMap.put(displayKey, ""); } } else { parameterMap.put(displayKey, display); } } orderNumber++; } removeFields(designFieldsToRemove, reportDesign); }
1,120,687
public void synchronizeResultAndDesign(QueryResult result, Map parameterMap, DesignBox designBox) { JasperDesign reportDesign = designBox.getDesign(); Map designParameterMap = designBox.getParameterMap(); List designFieldsToRemove = new ArrayList(); // get fields of the report design List fields = reportDesign.getFieldsList(); int orderNumber = 1; Iterator iterator = fields.iterator(); while (iterator.hasNext()) { JRField jrField = (JRField) iterator.next(); String designFieldId = jrField.getName(); QueryResultField field = result.getFieldByOrderNumber(orderNumber); // sometimes the design provides more fields than necessary if (field == null) { // note the design field designFieldsToRemove.add(designFieldId); } else { result.mapDesignIdToFieldId(designFieldId, field.getId()); String display = field.getValue(QueryResultField.DISPLAY); String displayKey = getColumnParameter(orderNumber); // be sure that the display key is set. Usually a default value is set by the design box! If not, set it now. if (display == null || display.length() == 0) { if (! designParameterMap.containsKey(displayKey)) { parameterMap.put(displayKey, ""); } } else { parameterMap.put(displayKey, display); } } orderNumber++; } removeFields(designFieldsToRemove, reportDesign); }
public void synchronizeResultAndDesign(QueryResult result, Map parameterMap, DesignBox designBox) { JasperDesign reportDesign = designBox.getDesign(); Map designParameterMap = designBox.getParameterMap(); List designFieldsToRemove = new ArrayList(); // get fields of the report design List fields = reportDesign.getFieldsList(); int orderNumber = 1; Iterator iterator = fields.iterator(); while (iterator.hasNext()) { JRField jrField = (JRField) iterator.next(); String designFieldId = jrField.getName(); QueryResultField field = result.getFieldByOrderNumber(orderNumber); // sometimes the design provides more fields than necessary if (field == null) { // note the design field designFieldsToRemove.add(designFieldId); } else { result.mapDesignIdToFieldId(designFieldId, field.getId()); String display = field.getValue(QueryResultField.DISPLAY); String displayKey = getColumnParameter(orderNumber); // be sure that the display key is set. Usually a default value is set by the design box! If not, set it now. if (display == null || display.length() == 0) { if (! designParameterMap.containsKey(displayKey)) { parameterMap.put(displayKey, ""); } } else { designParameterMap.put(displayKey, display); } } orderNumber++; } removeFields(designFieldsToRemove, reportDesign); }
1,120,688
public static final ATObject upExceptionCreation(InterpreterException jRcvr, ATTable atInitargs) throws InterpreterException { ATObject[] args = atInitargs.asNativeTable().elements_; return JavaInterfaceAdaptor.createNativeATObject(jRcvr.getClass(), args); }
public static final ATObject upExceptionCreation(InterpreterException jRcvr, ATTable atInitargs) throws InterpreterException { ATObject[] args = atInitargs.asNativeTable().elements_; return new NATException((InterpreterException) Symbiosis.symbioticInstanceCreation(jRcvr.getClass(), args) .asJavaObjectUnderSymbiosis().getWrappedObject()); }
1,120,689
public static final String valueNameOf(Class c) { String name = c.getSimpleName(); if (name.startsWith("AT")) { return "a" + classnameToValuename(name, "AT"); } else if (name.startsWith("NAT")) { return "a native" + classnameToValuename(name, "NAT"); } else if (name.startsWith("AG")) { return "a native AST" + classnameToValuename(name, "AG"); } else if (name.startsWith("X")) { return "a native exception" + classnameToValuename(name, "X"); } else if (name.startsWith("OBJ")) { return "the native object" + classnameToValuename(name, "OBJ"); } else { return name; } }
public static final String valueNameOf(Class c) { String name = getSimpleName(c); if (name.startsWith("AT")) { return "a" + classnameToValuename(name, "AT"); } else if (name.startsWith("NAT")) { return "a native" + classnameToValuename(name, "NAT"); } else if (name.startsWith("AG")) { return "a native AST" + classnameToValuename(name, "AG"); } else if (name.startsWith("X")) { return "a native exception" + classnameToValuename(name, "X"); } else if (name.startsWith("OBJ")) { return "the native object" + classnameToValuename(name, "OBJ"); } else { return name; } }
1,120,690
public void renderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException, FacesException { /* ViewNode node = getNode(facesContext); if (viewToRender == null) { log.warning("viewToRender must not be null"); throw new NullPointerException("viewToRender must not be null"); } ExternalContext externalContext = facesContext.getExternalContext(); String viewId = facesContext.getViewRoot().getViewId();*/ /* ServletMapping servletMapping = getServletMapping(externalContext); if (servletMapping.isExtensionMapping()) { String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME); String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX; DebugUtils.assertError(suffix.charAt(0) == '.', log, "Default suffix must start with a dot!"); if (!viewId.endsWith(suffix)) { int dot = viewId.lastIndexOf('.'); if (dot == -1) { if (log.isTraceEnabled()) log.trace("Current viewId has no extension, appending default suffix " + suffix); viewId = viewId + suffix; } else { if (log.isTraceEnabled()) log.trace("Replacing extension of current viewId by suffix " + suffix); viewId = viewId.substring(0, dot) + suffix; } facesContext.getViewRoot().setViewId(viewId); } } if (log.isTraceEnabled()) log.trace("Dispatching to " + viewId);*/ //externalContext.dispatch(viewId); super.renderView(facesContext,viewToRender); }
public void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesException { /* ViewNode node = getNode(facesContext); if (viewToRender == null) { log.warning("viewToRender must not be null"); throw new NullPointerException("viewToRender must not be null"); } ExternalContext externalContext = facesContext.getExternalContext(); String viewId = facesContext.getViewRoot().getViewId();*/ /* ServletMapping servletMapping = getServletMapping(externalContext); if (servletMapping.isExtensionMapping()) { String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME); String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX; DebugUtils.assertError(suffix.charAt(0) == '.', log, "Default suffix must start with a dot!"); if (!viewId.endsWith(suffix)) { int dot = viewId.lastIndexOf('.'); if (dot == -1) { if (log.isTraceEnabled()) log.trace("Current viewId has no extension, appending default suffix " + suffix); viewId = viewId + suffix; } else { if (log.isTraceEnabled()) log.trace("Replacing extension of current viewId by suffix " + suffix); viewId = viewId.substring(0, dot) + suffix; } facesContext.getViewRoot().setViewId(viewId); } } if (log.isTraceEnabled()) log.trace("Dispatching to " + viewId);*/ //externalContext.dispatch(viewId); super.renderView(facesContext,viewToRender); }
1,120,691
public void renderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException, FacesException { /* ViewNode node = getNode(facesContext); if (viewToRender == null) { log.warning("viewToRender must not be null"); throw new NullPointerException("viewToRender must not be null"); } ExternalContext externalContext = facesContext.getExternalContext(); String viewId = facesContext.getViewRoot().getViewId();*/ /* ServletMapping servletMapping = getServletMapping(externalContext); if (servletMapping.isExtensionMapping()) { String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME); String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX; DebugUtils.assertError(suffix.charAt(0) == '.', log, "Default suffix must start with a dot!"); if (!viewId.endsWith(suffix)) { int dot = viewId.lastIndexOf('.'); if (dot == -1) { if (log.isTraceEnabled()) log.trace("Current viewId has no extension, appending default suffix " + suffix); viewId = viewId + suffix; } else { if (log.isTraceEnabled()) log.trace("Replacing extension of current viewId by suffix " + suffix); viewId = viewId.substring(0, dot) + suffix; } facesContext.getViewRoot().setViewId(viewId); } } if (log.isTraceEnabled()) log.trace("Dispatching to " + viewId);*/ //externalContext.dispatch(viewId); super.renderView(facesContext,viewToRender); }
public void renderView(FacesContext facesContext, UIViewRoot viewToRender) throws IOException, FacesException { /* ViewNode node = getNode(facesContext); if (viewToRender == null) { log.warning("viewToRender must not be null"); throw new NullPointerException("viewToRender must not be null"); } ExternalContext externalContext = facesContext.getExternalContext(); String viewId = facesContext.getViewRoot().getViewId();*/ /* ServletMapping servletMapping = getServletMapping(externalContext); if (servletMapping.isExtensionMapping()) { String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME); String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX; DebugUtils.assertError(suffix.charAt(0) == '.', log, "Default suffix must start with a dot!"); if (!viewId.endsWith(suffix)) { int dot = viewId.lastIndexOf('.'); if (dot == -1) { if (log.isTraceEnabled()) log.trace("Current viewId has no extension, appending default suffix " + suffix); viewId = viewId + suffix; } else { if (log.isTraceEnabled()) log.trace("Replacing extension of current viewId by suffix " + suffix); viewId = viewId.substring(0, dot) + suffix; } facesContext.getViewRoot().setViewId(viewId); } } if (log.isTraceEnabled()) log.trace("Dispatching to " + viewId);*/ //externalContext.dispatch(viewId); ViewNode node = getNode(context); String viewId = viewToRender.getViewId(); String newViewId=viewId; if(node.isResourceBased() && nodeCorrespondsToViewId(node, viewId, context)){ newViewId=node.getResourceURI(); } viewToRender.setViewId(newViewId); super.renderView(context,viewToRender); }
1,120,692
public EventUpdateResult addEvent(BwCalendar cal, BwEvent event, Collection overrides) throws CalFacadeException { EventUpdateResult updResult = new EventUpdateResult(); if (event instanceof BwEventProxy) { BwEventProxy proxy = (BwEventProxy)event; BwEvent override = proxy.getTarget(); setupSharableEntity(override); } else { setupSharableEntity(event); } BwLocation loc = event.getLocation(); BwSponsor sp = event.getSponsor(); if ((sp != null) && (ensureSponsorExists(sp) == null)) { updResult.sponsorsAdded++; } if ((loc != null) && (ensureLocationExists(loc) == null)) { updResult.locationsAdded++; } /* If no calendar has been assigned for this event set it to the default * calendar for non-public events or reject it for public events. */ if (cal == null) { if (event.getPublick()) { throw new CalFacadeException("No calendar assigned"); } cal = getPreferences().getDefaultCalendar(); } if (!cal.getCalendarCollection()) { throw new CalFacadeAccessException(); } event.setCalendar(cal); event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); event.setLastmod(new LastModified(new DateTime(true)).getValue()); event.setCreated(new Created(new DateTime(true)).getValue()); getCal().addEvent(event, overrides); if (isPublicAdmin()) { /* Mail event to any subscribers */ } return updResult; }
public EventUpdateResult addEvent(BwCalendar cal, BwEvent event, Collection overrides) throws CalFacadeException { EventUpdateResult updResult = new EventUpdateResult(); if (event instanceof BwEventProxy) { BwEventProxy proxy = (BwEventProxy)event; BwEvent override = proxy.getRef(); setupSharableEntity(override); } else { setupSharableEntity(event); } BwLocation loc = event.getLocation(); BwSponsor sp = event.getSponsor(); if ((sp != null) && (ensureSponsorExists(sp) == null)) { updResult.sponsorsAdded++; } if ((loc != null) && (ensureLocationExists(loc) == null)) { updResult.locationsAdded++; } /* If no calendar has been assigned for this event set it to the default * calendar for non-public events or reject it for public events. */ if (cal == null) { if (event.getPublick()) { throw new CalFacadeException("No calendar assigned"); } cal = getPreferences().getDefaultCalendar(); } if (!cal.getCalendarCollection()) { throw new CalFacadeAccessException(); } event.setCalendar(cal); event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); event.setLastmod(new LastModified(new DateTime(true)).getValue()); event.setCreated(new Created(new DateTime(true)).getValue()); getCal().addEvent(event, overrides); if (isPublicAdmin()) { /* Mail event to any subscribers */ } return updResult; }
1,120,694
public EventUpdateResult addEvent(BwCalendar cal, BwEvent event, Collection overrides) throws CalFacadeException { EventUpdateResult updResult = new EventUpdateResult(); if (event instanceof BwEventProxy) { BwEventProxy proxy = (BwEventProxy)event; BwEvent override = proxy.getTarget(); setupSharableEntity(override); } else { setupSharableEntity(event); } BwLocation loc = event.getLocation(); BwSponsor sp = event.getSponsor(); if ((sp != null) && (ensureSponsorExists(sp) == null)) { updResult.sponsorsAdded++; } if ((loc != null) && (ensureLocationExists(loc) == null)) { updResult.locationsAdded++; } /* If no calendar has been assigned for this event set it to the default * calendar for non-public events or reject it for public events. */ if (cal == null) { if (event.getPublick()) { throw new CalFacadeException("No calendar assigned"); } cal = getPreferences().getDefaultCalendar(); } if (!cal.getCalendarCollection()) { throw new CalFacadeAccessException(); } event.setCalendar(cal); event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); event.setLastmod(new LastModified(new DateTime(true)).getValue()); event.setCreated(new Created(new DateTime(true)).getValue()); getCal().addEvent(event, overrides); if (isPublicAdmin()) { /* Mail event to any subscribers */ } return updResult; }
public EventUpdateResult addEvent(BwCalendar cal, BwEvent event, Collection overrides) throws CalFacadeException { EventUpdateResult updResult = new EventUpdateResult(); if (event instanceof BwEventProxy) { BwEventProxy proxy = (BwEventProxy)event; BwEvent override = proxy.getTarget(); setupSharableEntity(override); } else { setupSharableEntity(event); } BwLocation loc = event.getLocation(); BwSponsor sp = event.getSponsor(); if ((sp != null) && (ensureSponsorExists(sp) == null)) { updResult.sponsorsAdded++; } if ((loc != null) && (ensureLocationExists(loc) == null)) { updResult.locationsAdded++; } /* If no calendar has been assigned for this event set it to the default * calendar for non-public events or reject it for public events. */ if (cal == null) { if (event.getPublick()) { throw new CalFacadeException("No calendar assigned"); } cal = getPreferences().getDefaultCalendar(); } if (!cal.getCalendarCollection()) { throw new CalFacadeAccessException(); } event.setCalendar(cal); event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); event.setLastmod(new LastModified(new DateTime(true)).getValue()); event.setCreated(new Created(new DateTime(true)).getValue()); if (event instanceof BwEventProxy) { BwEventProxy proxy = (BwEventProxy)event; BwEvent override = proxy.getRef(); getCal().addEvent(override, overrides); } else { getCal().addEvent(event, overrides); } if (isPublicAdmin()) { /* Mail event to any subscribers */ } return updResult; }
1,120,695
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.assignAddingSponsor(true); return "continue"; }
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ initFields(form); form.assignAddingSponsor(true); return "continue"; }
1,120,697
public void field(String name) throws Exception { BwEvent e = (BwEvent)top(); if (shareableContainedEntityTags(e, name)) { return; } try { /* pre-hibernate fields */ if (name.equals("lastmod")) { // pre-hibernate e.setLastmod(isoDateTimeFld()); } else if (name.equals("created")) { // pre-hibernate e.setCreated(isoDateTimeFld()); e.setDtstamp(isoDateTimeFld()); } else if (name.equals("longdesc")) { // pre-hibernate e.setDescription(stringFld()); } else if (name.equals("startdate")) { // pre-hibernate e.setDtstart(dateFld()); } else if (name.equals("starttime")) { // pre-hibernate makeDateTimeFld(e.getDtstart()); } else if (name.equals("enddate")) { // pre-hibernate e.setEndType(BwEvent.endTypeDate); e.setDtend(dateFld()); } else if (name.equals("endtime")) { // pre-hibernate makeDateTimeFld(e.getDtend()); } else if (name.equals("shortdesc")) { // pre-hibernate e.setSummary(stringFld()); } else if (name.equals("keyword")) { // pre-hibernate //globals.eventKeysTbl.put(intFld(), e.getId()); BwCategory cat = categoryFld(); e.addCategory(cat); BwCalendar cal = globals.catCalTbl.get(cat.getId()); if (cal == null) { error("No mapping for category " + cat + " for event " + e); } else { e.setCalendar(cal); } } else if (name.equals("eventKeywords")) { // pre-hibernate // Nothing to do. } else if (name.equals("target-calendar")) { BwEvent target = getAnnotationTarget(e); // target.setCalendar() } else if (name.equals("name")) { e.setName(stringFld()); } else if (name.equals("guid")) { e.setGuid(stringFld()); } else if (name.equals("summary")) { e.setSummary(stringFld()); } else if (name.equals("description")) { e.setDescription(stringFld()); /* Start */ } else if (name.equals("start-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("start-tzid")) { tzid = stringFld(); } else if (name.equals("start-dtval")) { dtVal = fixedDateTimeFld(); } else if (name.equals("start-date")) { // Could compare given UTC time e.setDtstart(dateTimeFld()); /* end */ } else if (name.equals("end-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("end-tzid")) { tzid = stringFld(); } else if (name.equals("end-dtval")) { dtVal = fixedDateTimeFld(); } else if (name.equals("end-date")) { // Could compare given UTC time e.setDtend(dateTimeFld()); } else if (name.equals("duration")) { e.setDuration(stringFld()); } else if (name.equals("end-type")) { e.setEndType(charFld()); } else if (name.equals("link")) { e.setLink(stringFld()); } else if (name.equals("status")) { String status = stringFld(); if ((status != null) && (!status.equals("F"))) { // 2.3 e.setStatus(status); } } else if (name.equals("cost")) { e.setCost(stringFld()); } else if (name.equals("deleted")) { e.setDeleted(booleanFld()); } else if (name.equals("dtstamp")) { e.setDtstamp(stringFld()); } else if (name.equals("last-mod")) { e.setLastmod(stringFld()); } else if (name.equals("create-date")) { e.setCreated(stringFld()); } else if (name.equals("priority")) { e.setPriority(intFld()); } else if (name.equals("sequence")) { e.setSequence(intFld()); } else if (name.equals("eventCategories")) { // Nothing to do. } else if (name.equals("category")) { globals.eventKeysTbl.put(intFld(), e.getId()); e.addCategory(categoryFld()); } else if (name.equals("sponsor")) { e.setSponsor(sponsorFld()); } else if (name.equals("location")) { e.setLocation(locationFld()); } else if (name.equals("organizer")) { e.setOrganizer(organizerFld()); } else if (name.equals("transparency")) { e.setTransparency(stringFld()); } else if (name.equals("eventAttendees")) { // Nothing to do. } else if (name.equals("attendee")) { throw new Exception("Unimplemented - attendee"); } else if (name.equals("recurring")) { e.setRecurring(booleanFld()); } else if (name.equals("eventRecurrence")) { // Nothing to do. } else if (name.equals("rrule")) { e.getRecurrence().addRrule(stringFld()); } else if (name.equals("exrule")) { e.getRecurrence().addExrule(stringFld()); /* rdate */ } else if (name.equals("rdate-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("rdate-tzid")) { tzid = stringFld(); } else if (name.equals("rdate-dtval")) { dtVal = stringFld(); } else if (name.equals("rdate-date")) { // Could compare given UTC time e.getRecurrence().addRdate(dateTimeFld()); /* exdate */ } else if (name.equals("exdate-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("exdate-tzid")) { tzid = stringFld(); } else if (name.equals("exdate-dtval")) { dtVal = stringFld(); } else if (name.equals("exdate-date")) { // Could compare given UTC time e.getRecurrence().addExdate(dateTimeFld()); } else if (name.equals("recurrenceId")) { e.setRecurrenceId(stringFld()); } else if (name.equals("latestDate")) { e.getRecurrence().setLatestDate(stringFld()); } else { unknownTag(name); } } catch (Exception ex) { error("Error processing event id " + e.getId(), ex); globals.entityError = true; } }
public void field(String name) throws Exception { BwEvent e = (BwEvent)top(); if (shareableContainedEntityTags(e, name)) { return; } try { /* pre-hibernate fields */ if (name.equals("lastmod")) { // pre-hibernate e.setLastmod(isoDateTimeFld()); } else if (name.equals("created")) { // pre-hibernate e.setCreated(isoDateTimeFld()); e.setDtstamp(isoDateTimeFld()); } else if (name.equals("longdesc")) { // pre-hibernate e.setDescription(stringFld()); } else if (name.equals("startdate")) { // pre-hibernate e.setDtstart(dateFld()); } else if (name.equals("starttime")) { // pre-hibernate makeDateTimeFld(e.getDtstart()); } else if (name.equals("enddate")) { // pre-hibernate e.setEndType(BwEvent.endTypeDate); e.setDtend(dateFld()); } else if (name.equals("endtime")) { // pre-hibernate makeDateTimeFld(e.getDtend()); } else if (name.equals("shortdesc")) { // pre-hibernate e.setSummary(stringFld()); } else if (name.equals("keyword")) { // pre-hibernate //globals.eventKeysTbl.put(intFld(), e.getId()); BwCategory cat = categoryFld(); e.addCategory(cat); BwCalendar cal = globals.catCalTbl.get(cat.getId()); if (cal == null) { error("No mapping for category " + cat + " for event " + e); } else { e.setCalendar(cal); } } else if (name.equals("eventKeywords")) { // pre-hibernate // Nothing to do. } else if (name.equals("target-calendar")) { BwEvent target = getAnnotationTarget(e); // target.setCalendar() } else if (name.equals("name")) { e.setName(stringFld()); } else if (name.equals("guid")) { e.setGuid(stringFld()); } else if (name.equals("summary")) { e.setSummary(stringFld()); } else if (name.equals("description")) { e.setDescription(stringFld()); /* Start */ } else if (name.equals("start-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("start-tzid")) { tzid = stringFld(); } else if (name.equals("start-dtval")) { dtVal = fixedDateTimeFld(); } else if (name.equals("start-date")) { // Could compare given UTC time e.setDtstart(dateTimeFld()); /* end */ } else if (name.equals("end-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("end-tzid")) { tzid = stringFld(); } else if (name.equals("end-dtval")) { dtVal = fixedDateTimeFld(); } else if (name.equals("end-date")) { // Could compare given UTC time e.setDtend(dateTimeFld()); } else if (name.equals("duration")) { e.setDuration(stringFld()); } else if (name.equals("end-type")) { e.setEndType(charFld()); } else if (name.equals("link")) { e.setLink(stringFld()); } else if (name.equals("status")) { String status = stringFld(); if ((status != null) && (!status.equals("F"))) { // 2.3 e.setStatus(status); } } else if (name.equals("cost")) { e.setCost(stringFld()); } else if (name.equals("deleted")) { e.setDeleted(booleanFld()); } else if (name.equals("dtstamp")) { e.setDtstamp(stringFld()); } else if (name.equals("last-mod")) { e.setLastmod(stringFld()); } else if (name.equals("create-date")) { e.setCreated(stringFld()); } else if (name.equals("priority")) { e.setPriority(intFld()); } else if (name.equals("sequence")) { e.setSequence(intFld()); } else if (name.equals("eventCategories")) { // Nothing to do. } else if (name.equals("category")) { globals.eventKeysTbl.put(intFld(), e.getId()); e.addCategory(categoryFld()); } else if (name.equals("sponsor")) { e.setSponsor(sponsorFld()); } else if (name.equals("location")) { e.setLocation(locationFld()); } else if (name.equals("organizer")) { e.setOrganizer(organizerFld()); } else if (name.equals("transparency")) { e.setTransparency(stringFld()); } else if (name.equals("eventAttendees")) { // Nothing to do. } else if (name.equals("attendee")) { BwAttendee att = globals.attendeesTbl.get(intFld()); } else if (name.equals("recurring")) { e.setRecurring(booleanFld()); } else if (name.equals("eventRecurrence")) { // Nothing to do. } else if (name.equals("rrule")) { e.getRecurrence().addRrule(stringFld()); } else if (name.equals("exrule")) { e.getRecurrence().addExrule(stringFld()); /* rdate */ } else if (name.equals("rdate-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("rdate-tzid")) { tzid = stringFld(); } else if (name.equals("rdate-dtval")) { dtVal = stringFld(); } else if (name.equals("rdate-date")) { // Could compare given UTC time e.getRecurrence().addRdate(dateTimeFld()); /* exdate */ } else if (name.equals("exdate-date-type")) { dateType = booleanFld(); tzid = null; } else if (name.equals("exdate-tzid")) { tzid = stringFld(); } else if (name.equals("exdate-dtval")) { dtVal = stringFld(); } else if (name.equals("exdate-date")) { // Could compare given UTC time e.getRecurrence().addExdate(dateTimeFld()); } else if (name.equals("recurrenceId")) { e.setRecurrenceId(stringFld()); } else if (name.equals("latestDate")) { e.getRecurrence().setLatestDate(stringFld()); } else { unknownTag(name); } } catch (Exception ex) { error("Error processing event id " + e.getId(), ex); globals.entityError = true; } }
1,120,698
public String performAction(HttpServletRequest request, HttpServletResponse response, UtilActionForm frm, MessageResources messages) throws Throwable { String forward = "success"; BwActionFormBase form = (BwActionFormBase)frm; String adminUserId = null; boolean guestMode = getGuestMode(frm); if (guestMode) { form.assignCurrentUser(null); } else { adminUserId = form.getCurrentAdminUser(); if (adminUserId == null) { adminUserId = form.getCurrentUser(); } } if (getPublicAdmin(form)) { /** We may want to masquerade as a different user */ String temp = request.getParameter("adminUserId"); if (temp != null) { adminUserId = temp; } } /* UWCalCallback cb = new Callback(form); HttpSession sess = request.getSession(); sess.setAttribute(UWCalCallback.cbAttrName, cb); */ BwSession s = getState(request, form, messages, adminUserId, getPublicAdmin(form)); if (s == null) { /* An error should have been emitted. The superclass will return an error forward.*/ return forward; } form.setSession(s); form.setGuest(s.isGuest()); if (form.getGuest()) { // force public view on - off by default form.setPublicView(true); } String appBase = form.getAppBase(); if (appBase != null) { // Embed in request for pages that cannot access the form (loggedOut) request.setAttribute("org.bedework.action.appbase", appBase); } /* Set up ready for the action */ if (getPublicAdmin(form)) { /* Set some options from the environment */ CalEnv env = getEnv(form); form.setAutoCreateSponsors(env.getAppBoolProperty("app.autocreatesponsors")); form.setAutoCreateLocations(env.getAppBoolProperty("app.autocreatelocations")); form.setAutoDeleteSponsors(env.getAppBoolProperty("app.autodeletesponsors")); form.setAutoDeleteLocations(env.getAppBoolProperty("app.autodeletelocations")); if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } /** Show the owner we are administering */ form.setAdminUserId(form.fetchSvci().getUser().getAccount()); if (debug) { logIt("-------- isSuperUser: " + form.getUserAuth().isSuperUser()); } if (!form.getAuthorisedUser()) { return "noAccess"; } String temp = checkGroup(request, form, true); if (temp != null) { if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } return temp; } /** Ensure we have prefs and other values for the AuthUser */ setAuthUser(form); } else { form.setAutoCreateSponsors(true); form.setAutoCreateLocations(true); form.setAutoDeleteSponsors(true); form.setAutoDeleteLocations(true); String refreshAction = form.getEnv().getAppOptProperty("app.refresh.action"); if (refreshAction == null) { refreshAction = form.getActionPath(); } if (refreshAction != null) { setRefreshInterval(request, response, form.getEnv().getAppIntProperty("app.refresh.interval"), refreshAction, form); } if (debug) { log.debug("curTimeView=" + form.getCurTimeView()); } } /* see if we got cancelled */ String reqpar = request.getParameter("cancelled"); if (reqpar != null) { /** Set the objects to null so we get new ones. */ form.initFields(); form.getMsg().emit("org.bedework.client.message.cancelled"); return "cancelled"; } try { forward = doAction(request, response, s, form); if (getPublicAdmin(form)) { } else { /* See if we need to refresh */ checkRefresh(form); } } catch (CalFacadeAccessException cfae) { form.getErr().emit("org.bedework.client.error.noaccess", "for that action"); forward="noaccess"; } catch (Throwable t) { form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); form.getErr().emit(t); } return forward; }
public String performAction(HttpServletRequest request, HttpServletResponse response, UtilActionForm frm, MessageResources messages) throws Throwable { String forward = "success"; BwActionFormBase form = (BwActionFormBase)frm; String adminUserId = null; boolean guestMode = getGuestMode(frm); if (guestMode) { form.assignCurrentUser(null); } else { adminUserId = form.getCurrentAdminUser(); if (adminUserId == null) { adminUserId = form.getCurrentUser(); } } if (getPublicAdmin(form)) { /** We may want to masquerade as a different user */ String temp = request.getParameter("adminUserId"); if (temp != null) { adminUserId = temp; } } /* UWCalCallback cb = new Callback(form); HttpSession sess = request.getSession(); sess.setAttribute(UWCalCallback.cbAttrName, cb); */ BwSession s = getState(request, form, messages, adminUserId, getPublicAdmin(form)); if (s == null) { /* An error should have been emitted. The superclass will return an error forward.*/ return forward; } form.setSession(s); form.setGuest(s.isGuest()); if (form.getGuest()) { // force public view on - off by default form.setPublicView(true); } String appBase = form.getAppBase(); if (appBase != null) { // Embed in request for pages that cannot access the form (loggedOut) request.setAttribute("org.bedework.action.appbase", appBase); } /* Set up ready for the action */ if (getPublicAdmin(form)) { /* Set some options from the environment */ CalEnv env = getEnv(form); form.setAutoCreateSponsors(env.getAppBoolProperty("app.autocreatesponsors")); form.setAutoCreateLocations(env.getAppBoolProperty("app.autocreatelocations")); form.setAutoDeleteSponsors(env.getAppBoolProperty("app.autodeletesponsors")); form.setAutoDeleteLocations(env.getAppBoolProperty("app.autodeletelocations")); if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } /** Show the owner we are administering */ form.setAdminUserId(form.fetchSvci().getUser().getAccount()); if (debug) { logIt("-------- isSuperUser: " + form.getUserAuth().isSuperUser()); } if (!form.getAuthorisedUser()) { return "noAccess"; } String temp = checkGroup(request, form, true); if (temp != null) { if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } return temp; } /** Ensure we have prefs and other values for the AuthUser */ setAuthUser(form); } else { form.setAutoCreateSponsors(true); form.setAutoCreateLocations(true); form.setAutoDeleteSponsors(true); form.setAutoDeleteLocations(true); String refreshAction = form.getEnv().getAppOptProperty("app.refresh.action"); if (refreshAction == null) { refreshAction = form.getActionPath(); } if (refreshAction != null) { setRefreshInterval(request, response, form.getEnv().getAppIntProperty("app.refresh.interval"), refreshAction, form); } if (debug) { log.debug("curTimeView=" + form.getCurTimeView()); } } /* see if we got cancelled */ String reqpar = request.getParameter("cancelled"); if (reqpar != null) { /** Set the objects to null so we get new ones. */ initFields(form); form.getMsg().emit("org.bedework.client.message.cancelled"); return "cancelled"; } try { forward = doAction(request, response, s, form); if (getPublicAdmin(form)) { } else { /* See if we need to refresh */ checkRefresh(form); } } catch (CalFacadeAccessException cfae) { form.getErr().emit("org.bedework.client.error.noaccess", "for that action"); forward="noaccess"; } catch (Throwable t) { form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); form.getErr().emit(t); } return forward; }
1,120,701
private byte[] getBytes() { if (contentBytes != null) { return contentBytes; } StringBuffer sb = new StringBuffer(); for (int i = 0; i < content.length; i++) { sb.append(content[i]); sb.append("\n"); } contentBytes = sb.toString().getBytes(); return contentBytes; }
private byte[] getBytes() { if (contentBytes != null) { return contentBytes; } StringBuffer sb = new StringBuffer(); for (int i = 0; i < content.length; i++) { sb.append(content[i]); sb.append("\n"); } contentBytes = detokenizeContent(sb); return contentBytes; }
1,120,702
private byte[] getFileBytes() throws Throwable { if (contentBytes != null) { return contentBytes; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileInputStream in = new FileInputStream(contentFileName); do { int x = in.read(); if (x < 0) { break; } baos.write(x); } while (true); contentBytes = baos.toByteArray(); return contentBytes; }
private byte[] getFileBytes() throws Throwable { if (contentBytes != null) { return contentBytes; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileInputStream in = new FileInputStream(contentFileName); do { int x = in.read(); if (x < 0) { break; } baos.write(x); } while (true); contentBytes = detokenizeContent(new StringBuffer(baos.toString())); return contentBytes; }
1,120,703
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getPublicUser().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
1,120,704
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getPublicUser()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
1,120,705
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { warn(name + " " + entity.getId() + " has no owner, set to " + globals.getPublicUser().getAccount()); if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
1,120,706
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
1,120,707
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } }
1,120,708
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.error.usernotfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.error.usernotfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; }
1,120,709
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "preferredView"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; }
1,120,710
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; }
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.error.viewnotfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.error.viewnotfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.error.viewnotfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; }
1,120,711
protected static void writeLittleEndian(OutputStream out, int value) throws IOException { byte[] tmpBytes; tmpBytes = Utility.intToByteArray(value); out.write(tmpBytes[0]); out.write(tmpBytes[1]); out.write(tmpBytes[2]); out.write(tmpBytes[3]); }
protected static void writeLittleEndian(DataOutput out, int value) throws IOException { byte[] tmpBytes; tmpBytes = Utility.intToByteArray(value); out.write(tmpBytes[0]); out.write(tmpBytes[1]); out.write(tmpBytes[2]); out.write(tmpBytes[3]); }
1,120,713
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
1,120,714
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.writeBytes("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
1,120,715
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.writeBytes("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
1,120,716
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
1,120,717
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ }
public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () }
1,120,718
public boolean deleteCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); sess.delete(val); return true; }
public boolean deleteCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); BwCalendar parent = val.getCalendar(); if (parent == null) { throw new CalFacadeException(CalFacadeException.cannotDeleteCalendarRoot); } parent.removeChild(val); sess.update(parent); return true; }
1,120,719
private void addLoggingDir(JPanel p) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); final JButton button = new JButton("Choose"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String s = browser.getText(); if (s != null) { fileChooser.setSelectedFile(new File(s)); } int ret = fileChooser.showOpenDialog(EVI.getInstance().getMainFrame()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); if (f != null) { loggingDir.setText(f.toString()); } } } }); JPanel sub = new JPanel(new BorderLayout()); sub.add(new JPanel(), BorderLayout.NORTH); sub.add(new JPanel(), BorderLayout.SOUTH); sub.add(loggingDir, BorderLayout.WEST); sub.add(button, BorderLayout.EAST); JPanel row = new JPanel(new GridLayout(0, 2)); row.add(new JLabel("Logging directory:")); row.add(sub); p.add(row); }
private void addLoggingDir(JPanel p) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); final JButton button = new JButton("Choose"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String s = loggingDir.getText(); if (s != null) { fileChooser.setSelectedFile(new File(s)); } int ret = fileChooser.showOpenDialog(EVI.getInstance().getMainFrame()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); if (f != null) { loggingDir.setText(f.toString()); } } } }); JPanel sub = new JPanel(new BorderLayout()); sub.add(new JPanel(), BorderLayout.NORTH); sub.add(new JPanel(), BorderLayout.SOUTH); sub.add(loggingDir, BorderLayout.WEST); sub.add(button, BorderLayout.EAST); JPanel row = new JPanel(new GridLayout(0, 2)); row.add(new JLabel("Logging directory:")); row.add(sub); p.add(row); }
1,120,720
public void actionPerformed(ActionEvent e) { String s = browser.getText(); if (s != null) { fileChooser.setSelectedFile(new File(s)); } int ret = fileChooser.showOpenDialog(EVI.getInstance().getMainFrame()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); if (f != null) { loggingDir.setText(f.toString()); } } }
public void actionPerformed(ActionEvent e) { String s = loggingDir.getText(); if (s != null) { fileChooser.setSelectedFile(new File(s)); } int ret = fileChooser.showOpenDialog(EVI.getInstance().getMainFrame()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); if (f != null) { loggingDir.setText(f.toString()); } } }
1,120,721
public Object getFieldValue(JRField field) throws JRException { return getFieldValue(new ReportableField(field)); }
public Object getFieldValue(JRField field) throws JRException { return getFieldValue(new ReportableField(field)); }
1,120,723
public boolean next() throws JRException { if(_reportIterator == null){ _reportIterator = this.iterator(); } try { if(_reportIterator.hasNext()){ _currentJRDataSource = (IDOReportableEntity)_reportIterator.next(); return true; } else { _currentJRDataSource = null; return false; } } catch (ClassCastException e) { _currentJRDataSource=null; e.printStackTrace(); throw new JRException(e); } }
public boolean next() throws JRException { if(_reportIterator == null){ _reportIterator = this.iterator(); } try { if(_reportIterator.hasNext()){ _currentJRDataSource = (IDOReportableEntity)_reportIterator.next(); return true; } else { _currentJRDataSource = null; return false; } } catch (ClassCastException e) { _currentJRDataSource=null; e.printStackTrace(); throw new JRException(e); } }
1,120,724
public boolean next() throws JRException { if(_reportIterator == null){ _reportIterator = this.iterator(); } try { if(_reportIterator.hasNext()){ _currentJRDataSource = (IDOReportableEntity)_reportIterator.next(); return true; } else { _currentJRDataSource = null; return false; } } catch (ClassCastException e) { _currentJRDataSource=null; e.printStackTrace(); throw new JRException(e); } }
public boolean next() throws JRException { if(_reportIterator == null){ _reportIterator = this.iterator(); } try { if(_reportIterator.hasNext()){ _currentJRDataSource = (IDOReportableEntity)_reportIterator.next(); return true; } else { _currentJRDataSource = null; return false; } } catch (ClassCastException e) { _currentJRDataSource=null; e.printStackTrace(); throw new JRException(e); } }
1,120,725
public void disposed(IModule disposedInstance) { try { IApplet applet = (IApplet)disposedInstance; removeApplet(applet); } catch (Exception exc) { ExceptionDialog.show(Messages.getString("TabBar.UNEXPECTED_ERROR"), exc); //$NON-NLS-1$ } }
public void disposed(IModule disposedInstance) { try { IApplet applet = (IApplet)disposedInstance; removeApplet(applet); } catch (Exception exc) { ExceptionDialog.show(Messages.getString("ToolBar.UNEXPECTED_ERROR"), exc); //$NON-NLS-1$ } }
1,120,726