来源资料待手动核验
ABAP W3mi Poller
A tool to poll file change and upload changed files automatically as W3MI object
项目简介
A tool to poll file change and upload changed files automatically as W3MI object
A tool to poll file change and upload changed files automatically as W3MI object
A tool to poll file change and upload changed files automatically as W3MI object
A tool to poll file changes and upload changed files automatically as W3MI objects. Created mainly to simplify CSS editing in abapGit, but can be used for other purposes.

Clone the repository to your SAP system using abapGit.
Enter filenames to poll and target objects at the selection screen. You can also one of many pairs. The first pair is remembered in user parameters for the session live time (ZW3MIMEPOLL_FILE / ZW3MIMEPOLL_OBJ).
Optionally, choose if you want to upload the file to SAP or replace the frontend file before the polling start.


Enter package to poll and a root directory to save files to. The program will automatically detect all sub-packages, find all W3MI object and start tracking them. Importantly, W3MI object metadata must contain a filename (it will be used to match objects and files in directory).
.css files will go to css subdirectory )

The package contains several useful routines grouped into classes. All routines are static methods. Some of them may raise zcx_w3mime_error exception (use get_text to get some description of an error). For more details see implementations directly - the routines are mostly simple convenient wrappers over existing SAP calls. Can be used separately.
read_object(_x) - read MIME object into raw255 table (or xstring)update_object(_x) - save raw255 table (or xstring) as a MIME object (must exist already)choose_mime_dialog - display dialog to choose MIME object. Can be used for F4 search helps. Filters only Z objects.get_object_info and check_obj_existschoose_dir_dialog, choose_file_dialog - quick wrappers around cl_gui_frontend methods.read_file(_x), write_file(_x) - quick wrapper to read/write a file, raw255 and xstring versions respectfullyparse_path - split path into directory, filename and extensionresolve_filename - split path into directory and filename, if no directory - fallback to SAP GUI default pathpath_join - join 2 path parts e.g. directory and filename, respecting separators (but ignoring .. at the moment)path_is_relative - detects if one path is relative to the other (but ignoring .. at the moment)path_relative - calculates the difference between 2 paths (but ignoring .. at the moment)path_ensure_dir_tail - ensures dir ends with separator symboldownload - save W3MIME object directly to fileupload - vice versachanged event with changed file list.construct the object (this one is not static) giving the target list and timer interval, assign the event handler to changed (and to error optionally), start the poller.zw3mimepoll program if you are looking for an example. see lcl_poller class implementation - it contains concrete handling of a more abstract zcl_w3mime_poller toolcl_abap_zip.has - checks of the file exists in zipadd(x), read(x) - reads write data from zip, methods without convert the data to string based on encoding specified during instantiationxget_blob - returns xstring of current zip stateis_dirty - tracks if there has been any changes since last get_blob. (add sets the flag, get_blob releases it).