document types and templates relationships