Thursday night I got this fantastic news:
"Dear Karen:
Congratulations! Your abstract,
Use the Power of Apex Dictionary Views to Increase the Quality of Your Apex Applications,
has been accepted for presentation at ODTUG Kaleidoscope 2008, June 15-19, in New Orleans, Louisiana."
Wauw!! A range of emotions ran through me. I go to New Orleans, the city from the gospel and the jazz!
It's the first time I go to a foreign country to give a presentation, so you understand that I'm very excited to be one of the selected speakers at ODTUG! This is a wonderful opportunity!
The Apex-core team at iAdvise has developed their own QA-tool on top of the Apex Repository to guard the quality of our application guidelines and conventions. I will bring this case together with my colleague Jan Huyzentruyt. We already did a lot of presentations together in Belgium, but it is the first time we are doing it abroad ...
So, we are looking forward going to New Orleans and we are honoured being on the list of speakers together with big names like Tom Kyte, Steven Feuerstein, Mark Rittman, Carl Backstrom, Patrick Wolf, ...
Hope to see you there!
четверг, 31 января 2008 г.
ODTUG Kaleidoscope 2008
среда, 30 января 2008 г.
Flex 3 (Beta 3) Badge.swf don't like spaces!
I've hacked the batch.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now. I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my batch.swf and changed the code to use that one instead.
You can get the whole bag of goodies here. I've included all the source and a ready to use batch.swf, as well as a working sample.
ODTUG Kaleidoscope 2008
Thursday night I got this fantastic news:
"Dear Karen:
Congratulations! Your abstract,
Use the Power of Apex Dictionary Views to Increase the Quality of Your Apex Applications,
has been accepted for presentation at ODTUG Kaleidoscope 2008, June 15-19, in New Orleans, Louisiana."
Wauw!! A range of emotions ran through me. I go to New Orleans, the city from the gospel and the jazz!
It's the first time I go to a foreign country to give a presentation, so you understand that I'm very excited to be one of the selected speakers at ODTUG! This is a wonderful opportunity!
The Apex-core team at iAdvise has developed their own QA-tool on top of the Apex Repository to guard the quality of our application guidelines and conventions. I will bring this case together with my colleague Jan Huyzentruyt. We already did a lot of presentations together in Belgium, but it is the first time we are doing it abroad ...
So, we are looking forward going to New Orleans and we are honoured being on the list of speakers together with big names like Tom Kyte, Steven Feuerstein, Mark Rittman, Carl Backstrom, Patrick Wolf, ...
Hope to see you there!
воскресенье, 27 января 2008 г.
Flex 3 (Beta 3) Badge.swf don't like spaces!
I've hacked the batch.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now. I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my batch.swf and changed the code to use that one instead.
You can get the whole bag of goodies here. I've included all the source and a ready to use batch.swf, as well as a working sample.
ODTUG Kaleidoscope 2008
Thursday night I got this fantastic news:
"Dear Karen:
Congratulations! Your abstract,
Use the Power of Apex Dictionary Views to Increase the Quality of Your Apex Applications,
has been accepted for presentation at ODTUG Kaleidoscope 2008, June 15-19, in New Orleans, Louisiana."
Wauw!! A range of emotions ran through me. I go to New Orleans, the city from the gospel and the jazz!
It's the first time I go to a foreign country to give a presentation, so you understand that I'm very excited to be one of the selected speakers at ODTUG! This is a wonderful opportunity!
The Apex-core team at iAdvise has developed their own QA-tool on top of the Apex Repository to guard the quality of our application guidelines and conventions. I will bring this case together with my colleague Jan Huyzentruyt. We already did a lot of presentations together in Belgium, but it is the first time we are doing it abroad ...
So, we are looking forward going to New Orleans and we are honoured being on the list of speakers together with big names like Tom Kyte, Steven Feuerstein, Mark Rittman, Carl Backstrom, Patrick Wolf, ...
Hope to see you there!
пятница, 25 января 2008 г.
Flex 3 (Beta 3) Badge.swf don't like spaces!
I've hacked the batch.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now. I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my batch.swf and changed the code to use that one instead.
You can get the whole bag of goodies here. I've included all the source and a ready to use batch.swf, as well as a working sample.
четверг, 24 января 2008 г.
ODTUG Kaleidoscope 2008
Thursday night I got this fantastic news:
"Dear Karen:
Congratulations! Your abstract,
Use the Power of Apex Dictionary Views to Increase the Quality of Your Apex Applications,
has been accepted for presentation at ODTUG Kaleidoscope 2008, June 15-19, in New Orleans, Louisiana."
Wauw!! A range of emotions ran through me. I go to New Orleans, the city from the gospel and the jazz!
It's the first time I go to a foreign country to give a presentation, so you understand that I'm very excited to be one of the selected speakers at ODTUG! This is a wonderful opportunity!
The Apex-core team at iAdvise has developed their own QA-tool on top of the Apex Repository to guard the quality of our application guidelines and conventions. I will bring this case together with my colleague Jan Huyzentruyt. We already did a lot of presentations together in Belgium, but it is the first time we are doing it abroad ...
So, we are looking forward going to New Orleans and we are honoured being on the list of speakers together with big names like Tom Kyte, Steven Feuerstein, Mark Rittman, Carl Backstrom, Patrick Wolf, ...
Hope to see you there!
Flex 3 (Beta 3) Badge.swf don't like spaces!
I've hacked the batch.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now. I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my batch.swf and changed the code to use that one instead.
You can get the whole bag of goodies here. I've included all the source and a ready to use batch.swf, as well as a working sample.
вторник, 22 января 2008 г.
ODTUG Kaleidoscope 2008
Thursday night I got this fantastic news:
"Dear Karen:
Congratulations! Your abstract,
Use the Power of Apex Dictionary Views to Increase the Quality of Your Apex Applications,
has been accepted for presentation at ODTUG Kaleidoscope 2008, June 15-19, in New Orleans, Louisiana."
Wauw!! A range of emotions ran through me. I go to New Orleans, the city from the gospel and the jazz!
It's the first time I go to a foreign country to give a presentation, so you understand that I'm very excited to be one of the selected speakers at ODTUG! This is a wonderful opportunity!
The Apex-core team at iAdvise has developed their own QA-tool on top of the Apex Repository to guard the quality of our application guidelines and conventions. I will bring this case together with my colleague Jan Huyzentruyt. We already did a lot of presentations together in Belgium, but it is the first time we are doing it abroad ...
So, we are looking forward going to New Orleans and we are honoured being on the list of speakers together with big names like Tom Kyte, Steven Feuerstein, Mark Rittman, Carl Backstrom, Patrick Wolf, ...
Hope to see you there!
понедельник, 21 января 2008 г.
Flex 3 (Beta 3) Badge.swf don't like spaces!
I've hacked the batch.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now. I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my batch.swf and changed the code to use that one instead.
You can get the whole bag of goodies here. I've included all the source and a ready to use batch.swf, as well as a working sample.
воскресенье, 20 января 2008 г.
AIA - Application Integration Architecture
The AIA presentation was really great because now I got an in depth view of the amazing features and development that has been done by the Apps people.
AIA now delivers SOA integration to all the Apps people so your available to integrate with Siebel, SAP, ... using Process Integration Packs, the so called PIPs. These packs include the needed services, data, error-handling, validation-logic etc. to be able to integrate your E-business Suite application to third-party clients.
What struck me the most was that a lot features should be made available to the SOA community as well, the fusion middleware stack so to say.
What are these amazing features that should be promoted to the fusion middleware stack:
- Enterprise Business Object : The EBO is being used within AIA to describe the true business objects (such as customer, product, ...) in a standardized way. Through using these objects any services can retreive the payload and messages in a standardized way and integration is garantied in a loosely-coupled way.
- Enterprise Business Services : The EBS can be seen as the black dot in the middle that handles the payloads of 3-party applications and transforms your 3-party messages into standard EBO's.
- Application Business Connectivity Service : ABC is the important part inside the PIP's (Process Integration Packs) which will handle the interfacing with SAP, PeopleSoft, Siebel, ... and respond with a standardized payload, namely the EBO to your EBS. => This connector can be seen as the Adapters you're already familiair with within Enterprise Service Bus and BPEL.
- Composite Application Validation System and Composite Application Error Management and Resolution : enables you to test and simulate your integration services without the need for the whole architecture to be in place. No need for a Siebel-EBS dev, test, q&a and production environment, just test and simulate your processes using the AIA-validation and error packs. The error handling has been augmented so error messages are exchanged in a standardized way and the wright application and the wright user are notified in real-time. This validation logic and error handling could be a true value asset for the Fusion Middleware Market as well, which could just be a service offered by the SCA, by the composite.
- BSR = Business Service Repository, which is an extension on the already existing UDDI but is an answer to the common need for higher-level repositories for models and objects. The UDDI as we know it today only serves as a repository for services which are specific to applications. By taking this to the next level, the customer can now offer a portfolio of solutions instead of a portfolio of services. The BSR will act as a catalog of objects, messages and services that compose the integration scenarios.
AIA has tackled big integration issues already ... and the fusion of apps and middleware will be the next level?
пятница, 18 января 2008 г.
Tips & Tricks that'll save you a lot of time regarding ODI, Flex, Soa Suite
On the other hand I've been experimenting a lot with ODI and how the tool will handle changing data models, changing datasources, ...
Lastly I've been playing around with invocation of Bpel Processes using Web Service Proxy Clients instead of the Bpel Invocation API.
The question that's still unanswered because no documentation or benchmarks or best practices are available yet is: 'What's the best practice in invoking bpel processes, the Bpel Invocation API or Web Service Proxy Clients?'
Tips & Tricks ODI:
- Interesting Notes: 423740.1, 423817.1
- Grant dba-privileges to your source-db-user, otherwise you'll get 'insufficient privileges' exceptions when trying to execute your interfaces
Handling changing data models (new tables, deletion of existing attributes in tables, addition of new attributes, additional relationships, ... ) :
- Go to your datamodel and reverse engineer the changed tables again. New attributes are added, deleted attributes aren't removed yet because they're referenced in interfaces in your ODI Designer.
- Go to your interfaces defined in the Designer-tab in ODI: remove all active mappings to the attributes that were deleted
- Go back to the model-tab in designer and right-click the attribute in your tabel and choose delete. When all references are updated correctly (no active mapping), the attribute will be deleted from your datamodel
Tips & Tricks Flex:
- When you're getting weard errors regarding 'conversion exception between java.util.Date and java.util.Calendar' or exceptions regarding producer or consumer-errors => make sure you've defined 'autocommit'-property to false on your data services (Using LCDS)
- How to handle static data without usage of Value Object or Data Transfer Objects => use SQLAssembler without usage of java-classes or actionscript-classes in your data-management-config.
- rtmp-host connection failure on OC4J => try to reset the connection-port to another value than the default one which is '2038'. I've defined the value to '2035' and now no errors are thrown anymore
- Use [managed] attribute to make sure all changes on objects are synced between 2 clients
- Deploying data-management-config to different JEE Servers, e.g. Tomcat and OC4J. When you deploy to tomcat you have to define the full JNDI-location which would be for example: java:/comp/env/jdbc/flexDS. When you deploy to an OC4J, you need to define the short JNDI-descriptor: jdbc/flexDS.
The other exceptions, weard behaviour was already addressed in earlier posts:
- You need to add an xsl-choose-when-otherwise xsl-node structure to you transform-activity in your bpel-process and in the otherwise-tag define the xsi:nil=true on your attribute to make sure the web service proxy won't set this attribute to required.
- You need to update the toplink-mapping file being generated in bpel when using the database adapter. Relationships aren't defined properly, because the method accessor is checked for all one-to-many relationships whilst these aren't defined in the java wrapper classes. Uncheck these 'map to method accessors' and these exceptions will disappear. You can uncheck these when drilling down in your toplink.mwp file into to your object on your mappedCollections.
A beautiful one were all newbees in SOA Suite spend ages and ages to figure out what the problem is ... Oracle please fix this ???
You've installed SOA Suite (you can choose which version) and entered a custom password during installation for your oc4jadmin-password, not the 'welcome1' password. You can choose your own password wright ?
But when the newbee starts creating his first bpel and esb projects, there are weard errors poping up: 'connection timed out', 'jndi-location for db-adapter isn't properly defined', ...
Well, weard but true, the 'welcome1' password is defined hardcoded in different 'oc4j-ra.xml' files used in the jmsadapter-folder, dbadapter-folder, ... Make sure to change the passwords correctly when you're drilling through the different Oracle By Example-exercices or tutorials.
Flex 3 (Beta 3) Badge.swf don't like spaces!
I've hacked the batch.fla file using regex to put replace spaces with %20, and this seems to have fixed the problem for now. I also downloaded a copy of the air.swf from the Adobe site, threw it in the same folder as my batch.swf and changed the code to use that one instead.
You can get the whole bag of goodies here. I've included all the source and a ready to use batch.swf, as well as a working sample.
вторник, 15 января 2008 г.
Tips & Tricks that'll save you a lot of time regarding ODI, Flex, Soa Suite
On the other hand I've been experimenting a lot with ODI and how the tool will handle changing data models, changing datasources, ...
Lastly I've been playing around with invocation of Bpel Processes using Web Service Proxy Clients instead of the Bpel Invocation API.
The question that's still unanswered because no documentation or benchmarks or best practices are available yet is: 'What's the best practice in invoking bpel processes, the Bpel Invocation API or Web Service Proxy Clients?'
Tips & Tricks ODI:
- Interesting Notes: 423740.1, 423817.1
- Grant dba-privileges to your source-db-user, otherwise you'll get 'insufficient privileges' exceptions when trying to execute your interfaces
Handling changing data models (new tables, deletion of existing attributes in tables, addition of new attributes, additional relationships, ... ) :
- Go to your datamodel and reverse engineer the changed tables again. New attributes are added, deleted attributes aren't removed yet because they're referenced in interfaces in your ODI Designer.
- Go to your interfaces defined in the Designer-tab in ODI: remove all active mappings to the attributes that were deleted
- Go back to the model-tab in designer and right-click the attribute in your tabel and choose delete. When all references are updated correctly (no active mapping), the attribute will be deleted from your datamodel
Tips & Tricks Flex:
- When you're getting weard errors regarding 'conversion exception between java.util.Date and java.util.Calendar' or exceptions regarding producer or consumer-errors => make sure you've defined 'autocommit'-property to false on your data services (Using LCDS)
- How to handle static data without usage of Value Object or Data Transfer Objects => use SQLAssembler without usage of java-classes or actionscript-classes in your data-management-config.
- rtmp-host connection failure on OC4J => try to reset the connection-port to another value than the default one which is '2038'. I've defined the value to '2035' and now no errors are thrown anymore
- Use [managed] attribute to make sure all changes on objects are synced between 2 clients
- Deploying data-management-config to different JEE Servers, e.g. Tomcat and OC4J. When you deploy to tomcat you have to define the full JNDI-location which would be for example: java:/comp/env/jdbc/flexDS. When you deploy to an OC4J, you need to define the short JNDI-descriptor: jdbc/flexDS.
The other exceptions, weard behaviour was already addressed in earlier posts:
- You need to add an xsl-choose-when-otherwise xsl-node structure to you transform-activity in your bpel-process and in the otherwise-tag define the xsi:nil=true on your attribute to make sure the web service proxy won't set this attribute to required.
- You need to update the toplink-mapping file being generated in bpel when using the database adapter. Relationships aren't defined properly, because the method accessor is checked for all one-to-many relationships whilst these aren't defined in the java wrapper classes. Uncheck these 'map to method accessors' and these exceptions will disappear. You can uncheck these when drilling down in your toplink.mwp file into to your object on your mappedCollections.
A beautiful one were all newbees in SOA Suite spend ages and ages to figure out what the problem is ... Oracle please fix this ???
You've installed SOA Suite (you can choose which version) and entered a custom password during installation for your oc4jadmin-password, not the 'welcome1' password. You can choose your own password wright ?
But when the newbee starts creating his first bpel and esb projects, there are weard errors poping up: 'connection timed out', 'jndi-location for db-adapter isn't properly defined', ...
Well, weard but true, the 'welcome1' password is defined hardcoded in different 'oc4j-ra.xml' files used in the jmsadapter-folder, dbadapter-folder, ... Make sure to change the passwords correctly when you're drilling through the different Oracle By Example-exercices or tutorials.
понедельник, 14 января 2008 г.
amfphp/flex/cairngorm Codegen - Source Available on Google Code
Anyway, we finally had some time to get this thing cleaned up and out on Google code... you can find the source files at http://code.google.com/p/flexamfphpcairngormgenerator/source
суббота, 12 января 2008 г.
Flex and ApEx: exchanging data
I started by looking for a way to get a simple string from a flex application to an ApEx application. I came across the ActionScript API "ExternalInterface". The Adobe documentation for the api:
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container or a desktop application with Flash Player embedded.
ExternalInterface has a method "call" where you can specify the name of the external function you want to call, the second parameters are the parameters you want to pass to that function.

