red1.org Forum Index red1.org
Nihili est - in vita priore ego imperator romanus fui
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

About Session-Intake - its solution and impact

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    red1.org Forum Index -> College ERP Project
View previous topic :: View next topic  
Author Message
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Tue Sep 27, 2005 5:46 am    Post subject: About Session-Intake - its solution and impact Reply with quote

After understanding more bout Session-Intake and Sesson-Semester concept, and after some discussions with Gan and Sam, we are exploring that we reuse the Session table as the Session-Intake and thus we use its Session-Code.

What it means is that first we go into the Session table and delete all the records in there and create new records in the form of '0508' for the Session-Code. VMs will just switch to that field.

Since we are deleting all existing records, will the system still keeps track of which Session-Intake falls into which Study-Session? It is still important to keep track of Study-Session as it will be printed in Student Transcript later. - Gan

Thus Intake-Semester can be the same Session_Name (one to many) that can be SQL-amend later. This will mean no impact on many places which display intake, FeeStructure and its Report. But what bout the other impacts? I will try to explore today. From here this picture may change towards a more normalised one.

When Session-Name is to be amended later its a matter of SQL to bundle same semester intakes into that Session-Name.

Any1 can still offer comments. I will pinpoint the data and table changes I m doing to prove it on my instance here. Also the flow and structure impacted as ongoing below.

Some previous changes been done to correct the intake-code display is ok, we wont bother with that, but the present intake-semester to code need-to-change is not needed.

Impact on PreRegistration
This will mean that the intake month and year is parsed directly into the Session.Session-Code, refering to it as the Academic Session. If its not created, the user has to go into the Academic Session and create it. This gives better Admin and Data Entry control and maintainability.

Q to Sam. What is Intake_Batch? What is its impact here? What are the key tables i must look into? I will take a closer look at IntakeStatus.java.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sbahrin
Regular


Joined: 17 Dec 2004
Posts: 81
Location: Malaysia

PostPosted: Tue Sep 27, 2005 8:37 pm    Post subject: Reply with quote

About Intake_Batch

New students intake was done during certain period in time, meaning that students intakes happened in groups - these groups are called batches. In the system I called it Intake_Batch.

Students within the same batch shall have the same status (semester status) for the whole life cycle of their study - BUT - this is not always correct, because, of cases likes - defferment - shall makes some students "loss" their original batch, and they will "transfered" to the next batch.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Tue Sep 27, 2005 8:44 pm    Post subject: Reply with quote

The following are my actions while tracing what influence the Session table and the Semester and Intake values have on the whole system. I state here the javas, VMs, and logic as i see it.

1) Firstly i go into Academic Session http://localhost:86/cybernetics/x/mecca.sis.registration.SetupIntakeModule using vtl/sis/register/setup_intake.vm, and able to create intake like names such as 0605 (Code) June 2005/2006 (Name).

2) Then i assign the Period to this Intake-Session http://localhost:86/cybernetics/x/mecca.sis.registration.TermActivationModule using vtl/sis/register/term_activation.vm
It will place each following intake period into the Intake_Batch. From here the semesters may not be placed correctly by the system. But this can be solved by making the system refering to a fixed semester table perhaps under the Period Of Study Setup.

3) Next action is to assign Fee Structure to the Intake Batch: http://localhost:86/cybernetics/x/mecca.sis.billing.FeeStructureModule using vtl/sis/billing/fee_structure.vm.
Here each Program is assign to the Intake_Batch and defined its Fee Structure.

Thus so far i see that the only impact is the Period Batching (to use a Semester Standard Table), and most places where we want Intake_Code to appear is a matter of using the Session.Session_Intake field.

To answer Gan, perhaps we do not delete the old records first. We just have to create the new ones. Then again using SQL we assign the student database to the new Sessions. Of course we have to resolve the Intake_Batch auto-create first to lookup a Period_Semester table. This happens at createIntakeBatch method in IntakeStatus.java.

I wana dupe this method to refer a new table of half yearly semesters.

Awaiting further tots from others especially from Sam if this is corect.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Thu Sep 29, 2005 7:04 pm    Post subject: Reply with quote

I have created the new table as
Code:
CREATE TABLE `semester_session` (
    `session_id` varchar(50),
    `session_name` varchar(50),
    `start_date` datetime,
    `end_date` datetime,
    `session_code` varchar(50),
    `path_no` int
);

