implement restricted types for portlet. refactor portlet template