public void uploadFields ( final Set < String > fields , final Function < Map < String , String > , Void > filenameCallback , final I_CmsErrorCallback errorCallback ) { disableAllFileFieldsExcept ( fields ) ; final String id = CmsJsUtils . generateRandomId ( ) ; updateFormAction ( id ) ; // Using an array here because we can only store the handler registration after it has been created , but final HandlerRegistration [ ] registration = { null } ; registration [ 0 ] = addSubmitCompleteHandler ( new SubmitCompleteHandler ( ) { @ SuppressWarnings ( "synthetic-access" ) public void onSubmitComplete ( SubmitCompleteEvent event ) { enableAllFileFields ( ) ; registration [ 0 ] . removeHandler ( ) ; CmsUUID sessionId = m_formSession . internalGetSessionId ( ) ; RequestBuilder requestBuilder = CmsXmlContentUgcApi . SERVICE . uploadFiles ( sessionId , fields , id , new AsyncCallback < Map < String , String > > ( ) { public void onFailure ( Throwable caught ) { m_formSession . getContentFormApi ( ) . handleError ( caught , errorCallback ) ; } public void onSuccess ( Map < String , String > fileNames ) { filenameCallback . apply ( fileNames ) ; } } ) ; m_formSession . getContentFormApi ( ) . getRpcHelper ( ) . executeRpc ( requestBuilder ) ; m_formSession . getContentFormApi ( ) . getRequestCounter ( ) . decrement ( ) ; } } ) ; m_formSession . getContentFormApi ( ) . getRequestCounter ( ) . increment ( ) ; submit ( ) ; }
Uploads files from the given file input fields . <p<