In your html page make a function called "setDept" with the necessary parameters and let the fill the Apex Items. Make a clickhandler in your flex application and call your function, you will see that it works perfect.
Now we have send data from flex to ApEx, it’s time to send something back from ApEx to flex. To start we need to be sure we have a JavaScript function that allows us to speak with the swf file. After some searching, trial and error, I came across the next function that works in both Mozilla and IE:

Now we need to create a javascript function that will pass a String to our flex application using the thisMovie function. Once this is done the only thing we need to create an ActionScript function that can registers an ActionScript method as callable from the container. We can use the method "callBack" from the "ExternalInterface" class for this.
Your Actionscript could look something like this:

Test the JavaScript function on your html page and you will see that you send data from your ApEx application to your flex application.
amfphp/flex/cairngorm Codegen - Source Available on Google Code
Anyway, we finally had some time to get this thing cleaned up and out on Google code... you can find the source files at http://code.google.com/p/flexamfphpcairngormgenerator/source
пятница, 11 января 2008 г.
Flex and ApEx: exchanging data
I started by looking for a way to get a simple string from a flex application to an ApEx application. I came across the ActionScript API "ExternalInterface". The Adobe documentation for the api:
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container or a desktop application with Flash Player embedded.
ExternalInterface has a method "call" where you can specify the name of the external function you want to call, the second parameters are the parameters you want to pass to that function.

