Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add flex and php files

  • Loading branch information...
commit be5bafbdeafd13aed7fe1a988d150a1685001341 1 parent d0b2912
@SidneyAllen authored
Showing with 7,226 additions and 0 deletions.
  1. +64 −0 FlexShopper/.actionScriptProperties
  2. +3 −0  FlexShopper/.flexProperties
  3. +17 −0 FlexShopper/.fxpProperties
  4. +77 −0 FlexShopper/.model/FlexShopper.fml
  5. +32 −0 FlexShopper/.project
  6. +3 −0  FlexShopper/.settings/org.eclipse.core.resources.prefs
  7. +251 −0 FlexShopper/src/FlexShopper-app.xml
  8. +24 −0 FlexShopper/src/FlexShopper.mxml
  9. BIN  FlexShopper/src/assets/icons/48.png
  10. BIN  FlexShopper/src/assets/icons/72.png
  11. BIN  FlexShopper/src/assets/images/arrow-symbol.png
  12. BIN  FlexShopper/src/assets/images/paypal_checkout_button.jpg
  13. BIN  FlexShopper/src/assets/images/placeholder.jpg
  14. +30 −0 FlexShopper/src/com/PayPalBuyButton.mxml
  15. +116 −0 FlexShopper/src/com/soenkerohde/mobile/StageWebViewUIComponent.as
  16. +16 −0 FlexShopper/src/events/ProductEvent.as
  17. +24 −0 FlexShopper/src/services/products/Products.as
  18. +72 −0 FlexShopper/src/services/products/_Super_Products.as
  19. +51 −0 FlexShopper/src/valueObjects/Item.as
  20. +51 −0 FlexShopper/src/valueObjects/Items.as
  21. +19 −0 FlexShopper/src/valueObjects/Model.as
  22. +777 −0 FlexShopper/src/valueObjects/_ItemEntityMetadata.as
  23. +462 −0 FlexShopper/src/valueObjects/_ItemsEntityMetadata.as
  24. +435 −0 FlexShopper/src/valueObjects/_Super_Item.as
  25. +257 −0 FlexShopper/src/valueObjects/_Super_Items.as
  26. +188 −0 FlexShopper/src/views/Cart.mxml
  27. +38 −0 FlexShopper/src/views/Complete.mxml
  28. +100 −0 FlexShopper/src/views/Detail.mxml
  29. +83 −0 FlexShopper/src/views/FlexShopperHomeView.mxml
  30. +105 −0 PayPalFlex/APIError.php
  31. +94 −0 PayPalFlex/DoExpressCheckoutPayment.php
  32. +133 −0 PayPalFlex/GetExpressCheckoutDetails.php
  33. BIN  PayPalFlex/assets/images/football.jpg
  34. BIN  PayPalFlex/assets/images/micronaut.jpg
  35. BIN  PayPalFlex/assets/images/viewmaster.jpg
  36. +1 −0  PayPalFlex/assets/products.json
  37. +16 −0 PayPalFlex/cancel.php
  38. +16 −0 PayPalFlex/close.php
  39. +3 −0  PayPalFlex/getPaymentStatus.php
  40. +98 −0 PayPalFlex/ppNVP/APIError.php
  41. +116 −0 PayPalFlex/ppNVP/CallerService.php
  42. +79 −0 PayPalFlex/ppNVP/DoAuthorization.php
  43. +113 −0 PayPalFlex/ppNVP/DoAuthorizationReceipt.php
  44. +103 −0 PayPalFlex/ppNVP/DoCapture.php
  45. +115 −0 PayPalFlex/ppNVP/DoCaptureReceipt.php
  46. +262 −0 PayPalFlex/ppNVP/DoDirectPayment.php
  47. +119 −0 PayPalFlex/ppNVP/DoDirectPaymentReceipt.php
  48. +85 −0 PayPalFlex/ppNVP/DoExpressCheckoutPayment.php
  49. +63 −0 PayPalFlex/ppNVP/DoReauthorization.html
  50. +109 −0 PayPalFlex/ppNVP/DoReauthorizationReceipt.php
  51. +61 −0 PayPalFlex/ppNVP/DoVoid.php
  52. +85 −0 PayPalFlex/ppNVP/DoVoidReceipt.php
  53. +24 −0 PayPalFlex/ppNVP/GetBalance.php
  54. +67 −0 PayPalFlex/ppNVP/GetBalanceReceipt.php
  55. +110 −0 PayPalFlex/ppNVP/GetExpressCheckoutDetails.php
  56. +46 −0 PayPalFlex/ppNVP/GetTransactionDetails.html
  57. +139 −0 PayPalFlex/ppNVP/MassPay.html
  58. +95 −0 PayPalFlex/ppNVP/MassPayReceipt.php
  59. +525 −0 PayPalFlex/ppNVP/README.html
  60. +92 −0 PayPalFlex/ppNVP/RefundReceipt.php
  61. +98 −0 PayPalFlex/ppNVP/RefundTransaction.php
  62. +143 −0 PayPalFlex/ppNVP/ReviewOrder.php
  63. +74 −0 PayPalFlex/ppNVP/SetExpressCheckout.php
  64. +134 −0 PayPalFlex/ppNVP/TransactionDetails.php
  65. +92 −0 PayPalFlex/ppNVP/TransactionSearch.php
  66. +148 −0 PayPalFlex/ppNVP/TransactionSearchResults.php
  67. +82 −0 PayPalFlex/ppNVP/constants.php
  68. +105 −0 PayPalFlex/ppNVP/index.html
  69. +114 −0 PayPalFlex/ppNVP/sdk.css
  70. +145 −0 PayPalFlex/startPaymentFlex.php
  71. +27 −0 README
