publication.upload_record()
                if publication.status in ('initialized', 'edited'):
                    forms += publication.get_publication_form(projectid)
                else:
                    submitted_publications += publication.get_publication_preview()
            body += openaire_deposit_templates.tmpl_add_publication_data_and_submit(projectid, forms, submitted_publications, project_information=upload_to_project_information, ln=argd['ln'])
            body += openaire_deposit_templates.tmpl_upload_publications(projectid=upload_to_projectid, project_information=upload_to_project_information, session=get_session(req).sid(), style=style, ln=argd['ln'])
        else:
            body += openaire_deposit_templates.tmpl_upload_publications(projectid=upload_to_projectid, project_information=upload_to_project_information, session=get_session(req).sid(), style=style, ln=argd['ln'])
            projects = [get_project_information(uid, projectid_, deletable=False, ln=argd['ln'], style=style, linked=True) for projectid_ in get_exisiting_projectids_for_uid(user_info['uid']) if projectid_ != projectid]
            if projects:
                body += openaire_deposit_templates.tmpl_focus_on_project(
                    existing_projects=projects, ln=argd['ln'])

        title = _('Orphan Repository')
        return page(body=body, title=title, req=req, project_information=get_project_acronym(projectid), navmenuid="submit")

    def uploadifybackend(self, req, form):
        """
        File upload via Uploadify (flash) backend.
        """
        argd = wash_urlargd(
            form, {'session': (str, ''), 'projectid': (int, -1)})
        _ = gettext_set_language(argd['ln'])
        session = argd['session']
        get_session(req=req, sid=session)
        user_info = collect_user_info(req)
        if user_info['guest'] == '1':
            raise ValueError(_("This session is invalid"))
        projectid = argd['projectid']
        if projectid < 0:
            )
        else:
            ctx.update(
                {
                    "myresearch": get_exisiting_publications_for_uid(uid),
                    "upload_to_projectid": upload_to_projectid,
                    "upload_to_project_information": upload_to_project_information,
                }
            )

        return render_template(
            "openaire_index.html",
            body=body,
            title=_("Upload"),
            req=req,
            project_information=get_project_acronym(projectid),
            breadcrumbs=[(_("Home"), ""), (_("Upload"), "deposit")],
            **ctx
        ).encode("utf8")

    def portalproxy(self, req, form):
        """
        """
        argd_query = wash_urlargd(
            form,
            {
                "option": (str, ""),
                "tmpl": (str, ""),
                "type": (str, ""),
                "ordering": (str, ""),
                "searchphrase": (str, ""),
        else:
            ctx.update({
                'myresearch':
                get_exisiting_publications_for_uid(uid),
                'upload_to_projectid':
                upload_to_projectid,
                'upload_to_project_information':
                upload_to_project_information,
            })

        return render_template(
            "openaire_index.html",
            body=body,
            title=_('Upload'),
            req=req,
            project_information=get_project_acronym(projectid),
            breadcrumbs=[
                (_('Home'), ''),
                (_('Upload'), 'deposit'),
            ],
            **ctx).encode('utf8')

    def portalproxy(self, req, form):
        """
        """
        argd_query = wash_urlargd(
            form, {
                'option': (str, ''),
                'tmpl': (str, ''),
                'type': (str, ''),
                'ordering': (str, ''),