In your html page make a function called "setDept" with the necessary parameters and let the fill the Apex Items. Make a clickhandler in your flex application and call your function, you will see that it works perfect.
Now we have send data from flex to ApEx, it’s time to send something back from ApEx to flex. To start we need to be sure we have a JavaScript function that allows us to speak with the swf file. After some searching, trial and error, I came across the next function that works in both Mozilla and IE:

Now we need to create a javascript function that will pass a String to our flex application using the thisMovie function. Once this is done the only thing we need to create an ActionScript function that can registers an ActionScript method as callable from the container. We can use the method "callBack" from the "ExternalInterface" class for this.
Your Actionscript could look something like this:

Test the JavaScript function on your html page and you will see that you send data from your ApEx application to your flex application.
четверг, 10 января 2008 г.
amfphp/flex/cairngorm Codegen - Source Available on Google Code
Anyway, we finally had some time to get this thing cleaned up and out on Google code... you can find the source files at http://code.google.com/p/flexamfphpcairngormgenerator/source
вторник, 8 января 2008 г.
Flex and ApEx: exchanging data
I started by looking for a way to get a simple string from a flex application to an ApEx application. I came across the ActionScript API "ExternalInterface". The Adobe documentation for the api:
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container or a desktop application with Flash Player embedded.
ExternalInterface has a method "call" where you can specify the name of the external function you want to call, the second parameters are the parameters you want to pass to that function.

