Angular use Jasmine test framework, karma test runner and protractor for e2e tests.
Angular use Jasmine test framework, karma test runner and protractor for e2e tests.
NgModules consolidate components, directives, and pipes into cohesive blocks of functionality such as a feature area, a business domain, a workflow or a collection of related utilities.
This is a note about Angular form based on the official guide in https://angular.io/guide/user-input
This note is based on the official Angular doc in https://angular.io/docs
Angular is a framework consisting of several libraries for building client applications. An Angular application use Angularized markup to write templates, manage templates using component classes, add application logic in services, box components and services in modules, and launch the app by bootstrapping the root module.
There are a couple of things we like to improve on part 1. We want to move the
/src/index.html because it’s also a source code file. We let webpack to inject the build output instead of hardcoding the output in this template file. We also want to extrac the webpack manifest and vendor packages into separate bundles.
This is the first part of a series of tours exploring progressive Web applciation (PWA) deveopmenet using TypeScript and Vue. To fully explore the concepts in both PWA and the develpment experience of TypeScript and Vue, we create everything from scratch except some obvious code/resources copied from
VS is a code editor at its heart. You can open up to three editors side by side.
Vue has optional libraries such as router, validator, http request, state store and more.
There are many pieces in the react ecosystem, either direcly or indirectly needed to build a great web application.
The react boilerplate is a production-ready, well-documented and well-maitained boilerplate for a react project.
This is a study note of Jpa criteria api from resources of http://www.ibm.com/developerworks/java/library/j-typesafejpa/ (all diagram are linked from this site) and the book Pro JPA 2 2nd Edition.
This is a note summurizing the key concepts and practices of QueryDSL. It is based on http://www.querydsl.com/static/querydsl/4.1.3/reference/html_single/ and https://leanpub.com/opinionatedjpa/read.
The GraphQL Java implementation https://github.com/graphql-java/graphql-java is not documented well. Its source code is not documented at all. We have to learn it from its source code.
GraphQL is a query language created by Facebook in 2012. It describes the schema and operations of a hierarchical data model for client-server applications. It is a specification lanuaged describing the type system and interactions between a server application and its clients. It publishes server capabilities with type valication and let client specify the returned data at field-level granularity. GraphQL is rather new and good documents are desired. Here we try to understand and summary the concepts and usage patterns of GraphQL.
This is a study note of the first two parts of the book Express in Action.
This is a study note based on an online book Opinonated JPA.
ase on the the Jayway’s Vue.js 2.0 workshop, this document describes the steps to scaffold a TypeScript Vue project and add more components to create a structure for non-trivial projects.
This is study note based on TypeScript Handbook.
This is a study note of two chapters from the Exploring ES6:
It’s common to extend an e-commerce entity with additional fields. The commercetools uses
Type to define a set of fields for a custom field.
Class and object inheritance are things that confused me for a while. This article is a summary of my reading of Exploring ES6.
Chakram is a framework to test JSON REST endpoint. It use promises and offers a BDD testing style. It is built on node.js, mocha test framework and chai BDD assertion library. It use the request lib to provide comprehensive REST request capaiblities.
In any e-commerce application, the product, product variant and category are core entities that define many features of a Web site. This article describes the product-related design of http://dev.commercetools.com/.
In http://dev.commercetools.com/, a product variant can have a set of prices represented as an array of
Price values. A price is defined with a scope (customer group, channel and country) and/or an optional period (valid from and/or valid to). A price has a regular value and an optional discounted price. When calculate a price, there are two steps: price selection and discount checking.
This is a study notes of https://vuejs.org/v2/guide/. Updated on 03/30/2017.
First we need a set of computers, physic or virtual, to urn K8s, these computers are called node in K8s. Nodes are often organized as a cluster to provide high availability and scalability. In each node there is a kubelet node agent, a kube-proxynetwork proxy and a docker daemon to run one or more pods. In K8s, a pod consists of a set of docker containers. A pod is the minimum management unit to create, run and schedule.
For a cloud-native application, security is a big concern and brings new challenges. Luckily, the “silver bullet”, i.e, the open source software, makes life so easy. This time, it’s Spring security and OAuth2.
理解了logging的目的，那么所有的Tips都不难理解了。当软件变得复杂，尤其是分布式异步并行计算程序比如Cloud Native程序成为主流是，基于IDE单步执行的Debug无法工作。而且多数的bug通常发生在用户现场的生产系统，这时候能够像单步执行那样清晰的给出程序执行各个重要节点的完整状态就非常宝贵。我的经验证明，有了好的application logging，多数的debug工作就变得轻而易举：如果所有的关键步骤的状态数据都有记录，错误的原因也就清楚了。
Python is a dynamic script programming language that has no static type checking. For Python, documentation becomes very important for developers to understand and use Python components such as modules, classes, functions and methods.
In Odoo 8.0,
import openerp and
openerp.cli.main() method to boot the
Odoo backend services.
Odoo starts loading addons when it receives the first HTTP request.
__call__ method of
http.py file, it calls
to load all addons in the specified addon paths.
Odoo makes running a background job easy: simply insert a record
ir.cron table and Odoo will execute it as defined.
ir.cron table is defined in
It has the following columns:
Because most Odoo addons still use old-style field definition.
It is necessary for a developer to understand the old old-style
field definitions. These fields are in
The core Odoo addon for product is called product (“Products & Pricelists”). The followings are features listed in the module description:
A model represents a business entity that is stored in a database.
Fields represent entity properties and the corresponding table
columns in the database. Odoo also uses
fields representing entity relationships.
Odoo 8.0 introduces a new field syntax but keeps the old
syntax for backward compatibility. Here we focus on the
new syntax defined in
Model is the core concept in Odoo. A model is a Python class that represents a business entity and related operations. All Odoo business entities are implemented as models that are stored in a backend PostgreSQL database. Understanding how it works is a must for an Odoo developer.
In Odoo 8.0,
openerp/api.py defines two classes managing
“environments” of a database access for a client request:
Environments class and the
In my application, I need to replace a decorated class method using a new function that performs some actions before and after the replaced method but still keep the same replaced method interface, i.e., taking same input and return the same output. In general programming terms, I implement a decorator pattern for some “decorated” Python methods.
In the [Guide to Odoo Community Association Quality Tools Part 1] (http://www.mindissoftware.com/2014/10/28/guide-Odoo-OCA-QA-tools-part1/), we discussed how to link a GitHub repository with the OCA quality tools to run tests and code coverage. Here we investigate the implementation details of the Odoo test framework and the OCA quality tools.
Odoo 8.0 has a new test framework/platform called runbot. It looks good but is evolving and lack of documents. On the other hand, Odoo Community Association (OCA) has a Maintainer Quality Tools project that helps to ensure the quality of Odoo addons. It can run module unit tests and report test coverage. It uses Travis CI continuous integration service and Coveralls code coverage reporting service. Both are free services for open source projects. Both services support GitHub integration and automatically run test and report results to GitHub projects. This article describe the the setup of these two service for an Odoo addon project.
This article is a follow up of the Guide to boto Amazon MWS Python Package. Here we give a complete example of submitting a product feed.
boto is a Python package for Amazon web service APIs. It makes it easy to use Amazon marketplace web service (MWS) APIs by providing supporting functions such as connection pool, auto-retry, response parsing and iterative calls for extra data. However, there is no document and the Python code is not well commented. Below is an attempt to summarize boto implementation and usage.
Often a custom Odoo module needs some parameters to run. However, [my previous analysis of Odoo’s own implementation] (http://www.mindissoftware.com/2014/10/16/Odoo-Module-configuration-settings/) doesn’t give me an obvious answer on how to implement a configuration function for a custom module. Nonetheless, the analysis helps me to evaluate answers I found online today.
Odoo 8 was released on 09/18/2014. We created a self-contained [Odoo 8.0 Docker image] (https://registry.hub.docker.com/u/yingliu4203/odoo8nightly/) that was installed from [the latest Odoo 8.0 nightly build] (http://nightly.openerp.com/8.0/nightly/deb/). The Docker image building source code is in [a GitHub repository] (https://github.com/YingLiu4203/odoo-v8-nightly-docker).
As a beginner, being able to debug through the Odoo source code is a great learning experience. PyCharm Professional Edition is a wonderful tool to develop/debug Python applications. The following are steps to run/debug Odoo using PyCharm in Ubuntu. Though not officially stated, running Odoo in Windows is not a good idea. I started with a freshly installed Ubuntu 14.04.1 LTS desktop.
The created pull request is https://github.com/odoo/odoo/pull/2303
In Python, a module is a file that contains Python code.
The first time a module is imported, all statements in the module
are executed from top to bottom. The variables, functions, and classes
declared in the module become accessible to other modules. Later imports,
reload(), use the already-imported module without
executing the module code again. The module concept is easy to understand.
A project usually has many modules. A package is a directory that
contains modules and a
__init__.py file. The package concept means
two things in Python:
Odoo Connector (https://github.com/OCA/connector) is a framework used to integrate Odoo with other systems. It makes development of bi-direction data synchronization easier. Among other functions, it hooks into Odoo data model to intercept record creation, update and deletion calls and raise corresponding events that can be subscribed by an integration application. In this blog we look at the implementation details of its event mechanism.
Decorator is widely used in Python programs. As a beginner Python developer, I am curious about the theories and typical uses of a decorator. This blog summarizes what I learned about decorator.
This is the second part of the Open Adademy example. In part one we created a simple module layout. This part demonstrates model relationships, default values and the use of onchange api. All code are listed at the end of this blog. When making a change of an addon code, you may need to re-start Odoo or update the addon or do both.
Once I got Odoo installed from its GitHub source using an installation shell script, I was eager to make a sample custom add-on module work. The installation script can be customized easily to install a fresh Odoo application in Ubuntu from its 8.0 branch source code in GitHub.
It took me some time to add a new user and set a password in shell script. Eventually the code below worked in Ubuntu 14.04.
The following steps are based on [ANDRÉ SCHENKELS’s installation script.] (https://github.com/aschenkels-ictstudio/openerp-install-scripts/blob/master/odoo-v8/ubuntu-14-04/odoo_install.sh) with below changes. Some changes such as local settings are necessary because we starts from a base Ubuntu operating system.
While the previous blog shows an ugly way to create Odoo Docker image from GitHub source code, actually install and run Odoo from a Docker image is very easy.
Install Odoo from GitHub source code is a tedious process as shown in the previous blog
This blog is based on [ANDRÉ SCHENKELS’s post.] (http://www.schenkels.nl/2014/07/install-odoo-v8-0-from-github-ubuntu-14-04-lts-formerly-openerp/) The whole process can be fully automated by download and run [his installation script.] (http://www.schenkels.nl/2014/07/odoo-v8-install-script-github-ubuntu-14-04-lts/)