Edit the report's Java source

After you have set up the selected report to be publishable, you must edit its Java source which instructs Aspen on how to break the data source and who has access to the report.

Notes:

  • For assistance editing a report's Java source, submit a service request through the Service Request Workflow in Pando. Each published report requires its own service request. For assistance using the workflow, contact Aspen Technical Support.
  • Once you start editing the Java source, you have to complete your edits to get the report back to a compiled state. It is advised that you make a copy of the report being set up, edit the Java source in the copied version, and then move your changes to the original report.

To edit a report's Java source:

Before you begin this procedure, do the following to check if it is necessary:

  • Open the Report Card report and click Details.
  • At the Java source field, click Edit Edit icon. .
  • Press Ctrl-F and search for the following string: extends GradeReportJavaSource.
Note: If that string is present in the report, it is up to date. To make the report publishable, click the Publish tab and select the Publishable checkbox.
Important: By default the published report card is sent to anyone with a Y value in the Lives With or Receive Grade Mailing fields. If this is not the desired audience, additional edits to this report must be made (beyond those in this topic.) Contact Technical Services to make these edits.

The following example shows you how to make a report card report publishable to the Family portal.

  1. On the details page of the report you want to edit, click the General sub-tab (District view, Tools > Reports):
  1. At the Java source field, click Edit Edit icon. . The 'Java source' pop-up appears:
  1.  Add implements Publishable to the following line:

public class PublishedReportCardsPhsData extends

ReportJavaSourceNet

The line should now read:

public class PublishedReportCardsPhsData extends

ReportJavaSourceNet implements Publishable

  1. Add the following gray block of code (copy and paste it) after the line:
  1. private HashMap                         m_totalCredits;

private Map<String, Collection<Person>> m_recipientCache;

    /**
     * @see com.x2dev.sis.tools.reports.Publishable#getDataBreakColumn()
     */
    public String getDataBreakColumn()
    {
        return Transcript.REL_STUDENT;
    }
    /**
     * @see com.x2dev.sis.tools.reports.Publishable#getDescription(X2BaseBean)
     */
    public String getDescription(X2BaseBean bean)
    {
        return "Report card for " + ((Student) bean).getNameView();
    }
    
    /**
     * @see com.x2dev.sis.tools.reports.Publishable#getEmailAddress(com.x2dev.sis.model.beans.Person)
     */
    public String getEmailAddress(Person person)
    {
        return person.getEmail01();
    }
    /**
     * @see com.x2dev.sis.tools.reports.Publishable#getEmailRecipients(com.x2dev.sis.model.beans.X2BaseBean)
     */
    public Collection<Person> getEmailRecipients(X2BaseBean bean)
    {
        return m_recipientCache.get(bean.getOid());
    }

  1. Insert the following gray block of code immediately before the line:

String[] transcriptSortOrder = new String [] { Transcript.REL_SCHOOL_COURSE + PATH_DELIMITER +

SchoolCourse.COL_REPORT_SEQUENCE_NUMBER };

setRecipientCache();

  1. Insert the following gray block of code immediately before the final curly bracket:

/**
     * Populates the recipient cache for published reports.
     *
     * @param studentOids
     */
    private void setRecipientCache()
    {
        HashMap<String, Collection<Person>> map = new HashMap<String, Collection<Person>>();
        
        Criteria criteria = new Criteria();
        
        if (m_currentStudent != null)
        {
            criteria.addEqualTo(StudentContact.COL_STUDENT_OID, m_currentStudent.getOid());
        }    
        
        criteria.addEqualTo(StudentContact.COL_PORTAL_ACCESS_INDICATOR, "true");
        criteria.addEqualTo(StudentContact.COL_RECEIVE_EMAIL_INDICATOR, Boolean.True);
        
        QueryByCriteria query = new QueryByCriteria(StudentContact.class, criteria);
            
        QueryIterator iterator = getBroker().getIteratorByQuery(query);
        try
        {
            while (iterator.hasNext())
            {
                StudentContact contact = (StudentContact) iterator.next();
                String key = contact.getStudentOid();
                Person value = contact.getPerson();
                
                if (!map.containsKey(key))
                {
                    map.put(key, new ArrayList<Person>());
                    map.get(key).add(contact.getStudent().getPerson());
                }
                
                if (!map.get(key).contains(value))
                {
                    map.get(key).add(value);
                }
            }
        }
        finally
        {
            iterator.close();
        }
        m_recipientCache = map;
    }

  1. The lines, shown in bold italics in the gray code block, which begin with "criteria," determine who is going to get an email alerting them that there is a published report for them in the Family portal. Any of the available fields on the Student Contact table can be used to set who gets notified. The following table describes the two present in this example and a few others which you might want to add, or substitute for the ones provided:
  2. Code

    Description

    criteria.addEqualTo(StudentContact.COL_PORTAL_ACCESS_IND, "true");

    This line indicates that only those who have access to the Family portal receive an email that there is a report card available for them. There is no reason to send an e-mail to someone who does not have access to the Family portal.

    criteria.addEqualTo(StudentContact.COL_RECEIVE_EMAIL_IND, Boolean.True);

    This line indicates that only those who are set to receive emails are sent a notification that a there is a report card available in the Family portal.

    Additional Example:

    criteria.addEqualTo(StudentContact.COL_GRADE_MAIL_IND, "true");

    This line indicates that only those who are set to receive grades in the mail are sent a notification that there is a report card available in the Family portal.

    Additional Example:

    criteria.addEqualTo(StudentContact.COL_EMERGENCY_PRIORITY, "0");

    This line indicates that only those who are set to emergency priority 0 (zero) are sent a notification that there is a report is available in the Family portal.

  1. Click OK to save your changes.