In your html page make a function called "setDept" with the necessary parameters and let the fill the Apex Items. Make a clickhandler in your flex application and call your function, you will see that it works perfect.
Now we have send data from flex to ApEx, it’s time to send something back from ApEx to flex. To start we need to be sure we have a JavaScript function that allows us to speak with the swf file. After some searching, trial and error, I came across the next function that works in both Mozilla and IE:

Now we need to create a javascript function that will pass a String to our flex application using the thisMovie function. Once this is done the only thing we need to create an ActionScript function that can registers an ActionScript method as callable from the container. We can use the method "callBack" from the "ExternalInterface" class for this.
Your Actionscript could look something like this:

Test the JavaScript function on your html page and you will see that you send data from your ApEx application to your flex application.
понедельник, 7 января 2008 г.
amfphp/flex/cairngorm Codegen - Source Available on Google Code
Anyway, we finally had some time to get this thing cleaned up and out on Google code... you can find the source files at http://code.google.com/p/flexamfphpcairngormgenerator/source
Flex and ApEx: exchanging data
I started by looking for a way to get a simple string from a flex application to an ApEx application. I came across the ActionScript API "ExternalInterface". The Adobe documentation for the api:
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container or a desktop application with Flash Player embedded.
ExternalInterface has a method "call" where you can specify the name of the external function you want to call, the second parameters are the parameters you want to pass to that function.

