made portal::publish able to extract fields from constants and metadata. references #29