Whole trample is probably a single opportunity. Attacks of opportunity mentioned in it are generated for entering enemy's square (movement) not for making trample attack itself.
First of all it is movement, so it provokes normally untill it says it doesn't (doesn't provoke or not normally). As an example, when triceratops leaves first square human fighter with a spiked chain threatens, human may make an attack of opportunity. But trample also says those whose spase was crossed make attacks of opportunity with -4 penalty. Note, at the point mentioned in my example we don't really know if human's space will be crossed so we can't say if we should apply attack penalty or not.
At this point it seems like trample requires some kind of declaration of intent (somewhat similar to Spring Attack) before creature actually moves. In this case a guy playing triceratops says he is going to trample that pesky fighter and trample descriptive text remains true - trampled (later) fighter attempts attack of opportunity, but takes -4 penalty.
It becomes more complicated when trampling creature encounters invisible (either due to special ability or spell or due to environment) foe. But it is still solvable as trampling creature states it's path anyway. It may be declared as a whole, partially, and whole path may be changed mid-movement if combat situation changes, but you as a DM may still figure out if one executing an attack of opportunity would later be trampled (or at least some of his space would be crossed).
C is a commoner PCs were talking to when triceratops arrives. Seeng her as not a threat triceratops doesn't bother itself stomping her into dirt and pases by. When triceratops leaves
d-4 she can if she wishes to make an attack of opportunity against our dinosaur (she carries a quarterstaff).
R is invisible rogue who is large and armed. At the same point as C, he can make an attack of opportunity against dinosaur too, but suffers -4 penalty.
F is a fighter. He is armed with a spiked chain and may make attack of opportunity as soon as triceratops leaves
def-8. Or he can try to avoid some damage caused by trample but then he can't make his attack of opportunity. He also suffers from -4 penalty on that attack as he would be trampled and damaged.
M is a mage and carries a crossbow. So he can't make attack of opportunity and should hope he will pass a save.
As triceratops doesn't have enough speed and can't end it's movement in a space another creature occupies it is moved back 5 feet and now stands between F and M