Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Specify operation binding to use with fetch after save of DynamicForm

    Hello,

    Using Power, nightly 06-07-2011.

    I am using a special operationBinding for saving a form:
    Code:
        <operationBinding operationType="add" requiresAuthentication="false" requiresRole="" operationId="publicStudentRegistration" dataURL="/generatedcode/sc/PublicIDACall"> 
          <serverObject className="nl.sytematic.projects.MyProject.server.custom.dmi.CustomStudentDMI"/>  
        </operationBinding>
    This is to save public data to the database. It is for the form's add operation, and works fine. However, after this is done, it uses the default 'fetch' operation to get the last inserted id, see this log:
    Code:
    === 2011-06-08 15:18:59,364 [l0-3] INFO  SQLDriver - [builtinApplication.publicStudentRegistration] Executing SQL update on 'Mysql': INSERT INTO Student (phone, SaasCustomer_id, sofinummer, tussenvoegsel, street, surname, number, firstname, postcode, city, country, email, birthplace, cellphone, birthdate, gender) VALUES ('a', 1, 'a', 'a', 'a', 'a', 1, 'a', '1234ab', 'a', 'a', 'info@somedomain.nl', 'a', 'a', '1970-01-01 00:00:00.0', 'man')
    === 2011-06-08 15:18:59,379 [l0-3] DEBUG SQLDataSource - [builtinApplication.publicStudentRegistration] add operation affected 1 rows
    === 2011-06-08 15:18:59,379 [l0-3] DEBUG MysqlDriver - [builtinApplication.publicStudentRegistration] fetchLastRow data - primaryKeysPresent: {}sequencesNotPresent: [Student_id]
    === 2011-06-08 15:18:59,380 [l0-3] INFO  SQLDriver - [builtinApplication.publicStudentRegistration] Executing SQL query on 'Mysql': SELECT LAST_INSERT_ID()
    === 2011-06-08 15:18:59,380 [l0-3] INFO  SQLDataSource - [builtinApplication.publicStudentRegistration] primaryKeys: {Student_id=8}
    === 2011-06-08 15:18:59,380 [l0-3] INFO  SQLDataSource - [builtinApplication.publicStudentRegistration] Mysql getLastRow(): using default operationBinding

    Is it possible to change this? Because I have secured my default fetch operation, and want to use a specific operationId that is 'made public'

    I tried this, to no avail:
    Code:
    form.setAddOperation("publicStudentRegistration");
    form.setFetchOperation("publicStudentRegistrationFetch");
    ie. the fetchOperation 'publicStudentRegistrationFetch' is not used, instead the default (secured) one is used, thus yielding a securityexception, which is not what i want.
    Last edited by Sytematic; 8 Jun 2011, 05:29.

    #2
    See operationBinding,cacheSynchOperation

    Comment


      #3
      Works like a charm, thanks:
      Code:
      ... [builtinApplication.publicStudentRegistration] Mysql getLastRow(): using specific cacheSyncOperation publicStudentRegistrationFetch

      Comment

      Working...
      X