In your html page make a function called "setDept" with the necessary parameters and let the fill the Apex Items. Make a clickhandler in your flex application and call your function, you will see that it works perfect.
Now we have send data from flex to ApEx, it’s time to send something back from ApEx to flex. To start we need to be sure we have a JavaScript function that allows us to speak with the swf file. After some searching, trial and error, I came across the next function that works in both Mozilla and IE:

Now we need to create a javascript function that will pass a String to our flex application using the thisMovie function. Once this is done the only thing we need to create an ActionScript function that can registers an ActionScript method as callable from the container. We can use the method "callBack" from the "ExternalInterface" class for this.
Your Actionscript could look something like this:

Test the JavaScript function on your html page and you will see that you send data from your ApEx application to your flex application.
воскресенье, 6 января 2008 г.
amfphp/flex/cairngorm Codegen - Source Available on Google Code
Anyway, we finally had some time to get this thing cleaned up and out on Google code... you can find the source files at http://code.google.com/p/flexamfphpcairngormgenerator/source
суббота, 5 января 2008 г.
Flex and ApEx: exchanging data
I started by looking for a way to get a simple string from a flex application to an ApEx application. I came across the ActionScript API "ExternalInterface". The Adobe documentation for the api:
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container or a desktop application with Flash Player embedded.
ExternalInterface has a method "call" where you can specify the name of the external function you want to call, the second parameters are the parameters you want to pass to that function.

