那些年,我們用 Javascript	
  	
  
   幹了一套	
  POS
          Base	
  on	
  XULRunner	
  
                         	
  
  Rack	
  Lin	
  阿土伯	
  	
  	
  @HDM9	
  	
  V2
about:me
•  ViViPOS	
  Co.,	
  Ltd	
  	
  技術總監	
  
    –  利用 javascript	
  寫 〞收銀機〞(傳統產業,全新感受)	
  
             •  CoCo	
  都可、50嵐、歇腳亭、Yamaha	
  、星聚點KTV……	
  
      	
  
•  PHP	
  /	
  Javascript	
  /	
  Java	
  Programmer	
  (目前移情於
   Scala	
  )	
  
   	
  
•  racklin@gmail.com	
  
•  hSps://twiSer.com/racklin	
  
•  hSp://www.plurk.com/racklin	
  
•  hSps://www.facebook.com/racklin1002	
  
•  hSp://racklin.blogspot.tw/	
  	
  	
  (生小孩後就變癈墟)	
  
NOT	
  Web-­‐Based	
  POS

Standalone	
  Applica.on	
  
Running	
  on	
  Client	
  Terminal	
  
NOT	
  Only	
  POS	
  So[ware

       POS	
  SDK	
  
What	
  is	
  POS
What	
  is	
  POS
What	
  is	
  POS
POS	
  Development
•  Delphi	
  
    –  曾經王者 ,目前依然是	
  
•  Java	
  
    –  	
  非 Windows	
  Soluons	
  首選	
  
    	
  
•  VIVIPOS	
  SDK	
  
    –  Javascript	
  /	
  html	
  /	
  xul	
  	
  	
  	
  based	
  on	
  XULRunner	
  
WHY	
  XULRunner
•    Cross-­‐Pla_orm	
  
•    Update	
  and	
  Packages	
  mechanism	
  
•    XPCOM	
  *	
  
•    Networking	
  *	
  
•    Storage	
  -­‐	
  SQLite	
  interface	
  *	
  
•    Chrome	
  Registraon	
  *	
  
•    Gecko	
  rendering	
  engine	
  
     –  HTML5	
  /	
  CSS3	
  
     –  XBL	
  /	
  XUL	
  /	
  Javascript	
  1.8	
  
     –  XML	
  (XSLT,	
  XMLHSpRequest,	
  DOMParser,	
  etc.)	
  
•  Coding	
  For	
  Fun	
  
Cloc	
  for	
  VIVIPOS	
  SDK
Cloc	
  for	
  VIVIPOS	
  Exts
Coding	
  For	
  Fun	
  ?
•  over	
  100,000	
  lines	
  javascript	
  	
  
•  over	
  300,000	
  lines	
  XUL	
  
WHY	
  NOT	
  blablabla…
•  Before	
  2010	
  
    –  Why	
  not	
  Delphi	
  /	
  VB	
  /	
  Java	
  
•  A[er	
  2010	
  
    –  Why	
  not	
  Nodejs	
  
         •  v0.1.102.zip	
  —	
  2010.07.25,	
  Version	
  0.1.102	
  	
  
    –  Why	
  not	
  Chrome	
  
         •  0.2.149	
  	
  2008.09.08	
  


•  VIVIPOS	
  Start	
  at	
  2008	
  
About	
  VIVIPOS	
  (2008) 	
  
•    Hardware:	
  Via	
  Eden	
  1G	
  512MB	
  Ram	
  	
  
•    OS:	
  Ubuntu	
  Linux	
  8.04	
  
•    DB:	
  SQLite3	
  /	
  JSON	
  
•    XULRunner	
  1.8.1	
  
•    Languages:	
  C(vala)	
  /	
  Javascript	
  	
  
Start	
  Hard	
  Coding	
  ?
POS	
  Applicaon	
  Look	
  Simply…	
  
別急著硬幹!!	
  
          	
  
除非你想 75 天賣掉整個商業模式!!	
  
          	
  
       而不是產品!
Project	
  or	
  Product
•  經常 Branch	
  /	
  Code	
  Generator	
  	
  
                          Customer	
  A

                              Customer	
  B

                              Customer	
  C




•  流行名言:你以為在創新、其實是在代工
Components	
  Based
•  Upstream	
  Core	
  Components	
  	
  
                                       VIVIPOS	
  SDK

                                VIVIECR	
  (POS	
  Main	
  UI)

•  Customizaon	
  
   –  Customer	
  A	
  (	
  SDK	
  +	
  POS	
  +	
  A1	
  +	
  B1	
  +	
  C1	
  ….)	
  
   –  Customer	
  B	
  (	
  SDK	
  	
  +	
  POS	
  +	
  A1	
  +	
  C1	
  +	
  D1	
  …)	
  
   –  Customer	
  C	
  (	
  SDK	
  +	
  POS	
  +	
  A1	
  +	
  E1	
  +	
  F1	
  …)	
  
自給自足,豐衣足食
•  當 POS	
  主流開發是 WinForm	
  /	
  JFrame	
  /	
  
   TForm	
  時,我在 VIM.	
  
•  #1:GREUls	
  and	
  XPCOM	
  	
  
•  #2:GeckoJS	
  
•  #3:SDK	
  and	
  XBLs	
  
VIVIPOS	
  SDK
VIVIPOS	
  SDK




   WT     F	
  !	
  	
  
         Scree           n	
  ?
Gray	
  
老板:

   SDK	
  是嗎!! OK!	
  
那你至少告訴我 SDK	
  怎麼應用!
Hello	
  World
GREUls
•  2007.09	
  Released	
  and	
  open	
  source	
  
•  Object	
  Namespace	
  
•  Charset	
  Conversion	
  
•  Crypto	
  Hash	
  Ulies	
  –	
  md5	
  /	
  sha1	
  /sha256	
  
•  File	
  And	
  Directory	
  IO	
  	
  
•  JSON	
  encode	
  /	
  decode	
  use	
  nave	
  C++	
  
   implemented.	
  
•  Threading	
  –	
  Nave	
  Mul-­‐Threading	
  support	
  
•  XPCOM	
  Helper
GeckoJS
•  MVC	
  Architecture	
  
      –  Dispatcher	
  /	
  Controller	
  
      –  Model	
  –	
  AcveRecord	
  Like	
  and	
  Associa.ons	
  Support	
  
      –  VIVIPOS	
  Query	
  Language	
  (VQL)	
  	
  
•  Database	
  Adapter	
  
      –  SQLite	
  and	
  JSON	
  
•  Configure	
  /	
  Registry	
  System	
  
      –  Preference	
  System	
  
•    Applicaon	
  Scope	
  Session	
  
•    Logging	
  –	
  Log4js	
  !?	
  
•    i18n	
  /	
  l10n	
  
•    Event	
  System	
  –	
  NOT	
  DOM	
  Event
C++	
  XPCOM
•    On-­‐Screen-­‐Display	
  (OSD)	
  
•    DBUS	
  Noficaon	
  
•    Matchbox	
  Virtual	
  Keyboard	
  
•    IO	
  Control	
  
     –  Serial	
  Port	
  /	
  USB	
  	
  
     –  Parallel	
  Port	
  
     –  DIO	
  
     –  GPIO	
  	
  
•  JSLoader	
  
	
  
XBL	
  Components
•  ACL	
  /	
  Config	
  /	
  Session	
  aware	
  containers	
  
•  Data	
  aware	
  UI	
  components	
  
    –  Label	
  	
  
    –  BuSon	
  	
  

    –  BuSons	
  Group	
  
XBL	
  Components
•  Scrollable	
  BuSons	
  Group	
  
XBL	
  Components
•  Tree	
  and	
  scrollable	
  tree	
  
Debug	
  Tools
•    JS	
  Console	
  
•    JS	
  Debuger	
  
•    DOM	
  Inspector	
  
•    SQLite	
  Manager	
  
•    SDK	
  Console	
  #
Start	
  Hard	
  Coding	
  Now	
  ?
Wait!!	
  SDK	
  /	
  Framework	
  were	
  tools,	
  not	
  core	
  values.	
  
Core	
  Values
•  Pla_orm	
  For	
  3rd	
  Party	
  Developers	
  
•  Plugins	
  Anywhere	
  
   –  User	
  Interface	
  /	
  Layouts	
  /	
  Skins	
  
   –  I18n/l10n	
  
   –  Devices	
  
   –  Reports	
  
   –  Promoons	
  Modules	
  
   –  Second	
  Display	
  Modules	
  
   –  Inventory	
  System	
  
Core	
  Values
•  Services	
  Registry	
  
   –  Binding	
  To	
  UI	
  
   –  Binding	
  To	
  Hotkey	
  
   –  Remove	
  Invoke	
  (	
  IPC	
  /	
  Protocol)	
  
•  NO	
  Linux	
  Nave	
  UI	
  
•  Open	
  Source	
  Addons	
  
Reports
•  Reports	
  
   –  CSV	
  –	
  Template	
  Engine	
  
   –  HTML	
  –	
  Template	
  Engine	
  
   –  PDF	
  
       •  Print	
  To	
  PDF	
  By	
  Gecko	
  
             – Export	
  about	
  100	
  pages	
  PDF	
  more	
  than	
  30mins	
  
        •  Print	
  To	
  PDF	
  By	
  WebKit	
  (libwkhtmltox)	
  
             – Export	
  about	
  100	
  pages	
  PDF	
  less	
  than	
  3mins	
  
             – But	
  Buggy	
  –	
  NOT	
  Support	
  thead/tbody/_oot.	
  
Promoon	
  framework
•  Cart	
  is	
  Simple	
  !?	
  
   好的 PM	
  勝過好的 Programmers	
  
   –  二件九折 -­‐>	
  第二件八折	
  -­‐>	
  第三件七折 …..	
  


•  Promoon	
  Modules	
  *	
  
   –  Base	
  Condions	
  
   –  Product	
  Trigger	
  –	
  Plugin-­‐able	
  
   –  Discount	
  Type	
  –	
  Plugin-­‐able	
  
   	
  
VIVIPOS	
  Architecture
                                                                           ECR-­‐like	
  User	
  Interface	
  /	
  Func;ons	
  
                                                                                                                                       APPLICATIONS	
  
                                                                       Clerk	
                     Stock	
                                                                                                           System	
  
                                                                                                                                                    Repor.ng	
                                                                                   Others	
  
                                                                     Opera.ons	
                  Control	
                                                                                                         Func.on	
  


                                                                                                  VIVIPOS	
  APP	
  
                                                                                                  FRAMEWORK	
  
                                        Plug-­‐in	
  /	
  Add-­‐on	
  Manager	
                           Update	
                                              Content	
                                             Message	
               Report	
  
                                  Peripheral	
   UI	
      Func.on	
   Language	
                         Manager	
                                             Manager	
                                             Dispatch	
              Module	
  
                                   Manager	
   Manager	
   Manager	
   Manager	
  
                                                                                                           Window	
                                                 View	
                                           Database	
                Cart	
  
                                  Network	
   Backup	
   Restore	
  
                                                                                   Others	
                Manager	
                                               System	
                                          Interface	
              Module	
  
Add-­‐on	
                        Manager	
   Manager	
   Manager	
  
                                                                                                                                                                                                                                                              	
  	
  	
  	
  	
  	
  	
  	
  Add-­‐on	
  
	
  
                                                                                                                                                                                                                                                              	
  
-­‐	
  Member	
  Management	
  
                                                                                                                                                                                                                                                              	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  Cash	
  Flow	
  Report	
  
-­‐	
  SMS	
  Promo.on	
                                                                             LIBRARIES	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
       VIVIPOS	
  SDK	
           	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  Gi]	
  Card	
  Payment	
  
-­‐	
  Special	
  Discount	
  
                                                                                                                                                                                                                                                              	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  …	
  etc.	
  
-­‐	
  …	
  etc.	
  
                                                         XPCOM	
                                        Network	
                                                                                                                  Core	
  Libraries	
  
                                                                                                                                                                   Database	
  
                                      GPIO	
            Serial	
  IO	
       Parallel	
  IO	
                                                                                                                                    Signature	
  Func.on	
  
                                                                                                            Others	
  

                                                                                                   LINUX	
  BASE	
  
                                          Display	
                                Keypad	
                                                                      Audio	
                                                               Power	
  
                                          Driver	
                                 Driver	
                                                                      Driver	
                                                            Management	
  
                                           USB	
                                   Touch	
                                                                        LAN	
  
                                                                                                                                                                                                                                          Others	
  
                                          Driver	
                                 Driver	
                                                                      Driver	
  
VIVIPOS	
  POS
Binding	
  Service	
  To	
  UI
Binding	
  Service	
  Hotkey
I18n	
  /	
  l10n
VIVIPOS	
  Add-­‐ons	
  For	
  Producon
•  Main	
  POS	
  Add-­‐on	
  	
  -­‐	
  VIVIECR	
  
       –  690	
  pages	
  PDF	
  Manual	
  	
  
       –  En	
  /	
  zhTW	
  /	
  zhCN	
  /	
  Jp	
  /	
  Thai	
  /	
  Fr	
  	
  
•      Taiwan	
  Invoice	
  Add-­‐on	
  
•      Customer	
  Management	
  Add-­‐on	
  
•      Taiwan	
  Receipts	
  Format	
  Add-­‐on	
  
•      Simple	
  Browser	
  
                                                                                      u rc e
•      Second	
  Display	
  Add-­‐on	
  
                                                                        p en 	
  So
	
  
                                                              	
  O
Simple	
  Web	
  Browser	
  Add-­‐on
•  Embedded	
  Firefox	
  browser	
  
•  Gecko	
  1.9.2	
  Engine	
  
   –  HTML5	
  Support	
  
   –  CSS3	
  Support	
  
•  Binding	
  To	
  BuSon	
  
•  Binding	
  To	
  Hotkey	
  
•  Disable	
  Popup	
  Window
DEMO	
  VIVIPOS	
  
                
VIDEO:	
  hSp://youtu.be/-­‐z26mGeynok	
  
  •  Next	
  Page	
  is	
  DEMO	
  Descripon
DEMO	
  Descripon
•  A	
  Producon	
  POS	
  Soluon	
  is	
  combinaon	
  of	
  
   many	
  add-­‐ons	
  not	
  ONE	
  App.	
  
•  Every	
  individual	
  Add-­‐ons	
  CAN	
  online	
  update.	
  
•  Add-­‐on	
  can	
  hook	
  the	
  event	
  and	
  change	
  the	
  
   shopping	
  flow.	
  
•  EX.	
  ONLY	
  ONE	
  Customer	
  Need	
  BEEP	
  when	
  
   product	
  not	
  found	
  !?	
  
   Add	
  a	
  add-­‐on	
  for	
  him,	
  Not	
  add	
  BEEP	
  feature	
  in	
  
   upstream	
  version.
IPC
•  DBUS	
  	
  
•  Javascript	
  implemented	
  HSp	
  server	
  
     –  Binding	
  on	
  localhost:8888	
  
•    Dispatch	
  Command	
  	
  
•    Nofy	
  Observer	
  
•    Session	
  Operaon	
  
•    ...	
  	
  
IPC	
  Samples
•  AddItem	
  To	
  Cart	
  
     –  curl	
  hSp://localhost:8888/dispatch?
        controller=Cart&command=addItemByBarcode&data=123456789	
  
•  Get	
  Current	
  Login	
  Clerk	
  
     –  	
  curl	
  hSp://localhost:8888/session?acon=get&key=user.username	
  
•  Shutdown	
  –	
  Trigger	
  Event/Observe	
  
     –  	
  curl	
  hSp://localhost:8888/observer?topic=shutdown	
  


•  Ex.	
  Installed	
  HelloWorld.xpi	
  
     –  	
  curl	
  hSp://localhost:8888/dispatch?
        controller=Helloworld&command=sayHello&data=Rack	
  
Last	
  Mile	
  of	
  the	
  O2O
•  Add	
  a	
  Protocol	
  Handler,	
  ‘vivipos’	
  scheme.	
  
       –  Proxy	
  to	
  exists	
  JS	
  HSpd	
  Services.	
  


•  Remote/Local	
  Website	
  CAN	
  
       –  Callback	
  VIVIPOS	
  Funcons	
  
       –  Use	
  VIVIPOS	
  Hardwares	
  (	
  Printer	
  /	
  Cash	
  Drawer)	
  
       –  Use	
  VIVIPOS	
  Cart	
  and	
  Promoons	
  
       –  Use	
  VIVIPOS	
  Reports	
  
	
  
VIVIPOS	
  Scheme	
  Samples
•  Remote	
  website	
  HTML	
  
   –  AddItem	
  To	
  Cart	
  
      <a	
  href=“vivipos:dispatch?	
  
      controller=Cart&command=addItemByBarcode&data=123456789”>A
      ddItem</a>	
  
   –  Shutdown	
  –	
  Trigger	
  Event/Observe	
  
      <a	
  href=“vivipos:observer?topic=shutdown”>Shutdown</a>
Open	
  PCHOME24	
  Example
•  Click	
  ACER	
  E1-­‐531	
  Will	
  Add	
  Item	
  to	
  VIVIPOS	
  Cart	
  And	
  Prinng	
  
   Receipt.
What	
  is	
  Online2OffLine
•    線上訂位	
  /	
  線上團購 <>實體消費	
  
•    會員積點 /	
  折扣 	
  
•    線上促銷<>實體促銷	
  
•    線上銷售<>實體銷售	
  
•    消費分析	
  
SDK	
  -­‐	
  Last	
  Mile	
  of	
  O2O
•  Online	
  Services	
  開發者不用重覆造輪子,為
   了整合服務而開發陽春 POS 系統.	
  
   VIVIPOS 是完整的收銀系統且 Open	
  Source	
  
•  除了整合服務,更可開發自己的 POS	
  系統	
  
•  使用您熟悉的平台語言開發 POS	
  	
  
   JAVA	
  /	
  PHP	
  /	
  RAILS	
  /	
  NODEJS	
  ……..	
  	
  
•  可以不需要學習 VIVIPOS	
  SDK.	
  (盡量啦)
3rd	
  Party	
  interes.ng	
  Addons


•  Singapore	
  Bugis	
  Street	
  
     –  NetPayment	
  /	
  EZLinks	
  
•    Microprogram 悠遊卡 and	
  Life+	
  
•    OpenLife	
  
•    24卷 (大陸團購-好像掛了 orz	
  )	
  
•    USA	
  -­‐	
  KIOSK	
  
•    Media	
  Player	
  
About	
  Cloud?
•  Running	
  Web	
  Based	
  Applicaon	
  in	
  Cloud	
  
     –  Yes	
  ,	
  Simple	
  Web	
  Browser	
  with	
  	
  
        HTML5	
  /	
  CSS3	
  Supported	
  
•  Sending	
  Data	
  to	
  Cloud	
  realme	
  
     –  Yes,	
  Using	
  AJAX	
  
•  Packing	
  Data	
  to	
  Cloud	
  when	
  Day-­‐End	
  
     –  YES	
  ,	
  VIVIConnect	
  Add-­‐on	
  support	
  Client-­‐Side	
  ETL	
  to	
  packing	
  
        Databases	
  to	
  your	
  own	
  Back-­‐End	
  Server.	
  
     –  HTTP/HTTPs	
  
     –  FTP	
  
     –  S3	
  
•  Running	
  your	
  own	
  scripts	
  
     –  PHP	
  /	
  Python	
  	
  installed	
  on	
  every	
  VIVIPOS	
  Terminal.	
  
JS	
  Loader
•  Javascript	
  Encoder	
  For	
  3rd	
  party	
  Developer	
  
    –  NOT	
  obfuscator	
  
•  Add	
  Trial	
  Version	
  to	
  your	
  Add-­‐on	
  
•  Add	
  Expire	
  Date	
  to	
  your	
  Add-­‐on	
  
•  Lock	
  your	
  Add-­‐on	
  on	
  a	
  special	
  Terminal	
  
Any	
  Ideas	
  are	
  welcome

         POS	
  or	
  POS
Thank	
  You	
  

Coding	
  For	
  Fun
Resources
•  Slide:	
  	
  
   hSp://goo.gl/TlHKf	
  	
  
•  GREUls:	
  
   hSps://github.com/racklin/greuls	
  
•  XULRunner	
  –	
  MDN	
  
   hSps://developer.mozilla.org/en-­‐US/docs/
   XULRunner	
  

More Related Content

PDF
What Your Jvm Has Been Trying To Tell You
PDF
Quattor
PDF
Enterprise OSGi at eBay
PDF
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
PDF
Flex Continuous Quality Builds Flex & (Ant || Maven)
PDF
Flash Iphone Fitc 2010
PDF
Inside IBM Java 7
PPTX
connmove - Software for SAP and Microsoft
What Your Jvm Has Been Trying To Tell You
Quattor
Enterprise OSGi at eBay
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Flex Continuous Quality Builds Flex & (Ant || Maven)
Flash Iphone Fitc 2010
Inside IBM Java 7
connmove - Software for SAP and Microsoft

What's hot (20)

PDF
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...
PPTX
VMware PEX Boot Camp - VMware View on NetApp: Technical Integration to Drive ...
PDF
02.egovFrame Development Environment training book
PDF
JavaOne 2012 CON3978 Scripting Languages on the JVM
PDF
Lotus Connections Schaalbaarheid En Performance
PDF
JavaOne 2012 CON 3961 Innovative Testing Techniques Using Bytecode Instrument...
PDF
04.egovFrame Runtime Environment Workshop
PDF
Making Portals Cool: The Compelling Advantages of a Portlet Bridge
PDF
We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell
PDF
XS Japan 2008 Xen Mgmt English
PPTX
Collaborative lifecycle development for Mobile Software
PDF
03.eGovFrame Runtime Environment Training Book Supplement
PPTX
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
PDF
Minimizing I/O Latency in Xen-ARM
PDF
z/VSE Connectors Update
PDF
OpenSAF Symposium_Architecture_and_Roadmap_Update9.19.11
PDF
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPages
PDF
BP209 doctors have scalpels, carpenters have hammers, ibm sametime develope...
PDF
Devoxx 2009 Conference session Jbpm4 In Action
PDF
Blue Ruby SDN Webinar
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...
VMware PEX Boot Camp - VMware View on NetApp: Technical Integration to Drive ...
02.egovFrame Development Environment training book
JavaOne 2012 CON3978 Scripting Languages on the JVM
Lotus Connections Schaalbaarheid En Performance
JavaOne 2012 CON 3961 Innovative Testing Techniques Using Bytecode Instrument...
04.egovFrame Runtime Environment Workshop
Making Portals Cool: The Compelling Advantages of a Portlet Bridge
We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell
XS Japan 2008 Xen Mgmt English
Collaborative lifecycle development for Mobile Software
03.eGovFrame Runtime Environment Training Book Supplement
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
Minimizing I/O Latency in Xen-ARM
z/VSE Connectors Update
OpenSAF Symposium_Architecture_and_Roadmap_Update9.19.11
Java: Finding Bugs, Fixing Bugs in IBM Domino Designer and XPages
BP209 doctors have scalpels, carpenters have hammers, ibm sametime develope...
Devoxx 2009 Conference session Jbpm4 In Action
Blue Ruby SDN Webinar
Ad

Similar to Plugin-able POS Solutions by Javascript @HDM9 Taiwan (20)

PDF
21st Century SOA
PDF
21st Century SOA
PDF
What's new in Nuxeo 5.2? - Solutions Linux 2009
PDF
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
PPTX
DevOps, A brief introduction to Vagrant & Ansible
PDF
E g innovations overview
PDF
Puppet devops wdec
PDF
2009 Q2 WSO2 Technical Update
PPTX
Convertigo Mobile Application Development platform for Enterprises
PDF
Know More About Rational Performance - Snehamoy K
PDF
3 know more_about_rational_performance_tester_8-1-snehamoy_k
 
PDF
Operating the Hyperscale Cloud
PDF
Windows Azure Interoperability
PDF
21st Century Service Oriented Architecture
PPTX
InduSoft VBScript Webinar
PPTX
Serverless design with Fn project
PDF
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
PDF
OOW09 Ebs Tuning Final
PDF
Threads Needles Stacks Heaps - Java edition
PDF
Codecoon - A technical Case Study
21st Century SOA
21st Century SOA
What's new in Nuxeo 5.2? - Solutions Linux 2009
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
DevOps, A brief introduction to Vagrant & Ansible
E g innovations overview
Puppet devops wdec
2009 Q2 WSO2 Technical Update
Convertigo Mobile Application Development platform for Enterprises
Know More About Rational Performance - Snehamoy K
3 know more_about_rational_performance_tester_8-1-snehamoy_k
 
Operating the Hyperscale Cloud
Windows Azure Interoperability
21st Century Service Oriented Architecture
InduSoft VBScript Webinar
Serverless design with Fn project
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
OOW09 Ebs Tuning Final
Threads Needles Stacks Heaps - Java edition
Codecoon - A technical Case Study
Ad

Recently uploaded (20)

PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Hybrid model detection and classification of lung cancer
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Architecture types and enterprise applications.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Unlock new opportunities with location data.pdf
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
sustainability-14-14877-v2.pddhzftheheeeee
Web Crawler for Trend Tracking Gen Z Insights.pptx
Taming the Chaos: How to Turn Unstructured Data into Decisions
Benefits of Physical activity for teenagers.pptx
WOOl fibre morphology and structure.pdf for textiles
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Chapter 5: Probability Theory and Statistics
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Assigned Numbers - 2025 - Bluetooth® Document
A novel scalable deep ensemble learning framework for big data classification...
A review of recent deep learning applications in wood surface defect identifi...
Hybrid model detection and classification of lung cancer
O2C Customer Invoices to Receipt V15A.pptx
DP Operators-handbook-extract for the Mautical Institute
A comparative study of natural language inference in Swahili using monolingua...
Architecture types and enterprise applications.pdf
Getting started with AI Agents and Multi-Agent Systems
Unlock new opportunities with location data.pdf
observCloud-Native Containerability and monitoring.pptx
sustainability-14-14877-v2.pddhzftheheeeee

Plugin-able POS Solutions by Javascript @HDM9 Taiwan

  • 1. 那些年,我們用 Javascript     幹了一套  POS Base  on  XULRunner     Rack  Lin  阿土伯      @HDM9    V2
  • 2. about:me •  ViViPOS  Co.,  Ltd    技術總監   –  利用 javascript  寫 〞收銀機〞(傳統產業,全新感受)   •  CoCo  都可、50嵐、歇腳亭、Yamaha  、星聚點KTV……     •  PHP  /  Javascript  /  Java  Programmer  (目前移情於 Scala  )     •  racklin@gmail.com   •  hSps://twiSer.com/racklin   •  hSp://www.plurk.com/racklin   •  hSps://www.facebook.com/racklin1002   •  hSp://racklin.blogspot.tw/      (生小孩後就變癈墟)  
  • 3. NOT  Web-­‐Based  POS Standalone  Applica.on   Running  on  Client  Terminal  
  • 4. NOT  Only  POS  So[ware POS  SDK  
  • 8. POS  Development •  Delphi   –  曾經王者 ,目前依然是   •  Java   –   非 Windows  Soluons  首選     •  VIVIPOS  SDK   –  Javascript  /  html  /  xul        based  on  XULRunner  
  • 9. WHY  XULRunner •  Cross-­‐Pla_orm   •  Update  and  Packages  mechanism   •  XPCOM  *   •  Networking  *   •  Storage  -­‐  SQLite  interface  *   •  Chrome  Registraon  *   •  Gecko  rendering  engine   –  HTML5  /  CSS3   –  XBL  /  XUL  /  Javascript  1.8   –  XML  (XSLT,  XMLHSpRequest,  DOMParser,  etc.)   •  Coding  For  Fun  
  • 12. Coding  For  Fun  ? •  over  100,000  lines  javascript     •  over  300,000  lines  XUL  
  • 13. WHY  NOT  blablabla… •  Before  2010   –  Why  not  Delphi  /  VB  /  Java   •  A[er  2010   –  Why  not  Nodejs   •  v0.1.102.zip  —  2010.07.25,  Version  0.1.102     –  Why  not  Chrome   •  0.2.149    2008.09.08   •  VIVIPOS  Start  at  2008  
  • 14. About  VIVIPOS  (2008)   •  Hardware:  Via  Eden  1G  512MB  Ram     •  OS:  Ubuntu  Linux  8.04   •  DB:  SQLite3  /  JSON   •  XULRunner  1.8.1   •  Languages:  C(vala)  /  Javascript    
  • 15. Start  Hard  Coding  ? POS  Applicaon  Look  Simply…  
  • 16. 別急著硬幹!!     除非你想 75 天賣掉整個商業模式!!     而不是產品!
  • 17. Project  or  Product •  經常 Branch  /  Code  Generator     Customer  A Customer  B Customer  C •  流行名言:你以為在創新、其實是在代工
  • 18. Components  Based •  Upstream  Core  Components     VIVIPOS  SDK VIVIECR  (POS  Main  UI) •  Customizaon   –  Customer  A  (  SDK  +  POS  +  A1  +  B1  +  C1  ….)   –  Customer  B  (  SDK    +  POS  +  A1  +  C1  +  D1  …)   –  Customer  C  (  SDK  +  POS  +  A1  +  E1  +  F1  …)  
  • 19. 自給自足,豐衣足食 •  當 POS  主流開發是 WinForm  /  JFrame  /   TForm  時,我在 VIM.   •  #1:GREUls  and  XPCOM     •  #2:GeckoJS   •  #3:SDK  and  XBLs  
  • 21. VIVIPOS  SDK WT F  !     Scree n  ? Gray  
  • 22. 老板: SDK  是嗎!! OK!   那你至少告訴我 SDK  怎麼應用!
  • 24. GREUls •  2007.09  Released  and  open  source   •  Object  Namespace   •  Charset  Conversion   •  Crypto  Hash  Ulies  –  md5  /  sha1  /sha256   •  File  And  Directory  IO     •  JSON  encode  /  decode  use  nave  C++   implemented.   •  Threading  –  Nave  Mul-­‐Threading  support   •  XPCOM  Helper
  • 25. GeckoJS •  MVC  Architecture   –  Dispatcher  /  Controller   –  Model  –  AcveRecord  Like  and  Associa.ons  Support   –  VIVIPOS  Query  Language  (VQL)     •  Database  Adapter   –  SQLite  and  JSON   •  Configure  /  Registry  System   –  Preference  System   •  Applicaon  Scope  Session   •  Logging  –  Log4js  !?   •  i18n  /  l10n   •  Event  System  –  NOT  DOM  Event
  • 26. C++  XPCOM •  On-­‐Screen-­‐Display  (OSD)   •  DBUS  Noficaon   •  Matchbox  Virtual  Keyboard   •  IO  Control   –  Serial  Port  /  USB     –  Parallel  Port   –  DIO   –  GPIO     •  JSLoader    
  • 27. XBL  Components •  ACL  /  Config  /  Session  aware  containers   •  Data  aware  UI  components   –  Label     –  BuSon     –  BuSons  Group  
  • 28. XBL  Components •  Scrollable  BuSons  Group  
  • 29. XBL  Components •  Tree  and  scrollable  tree  
  • 30. Debug  Tools •  JS  Console   •  JS  Debuger   •  DOM  Inspector   •  SQLite  Manager   •  SDK  Console  #
  • 31. Start  Hard  Coding  Now  ? Wait!!  SDK  /  Framework  were  tools,  not  core  values.  
  • 32. Core  Values •  Pla_orm  For  3rd  Party  Developers   •  Plugins  Anywhere   –  User  Interface  /  Layouts  /  Skins   –  I18n/l10n   –  Devices   –  Reports   –  Promoons  Modules   –  Second  Display  Modules   –  Inventory  System  
  • 33. Core  Values •  Services  Registry   –  Binding  To  UI   –  Binding  To  Hotkey   –  Remove  Invoke  (  IPC  /  Protocol)   •  NO  Linux  Nave  UI   •  Open  Source  Addons  
  • 34. Reports •  Reports   –  CSV  –  Template  Engine   –  HTML  –  Template  Engine   –  PDF   •  Print  To  PDF  By  Gecko   – Export  about  100  pages  PDF  more  than  30mins   •  Print  To  PDF  By  WebKit  (libwkhtmltox)   – Export  about  100  pages  PDF  less  than  3mins   – But  Buggy  –  NOT  Support  thead/tbody/_oot.  
  • 35. Promoon  framework •  Cart  is  Simple  !?   好的 PM  勝過好的 Programmers   –  二件九折 -­‐>  第二件八折  -­‐>  第三件七折 …..   •  Promoon  Modules  *   –  Base  Condions   –  Product  Trigger  –  Plugin-­‐able   –  Discount  Type  –  Plugin-­‐able    
  • 36. VIVIPOS  Architecture ECR-­‐like  User  Interface  /  Func;ons   APPLICATIONS   Clerk   Stock   System   Repor.ng   Others   Opera.ons   Control   Func.on   VIVIPOS  APP   FRAMEWORK   Plug-­‐in  /  Add-­‐on  Manager   Update   Content   Message   Report   Peripheral   UI   Func.on   Language   Manager   Manager   Dispatch   Module   Manager   Manager   Manager   Manager   Window   View   Database   Cart   Network   Backup   Restore   Others   Manager   System   Interface   Module   Add-­‐on   Manager   Manager   Manager                  Add-­‐on       -­‐  Member  Management                  -­‐  Cash  Flow  Report   -­‐  SMS  Promo.on   LIBRARIES                                                         VIVIPOS  SDK                  -­‐  Gi]  Card  Payment   -­‐  Special  Discount                  -­‐  …  etc.   -­‐  …  etc.   XPCOM   Network   Core  Libraries   Database   GPIO   Serial  IO   Parallel  IO   Signature  Func.on   Others   LINUX  BASE   Display   Keypad   Audio   Power   Driver   Driver   Driver   Management   USB   Touch   LAN   Others   Driver   Driver   Driver  
  • 41. VIVIPOS  Add-­‐ons  For  Producon •  Main  POS  Add-­‐on    -­‐  VIVIECR   –  690  pages  PDF  Manual     –  En  /  zhTW  /  zhCN  /  Jp  /  Thai  /  Fr     •  Taiwan  Invoice  Add-­‐on   •  Customer  Management  Add-­‐on   •  Taiwan  Receipts  Format  Add-­‐on   •  Simple  Browser   u rc e •  Second  Display  Add-­‐on   p en  So    O
  • 42. Simple  Web  Browser  Add-­‐on •  Embedded  Firefox  browser   •  Gecko  1.9.2  Engine   –  HTML5  Support   –  CSS3  Support   •  Binding  To  BuSon   •  Binding  To  Hotkey   •  Disable  Popup  Window
  • 43. DEMO  VIVIPOS   VIDEO:  hSp://youtu.be/-­‐z26mGeynok   •  Next  Page  is  DEMO  Descripon
  • 44. DEMO  Descripon •  A  Producon  POS  Soluon  is  combinaon  of   many  add-­‐ons  not  ONE  App.   •  Every  individual  Add-­‐ons  CAN  online  update.   •  Add-­‐on  can  hook  the  event  and  change  the   shopping  flow.   •  EX.  ONLY  ONE  Customer  Need  BEEP  when   product  not  found  !?   Add  a  add-­‐on  for  him,  Not  add  BEEP  feature  in   upstream  version.
  • 45. IPC •  DBUS     •  Javascript  implemented  HSp  server   –  Binding  on  localhost:8888   •  Dispatch  Command     •  Nofy  Observer   •  Session  Operaon   •  ...    
  • 46. IPC  Samples •  AddItem  To  Cart   –  curl  hSp://localhost:8888/dispatch? controller=Cart&command=addItemByBarcode&data=123456789   •  Get  Current  Login  Clerk   –   curl  hSp://localhost:8888/session?acon=get&key=user.username   •  Shutdown  –  Trigger  Event/Observe   –   curl  hSp://localhost:8888/observer?topic=shutdown   •  Ex.  Installed  HelloWorld.xpi   –   curl  hSp://localhost:8888/dispatch? controller=Helloworld&command=sayHello&data=Rack  
  • 47. Last  Mile  of  the  O2O •  Add  a  Protocol  Handler,  ‘vivipos’  scheme.   –  Proxy  to  exists  JS  HSpd  Services.   •  Remote/Local  Website  CAN   –  Callback  VIVIPOS  Funcons   –  Use  VIVIPOS  Hardwares  (  Printer  /  Cash  Drawer)   –  Use  VIVIPOS  Cart  and  Promoons   –  Use  VIVIPOS  Reports    
  • 48. VIVIPOS  Scheme  Samples •  Remote  website  HTML   –  AddItem  To  Cart   <a  href=“vivipos:dispatch?   controller=Cart&command=addItemByBarcode&data=123456789”>A ddItem</a>   –  Shutdown  –  Trigger  Event/Observe   <a  href=“vivipos:observer?topic=shutdown”>Shutdown</a>
  • 49. Open  PCHOME24  Example •  Click  ACER  E1-­‐531  Will  Add  Item  to  VIVIPOS  Cart  And  Prinng   Receipt.
  • 50. What  is  Online2OffLine •  線上訂位  /  線上團購 <>實體消費   •  會員積點 /  折扣   •  線上促銷<>實體促銷   •  線上銷售<>實體銷售   •  消費分析  
  • 51. SDK  -­‐  Last  Mile  of  O2O •  Online  Services  開發者不用重覆造輪子,為 了整合服務而開發陽春 POS 系統.   VIVIPOS 是完整的收銀系統且 Open  Source   •  除了整合服務,更可開發自己的 POS  系統   •  使用您熟悉的平台語言開發 POS     JAVA  /  PHP  /  RAILS  /  NODEJS  ……..     •  可以不需要學習 VIVIPOS  SDK.  (盡量啦)
  • 52. 3rd  Party  interes.ng  Addons •  Singapore  Bugis  Street   –  NetPayment  /  EZLinks   •  Microprogram 悠遊卡 and  Life+   •  OpenLife   •  24卷 (大陸團購-好像掛了 orz  )   •  USA  -­‐  KIOSK   •  Media  Player  
  • 53. About  Cloud? •  Running  Web  Based  Applicaon  in  Cloud   –  Yes  ,  Simple  Web  Browser  with     HTML5  /  CSS3  Supported   •  Sending  Data  to  Cloud  realme   –  Yes,  Using  AJAX   •  Packing  Data  to  Cloud  when  Day-­‐End   –  YES  ,  VIVIConnect  Add-­‐on  support  Client-­‐Side  ETL  to  packing   Databases  to  your  own  Back-­‐End  Server.   –  HTTP/HTTPs   –  FTP   –  S3   •  Running  your  own  scripts   –  PHP  /  Python    installed  on  every  VIVIPOS  Terminal.  
  • 54. JS  Loader •  Javascript  Encoder  For  3rd  party  Developer   –  NOT  obfuscator   •  Add  Trial  Version  to  your  Add-­‐on   •  Add  Expire  Date  to  your  Add-­‐on   •  Lock  your  Add-­‐on  on  a  special  Terminal  
  • 55. Any  Ideas  are  welcome POS  or  POS
  • 56. Thank  You   Coding  For  Fun
  • 57. Resources •  Slide:     hSp://goo.gl/TlHKf     •  GREUls:   hSps://github.com/racklin/greuls   •  XULRunner  –  MDN   hSps://developer.mozilla.org/en-­‐US/docs/ XULRunner