public static void updateProjectFromRequest(PortletRequest request, Project project) { for (Project._Fields field : Project._Fields.values()) { switch (field) { case LINKED_PROJECTS: if (!project.isSetLinkedProjects()) project.setLinkedProjects(new HashMap<String, ProjectRelationship>()); updateLinkedProjectsFromRequest(request, project.linkedProjects); break; case RELEASE_ID_TO_USAGE: if (!project.isSetReleaseIdToUsage()) project.setReleaseIdToUsage(new HashMap<String, String>()); updateLinkedReleasesFromRequest(request, project.releaseIdToUsage); break; case ATTACHMENTS: project.setAttachments( PortletUtils.updateAttachmentsFromRequest(request, project.getAttachments())); break; default: setFieldValue(request, project, field); } } }
private static void setFieldValue( PortletRequest request, Project project, Project._Fields field) { PortletUtils.setFieldValue(request, project, field, Project.metaDataMap.get(field), ""); }