and put in 4 semesters of data to test.
Code:
session_id  session_name  start_date  end_date  session_code  path_no     
Mei05  Mei 2005/2006  2005-05-01 00:00:00.0  2005-10-30 00:00:00.0   0     
Nov05  Nov 2005/2006  2005-11-01 00:00:00.0  2006-05-01 00:00:00.0   0     
Mei06  Mei 2006/2007  2006-05-01 00:00:00.0  2006-10-30 00:00:00.0   0     
Nov06  Nov 2006/2007  2006-11-01 00:00:00.0  2007-04-30 00:00:00.0   0     
Data at the moment has to be entered manually via y.html. Its ok since its a fixed dataset at the moment.

Then i modify the following javas:
SessionData.java sql = r.getSQLSelect("intake_batch ib, period p, semester_session s"); //red1 session
IntakeStatus.java sql = "select session_id from semester_session " + //red1 session

and VM:
term_activation.vm <option value="$batch.id" $selected>$batch.code</option> ##red1 batch.name

It works fine that we can now create different Academic Session Intakes and autocreate the same Session-Periods. Now i m tracing the impact thruout the system and i have tracked up to FeeStructureModule which is hardcoded to Period A and doesnt use the Intake_Batch thus no impact. Only the VM has to be adjusted to display intake_code instead of intake_name.

All my changes are stated here and commented with //red1 in javas and ##red1 in the VM. CVS done.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Thu Sep 29, 2005 8:58 pm    Post subject: Reply with quote

