public SubmissionLink createSubmissionLink ( final Submission submission ) { Head head = getRoot ( ) . find ( "Head" , Head . class ) ; if ( head == null ) { head = createHead ( ) ; } final SubmissionLink submissionLink = new SubmissionLink ( head , "Submission" , new ObjectId ( submission . getString ( ) ) ) ; head . insert ( submissionLink ) ; return submissionLink ; }
Create a link to the submission in the head . If head doesn t already exist create it .