Plugin Export with PS Data Export Manager (DEM)

If you have been on PowerSchool long you probably have several things that communicate via AutoSend or something else that sends data via FTP as a csv file.  Now you can write your SQL in a plugin and schedule it with the Data Export Manager.  It certainly feels more modern, gives you more flexibility because you can write your own SQL, and if you’re a vendor it’s a much easier for clients to install and update.

First, write a simple plugin – we have a CSV file that is exported to our student id badge printing software.  It’s an easy plugin to write but something that kept tripping me up was the permissions_root folder and the <permission_mappings> – here’s the one for this example:

screen-shot-2017-01-23-at-2-28-43-pm-2

Now, the bit that kept causing me grief was the permission name tag…. Anyone who has a security role which allows them to access the page referenced in <permission name> can access this query in the DEM.  So in this case anyone with import/export page access.  The only other tag is the name of the query which is defined in the named_queries file:

<queries>
<query name=”com.neosho.product.students.badge_export” coreTable=”Students” flattened=”false”>
<summary>Badge System Export</summary>
<description>Badge System Export</description>
<columns>
<column column=”STUDENTS.last_name”>Last_Name</column>
<column column=”STUDENTS.first_name”>First_Name</column>
<column column=”STUDENTS.grade_level”>Grade_Level</column>
<column column=”STUDENTS.home_room”>Home_Room</column>
<column column=”STUDENTS.student_number”>Student_Number</column>
</columns>
<sql>
<![CDATA[
SELECT
Last_Name, First_Name, Grade_Level, Home_Room, Student_Number
FROM
Students
WHERE
Grade_Level >= 5
AND
Enroll_Status = 0
]]>
</sql>
</query>
</queries>

Once you have the plugin installed, navigate to the DEM screen and select it:

screen-shot-2017-01-23-at-2-18-56-pm-2

 

Then pick your file name and delimiter settings and click the ‘Save Template’ button at the bottom right:

 

screen-shot-2017-01-23-at-2-19-19-pm-2

Now just name your template and enter a description then click ‘Save as New’:

screen-shot-2017-01-23-at-2-19-26-pm-2

You can now schedule the export, if you’re self hosted you can save it locally but if you’re hosted by PowerSchool you will need to have setup your FTP server in the Remote Connection Manager.

screen-shot-2017-01-23-at-2-19-40-pm-2

You can click the play button to force it to run, or click the pencil icon to edit the settings or the dash to remove it:

screen-shot-2017-01-23-at-2-40-46-pm-2

 

The plugin code is available on GitHub.

 

 

Advertisements
Plugin Export with PS Data Export Manager (DEM)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s