In your html page make a function called "setDept" with the necessary parameters and let the fill the Apex Items. Make a clickhandler in your flex application and call your function, you will see that it works perfect.
Now we have send data from flex to ApEx, it’s time to send something back from ApEx to flex. To start we need to be sure we have a JavaScript function that allows us to speak with the swf file. After some searching, trial and error, I came across the next function that works in both Mozilla and IE:

Now we need to create a javascript function that will pass a String to our flex application using the thisMovie function. Once this is done the only thing we need to create an ActionScript function that can registers an ActionScript method as callable from the container. We can use the method "callBack" from the "ExternalInterface" class for this.
Your Actionscript could look something like this:

Test the JavaScript function on your html page and you will see that you send data from your ApEx application to your flex application.
пятница, 4 января 2008 г.
DataServiceTransaction & LCDS
There's some documentation on this, scattered vaguely across the web, and there's a good chance that perhaps this has already been blogged - but I just couldn't find it. The trick is that there are 2 sides to this story, one, you must perform your operations on the database directly, and then two, you must INFORM FDS that changes have occurred. So say I want to create a new Author record, this is what that might look like:
public void createAuthor(){So I just do my regular db insert, then I use a DataServiceTransaction to let FDS know that I've created an Item. Alternatively, I could use this approach:
DataServiceTransaction dtx = DataServiceTransaction.begin(false);
//create record and save:
Author auth = new Author();
auth.setFirstName("Ernest");
auth.setLastName("Hemingway");
AuthorDAO dao = new AuthorDAO();
dao.create(auth);
//let LCDS know:
dtx.createItem("author", auth);
dtx.commit();
}
public void createFDSItem(){This approach might be a bit of overkill and might be better suited when doing mass updates across many records. I did a little bit of testing and it seemed that for the most part calling CreateItem() was faster that the refreshFill() in pushing the new record to the Flex Client.
DataServiceTransaction dtx = DataServiceTransaction.begin(false);
Author auth = new Author();
auth.setFirstName("victor");
auth.setLastName("javarubba");
AuthorDAO dao = new AuthorDAO();
dao.create(auth);
dtx.refreshFill("author", null);
dtx.commit();
}
What cost me so much grief is that I was falsely led down the garden path to believe that calling dtx.createItem("author", auth) would not only inform FDS but also actually create the item. This is not the case. There! Officially blogged!
четверг, 3 января 2008 г.
Flex and ApEx: exchanging data
I started by looking for a way to get a simple string from a flex application to an ApEx application. I came across the ActionScript API "ExternalInterface". The Adobe documentation for the api:
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container or a desktop application with Flash Player embedded.
ExternalInterface has a method "call" where you can specify the name of the external function you want to call, the second parameters are the parameters you want to pass to that function.