Now FeeStructureModule can select by intake_code. Amended again SessionData.java
Code:
   public static Vector getIntakeBatch(String period_root) throws Exception {
      Db db = null;
      String sql = "";
      try {
         db = new Db();
         Statement stmt = db.getStatement();
         SQLRenderer r = new SQLRenderer();
         Vector v = new Vector();
         {
            r.add("ib.intake_session");
            r.add("s.start_date"); //red1
            r.add("s.session_name");
            r.add("s.session_code"); //red1
            r.add("ib.period_root_id", period_root);
            r.add("ib.intake_session", r.unquote("s.session_id"));
            sql = r.getSQLSelectDistinct("intake_batch ib, session s", "s.start_date desc");

            ResultSet rs = stmt.executeQuery(sql);
            while ( rs.next() ) {
               Hashtable h = new Hashtable();
               h.put("id", getString(rs, "intake_session"));
               h.put("name", getString(rs, "session_name"));
               h.put("code", getString(rs, "session_code")); //red1
               h.put("start_date", getString(rs, "start_date")); //red1
               v.addElement(h);

and its FeeStructure.vm
Code:
                  <option value="$intake.id" $selected>$intake.code</option> ##red1 name
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Tue Oct 04, 2005 1:47 am    Post subject: Reply with quote

There is been further impact due to the change to Session table of not relying anymore on session_id as key index in the Intake_Batch but semester_session's instead.

1) IntakeStatus.java
Code:
   private static Vector getSessions(Statement stmt, String intake, String period) throws Exception {
      String sql = "select i.session_id " +
      "from intake_batch i, semester_session s " + //red1

2) StudentData.java
Code:
   public static Hashtable getEnrollmentInfo1(Statement stmt, String student_id, String session_id) throws Exception {
...
         r.add("sta.batch_id", session_id); //red1 "session_id"
...
   public static Hashtable getEnrollmentInfo(String student_id) throws Exception {
      //get current session
      String session_id = SessionData.getCurrentSessionId();    
      
      //does this session_id exist in student_status?
      boolean isExist = false;
      Db db = null;
      try {
          db = new Db();
          Statement stmt = db.getStatement();
          String sql = "select batch_id from student_status where batch_id = '" + session_id + "' " +  //red1 batch_id>session_id
          "and student_id = '" + student_id + "'";
Trying to contain the impact just to safely deliver to client ASAP.
I suspect that this code will break cos its matching current session, which will change when next semester happens. As it wont be able to give the same ID to batch, which is only in the first session. I will think bout using the session_id to return not based on session but intake-batch. May need to obtain initial session id -red1

Above is reverted. Found better way via SessionData.java :
Code:
   public static String getCurrentSessionId(Statement stmt) throws Exception {
      String sql = "";
      sql = "select session_id " +
      "from semester_session " +  //red1 semester_session > session
      "where (start_date <= now() " +
      "and end_date >= now())";   
Few things went haywire, and i fall back to morning version reusing the above changes, where the only problem is PeriodID is UNDEFINED. That is sovled in the SessionData.getCurrentPeriodId
Code:

            sql = "select ib.period_id " +
            "from intake_batch ib, semester_session s " + //red1
            "where ib.session_id = s.session_id " +
            "and ib.period_root_id = '" + period_root + "'" +
            "and ib.intake_session = '" + intake + "'" +
            "and (s.start_date <= now() " +
            "and s.end_date >= now())";

But still the problem in the system is the StudentStatus is taking a different id "Mei05" from SemesterSession from the Session. Need to figure out a solution model that incorporate into SemesterSession the right IDs as Sam advised.


Last edited by red1 on Wed Oct 05, 2005 12:53 am; edited 5 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Tue Oct 04, 2005 10:59 am    Post subject: Reply with quote

The next purpose of multiple IntakeCode is to allow the system to return to the new student its appropriate FeeStructureMap. At the moment the system looks for startdate which doesnt return the right Fees. It should look up the IntakeCode which is unique and accurate. The java classes affected is IntakeStatus.java. Since its called by numerous other Java classes i will try to blackbox its return within this Java as a temp measure.
Basically is to fetch the Student (new and present) 's IntakeCode to return its corresponding Session_ID

I deprecated Sam's method with this one in IntakeStatus.java:
Code:
   public static String getSessionId(String intakeCode) throws Exception {
      Db db = null;
      String sql = "";
      try {
         db = new Db();
         Statement stmt = db.getStatement();
          String session_id = "";
         sql = "";         
         boolean found = false;
         {
            SQLRenderer r = new SQLRenderer();
            r.add("session_id");
            r.add("session_code", intakeCode);
            sql = r.getSQLSelect("session"); //red1 this time its ok cos it has intakes...
            ResultSet rs = stmt.executeQuery(sql);
            if ( rs.next() ) {
               found = true;
                session_id = rs.getString(1);
            }
         }   
         return session_id;
      } finally {
         if ( db != null ) db.close();
      }
   }

I didnt disturb the other getSessionID methods. So we will expect other calls to these methods so that they dont return the wrong SessionID. In conclusion i didnt blackbox but fork the call to this getSessionID(intake_code). To persist it i always place it either in context or any convenient hashtable currently in use. Of course we have to fetch the intake_code from the session table, and that is done like this:
Code:
            if (intake_month.length()==1)
            intake_month = "0"+ intake_month;
            String intakeCode = intake_year.substring(2);
            intakeCode = intakeCode + intake_month;
            context.put("intake_code",intakeCode);
            session_id = IntakeStatus.getSessionId(intakeCode);
      //      int intmn = !"".equals(intake_month) ? Integer.parseInt(intake_month) : 0;
      //      int intyr = !"".equals(intake_year) ? Integer.parseInt(intake_year) : 0;
      //      session_id = IntakeStatus.getSessionId(intyr, intmn);
            context.put("session_id",session_id);
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Wed Oct 05, 2005 9:39 am    Post subject: Reply with quote

After hitting some more impact and consulting Sam, i have to figure out other more normalised design:
1) The Session table is equivalent to Semester_Session so that is redundant, thus its Intake_Batch not sessions that must exist separately. It contains different intakes but related to same Semesters in the Session table.

2) All intake codes will refer to that Intake_Batch for legitimacy.
This avoid impact as Session.Session_ID relationship remains intact, i.e. with Intake_Batch.Session_ID.

3) Some online discussion with Sam says that we dont change the present system he put in. The intake code will look for the same batch as it is now. I agree so that all present data has no issue. He said that different subject and fee structure can be handled in different way.
So i will now reverse all changes and commit to CVS. Then Gan also can delete the testdata he created before.

But main issue will be how do we then cater for different intake's fee structure and subject structure?

I will be meeting Sam 4.30pm at KLCC to discuss more if this is the rite way. Till then i will be studying the Entity Relationship Diagram as homework.

"Study More, Do Less"
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Fri Oct 07, 2005 5:35 am    Post subject: Reply with quote

After discussion with Sam, we agree that handling of different Fee and Subject Struture is done by way of a separate Intake_Code (0505,0506,0507...) which is FK in those tables.

This means changes needed during:
1) Invoice Creation - when student is looking up its Fee to pay for that semester has to see which intake_code it is.

2) Creation of Fee Structure (stated above)

3) Creation of Program-Subject Structure (stated above)

This seem very clear in concept and allow quick maintenance of such system change. Sam will be doing this as i m still not sure of many meanings in the system and want to avoid my last mistake. I m faster at debugging as per Gan's requests.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Mon Oct 10, 2005 10:59 pm    Post subject: Reply with quote

To integrate into the Session table, i think we need a table 'Intake_Code' which has 'Intake_Code', and "Session_ID' which will map into the many points that needs to return back Session_ID.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sbahrin
Regular


Joined: 17 Dec 2004
Posts: 81
Location: Malaysia

PostPosted: Thu Oct 20, 2005 5:42 am    Post subject: Reply with quote

CHANGES OF THE TABLE STRUCTURE FOR FEE_STRUCTURE_PROGRAM

Add one field: intake_code varchar(50)
You can remove field: intake_session (not needed anymore)
Code:

`fee_structure_program`
=================

    `program_code` varchar(50)
    `fee_code` varchar(50)
    `fee_description` varchar(255)
    `fee_amount` float
    `fee_id` varchar(50)
    `period_id` varchar(50)
    `period_scheme` varchar(50)
    `priority` int
    `intake_code` varchar(50)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Thu Oct 20, 2005 8:09 am    Post subject: Reply with quote

There is also a new field in INTAKE table that needs Intake_Code and Session_ID. Just add it there and the error in Fee_Structure Module goes away. Can Sam tell us what further new changes happened to the Table/Columns? Also what are the new functions he added? We need to know to test better and stabilise before demo. If too much changes we have to freeze the version and update changes only after a demo.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Thu Oct 20, 2005 2:51 pm    Post subject: Reply with quote

Intake table has to be populated by running mecca.sis.intake.IntakeCodeData.java

Then during FeeStructureReport there is a bug where no data is pulled from the new FeeStructure as SessionID is still in use instead of IntakeCode, so i amended mecca.sis.billing.FeeStructureReportModule.java to extend the IntakeBatch to IntakeCodes sessions.
Code:
      Vector intakePreList = SessionData.getIntakeBatch(period_scheme);
      Vector intakeList = SessionData.extend2IntakeCode(intakePreList);
Code:
   /*
    * red1  - to fetch child intake codes from each session
    * Select intake_code from Intake where session_id = ?
   */
   public static Vector extend2IntakeCode(Vector intakeList) throws Exception
   {            
      Db db = null;
      String sql = "";
      String intake_session = "";
      String intake_code = "";
   try {
      db = new Db();
      Statement stmt = db.getStatement();
      SQLRenderer r = new SQLRenderer();
      Vector v = new Vector();
         {
         for ( int i=0; i < intakeList.size(); i++ ) {
            r.clear();
            Hashtable h = (Hashtable) intakeList.elementAt(i);
            intake_session = (String)h.get("id");
            r.add("intake_code");
            r.add("session_id", intake_session);
            sql = r.getSQLSelect("intake", "session_id");
            ResultSet rs = stmt.executeQuery(sql);
            while ( rs.next() ) {
               Hashtable h2 = new Hashtable();
               intake_code = getString(rs, "intake_code");
               h2.put("id",intake_code);
               h2.put("name",h.get("name"));
               h2.put("code",h.get("code"));
               h2.put("start_date",h.get("start_date"));
               v.addElement(h2);
               }
            }               
         }   
      return v;
      }
   finally {
      if ( db != null ) db.close();
         }
   }   
Then i make the sis.billing.fee_structure_report.VM to display the IntakeCode instead of SessionCode
Back to top
View user's profile Send private message Send e-mail Visit poster's website
red1
Site Admin


Joined: 06 Jul 2004
Posts: 1756
Location: Kuala Lumpur, Malaysia

PostPosted: Tue Nov 29, 2005 7:52 am    Post subject: Reply with quote

From here, the fast temporary workaround for creating new intake-code is to use the x.html > Databases Metadata > (Cybernetics/table)intake > (View Data) > intake_code - session_id (insert).

Insert data in the form 0509 - 2005/2006-M
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    red1.org Forum Index -> College ERP Project All times are GMT + 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group