View
64 FlexShopper/.actionScriptProperties
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<actionScriptProperties analytics="false" mainApplicationPath="FlexShopper.mxml" projectUUID="925ed27d-26e8-4024-ba88-256e48ceede8" version="10">
+ <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderLocation="/Applications/XAMPP/xamppfiles/htdocs/paypal/FlexShopper" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+ <compilerSourcePath/>
+ <libraryPath defaultLinkType="0">
+ <libraryPathEntry kind="4" path="">
+ <excludedEntries>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/advancedgrids.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_air.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airspark.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/netmon.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/mx/mx.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/applicationupdater.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/utilities.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/core.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/applicationupdater_ui.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airframework.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
+ </excludedEntries>
+ </libraryPathEntry>
+ <libraryPathEntry kind="1" linkType="1" path="libs"/>
+ <libraryPathEntry kind="1" linkType="1" path="${DCD_LIB_LOCATION}"/>
+ <libraryPathEntry kind="1" linkType="1" path="${DCD_LOCALE_LOCATION}"/>
+ <libraryPathEntry kind="3" linkType="1" path="${DCD_FIBER_LOCATION}/fiber.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${DCD_FIBER_LOCALE_LOCATION}/fiber_rb.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${DCD_FIBER_LOCATION}/playerfds.swc" useDefaultLinkType="false"/>
+ </libraryPath>
+ <sourceAttachmentPath/>
+ </compiler>
+ <applications>
+ <application path="FlexShopper.mxml">
+ <airExcludes/>
+ </application>
+ </applications>
+ <modules/>
+ <buildCSSFiles/>
+ <flashCatalyst validateFlashCatalystCompatibility="false"/>
+ <buildTargets>
+ <buildTarget androidSettingsVersion="1" buildTargetName="com.adobe.flexide.multiplatform.android.platform">
+ <multiPlatformSettings enabled="true" includePlatformLibs="false" platformID="com.adobe.flexide.multiplatform.android.platform" version="2"/>
+ <airSettings airCertificatePath="/Users/smaestre/Documents/Adobe Flash Builder 4.5/flashpal.p12" airTimestamp="true" version="1">
+ <airExcludes/>
+ </airSettings>
+ <actionScriptSettings version="1"/>
+ </buildTarget>
+ <buildTarget buildTargetName="default">
+ <multiPlatformSettings enabled="false" includePlatformLibs="false" platformID="default" version="2"/>
+ <airSettings airCertificatePath="" airTimestamp="true" version="1">
+ <airExcludes/>
+ </airSettings>
+ <actionScriptSettings version="1"/>
+ </buildTarget>
+ </buildTargets>
+</actionScriptProperties>
+
View
3  FlexShopper/.flexProperties
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" fmlDataModelLocation=".model/FlexShopper.fml" toolCompile="true" useServerFlexSDK="false" version="2"/>
+
View
17 FlexShopper/.fxpProperties
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<fxpProperties abbreviated="false" authoringTool="Flex Builder" compiles="true" parentProject="925ed27d-26e8-4024-ba88-256e48ceede8" projectUUID="925ed27d-26e8-4024-ba88-256e48ceede8" pureCatalystProject="false" sdkVersion="4.5.0" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8" version="15">
+ <projects/>
+ <src/>
+ <swc>
+ <linked location="sdkPlaceHolder" path="sdkPlaceHolder" position="0" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8"/>
+ <linked location="/libs" path="\libs" position="1" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8"/>
+ <linked location="${DCD_LIB_LOCATION}" path="${DCD_LIB_LOCATION}" position="2" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8"/>
+ <linked location="${DCD_LOCALE_LOCATION}" path="${DCD_LOCALE_LOCATION}" position="3" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8"/>
+ <linked location="${DCD_FIBER_LOCATION}/fiber.swc" path="${DCD_FIBER_LOCATION}/fiber.swc" position="4" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8"/>
+ <linked location="${DCD_FIBER_LOCALE_LOCATION}/fiber_rb.swc" path="${DCD_FIBER_LOCALE_LOCATION}/fiber_rb.swc" position="5" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8"/>
+ <linked location="${DCD_FIBER_LOCATION}/playerfds.swc" path="${DCD_FIBER_LOCATION}/playerfds.swc" position="6" uuid="56d41b8c-756d-4bde-9a48-79d1e8e44ed8"/>
+ </swc>
+ <misc/>
+ <theme/>
+ <mxmlFormattingPrefs groupAttributesByState="true" maxLineWidth="100" mxmlAlignAttributes="true" mxmlAttributeOrder="id,userLabel,includeIn,excludeFrom,visible,x,y,z,left,right,top,bottom,width,height,minWidth,minHeight,maxWidth,maxHeight,label" mxmlKeepAttributeValuesOrganized="true"/>
+</fxpProperties>
View
77 FlexShopper/.model/FlexShopper.fml
@@ -0,0 +1,77 @@
+
+<model xmlns="http://ns.adobe.com/Fiber/1.0">
+ <annotation name="ActionScriptGeneration">
+ <item name="FullyQualifyReferences">true</item>
+ </annotation>
+ <service name="Products">
+ <annotation name="ActionScriptGeneration">
+ <item name="ServiceType">HTTPMultiService</item>
+ <item name="Package">services.products</item>
+ </annotation>
+ <annotation name="ServiceTypeGroup">
+ <item name="ServiceBackendType">HTTPService</item>
+ </annotation>
+ <annotation name="ServiceConfig">
+ <item name="DEFAULT_ENTITY_PACKAGE">valueObjects</item>
+ <item name="LINKED_FILE"></item>
+ </annotation>
+ <function name="getProduct" return-type="Items[]">
+ <annotation name="analyze group">
+ <item name="analyzed">true</item>
+ </annotation>
+ <annotation name="ActionScriptGeneration">
+ <item name="SerializationFilter">com.adobe.serializers.json.JSONSerializationFilter</item>
+ <item name="method">GET</item>
+ <item name="url">http://www.crushitmobile.com/PayPalFlex/assets/products.json</item>
+ </annotation>
+ <annotation name="url group">
+ <item name="completeURL">http://www.crushitmobile.com/PayPalFlex/assets/products.json</item>
+ </annotation>
+ <annotation name="ValidProperties">
+ <item name="propertySpecifier">item</item>
+ </annotation>
+ <annotation name="original signature">
+ <item name="returnType">opaque</item>
+ </annotation>
+ </function>
+ </service>
+ <entity name="Items">
+ <annotation name="EntityProperties">
+ <item name="EntityOriginalName">Items</item>
+ </annotation>
+ <annotation name="service Group">
+ <item name="service">Products</item>
+ </annotation>
+ <annotation name="ServerProperties">
+ <item name="IncludeRemoteClass">nonempty</item>
+ </annotation>
+ <annotation name="getProduct">
+ <item name="propertySpecifier">item</item>
+ </annotation>
+ <annotation name="ActionScriptGeneration">
+ <item name="Package">valueObjects</item>
+ </annotation>
+ <property name="item" type="Item" required="true"/>
+ </entity>
+ <entity name="Item">
+ <annotation name="EntityProperties">
+ <item name="EntityOriginalName">Item</item>
+ </annotation>
+ <annotation name="service Group">
+ <item name="service">Products</item>
+ </annotation>
+ <annotation name="ServerProperties">
+ <item name="IncludeRemoteClass">nonempty</item>
+ </annotation>
+ <annotation name="ActionScriptGeneration">
+ <item name="Package">valueObjects</item>
+ </annotation>
+ <property name="id" type="integer" required="true"/>
+ <property name="desc" type="string" required="true"/>
+ <property name="price" type="double" required="true" default="0"/>
+ <property name="image_url" type="string" required="true"/>
+ <property name="in_stock" type="boolean" required="true"/>
+ <property name="name" type="string" required="true"/>
+ <property name="qty" type="integer" required="true"/>
+ </entity>
+</model>
View
32 FlexShopper/.project
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>FlexShopper</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.adobe.flexbuilder.project.flexbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.adobe.flexbuilder.project.apollobuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.adobe.flexide.project.multiplatform.multiplatformnature</nature>
+ <nature>com.adobe.flexbuilder.project.apollonature</nature>
+ <nature>com.adobe.flexbuilder.project.flexnature</nature>
+ <nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>bin-debug</name>
+ <type>2</type>
+ <location>/Applications/XAMPP/xamppfiles/htdocs/paypal/FlexShopper</location>
+ </link>
+ </linkedResources>
+</projectDescription>
View
3  FlexShopper/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Thu May 12 15:16:25 PDT 2011
+eclipse.preferences.version=1
+encoding/<project>=utf-8
View
251 FlexShopper/src/FlexShopper-app.xml
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<application xmlns="http://ns.adobe.com/air/application/2.6">
+
+<!-- Adobe AIR Application Descriptor File Template.
+
+ Specifies parameters for identifying, installing, and launching AIR applications.
+
+ xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.6
+ The last segment of the namespace specifies the version
+ of the AIR runtime required for this application to run.
+
+ minimumPatchLevel - The minimum patch level of the AIR runtime required to run
+ the application. Optional.
+-->
+
+ <!-- A universally unique application identifier. Must be unique across all AIR applications.
+ Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
+ <id>FlexShopper</id>
+
+ <!-- Used as the filename for the application. Required. -->
+ <filename>FlexShopper</filename>
+
+ <!-- The name that is displayed in the AIR application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <name>Flex Shopper</name>
+
+ <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
+ Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
+ An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
+ <versionNumber>0.0.1</versionNumber>
+
+ <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
+ <!-- <versionLabel></versionLabel> -->
+
+ <!-- Description, displayed in the AIR application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <!-- <description></description> -->
+
+ <!-- Copyright information. Optional -->
+ <!-- <copyright></copyright> -->
+
+ <!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
+ <!-- <publisherID></publisherID> -->
+
+ <!-- Settings for the application's initial window. Required. -->
+ <initialWindow>
+ <!-- The main SWF or HTML file of the application. Required. -->
+ <!-- Note: In Flash Builder, the SWF reference is set automatically. -->
+ <content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
+
+ <!-- The title of the main window. Optional. -->
+ <!-- <title></title> -->
+
+ <!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
+ <!-- <systemChrome></systemChrome> -->
+
+ <!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
+ <!-- <transparent></transparent> -->
+
+ <!-- Whether the window is initially visible. Optional. Default false. -->
+ <!-- <visible></visible> -->
+
+ <!-- Whether the user can minimize the window. Optional. Default true. -->
+ <!-- <minimizable></minimizable> -->
+
+ <!-- Whether the user can maximize the window. Optional. Default true. -->
+ <!-- <maximizable></maximizable> -->
+
+ <!-- Whether the user can resize the window. Optional. Default true. -->
+ <!-- <resizable></resizable> -->
+
+ <!-- The window's initial width in pixels. Optional. -->
+ <!-- <width></width> -->
+
+ <!-- The window's initial height in pixels. Optional. -->
+ <!-- <height></height> -->
+
+ <!-- The window's initial x position. Optional. -->
+ <!-- <x></x> -->
+
+ <!-- The window's initial y position. Optional. -->
+ <!-- <y></y> -->
+
+ <!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
+ <!-- <minSize></minSize> -->
+
+ <!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
+ <!-- <maxSize></maxSize> -->
+
+ <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device -->
+
+ <!-- <aspectRatio></aspectRatio> -->
+
+ <!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false -->
+
+ <!-- <autoOrients></autoOrients> -->
+
+ <!-- Whether the app launches in full screen. Optional. Mobile only. Default false -->
+
+ <!-- <fullScreen></fullScreen> -->
+
+ <!-- The render mode for the app (either auto, cpu, or gpu). Optional. Mobile only. Default auto -->
+
+ <!-- <renderMode></renderMode> -->
+
+ <!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none"). Optional. Defaults "pan." -->
+ <!-- <softKeyboardBehavior></softKeyboardBehavior> -->
+ <autoOrients>false</autoOrients>
+ <fullScreen>true</fullScreen>
+ <visible>true</visible>
+ <softKeyboardBehavior>none</softKeyboardBehavior>
+ </initialWindow>
+
+ <!-- We recommend omitting the supportedProfiles element, -->
+ <!-- which in turn permits your application to be deployed to all -->
+ <!-- devices supported by AIR. If you wish to restrict deployment -->
+ <!-- (i.e., to only mobile devices) then add this element and list -->
+ <!-- only the profiles which your application does support. -->
+ <!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
+
+ <!-- The subpath of the standard default installation location to use. Optional. -->
+ <!-- <installFolder></installFolder> -->
+
+ <!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
+ <!-- <programMenuFolder></programMenuFolder> -->
+
+ <!-- The icon the system uses for the application. For at least one resolution,
+ specify the path to a PNG file included in the AIR package. Optional. -->
+ <!-- <icon>
+ <image16x16></image16x16>
+ <image32x32></image32x32>
+ <image36x36></image36x36>
+ <image48x48></image48x48>
+ <image72x72></image72x72>
+ <image114x114></image114x114>
+ <image128x128></image128x128>
+ </icon> -->
+
+ <!-- Whether the application handles the update when a user double-clicks an update version
+ of the AIR file (true), or the default AIR application installer handles the update (false).
+ Optional. Default false. -->
+ <!-- <customUpdateUI></customUpdateUI> -->
+
+ <!-- Whether the application can be launched when the user clicks a link in a web browser.
+ Optional. Default false. -->
+ <!-- <allowBrowserInvocation></allowBrowserInvocation> -->
+
+ <!-- Listing of file types for which the application can register. Optional. -->
+
+ <!-- <fileTypes> -->
+
+ <!-- Defines one file type. Optional. -->
+ <!-- <fileType> -->
+
+ <!-- The name that the system displays for the registered file type. Required. -->
+ <!-- <name>FlashPal</name> -->
+
+ <!-- The extension to register. Required. -->
+ <!-- <extension>png</extension> -->
+
+ <!-- The description of the file type. Optional. -->
+ <!-- <description></description> -->
+
+ <!-- The MIME content type. -->
+ <!-- <contentType>image/png</contentType> -->
+
+ <!-- The icon to display for the file type. Optional. -->
+ <!-- <icon>
+ <image16x16>assets/icons/16.png</image16x16>
+ <image32x32>assets/icons/32.png</image32x32>
+ <image48x48>assets/icons/48.png</image48x48>
+
+ <image128x128>assets/icons/128.png</image128x128>
+ </icon> -->
+
+ <!-- </fileType> -->
+ <!-- </fileTypes> -->
+
+ <!-- iOS specific capabilities -->
+ <!-- <iPhone> -->
+ <!-- A list of plist key/value pairs to be added to the application Info.plist -->
+ <!-- <InfoAdditions>
+ <![CDATA[
+ <key>UIDeviceFamily</key>
+ <array>
+ <string>1</string>
+ <string>2</string>
+ </array>
+ <key>UIStatusBarStyle</key>
+ <string>UIStatusBarStyleBlackOpaque</string>
+ <key>UIRequiresPersistentWiFi</key>
+ <string>YES</string>
+ ]]>
+ </InfoAdditions> -->
+ <!-- <requestedDisplayResolution></requestedDisplayResolution> -->
+ <!-- </iPhone> -->
+
+ <!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
+ <!--<android>
+ <manifestAdditions>
+ <![CDATA[
+ <manifest android:installLocation="auto">
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+ <uses-configuration android:reqFiveWayNav="true"/>
+ <supports-screens android:normalScreens="true"/>
+ <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
+ <application android:enabled="true">
+ <activity android:excludeFromRecents="false">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+ </manifest>
+ ]]>
+ </manifestAdditions>
+ </android> -->
+ <!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
+
+<android>
+ <manifestAdditions><![CDATA[
+ <manifest android:installLocation="auto">
+ <!--See the Adobe AIR documentation for more information about setting Google Android permissions-->
+ <!--Removing the permission android.permission.INTERNET will have the side effect
+ of preventing you from debugging your application on your device-->
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
+ <!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
+ <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
+ <!--The DISABLE_KEYGUARD and WAKE_LOCK permissions should be toggled together
+ in order to access AIR's SystemIdleMode APIs-->
+ <!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
+ <!--<uses-permission android:name="android.permission.WAKE_LOCK"/>-->
+ <!--<uses-permission android:name="android.permission.CAMERA"/>-->
+ <!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
+ <!--The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions should be toggled
+ together in order to use AIR's NetworkInfo APIs-->
+ <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
+ <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
+ </manifest>
+
+ ]]></manifestAdditions>
+ </android>
+ <icon>
+ <image48x48>assets/icons/48.png</image48x48>
+ <image72x72>assets/icons/72.png</image72x72>
+ </icon>
+</application>
View
24 FlexShopper/src/FlexShopper.mxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ firstView="views.FlexShopperHomeView"
+ applicationDPI="160"
+ xmlns:views="views.*"
+ initialize="init()">
+ <fx:Script>
+ <![CDATA[
+ import valueObjects.Model;
+ private var model:Model = new Model();
+
+ protected function init():void
+ {
+ navigator.firstViewData = model;
+ }
+
+ ]]>
+ </fx:Script>
+ <fx:Declarations>
+ <!-- Place non-visual elements (e.g., services, value objects) here -->
+ </fx:Declarations>
+
+</s:ViewNavigatorApplication>
View
BIN  FlexShopper/src/assets/icons/48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  FlexShopper/src/assets/icons/72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  FlexShopper/src/assets/images/arrow-symbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  FlexShopper/src/assets/images/paypal_checkout_button.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  FlexShopper/src/assets/images/placeholder.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
30 FlexShopper/src/com/PayPalBuyButton.mxml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<s:Skin xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:ai="http://ns.adobe.com/ai/2008" xmlns:mx="library://ns.adobe.com/flex/mx">
+ <s:states>
+ <s:State name="up"/>
+ <s:State name="over"/>
+ <s:State name="down"/>
+ <s:State name="upAndSelected"/>
+ <s:State name="disabled"/>
+ <s:State name="overAndSelected"/>
+ <s:State name="downAndSelected"/>
+ <s:State name="disabledAndSelected"/>
+ </s:states>
+
+ <fx:Metadata>[HostComponent("spark.components.ToggleButton")]</fx:Metadata>
+
+ <s:layout>
+ <s:BasicLayout/>
+ </s:layout>
+ <s:Label x="15" y="15" text="Start PayPal" includeIn="upAndSelected" />
+ <s:BitmapImage includeIn="up" smoothingQuality="high" smooth="true"
+ source="@Embed('/assets/images/paypal_checkout_button.jpg')"
+ id="bitmapimage1" x="1"/>
+
+ <s:Rect includeIn="down,downAndSelected,upAndSelected" height="{bitmapimage1.height}" radiusY="10" width="{bitmapimage1.width}" radiusX="10" id="rect1" alpha="0.37">
+ <s:fill>
+ <s:SolidColor color="0xCCCCCC"/>
+ </s:fill>
+ </s:Rect>
+</s:Skin>
View
116 FlexShopper/src/com/soenkerohde/mobile/StageWebViewUIComponent.as
@@ -0,0 +1,116 @@
+package com.soenkerohde.mobile{
+
+ import flash.display.Stage;
+ import flash.events.ErrorEvent;
+ import flash.events.Event;
+ import flash.events.LocationChangeEvent;
+ import flash.geom.Rectangle;
+ import flash.media.StageWebView;
+
+ import mx.core.UIComponent;
+
+ [Event(name="complete", type="flash.events.Event")]
+ [Event(name="locationChanging", type="flash.events.LocationChangeEvent")]
+ [Event(name="locationChange", type="flash.events.LocationChangeEvent")]
+
+ public class StageWebViewUIComponent extends UIComponent{
+
+ public var yOffset:int = 80;
+
+ protected var myStage:Stage;
+ private var _url:String;
+ private var _text:String;
+
+ private var _stageWebView:StageWebView;
+
+
+ public function get stageWebView():StageWebView{
+ return _stageWebView;
+ }
+
+ public function StageWebViewUIComponent(){
+ addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
+ }
+
+ public function set url(url:String):void{
+ _url = url;
+
+ if(_stageWebView){
+ _stageWebView.loadURL(url);
+ }
+ }
+ public function get url():String{
+ return _url;
+
+ }
+
+ public function set text(text:String):void{
+ _text = text;
+
+ if(_stageWebView){
+ _stageWebView.loadString(text);
+ }
+ }
+
+ public function hide():void{
+ _stageWebView.stage = null;
+ }
+
+ public function show():void{
+ _stageWebView.stage = myStage;
+ }
+
+ public function dispose():void{
+ hide();
+ _stageWebView.dispose();
+ }
+
+ public function cancel():void{
+ hide();
+ _stageWebView.stop();
+ _url = null;
+ }
+
+
+
+ protected function addedToStageHandler(event:Event):void{
+ myStage = event.currentTarget.document.stage;
+ removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
+
+ _stageWebView = new StageWebView();
+ _stageWebView.stage = myStage;
+ _stageWebView.viewPort = new Rectangle(0, yOffset, myStage.fullScreenWidth, myStage.fullScreenHeight - (yOffset ));
+
+ _stageWebView.addEventListener(Event.COMPLETE, completeHandler);
+ _stageWebView.addEventListener(ErrorEvent.ERROR, errorHandler);
+ _stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGING, locationChangingHandler);
+ _stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, locationChangeHandler);
+ if(_url){
+ _stageWebView.loadURL(_url);
+ }else if(_text){
+ _stageWebView.loadString(_text);
+ }
+ }
+
+ protected function completeHandler(event:Event):void
+ {
+ dispatchEvent(event.clone());
+ }
+
+ protected function locationChangingHandler(event:Event):void
+ {
+ dispatchEvent(event.clone());
+ }
+
+ protected function locationChangeHandler(event:Event):void{
+ dispatchEvent(event.clone());
+ }
+
+ protected function errorHandler(event:Event):void
+ {
+ dispatchEvent(event.clone());
+ }
+
+
+ }
+}
View
16 FlexShopper/src/events/ProductEvent.as
@@ -0,0 +1,16 @@
+package events
+{
+ import flash.events.Event;
+
+ import valueObjects.Model;
+
+ public class ProductEvent extends Event
+ {
+ public var productData:Model = new Model();
+ public function ProductEvent(type:String,productData:Model)
+ {
+ super(type);
+ this.productData = productData;
+ }
+ }
+}
View
24 FlexShopper/src/services/products/Products.as
@@ -0,0 +1,24 @@
+/**
+ * This is a generated sub-class of _Products.as and is intended for behavior
+ * customization. This class is only generated when there is no file already present
+ * at its target location. Thus custom behavior that you add here will survive regeneration
+ * of the super-class.
+ **/
+
+package services.products
+{
+
+public class Products extends _Super_Products
+{
+ /**
+ * Override super.init() to provide any initialization customization if needed.
+ */
+ protected override function preInitializeService():void
+ {
+ super.preInitializeService();
+ // Initialization customization goes here
+ }
+
+}
+
+}
View
72 FlexShopper/src/services/products/_Super_Products.as
@@ -0,0 +1,72 @@
+/**
+ * This is a generated class and is not intended for modification. To customize behavior
+ * of this service wrapper you may modify the generated sub-class of this class - Products.as.
+ */
+package services.products
+{
+import com.adobe.fiber.core.model_internal;
+import com.adobe.fiber.services.wrapper.HTTPServiceWrapper;
+import mx.rpc.AbstractOperation;
+import mx.rpc.AsyncToken;
+import mx.rpc.http.HTTPMultiService;
+import mx.rpc.http.Operation;
+import valueObjects.Items;
+
+import com.adobe.serializers.json.JSONSerializationFilter;
+
+[ExcludeClass]
+internal class _Super_Products extends com.adobe.fiber.services.wrapper.HTTPServiceWrapper
+{
+ private static var serializer0:JSONSerializationFilter = new JSONSerializationFilter();
+
+ // Constructor
+ public function _Super_Products()
+ {
+ // initialize service control
+ _serviceControl = new mx.rpc.http.HTTPMultiService();
+ var operations:Array = new Array();
+ var operation:mx.rpc.http.Operation;
+ var argsArray:Array;
+
+ operation = new mx.rpc.http.Operation(null, "getProduct");
+ operation.url = "http://localhost/PayPalFlex/assets/products.json";
+ operation.method = "GET";
+ operation.serializationFilter = serializer0;
+ operation.resultElementType = valueObjects.Items;
+ operations.push(operation);
+
+ _serviceControl.operationList = operations;
+
+
+ preInitializeService();
+ model_internal::initialize();
+ }
+
+ //init initialization routine here, child class to override
+ protected function preInitializeService():void
+ {
+
+ }
+
+
+ /**
+ * This method is a generated wrapper used to call the 'getProduct' operation. It returns an mx.rpc.AsyncToken whose
+ * result property will be populated with the result of the operation when the server response is received.
+ * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
+ * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
+ *
+ * @see mx.rpc.AsyncToken
+ * @see mx.rpc.CallResponder
+ *
+ * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
+ */
+ public function getProduct() : mx.rpc.AsyncToken
+ {
+ var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getProduct");
+ var _internal_token:mx.rpc.AsyncToken = _internal_operation.send() ;
+ return _internal_token;
+ }
+
+}
+
+}
View
51 FlexShopper/src/valueObjects/Item.as
@@ -0,0 +1,51 @@
+/**
+ * This is a generated sub-class of _Item.as and is intended for behavior
+ * customization. This class is only generated when there is no file already present
+ * at its target location. Thus custom behavior that you add here will survive regeneration
+ * of the super-class.
+ *
+ * NOTE: Do not manually modify the RemoteClass mapping unless
+ * your server representation of this class has changed and you've
+ * updated your ActionScriptGeneration,RemoteClass annotation on the
+ * corresponding entity
+ **/
+
+package valueObjects
+{
+
+import com.adobe.fiber.core.model_internal;
+
+public class Item extends _Super_Item
+{
+ /**
+ * DO NOT MODIFY THIS STATIC INITIALIZER - IT IS NECESSARY
+ * FOR PROPERLY SETTING UP THE REMOTE CLASS ALIAS FOR THIS CLASS
+ *
+ **/
+
+ /**
+ * Calling this static function will initialize RemoteClass aliases
+ * for this value object as well as all of the value objects corresponding
+ * to entities associated to this value object's entity.
+ */
+ public static function _initRemoteClassAlias() : void
+ {
+ _Super_Item.model_internal::initRemoteClassAliasSingle(valueObjects.Item);
+ _Super_Item.model_internal::initRemoteClassAliasAllRelated();
+ }
+
+ model_internal static function initRemoteClassAliasSingleChild() : void
+ {
+ _Super_Item.model_internal::initRemoteClassAliasSingle(valueObjects.Item);
+ }
+
+ {
+ _Super_Item.model_internal::initRemoteClassAliasSingle(valueObjects.Item);
+ }
+ /**
+ * END OF DO NOT MODIFY SECTION
+ *
+ **/
+}
+
+}
View
51 FlexShopper/src/valueObjects/Items.as
@@ -0,0 +1,51 @@
+/**
+ * This is a generated sub-class of _Items.as and is intended for behavior
+ * customization. This class is only generated when there is no file already present
+ * at its target location. Thus custom behavior that you add here will survive regeneration
+ * of the super-class.
+ *
+ * NOTE: Do not manually modify the RemoteClass mapping unless
+ * your server representation of this class has changed and you've
+ * updated your ActionScriptGeneration,RemoteClass annotation on the
+ * corresponding entity
+ **/
+
+package valueObjects
+{
+
+import com.adobe.fiber.core.model_internal;
+
+public class Items extends _Super_Items
+{
+ /**
+ * DO NOT MODIFY THIS STATIC INITIALIZER - IT IS NECESSARY
+ * FOR PROPERLY SETTING UP THE REMOTE CLASS ALIAS FOR THIS CLASS
+ *
+ **/
+
+ /**
+ * Calling this static function will initialize RemoteClass aliases
+ * for this value object as well as all of the value objects corresponding
+ * to entities associated to this value object's entity.
+ */
+ public static function _initRemoteClassAlias() : void
+ {
+ _Super_Items.model_internal::initRemoteClassAliasSingle(valueObjects.Items);
+ _Super_Items.model_internal::initRemoteClassAliasAllRelated();
+ }
+
+ model_internal static function initRemoteClassAliasSingleChild() : void
+ {
+ _Super_Items.model_internal::initRemoteClassAliasSingle(valueObjects.Items);
+ }
+
+ {
+ _Super_Items.model_internal::initRemoteClassAliasSingle(valueObjects.Items);
+ }
+ /**
+ * END OF DO NOT MODIFY SECTION
+ *
+ **/
+}
+
+}
View
19 FlexShopper/src/valueObjects/Model.as
@@ -0,0 +1,19 @@
+package valueObjects
+{
+ import mx.collections.ArrayCollection;
+
+ public class Model
+ {
+
+ public var id:String;
+ public var name:String;
+ public var price:String;
+ public var qty:Number;
+ public var item:Item;
+ public var cart:ArrayCollection = new ArrayCollection();
+
+ public function Model()
+ {
+ }
+ }
+}
View
777 FlexShopper/src/valueObjects/_ItemEntityMetadata.as
@@ -0,0 +1,777 @@
+
+/**
+ * This is a generated class and is not intended for modification.
+ */
+package valueObjects
+{
+import com.adobe.fiber.styles.IStyle;
+import com.adobe.fiber.styles.Style;
+import com.adobe.fiber.styles.StyleValidator;
+import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
+import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
+import com.adobe.fiber.valueobjects.IPropertyIterator;
+import mx.events.ValidationResultEvent;
+import com.adobe.fiber.core.model_internal;
+import com.adobe.fiber.valueobjects.IModelType;
+import mx.events.PropertyChangeEvent;
+
+use namespace model_internal;
+
+[ExcludeClass]
+internal class _ItemEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
+{
+ private static var emptyArray:Array = new Array();
+
+ model_internal static var allProperties:Array = new Array("id", "desc", "price", "image_url", "in_stock", "name", "qty");
+ model_internal static var allAssociationProperties:Array = new Array();
+ model_internal static var allRequiredProperties:Array = new Array("id", "desc", "price", "image_url", "in_stock", "name", "qty");
+ model_internal static var allAlwaysAvailableProperties:Array = new Array("id", "desc", "price", "image_url", "in_stock", "name", "qty");
+ model_internal static var guardedProperties:Array = new Array();
+ model_internal static var dataProperties:Array = new Array("id", "desc", "price", "image_url", "in_stock", "name", "qty");
+ model_internal static var sourceProperties:Array = emptyArray
+ model_internal static var nonDerivedProperties:Array = new Array("id", "desc", "price", "image_url", "in_stock", "name", "qty");
+ model_internal static var derivedProperties:Array = new Array();
+ model_internal static var collectionProperties:Array = new Array();
+ model_internal static var collectionBaseMap:Object;
+ model_internal static var entityName:String = "Item";
+ model_internal static var dependentsOnMap:Object;
+ model_internal static var dependedOnServices:Array = new Array();
+ model_internal static var propertyTypeMap:Object;
+
+
+ model_internal var _descIsValid:Boolean;
+ model_internal var _descValidator:com.adobe.fiber.styles.StyleValidator;
+ model_internal var _descIsValidCacheInitialized:Boolean = false;
+ model_internal var _descValidationFailureMessages:Array;
+
+ model_internal var _image_urlIsValid:Boolean;
+ model_internal var _image_urlValidator:com.adobe.fiber.styles.StyleValidator;
+ model_internal var _image_urlIsValidCacheInitialized:Boolean = false;
+ model_internal var _image_urlValidationFailureMessages:Array;
+
+ model_internal var _nameIsValid:Boolean;
+ model_internal var _nameValidator:com.adobe.fiber.styles.StyleValidator;
+ model_internal var _nameIsValidCacheInitialized:Boolean = false;
+ model_internal var _nameValidationFailureMessages:Array;
+
+ model_internal var _instance:_Super_Item;
+ model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();
+
+ public function _ItemEntityMetadata(value : _Super_Item)
+ {
+ // initialize property maps
+ if (model_internal::dependentsOnMap == null)
+ {
+ // dependents map
+ model_internal::dependentsOnMap = new Object();
+ model_internal::dependentsOnMap["id"] = new Array();
+ model_internal::dependentsOnMap["desc"] = new Array();
+ model_internal::dependentsOnMap["price"] = new Array();
+ model_internal::dependentsOnMap["image_url"] = new Array();
+ model_internal::dependentsOnMap["in_stock"] = new Array();
+ model_internal::dependentsOnMap["name"] = new Array();
+ model_internal::dependentsOnMap["qty"] = new Array();
+
+ // collection base map
+ model_internal::collectionBaseMap = new Object();
+ }
+
+ // Property type Map
+ model_internal::propertyTypeMap = new Object();
+ model_internal::propertyTypeMap["id"] = "int";
+ model_internal::propertyTypeMap["desc"] = "String";
+ model_internal::propertyTypeMap["price"] = "Number";
+ model_internal::propertyTypeMap["image_url"] = "String";
+ model_internal::propertyTypeMap["in_stock"] = "Boolean";
+ model_internal::propertyTypeMap["name"] = "String";
+ model_internal::propertyTypeMap["qty"] = "int";
+
+ model_internal::_instance = value;
+ model_internal::_descValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForDesc);
+ model_internal::_descValidator.required = true;
+ model_internal::_descValidator.requiredFieldError = "desc is required";
+ //model_internal::_descValidator.source = model_internal::_instance;
+ //model_internal::_descValidator.property = "desc";
+ model_internal::_image_urlValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForImage_url);
+ model_internal::_image_urlValidator.required = true;
+ model_internal::_image_urlValidator.requiredFieldError = "image_url is required";
+ //model_internal::_image_urlValidator.source = model_internal::_instance;
+ //model_internal::_image_urlValidator.property = "image_url";
+ model_internal::_nameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForName);
+ model_internal::_nameValidator.required = true;
+ model_internal::_nameValidator.requiredFieldError = "name is required";
+ //model_internal::_nameValidator.source = model_internal::_instance;
+ //model_internal::_nameValidator.property = "name";
+ }
+
+ override public function getEntityName():String
+ {
+ return model_internal::entityName;
+ }
+
+ override public function getProperties():Array
+ {
+ return model_internal::allProperties;
+ }
+
+ override public function getAssociationProperties():Array
+ {
+ return model_internal::allAssociationProperties;
+ }
+
+ override public function getRequiredProperties():Array
+ {
+ return model_internal::allRequiredProperties;
+ }
+
+ override public function getDataProperties():Array
+ {
+ return model_internal::dataProperties;
+ }
+
+ public function getSourceProperties():Array
+ {
+ return model_internal::sourceProperties;
+ }
+
+ public function getNonDerivedProperties():Array
+ {
+ return model_internal::nonDerivedProperties;
+ }
+
+ override public function getGuardedProperties():Array
+ {
+ return model_internal::guardedProperties;
+ }
+
+ override public function getUnguardedProperties():Array
+ {
+ return model_internal::allAlwaysAvailableProperties;
+ }
+
+ override public function getDependants(propertyName:String):Array
+ {
+ if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
+ throw new Error(propertyName + " is not a data property of entity Item");
+
+ return model_internal::dependentsOnMap[propertyName] as Array;
+ }
+
+ override public function getDependedOnServices():Array
+ {
+ return model_internal::dependedOnServices;
+ }
+
+ override public function getCollectionProperties():Array
+ {
+ return model_internal::collectionProperties;
+ }
+
+ override public function getCollectionBase(propertyName:String):String
+ {
+ if (model_internal::collectionProperties.indexOf(propertyName) == -1)
+ throw new Error(propertyName + " is not a collection property of entity Item");
+
+ return model_internal::collectionBaseMap[propertyName];
+ }
+
+ override public function getPropertyType(propertyName:String):String
+ {
+ if (model_internal::allProperties.indexOf(propertyName) == -1)
+ throw new Error(propertyName + " is not a property of Item");
+
+ return model_internal::propertyTypeMap[propertyName];
+ }
+
+ override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
+ {
+ return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
+ }
+
+ override public function getValue(propertyName:String):*
+ {
+ if (model_internal::allProperties.indexOf(propertyName) == -1)
+ {
+ throw new Error(propertyName + " does not exist for entity Item");
+ }
+
+ return model_internal::_instance[propertyName];
+ }
+
+ override public function setValue(propertyName:String, value:*):void
+ {
+ if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
+ {
+ throw new Error(propertyName + " is not a modifiable property of entity Item");
+ }
+
+ model_internal::_instance[propertyName] = value;
+ }
+
+ override public function getMappedByProperty(associationProperty:String):String
+ {
+ switch(associationProperty)
+ {
+ default:
+ {
+ return null;
+ }
+ }
+ }
+
+ override public function getPropertyLength(propertyName:String):int
+ {
+ switch(propertyName)
+ {
+ default:
+ {
+ return 0;
+ }
+ }
+ }
+
+ override public function isAvailable(propertyName:String):Boolean
+ {
+ if (model_internal::allProperties.indexOf(propertyName) == -1)
+ {
+ throw new Error(propertyName + " does not exist for entity Item");
+ }
+
+ if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
+ {
+ return true;
+ }
+
+ switch(propertyName)
+ {
+ default:
+ {
+ return true;
+ }
+ }
+ }
+
+ override public function getIdentityMap():Object
+ {
+ var returnMap:Object = new Object();
+
+ return returnMap;
+ }
+
+ [Bindable(event="propertyChange")]
+ override public function get invalidConstraints():Array
+ {
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ return model_internal::_instance.model_internal::_invalidConstraints;
+ }
+ else
+ {
+ // recalculate isValid
+ model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
+ return model_internal::_instance.model_internal::_invalidConstraints;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ override public function get validationFailureMessages():Array
+ {
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ return model_internal::_instance.model_internal::_validationFailureMessages;
+ }
+ else
+ {
+ // recalculate isValid
+ model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
+ return model_internal::_instance.model_internal::_validationFailureMessages;
+ }
+ }
+
+ override public function getDependantInvalidConstraints(propertyName:String):Array
+ {
+ var dependants:Array = getDependants(propertyName);
+ if (dependants.length == 0)
+ {
+ return emptyArray;
+ }
+
+ var currentlyInvalid:Array = invalidConstraints;
+ if (currentlyInvalid.length == 0)
+ {
+ return emptyArray;
+ }
+
+ var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
+ {
+ return dependants.indexOf(element) > -1;
+ }
+
+ return currentlyInvalid.filter(filterFunc);
+ }
+
+ /**
+ * isValid
+ */
+ [Bindable(event="propertyChange")]
+ public function get isValid() : Boolean
+ {
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ return model_internal::_instance.model_internal::_isValid;
+ }
+ else
+ {
+ // recalculate isValid
+ model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
+ return model_internal::_instance.model_internal::_isValid;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isIdAvailable():Boolean
+ {
+ return true;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isDescAvailable():Boolean
+ {
+ return true;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isPriceAvailable():Boolean
+ {
+ return true;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isImage_urlAvailable():Boolean
+ {
+ return true;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isIn_stockAvailable():Boolean
+ {
+ return true;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isNameAvailable():Boolean
+ {
+ return true;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isQtyAvailable():Boolean
+ {
+ return true;
+ }
+
+
+ /**
+ * derived property recalculation
+ */
+ public function invalidateDependentOnDesc():void
+ {
+ if (model_internal::_descIsValidCacheInitialized )
+ {
+ model_internal::_instance.model_internal::_doValidationCacheOfDesc = null;
+ model_internal::calculateDescIsValid();
+ }
+ }
+ public function invalidateDependentOnImage_url():void
+ {
+ if (model_internal::_image_urlIsValidCacheInitialized )
+ {
+ model_internal::_instance.model_internal::_doValidationCacheOfImage_url = null;
+ model_internal::calculateImage_urlIsValid();
+ }
+ }
+ public function invalidateDependentOnName():void
+ {
+ if (model_internal::_nameIsValidCacheInitialized )
+ {
+ model_internal::_instance.model_internal::_doValidationCacheOfName = null;
+ model_internal::calculateNameIsValid();
+ }
+ }
+
+ model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
+ {
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get idStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get descStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+ public function get descValidator() : StyleValidator
+ {
+ return model_internal::_descValidator;
+ }
+
+ model_internal function set _descIsValid_der(value:Boolean):void
+ {
+ var oldValue:Boolean = model_internal::_descIsValid;
+ if (oldValue !== value)
+ {
+ model_internal::_descIsValid = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "descIsValid", oldValue, value));
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get descIsValid():Boolean
+ {
+ if (!model_internal::_descIsValidCacheInitialized)
+ {
+ model_internal::calculateDescIsValid();
+ }
+
+ return model_internal::_descIsValid;
+ }
+
+ model_internal function calculateDescIsValid():void
+ {
+ var valRes:ValidationResultEvent = model_internal::_descValidator.validate(model_internal::_instance.desc)
+ model_internal::_descIsValid_der = (valRes.results == null);
+ model_internal::_descIsValidCacheInitialized = true;
+ if (valRes.results == null)
+ model_internal::descValidationFailureMessages_der = emptyArray;
+ else
+ {
+ var _valFailures:Array = new Array();
+ for (var a:int = 0 ; a<valRes.results.length ; a++)
+ {
+ _valFailures.push(valRes.results[a].errorMessage);
+ }
+ model_internal::descValidationFailureMessages_der = _valFailures;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get descValidationFailureMessages():Array
+ {
+ if (model_internal::_descValidationFailureMessages == null)
+ model_internal::calculateDescIsValid();
+
+ return _descValidationFailureMessages;
+ }
+
+ model_internal function set descValidationFailureMessages_der(value:Array) : void
+ {
+ var oldValue:Array = model_internal::_descValidationFailureMessages;
+
+ var needUpdate : Boolean = false;
+ if (oldValue == null)
+ needUpdate = true;
+
+ // avoid firing the event when old and new value are different empty arrays
+ if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
+ {
+ if (oldValue.length == value.length)
+ {
+ for (var a:int=0; a < oldValue.length; a++)
+ {
+ if (oldValue[a] !== value[a])
+ {
+ needUpdate = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ needUpdate = true;
+ }
+ }
+
+ if (needUpdate)
+ {
+ model_internal::_descValidationFailureMessages = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "descValidationFailureMessages", oldValue, value));
+ // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
+ // the entire entity.
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
+ }
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get priceStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get image_urlStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+ public function get image_urlValidator() : StyleValidator
+ {
+ return model_internal::_image_urlValidator;
+ }
+
+ model_internal function set _image_urlIsValid_der(value:Boolean):void
+ {
+ var oldValue:Boolean = model_internal::_image_urlIsValid;
+ if (oldValue !== value)
+ {
+ model_internal::_image_urlIsValid = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "image_urlIsValid", oldValue, value));
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get image_urlIsValid():Boolean
+ {
+ if (!model_internal::_image_urlIsValidCacheInitialized)
+ {
+ model_internal::calculateImage_urlIsValid();
+ }
+
+ return model_internal::_image_urlIsValid;
+ }
+
+ model_internal function calculateImage_urlIsValid():void
+ {
+ var valRes:ValidationResultEvent = model_internal::_image_urlValidator.validate(model_internal::_instance.image_url)
+ model_internal::_image_urlIsValid_der = (valRes.results == null);
+ model_internal::_image_urlIsValidCacheInitialized = true;
+ if (valRes.results == null)
+ model_internal::image_urlValidationFailureMessages_der = emptyArray;
+ else
+ {
+ var _valFailures:Array = new Array();
+ for (var a:int = 0 ; a<valRes.results.length ; a++)
+ {
+ _valFailures.push(valRes.results[a].errorMessage);
+ }
+ model_internal::image_urlValidationFailureMessages_der = _valFailures;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get image_urlValidationFailureMessages():Array
+ {
+ if (model_internal::_image_urlValidationFailureMessages == null)
+ model_internal::calculateImage_urlIsValid();
+
+ return _image_urlValidationFailureMessages;
+ }
+
+ model_internal function set image_urlValidationFailureMessages_der(value:Array) : void
+ {
+ var oldValue:Array = model_internal::_image_urlValidationFailureMessages;
+
+ var needUpdate : Boolean = false;
+ if (oldValue == null)
+ needUpdate = true;
+
+ // avoid firing the event when old and new value are different empty arrays
+ if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
+ {
+ if (oldValue.length == value.length)
+ {
+ for (var a:int=0; a < oldValue.length; a++)
+ {
+ if (oldValue[a] !== value[a])
+ {
+ needUpdate = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ needUpdate = true;
+ }
+ }
+
+ if (needUpdate)
+ {
+ model_internal::_image_urlValidationFailureMessages = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "image_urlValidationFailureMessages", oldValue, value));
+ // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
+ // the entire entity.
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
+ }
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get in_stockStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get nameStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+ public function get nameValidator() : StyleValidator
+ {
+ return model_internal::_nameValidator;
+ }
+
+ model_internal function set _nameIsValid_der(value:Boolean):void
+ {
+ var oldValue:Boolean = model_internal::_nameIsValid;
+ if (oldValue !== value)
+ {
+ model_internal::_nameIsValid = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "nameIsValid", oldValue, value));
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get nameIsValid():Boolean
+ {
+ if (!model_internal::_nameIsValidCacheInitialized)
+ {
+ model_internal::calculateNameIsValid();
+ }
+
+ return model_internal::_nameIsValid;
+ }
+
+ model_internal function calculateNameIsValid():void
+ {
+ var valRes:ValidationResultEvent = model_internal::_nameValidator.validate(model_internal::_instance.name)
+ model_internal::_nameIsValid_der = (valRes.results == null);
+ model_internal::_nameIsValidCacheInitialized = true;
+ if (valRes.results == null)
+ model_internal::nameValidationFailureMessages_der = emptyArray;
+ else
+ {
+ var _valFailures:Array = new Array();
+ for (var a:int = 0 ; a<valRes.results.length ; a++)
+ {
+ _valFailures.push(valRes.results[a].errorMessage);
+ }
+ model_internal::nameValidationFailureMessages_der = _valFailures;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get nameValidationFailureMessages():Array
+ {
+ if (model_internal::_nameValidationFailureMessages == null)
+ model_internal::calculateNameIsValid();
+
+ return _nameValidationFailureMessages;
+ }
+
+ model_internal function set nameValidationFailureMessages_der(value:Array) : void
+ {
+ var oldValue:Array = model_internal::_nameValidationFailureMessages;
+
+ var needUpdate : Boolean = false;
+ if (oldValue == null)
+ needUpdate = true;
+
+ // avoid firing the event when old and new value are different empty arrays
+ if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
+ {
+ if (oldValue.length == value.length)
+ {
+ for (var a:int=0; a < oldValue.length; a++)
+ {
+ if (oldValue[a] !== value[a])
+ {
+ needUpdate = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ needUpdate = true;
+ }
+ }
+
+ if (needUpdate)
+ {
+ model_internal::_nameValidationFailureMessages = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "nameValidationFailureMessages", oldValue, value));
+ // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
+ // the entire entity.
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
+ }
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get qtyStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+
+ /**
+ *
+ * @inheritDoc
+ */
+ override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
+ {
+ switch(propertyName)
+ {
+ default:
+ {
+ return null;
+ }
+ }
+ }
+
+ /**
+ *
+ * @inheritDoc
+ *
+ */
+ override public function getPropertyValidationFailureMessages(propertyName:String):Array
+ {
+ switch(propertyName)
+ {
+ case("desc"):
+ {
+ return descValidationFailureMessages;
+ }
+ case("image_url"):
+ {
+ return image_urlValidationFailureMessages;
+ }
+ case("name"):
+ {
+ return nameValidationFailureMessages;
+ }
+ default:
+ {
+ return emptyArray;
+ }
+ }
+ }
+
+}
+
+}
View
462 FlexShopper/src/valueObjects/_ItemsEntityMetadata.as
@@ -0,0 +1,462 @@
+
+/**
+ * This is a generated class and is not intended for modification.
+ */
+package valueObjects
+{
+import com.adobe.fiber.styles.IStyle;
+import com.adobe.fiber.styles.Style;
+import com.adobe.fiber.styles.StyleValidator;
+import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
+import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
+import com.adobe.fiber.valueobjects.IPropertyIterator;
+import mx.events.ValidationResultEvent;
+import valueObjects.Item;
+import com.adobe.fiber.core.model_internal;
+import com.adobe.fiber.valueobjects.IModelType;
+import mx.events.PropertyChangeEvent;
+
+use namespace model_internal;
+
+[ExcludeClass]
+internal class _ItemsEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
+{
+ private static var emptyArray:Array = new Array();
+
+ model_internal static var allProperties:Array = new Array("item");
+ model_internal static var allAssociationProperties:Array = new Array();
+ model_internal static var allRequiredProperties:Array = new Array("item");
+ model_internal static var allAlwaysAvailableProperties:Array = new Array("item");
+ model_internal static var guardedProperties:Array = new Array();
+ model_internal static var dataProperties:Array = new Array("item");
+ model_internal static var sourceProperties:Array = emptyArray
+ model_internal static var nonDerivedProperties:Array = new Array("item");
+ model_internal static var derivedProperties:Array = new Array();
+ model_internal static var collectionProperties:Array = new Array();
+ model_internal static var collectionBaseMap:Object;
+ model_internal static var entityName:String = "Items";
+ model_internal static var dependentsOnMap:Object;
+ model_internal static var dependedOnServices:Array = new Array();
+ model_internal static var propertyTypeMap:Object;
+
+
+ model_internal var _itemIsValid:Boolean;
+ model_internal var _itemValidator:com.adobe.fiber.styles.StyleValidator;
+ model_internal var _itemIsValidCacheInitialized:Boolean = false;
+ model_internal var _itemValidationFailureMessages:Array;
+
+ model_internal var _instance:_Super_Items;
+ model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();
+
+ public function _ItemsEntityMetadata(value : _Super_Items)
+ {
+ // initialize property maps
+ if (model_internal::dependentsOnMap == null)
+ {
+ // dependents map
+ model_internal::dependentsOnMap = new Object();
+ model_internal::dependentsOnMap["item"] = new Array();
+
+ // collection base map
+ model_internal::collectionBaseMap = new Object();
+ }
+
+ // Property type Map
+ model_internal::propertyTypeMap = new Object();
+ model_internal::propertyTypeMap["item"] = "valueObjects.Item";
+
+ model_internal::_instance = value;
+ model_internal::_itemValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForItem);
+ model_internal::_itemValidator.required = true;
+ model_internal::_itemValidator.requiredFieldError = "item is required";
+ //model_internal::_itemValidator.source = model_internal::_instance;
+ //model_internal::_itemValidator.property = "item";
+ }
+
+ override public function getEntityName():String
+ {
+ return model_internal::entityName;
+ }
+
+ override public function getProperties():Array
+ {
+ return model_internal::allProperties;
+ }
+
+ override public function getAssociationProperties():Array
+ {
+ return model_internal::allAssociationProperties;
+ }
+
+ override public function getRequiredProperties():Array
+ {
+ return model_internal::allRequiredProperties;
+ }
+
+ override public function getDataProperties():Array
+ {
+ return model_internal::dataProperties;
+ }
+
+ public function getSourceProperties():Array
+ {
+ return model_internal::sourceProperties;
+ }
+
+ public function getNonDerivedProperties():Array
+ {
+ return model_internal::nonDerivedProperties;
+ }
+
+ override public function getGuardedProperties():Array
+ {
+ return model_internal::guardedProperties;
+ }
+
+ override public function getUnguardedProperties():Array
+ {
+ return model_internal::allAlwaysAvailableProperties;
+ }
+
+ override public function getDependants(propertyName:String):Array
+ {
+ if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
+ throw new Error(propertyName + " is not a data property of entity Items");
+
+ return model_internal::dependentsOnMap[propertyName] as Array;
+ }
+
+ override public function getDependedOnServices():Array
+ {
+ return model_internal::dependedOnServices;
+ }
+
+ override public function getCollectionProperties():Array
+ {
+ return model_internal::collectionProperties;
+ }
+
+ override public function getCollectionBase(propertyName:String):String
+ {
+ if (model_internal::collectionProperties.indexOf(propertyName) == -1)
+ throw new Error(propertyName + " is not a collection property of entity Items");
+
+ return model_internal::collectionBaseMap[propertyName];
+ }
+
+ override public function getPropertyType(propertyName:String):String
+ {
+ if (model_internal::allProperties.indexOf(propertyName) == -1)
+ throw new Error(propertyName + " is not a property of Items");
+
+ return model_internal::propertyTypeMap[propertyName];
+ }
+
+ override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
+ {
+ return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
+ }
+
+ override public function getValue(propertyName:String):*
+ {
+ if (model_internal::allProperties.indexOf(propertyName) == -1)
+ {
+ throw new Error(propertyName + " does not exist for entity Items");
+ }
+
+ return model_internal::_instance[propertyName];
+ }
+
+ override public function setValue(propertyName:String, value:*):void
+ {
+ if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
+ {
+ throw new Error(propertyName + " is not a modifiable property of entity Items");
+ }
+
+ model_internal::_instance[propertyName] = value;
+ }
+
+ override public function getMappedByProperty(associationProperty:String):String
+ {
+ switch(associationProperty)
+ {
+ default:
+ {
+ return null;
+ }
+ }
+ }
+
+ override public function getPropertyLength(propertyName:String):int
+ {
+ switch(propertyName)
+ {
+ default:
+ {
+ return 0;
+ }
+ }
+ }
+
+ override public function isAvailable(propertyName:String):Boolean
+ {
+ if (model_internal::allProperties.indexOf(propertyName) == -1)
+ {
+ throw new Error(propertyName + " does not exist for entity Items");
+ }
+
+ if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
+ {
+ return true;
+ }
+
+ switch(propertyName)
+ {
+ default:
+ {
+ return true;
+ }
+ }
+ }
+
+ override public function getIdentityMap():Object
+ {
+ var returnMap:Object = new Object();
+
+ return returnMap;
+ }
+
+ [Bindable(event="propertyChange")]
+ override public function get invalidConstraints():Array
+ {
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ return model_internal::_instance.model_internal::_invalidConstraints;
+ }
+ else
+ {
+ // recalculate isValid
+ model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
+ return model_internal::_instance.model_internal::_invalidConstraints;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ override public function get validationFailureMessages():Array
+ {
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ return model_internal::_instance.model_internal::_validationFailureMessages;
+ }
+ else
+ {
+ // recalculate isValid
+ model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
+ return model_internal::_instance.model_internal::_validationFailureMessages;
+ }
+ }
+
+ override public function getDependantInvalidConstraints(propertyName:String):Array
+ {
+ var dependants:Array = getDependants(propertyName);
+ if (dependants.length == 0)
+ {
+ return emptyArray;
+ }
+
+ var currentlyInvalid:Array = invalidConstraints;
+ if (currentlyInvalid.length == 0)
+ {
+ return emptyArray;
+ }
+
+ var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
+ {
+ return dependants.indexOf(element) > -1;
+ }
+
+ return currentlyInvalid.filter(filterFunc);
+ }
+
+ /**
+ * isValid
+ */
+ [Bindable(event="propertyChange")]
+ public function get isValid() : Boolean
+ {
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ return model_internal::_instance.model_internal::_isValid;
+ }
+ else
+ {
+ // recalculate isValid
+ model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
+ return model_internal::_instance.model_internal::_isValid;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get isItemAvailable():Boolean
+ {
+ return true;
+ }
+
+
+ /**
+ * derived property recalculation
+ */
+ public function invalidateDependentOnItem():void
+ {
+ if (model_internal::_itemIsValidCacheInitialized )
+ {
+ model_internal::_instance.model_internal::_doValidationCacheOfItem = null;
+ model_internal::calculateItemIsValid();
+ }
+ }
+
+ model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
+ {
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get itemStyle():com.adobe.fiber.styles.Style
+ {
+ return model_internal::_nullStyle;
+ }
+
+ public function get itemValidator() : StyleValidator
+ {
+ return model_internal::_itemValidator;
+ }
+
+ model_internal function set _itemIsValid_der(value:Boolean):void
+ {
+ var oldValue:Boolean = model_internal::_itemIsValid;
+ if (oldValue !== value)
+ {
+ model_internal::_itemIsValid = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "itemIsValid", oldValue, value));
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get itemIsValid():Boolean
+ {
+ if (!model_internal::_itemIsValidCacheInitialized)
+ {
+ model_internal::calculateItemIsValid();
+ }
+
+ return model_internal::_itemIsValid;
+ }
+
+ model_internal function calculateItemIsValid():void
+ {
+ var valRes:ValidationResultEvent = model_internal::_itemValidator.validate(model_internal::_instance.item)
+ model_internal::_itemIsValid_der = (valRes.results == null);
+ model_internal::_itemIsValidCacheInitialized = true;
+ if (valRes.results == null)
+ model_internal::itemValidationFailureMessages_der = emptyArray;
+ else
+ {
+ var _valFailures:Array = new Array();
+ for (var a:int = 0 ; a<valRes.results.length ; a++)
+ {
+ _valFailures.push(valRes.results[a].errorMessage);
+ }
+ model_internal::itemValidationFailureMessages_der = _valFailures;
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get itemValidationFailureMessages():Array
+ {
+ if (model_internal::_itemValidationFailureMessages == null)
+ model_internal::calculateItemIsValid();
+
+ return _itemValidationFailureMessages;
+ }
+
+ model_internal function set itemValidationFailureMessages_der(value:Array) : void
+ {
+ var oldValue:Array = model_internal::_itemValidationFailureMessages;
+
+ var needUpdate : Boolean = false;
+ if (oldValue == null)
+ needUpdate = true;
+
+ // avoid firing the event when old and new value are different empty arrays
+ if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
+ {
+ if (oldValue.length == value.length)
+ {
+ for (var a:int=0; a < oldValue.length; a++)
+ {
+ if (oldValue[a] !== value[a])
+ {
+ needUpdate = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ needUpdate = true;
+ }
+ }
+
+ if (needUpdate)
+ {
+ model_internal::_itemValidationFailureMessages = value;
+ this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "itemValidationFailureMessages", oldValue, value));
+ // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
+ // the entire entity.
+ if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
+ {
+ model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
+ }
+ }
+ }
+
+
+ /**
+ *
+ * @inheritDoc
+ */
+ override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
+ {
+ switch(propertyName)
+ {
+ default:
+ {
+ return null;
+ }
+ }
+ }
+
+ /**
+ *
+ * @inheritDoc
+ *
+ */
+ override public function getPropertyValidationFailureMessages(propertyName:String):Array
+ {
+ switch(propertyName)
+ {
+ case("item"):
+ {
+ return itemValidationFailureMessages;
+ }
+ default:
+ {
+ return emptyArray;
+ }
+ }
+ }
+
+}
+
+}
View
435 FlexShopper/src/valueObjects/_Super_Item.as
@@ -0,0 +1,435 @@
+/**
+ * This is a generated class and is not intended for modification. To customize behavior
+ * of this value object you may modify the generated sub-class of this class - Item.as.
+ */
+
+package valueObjects
+{
+import com.adobe.fiber.services.IFiberManagingService;
+import com.adobe.fiber.util.FiberUtils;
+import com.adobe.fiber.valueobjects.IValueObject;
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import mx.binding.utils.ChangeWatcher;
+import mx.collections.ArrayCollection;
+import mx.events.PropertyChangeEvent;
+import mx.validators.ValidationResult;
+
+import flash.net.registerClassAlias;
+import flash.net.getClassByAlias;
+import com.adobe.fiber.core.model_internal;
+import com.adobe.fiber.valueobjects.IPropertyIterator;
+import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
+
+use namespace model_internal;
+
+[ExcludeClass]
+public class _Super_Item extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
+{
+ model_internal static function initRemoteClassAliasSingle(cz:Class) : void
+ {
+ }
+
+ model_internal static function initRemoteClassAliasAllRelated() : void
+ {
+ }
+
+ model_internal var _dminternal_model : _ItemEntityMetadata;
+ model_internal var _changedObjects:mx.collections.ArrayCollection = new ArrayCollection();
+
+ public function getChangedObjects() : Array
+ {
+ _changedObjects.addItemAt(this,0);
+ return _changedObjects.source;
+ }
+
+ public function clearChangedObjects() : void
+ {
+ _changedObjects.removeAll();
+ }
+
+ /**
+ * properties
+ */
+ private var _internal_id : int;
+ private var _internal_desc : String;
+ private var _internal_price : Number = Number(0);
+ private var _internal_image_url : String;
+ private var _internal_in_stock : Boolean;
+ private var _internal_name : String;
+ private var _internal_qty : int;
+
+ private static var emptyArray:Array = new Array();
+
+ // Change this value according to your application's floating-point precision
+ private static var epsilon:Number = 0.0001;
+
+ /**
+ * derived property cache initialization
+ */
+ model_internal var _cacheInitialized_isValid:Boolean = false;
+
+ model_internal var _changeWatcherArray:Array = new Array();
+
+ public function _Super_It