/** * Gets a new person. * * @param inActionContext the action context * @param inFields the fields. * @return a new person. */ @Override public Person get( final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields) { // create the person Person person = new Person( (String) inFields.get("accountId"), (String) inFields.get("firstName"), (String) inFields.get("middleName"), (String) inFields.get("lastName"), (String) inFields.get("preferredName")); person.setEmail((String) inFields.get("email")); person.setOpenSocialId(UUID.randomUUID().toString()); person.setCompanyName((String) inFields.get("companyName")); // create and add start page tabs TabGroup startTabGroup = new TabGroup(); for (String tabType : startPageTabs) { // These tabs create their own templates based on other templates. TabTemplate template = new TabTemplate(tabMapper.getTabTemplate(tabType)); for (Gadget gadget : template.getGadgets()) { gadget.setOwner(person); } startTabGroup.addTab(new Tab(template)); } person.setStartTabGroup(startTabGroup); // Make the default view for a person StreamScope personScope = new StreamScope(ScopeType.PERSON, (String) inFields.get("accountId")); person.setStreamScope(personScope); Set<StreamScope> defaultScopeList = new HashSet<StreamScope>(); defaultScopeList.add(personScope); List<Stream> streams = getStreamsForPerson(); person.setStreams(streams); // Set hidden line indexes. person.setStreamViewHiddenLineIndex(streams.size() - 1); person.setGroupStreamHiddenLineIndex(3); if (inFields.containsKey("additionalProperties")) { HashMap<String, String> additionalProperties = (HashMap<String, String>) inFields.get("additionalProperties"); person.setAdditionalProperties(additionalProperties); } // remove public settable properties already handled from map so updater // doesn't do them again. inFields.remove("organization"); inFields.remove("email"); return person; }