The present invention relates to compounds represented by formula (I), which can modulate the activity of protein kinases. The invention also relates to a composition containing a compound of formula (I), and a method for synthesizing and using such compound for preventing or treating ALK or cMet mediated disorders or conditions.