User Tools

Site Tools


customization:procedure:ma-ply-grd-001

Create Documents GradeReportJavaSource

Description

This procedure can be added as an external tool source to any report that extends “GradeReportJavaSource” and will create student documents (records in the PERSON_DOCUMENT table) from the report results. For example, using this procedure to run the “Report Cards” report would create a document record that contains the individual report card (as a PDF) for each student in the results.

Procedure ID MA-PLY-GRD-001
District Plymouth Public Schools
Developer Brian Converse
Bundle ma-ply-grd-001.zip
Default Navigation N/A

Input Parameters

Although there are no input parameters for this procedure, there is one required and one optional input parameter for whatever report uses this procedure as an external tool source. See comments in Post-Import Adjustments for details.

Post-Import Adjustments

Required Adjustments

  1. This procedure must be set as the report's external tool
    On the report details page, there is an “External Sources” embedded list at the bottom of the “General” tab. Add this procedure to your report.
  2. Your report's Java source must import CreateDocGradeReportJavaSource at the top with all of the other imports
    import com.x2dev.reports.ma.plymouth.CreateDocGradeReportJavaSource;
  3. The report's Java source must extend this class (CreateDocGradeReportJavaSource) instead of GradeReportJavaSource (don't forget to compile your Java source)
      /**
       * Prepares the data for the "Report Cards" report for Plymouth.
       * 
       * @author X2 Development Corporation
       */
      public class ReportCardsV2 extends CreateDocGradeReportJavaSource
      {
  4. Check and see if your report overrides “getEmailRecipients” by searching for the following code
        /**
         * @see com.x2dev.sis.tools.reports.GradeReportJavaSource#getEmailRecipients(com.follett.fsc.core.k12.beans.X2BaseBean)
         */
        @Override
        public Collection<Person> getEmailRecipients(X2BaseBean bean)
        {
          // A bunch of code here
        }

    If your report DOES NOT override this method (can't find it), nothing else needs to be done.
    If your report DOES override the method (you find it), place all of the code in this method (between the curley brackets) in an else statement as seen below

        /**
         * @see com.x2dev.sis.tools.reports.GradeReportJavaSource#getEmailRecipients(com.follett.fsc.core.k12.beans.X2BaseBean)
         */
        @Override
        public Collection<Person> getEmailRecipients(X2BaseBean bean)
        {
            if (m_createDocuments)
            {
                return super.getEmailRecipients(bean);
            }
            else
            {
                // All of your code here
            }
        }
  5. Check and see if your report overrides “initialize” by searching for the following code
        /**
         * @see com.x2dev.sis.tools.reports.GradeReportJavaSource#initialize()
         */
        @Override
        protected void initialize()
        {
          // A bunch of code here
        }

    If your report DOES NOT override this method (can't find it), nothing else needs to be done.
    If your report DOES override the method (you find it), see if super.initialize(); is inside its curly brackets. If not, add it as the first line of this method.

        /**
         * @see com.x2dev.sis.tools.reports.GradeReportJavaSource#initialize()
         */
        @Override
        protected void initialize()
        {
          super.initialize();
     
          // Whatever was already in initialize will remain
        }
  6. The report must be publishable
    Go to the “Publish” tab (District view, Tools > Reports > Details > Publish) and select “Publishable”
  7. Add new logical input to your report's input with a name attribute of createDocuments
     <!-- **************** -->
     <!-- CREATE DOCUMENTS -->
     <!-- **************** -->
     
     <input name="createDocuments" data-type="boolean" display-type="checkbox" default-value="false" display-name="Create student documents" />

Optional Adjustments: User Defined Fields

You can set up user defined fields on the PERSON_DOCUMENT table using aliases to store the following values:

Alias Description Required Field Size
upload-date Stores the date that the document was created and saved to the student by the procedure 10 - Field A
school-id Stores the school's ID that the report was run for 25 - Field B
report-oid Stores the report's OID that the document was generated from 25 - Field B
user-oid Stores the OID of the user who ran the report that created the document 25 - Field B

Optional Adjustments: Input Parameters

You can add the following optional input parameters:

Name Attribute data-type Description
emailResults boolean Emails the user running the report with logs describing what the procedure did
 <!-- ********** -->
 <!-- EMAIL LOGS -->
 <!-- ********** -->
 
 <input name="emailResults" data-type="boolean" display-type="checkbox" default-value="false" display-name="Email procedure results" />
 

Rating

(3) (0)

See Also

None

Comments

In Plymouth, we had our users printing hard copies of the student report cards and filing them each year. This will allow us to document them in Aspen without having to print them. Since we do not yet publish reports and we do not want all of our staff to create documents, we leave the input checkboxes hidden until we want to run them and create documents. We do this by changing their “display-type” to “hidden”.

 <!-- **************** -->
 <!-- CREATE DOCUMENTS -->
 <!-- **************** -->
 
 <input name="createDocuments" data-type="boolean" display-type="hidden" default-value="false" display-name="Create student document" />
 
 <!-- ********** -->
 <!-- EMAIL LOGS -->
 <!-- ********** -->
 
 <input name="emailResults" data-type="boolean" display-type="hidden" default-value="false" display-name="Email procedure results" />
 

Brian Converse

customization/procedure/ma-ply-grd-001.txt · Last modified: 2015/11/01 07:08 by bciccolo