private void setAttributes ( Element el , ScheduleTask task ) { if ( el == null ) return ; NamedNodeMap atts = el . getAttributes ( ) ; for ( int i = atts . getLength ( ) - 1 ; i >= 0 ; i -- ) { Attr att = ( Attr ) atts . item ( i ) ; el . removeAttribute ( att . getName ( ) ) ; } su . setString ( el , "name" , task . getTask ( ) ) ; su . setFile ( el , "file" , task . getResource ( ) ) ; su . setDateTime ( el , "startDate" , task . getStartDate ( ) ) ; su . setDateTime ( el , "startTime" , task . getStartTime ( ) ) ; su . setDateTime ( el , "endDate" , task . getEndDate ( ) ) ; su . setDateTime ( el , "endTime" , task . getEndTime ( ) ) ; su . setString ( el , "url" , task . getUrl ( ) . toExternalForm ( ) ) ; su . setInt ( el , "port" , task . getUrl ( ) . getPort ( ) ) ; su . setString ( el , "interval" , task . getIntervalAsString ( ) ) ; su . setInt ( el , "timeout" , ( int ) task . getTimeout ( ) ) ; su . setCredentials ( el , "username" , "password" , task . getCredentials ( ) ) ; ProxyData pd = task . getProxyData ( ) ; su . setString ( el , "proxyHost" , StringUtil . emptyIfNull ( pd == null ? "" : pd . getServer ( ) ) ) ; su . setString ( el , "proxyUser" , StringUtil . emptyIfNull ( pd == null ? "" : pd . getUsername ( ) ) ) ; su . setString ( el , "proxyPassword" , StringUtil . emptyIfNull ( pd == null ? "" : pd . getPassword ( ) ) ) ; su . setInt ( el , "proxyPort" , pd == null ? 0 : pd . getPort ( ) ) ; su . setBoolean ( el , "resolveUrl" , task . isResolveURL ( ) ) ; su . setBoolean ( el , "publish" , task . isPublish ( ) ) ; su . setBoolean ( el , "hidden" , ( ( ScheduleTaskImpl ) task ) . isHidden ( ) ) ; su . setBoolean ( el , "readonly" , ( ( ScheduleTaskImpl ) task ) . isReadonly ( ) ) ; su . setBoolean ( el , "autoDelete" , ( ( ScheduleTaskImpl ) task ) . isAutoDelete ( ) ) ; }
sets all attributes in XML Element from Schedule Task