/** * Initialize a CachedPage. * * <p>Initialize the object, ie. perform work normally perfomed in constructor. Called by * setIdentity() and createIdentity(). */ protected void initialize() { super.initialize(); isDirty = false; preDirty = false; initialRowCount = 0; containerRowCount = 0; }
@Override public void onAttachedToWindow(int flag, int position) { if (vis == View.VISIBLE) { setTotal(); } super.onAttachedToWindow(flag, position); }
@Override public void onDetachedFromWindow(int flag) { arrayListOld.clear(); start = 0; mExpandListAdatpger.notifyDataSetChanged(); end = 20; super.onDetachedFromWindow(flag); }
@Override public void onLocationChanged(Location location) { super.onLocationChanged(location); LogPrint.Print("gps", "MTaskOldPage--onLocationChanged---location=" + location.getProvider()); if (Configs.LOCATIONTYPE.equals(location.getProvider())) { CustomCameraActivity.mlocation = location; } }
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); final String version = ServerConfigurationService.getString("portal.cdn.version", ""); response.render( CssHeaderItem.forUrl( String.format("/gradebookng-tool/styles/gradebook-settings.css?version=%s", version))); response.render( JavaScriptHeaderItem.forUrl( String.format("/gradebookng-tool/scripts/gradebook-settings.js?version=%s", version))); }
@Override public void onBeforeRender() { super.onBeforeRender(); // System.out.println("basepage.onBeforeRender()"); // // System.out.println("cbsaccessLogpage.onBeforeRender()"); // if (ServiceAggregation.accessLogResults == null) { // label.setVisible(true); // // chart.setVisible(false); // } else { // System.out.println("finish flash...."); // System.out.println(ServiceAggregation.accessLogResults.size()); // fullViewLabel.setVisible(false); // ajaxSelfFlash.stop(); // } }
/** * exclusive latch on page is being released. * * <p>The only work done in CachedPage is to update the row count on the container if it is too * out of sync. */ protected void releaseExclusive() { // look at dirty bit without latching, the updating of the row // count is just an optimization so does not need the latch. // // if this page actually has > 1/8 rows of the entire container, then // consider updating the row count if it is different. // // No need to special case allocation pages because it has recordCount // of zero, thus the if clause will never be true for an allocation // page. if (isDirty && !isOverflowPage() && (containerRowCount / 8) < recordCount()) { int currentRowCount = internalNonDeletedRecordCount(); int delta = currentRowCount - initialRowCount; int posDelta = delta > 0 ? delta : (-delta); if ((containerRowCount / 8) < posDelta) { // This pages delta row count represents a significant change // with respect to current container row count so update // container row count FileContainer myContainer = null; try { myContainer = (FileContainer) containerCache.find(identity.getContainerId()); if (myContainer != null) { myContainer.updateEstimatedRowCount(delta); setContainerRowCount(myContainer.getEstimatedRowCount(0)); initialRowCount = currentRowCount; // since I have the container, might as well update the // unfilled information myContainer.trackUnfilledPage(identity.getPageNumber(), unfilled()); } } catch (StandardException se) { // do nothing, not sure what could fail but this update // is just an optimization so no need to throw error. } finally { if (myContainer != null) containerCache.release(myContainer); } } } super.releaseExclusive(); }
public void clearIdentity() { alreadyReadPage = false; super.clearIdentity(); }
@Override public void onInitialize() { super.onInitialize(); // get settings data final GradebookInformation settings = this.businessService.getGradebookSettings(); // setup page model final GbSettings gbSettings = new GbSettings(settings); final CompoundPropertyModel<GbSettings> formModel = new CompoundPropertyModel<GbSettings>(gbSettings); final SettingsGradeEntryPanel gradeEntryPanel = new SettingsGradeEntryPanel("gradeEntryPanel", formModel, gradeEntryExpanded); final SettingsGradeReleasePanel gradeReleasePanel = new SettingsGradeReleasePanel("gradeReleasePanel", formModel, gradeReleaseExpanded); final SettingsCategoryPanel categoryPanel = new SettingsCategoryPanel("categoryPanel", formModel, categoryExpanded); final SettingsGradingSchemaPanel gradingSchemaPanel = new SettingsGradingSchemaPanel("gradingSchemaPanel", formModel, gradingSchemaExpanded); // form final Form<GbSettings> form = new Form<GbSettings>("form", formModel) { private static final long serialVersionUID = 1L; @Override public void onValidate() { super.onValidate(); final GbSettings model = getModelObject(); final List<CategoryDefinition> categories = model.getGradebookInformation().getCategories(); // validate the categories if (model.getGradebookInformation().getCategoryType() == GbCategoryType.WEIGHTED_CATEGORY.getValue()) { BigDecimal totalWeight = BigDecimal.ZERO; for (final CategoryDefinition cat : categories) { if (cat.getWeight() == null) { error(getString("settingspage.update.failure.categorymissingweight")); } else { // extra credit items do not participate in the weightings, so exclude from the // tally if (!cat.isExtraCredit()) { totalWeight = totalWeight.add(BigDecimal.valueOf(cat.getWeight())); } } } if (totalWeight.compareTo(BigDecimal.ONE) != 0) { error(getString("settingspage.update.failure.categoryweighttotals")); } } // if categories and weighting selected AND if course grade display points was selected, // give error message if (model.getGradebookInformation().getCategoryType() == GbCategoryType.WEIGHTED_CATEGORY.getValue() && model.getGradebookInformation().isCourseGradeDisplayed() && model.getGradebookInformation().isCoursePointsDisplayed()) { error(getString("settingspage.displaycoursegrade.incompatible")); } // validate the course grade display settings if (model.getGradebookInformation().isCourseGradeDisplayed()) { int displayOptions = 0; if (model.getGradebookInformation().isCourseLetterGradeDisplayed()) { displayOptions++; } if (model.getGradebookInformation().isCourseAverageDisplayed()) { displayOptions++; } if (model.getGradebookInformation().isCoursePointsDisplayed()) { displayOptions++; } if (displayOptions == 0) { error(getString("settingspage.displaycoursegrade.notenough")); } } } @Override public void onSubmit() { final GbSettings model = getModelObject(); Page responsePage = new SettingsPage( gradeEntryPanel.isExpanded(), gradeReleasePanel.isExpanded(), categoryPanel.isExpanded(), gradingSchemaPanel.isExpanded()); // update settings try { SettingsPage.this.businessService.updateGradebookSettings( model.getGradebookInformation()); getSession().info(getString("settingspage.update.success")); } catch (ConflictingCategoryNameException e) { getSession().error(getString("settingspage.update.failure.categorynameconflict")); responsePage = this.getPage(); } catch (IllegalArgumentException e) { getSession().error(e.getMessage()); responsePage = this.getPage(); } setResponsePage(responsePage); } }; // cancel button final Button cancel = new Button("cancel") { private static final long serialVersionUID = 1L; @Override public void onSubmit() { setResponsePage(new GradebookPage()); } }; cancel.setDefaultFormProcessing(false); form.add(cancel); // panels form.add(gradeEntryPanel); form.add(gradeReleasePanel); form.add(categoryPanel); form.add(gradingSchemaPanel); add(form); // expand/collapse panel actions add( new AjaxLink<String>("expandAll") { private static final long serialVersionUID = 1L; @Override public void onClick(final AjaxRequestTarget target) { target.appendJavaScript("$('#settingsAccordion .panel-collapse').collapse('show');"); } }); add( new AjaxLink<String>("collapseAll") { private static final long serialVersionUID = 1L; @Override public void onClick(final AjaxRequestTarget target) { target.appendJavaScript("$('#settingsAccordion .panel-collapse').collapse('hide');"); } }); }
@Override public void onAfterRender() { super.onAfterRender(); System.out.println("Finished rendering.."); }
@Override public void onPause() { super.onPause(); mHandler.removeMessages(MSG_GET_MY_THROW_PHOTOS); }
@Override public void onResume() { super.onResume(); mHandler.sendEmptyMessage(MSG_GET_MY_THROW_PHOTOS); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forUrl(JQUERYSCRIPT)); }