In your html page make a function called "setDept" with the necessary parameters and let the fill the Apex Items. Make a clickhandler in your flex application and call your function, you will see that it works perfect.
Now we have send data from flex to ApEx, it’s time to send something back from ApEx to flex. To start we need to be sure we have a JavaScript function that allows us to speak with the swf file. After some searching, trial and error, I came across the next function that works in both Mozilla and IE:

Now we need to create a javascript function that will pass a String to our flex application using the thisMovie function. Once this is done the only thing we need to create an ActionScript function that can registers an ActionScript method as callable from the container. We can use the method "callBack" from the "ExternalInterface" class for this.
Your Actionscript could look something like this:

Test the JavaScript function on your html page and you will see that you send data from your ApEx application to your flex application.
DataServiceTransaction & LCDS
There's some documentation on this, scattered vaguely across the web, and there's a good chance that perhaps this has already been blogged - but I just couldn't find it. The trick is that there are 2 sides to this story, one, you must perform your operations on the database directly, and then two, you must INFORM FDS that changes have occurred. So say I want to create a new Author record, this is what that might look like:
public void createAuthor(){So I just do my regular db insert, then I use a DataServiceTransaction to let FDS know that I've created an Item. Alternatively, I could use this approach:
DataServiceTransaction dtx = DataServiceTransaction.begin(false);
//create record and save:
Author auth = new Author();
auth.setFirstName("Ernest");
auth.setLastName("Hemingway");
AuthorDAO dao = new AuthorDAO();
dao.create(auth);
//let LCDS know:
dtx.createItem("author", auth);
dtx.commit();
}
public void createFDSItem(){This approach might be a bit of overkill and might be better suited when doing mass updates across many records. I did a little bit of testing and it seemed that for the most part calling CreateItem() was faster that the refreshFill() in pushing the new record to the Flex Client.
DataServiceTransaction dtx = DataServiceTransaction.begin(false);
Author auth = new Author();
auth.setFirstName("victor");
auth.setLastName("javarubba");
AuthorDAO dao = new AuthorDAO();
dao.create(auth);
dtx.refreshFill("author", null);
dtx.commit();
}
What cost me so much grief is that I was falsely led down the garden path to believe that calling dtx.createItem("author", auth) would not only inform FDS but also actually create the item. This is not the case. There! Officially blogged!
среда, 2 января 2008 г.
Flex and ApEx: exchanging data
I started by looking for a way to get a simple string from a flex application to an ApEx application. I came across the ActionScript API "ExternalInterface". The Adobe documentation for the api:
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container or a desktop application with Flash Player embedded.
ExternalInterface has a method "call" where you can specify the name of the external function you want to call, the second parameters are the parameters you want to pass to that function.

In your html page make a function called "setDept" with the necessary parameters and let the fill the Apex Items. Make a clickhandler in your flex application and call your function, you will see that it works perfect.
Now we have send data from flex to ApEx, it’s time to send something back from ApEx to flex. To start we need to be sure we have a JavaScript function that allows us to speak with the swf file. After some searching, trial and error, I came across the next function that works in both Mozilla and IE:

Now we need to create a javascript function that will pass a String to our flex application using the thisMovie function. Once this is done the only thing we need to create an ActionScript function that can registers an ActionScript method as callable from the container. We can use the method "callBack" from the "ExternalInterface" class for this.
Your Actionscript could look something like this:

Test the JavaScript function on your html page and you will see that you send data from your ApEx application to your flex application.