diff --git a/README.md b/README.md index 1456d778..e52fc08a 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,6 @@ An alternative to the last 2 instructions is to use the script from tools folder ### text * __encoder__: Various simpler encoders: base64, url-encoder, xml entities, html entities [read more](library/text/encoder) -### crypto -* eel -* eapml - ### Others * error: very simple/basic library to handle error diff --git a/contrib/ise_library/cURL-safe.ecf b/contrib/ise_library/cURL-safe.ecf deleted file mode 100644 index 81f2428b..00000000 --- a/contrib/ise_library/cURL-safe.ecf +++ /dev/null @@ -1,93 +0,0 @@ - - - - cURL: libcURL wrapper library for Eiffel. - Copyright (c) 1984-2006, Eiffel Software and others. - Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt). - - - /\.svn$ - /EIFGEN.{0,1}$ - /temp$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /spec$ - /Clib$ - - - /gtk$ - /mac$ - - - - - - /mswin$ - /gtk$ - - - - - - - /mswin$ - /mac$ - - - - - - - - - - - diff --git a/contrib/ise_library/cURL.ecf b/contrib/ise_library/cURL.ecf deleted file mode 100644 index c7189049..00000000 --- a/contrib/ise_library/cURL.ecf +++ /dev/null @@ -1,93 +0,0 @@ - - - - cURL: libcURL wrapper library for Eiffel. - Copyright (c) 1984-2006, Eiffel Software and others. - Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt). - - - /\.svn$ - /EIFGEN.{0,1}$ - /temp$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /spec$ - /Clib$ - - - /gtk$ - /mac$ - - - - - - /mswin$ - /gtk$ - - - - - - - /mswin$ - /mac$ - - - - - - - - - - - diff --git a/contrib/ise_library/cURL/Clib/Makefile-win.SH b/contrib/ise_library/cURL/Clib/Makefile-win.SH deleted file mode 100644 index 9db5fcfc..00000000 --- a/contrib/ise_library/cURL/Clib/Makefile-win.SH +++ /dev/null @@ -1,58 +0,0 @@ -TOP = .. -DIR = $dir_sep -OUTDIR= . -INDIR= . -CC = $cc -OUTPUT_CMD = $output_cmd -CFLAGS = -I"$rt_include" -I..$(DIR)spec$(DIR)include -I. \ - -I..$(DIR)..$(DIR)..$(DIR)C_library$(DIR)libpng -I..$(DIR)..$(DIR)..$(DIR)C_library$(DIR)zlib -JCFLAGS = $(CFLAGS) $ccflags $optimize -JMTCFLAGS = $(CFLAGS) $mtccflags $optimize -JILCFLAGS = $(CFLAGS) $mtccflags $optimize -DEIF_IL_DLL -LN = copy -MV = $mv -RM = $del -MAKE = $make -MKDIR = $mkdir -LINK = $link32 -DLL_FLAGS = $dll_flags -DLL_LIBS = $dll_libs -OBJECTS = eiffel_curl.$obj -MT_OBJECTS = MTeiffel_curl.$obj -IL_OBJECTS = ILeiffel_curl.$obj - -.c.$obj: - $(CC) -c $(JCFLAGS) $< - -all:: $output_libraries - $(MAKE) clean - -standard:: eiffel_curl.lib ileiffel_curl.lib -mtstandard:: mteiffel_curl.lib - -clean: - $(RM) *.$obj - $(RM) *.lib - -eiffel_curl.lib: $(OBJECTS) - $alib_line - $(MKDIR) ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib - $(MV) $@ ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib$(DIR)$@ - -mteiffel_curl.lib: $(MT_OBJECTS) - $alib_line - $(MKDIR) ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib - $(MV) $@ ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib$(DIR)$@ - -ileiffel_curl.lib: $(IL_OBJECTS) - $alib_line - $(MKDIR) ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib - $(MV) $@ ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib$(DIR)$@ - -#Multithreaded targets. -MTeiffel_curl.$obj: eiffel_curl.c - $(CC) $(JMTCFLAGS) $(OUTPUT_CMD)$@ -c $? - -#.NET targets. -ILeiffel_curl.$obj: eiffel_curl.c - $(CC) $(JILCFLAGS) $(OUTPUT_CMD)$@ -c $? diff --git a/contrib/ise_library/cURL/Clib/Makefile.SH b/contrib/ise_library/cURL/Clib/Makefile.SH deleted file mode 100644 index 7c49d5de..00000000 --- a/contrib/ise_library/cURL/Clib/Makefile.SH +++ /dev/null @@ -1,92 +0,0 @@ -case $CONFIG in -'') - if test ! -f config.sh; then - (echo "Can't find config.sh."; exit 1) - fi 2>/dev/null - . ./config.sh - ;; -esac -case "$0" in -*/*) cd `expr X$0 : 'X\(.*\)/'` ;; -esac -echo "Extracting "."/Makefile (with variable substitutions)" -$spitshell >Makefile <>Makefile <<'!NO!SUBS!' - -MT_OBJECTS = MTeiffel_curl.o -OBJECTS = eiffel_curl.o - -ALL_OBJECTS = $(OBJECTS) $(MT_OBJECTS) - -all: $(ALL_OBJECTS) - $(MKDIR) ../spec/$(PLATFORM)/lib - $(MV) $? ../spec/$(PLATFORM)/lib - $(MAKE) clobber - -MTeiffel_curl.o: eiffel_curl.c - $(CC) -c $(MTCFLAGS) $? -o $@ - -######################################################################## -# Common rules for all Makefiles -- do not edit - -emptyrule:: - -clean: local_clean -realclean: local_realclean -clobber: local_clobber - -local_clean:: - $(RM) core *~ *.o *.so *.a - -local_realclean:: local_clean - -local_clobber:: local_realclean - $(RM) Makefile config.sh - -Makefile: Makefile.SH - /bin/sh Makefile.SH - -tags:: - $(CTAGS) -w *.[ch] - $(CTAGS) -xw *.[ch] > tags - -local_clobber:: - $(RM) tags - -######################################################################## -# Dependencies generated by make depend -# DO NOT DELETE THIS LINE -- make depend relies on it - -# Put nothing here or make depend will gobble it up -.FORCE_DEPEND:: - @echo "You must run 'make depend' in $(TOP) first."; exit 1 -!NO!SUBS! -chmod 644 Makefile -$eunicefix Makefile - diff --git a/contrib/ise_library/cURL/Clib/build.eant b/contrib/ise_library/cURL/Clib/build.eant deleted file mode 100644 index ca40ab29..00000000 --- a/contrib/ise_library/cURL/Clib/build.eant +++ /dev/null @@ -1,24 +0,0 @@ - - - - - description: "cURL Clib library compilation" - - - - - - - - - - - - - - - - - - - diff --git a/contrib/ise_library/cURL/Clib/eiffel_curl.c b/contrib/ise_library/cURL/Clib/eiffel_curl.c deleted file mode 100644 index 635ea00c..00000000 --- a/contrib/ise_library/cURL/Clib/eiffel_curl.c +++ /dev/null @@ -1,188 +0,0 @@ -/* -indexing - description: "Functions used by the class CURL_FUNCTION." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -*/ - -#include "eiffel_curl.h" - -typedef EIF_INTEGER (* EIF_CURL_PROGRESS_PROC) ( -#ifndef EIF_IL_DLL - EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */ -#endif - EIF_POINTER, /* a_user_pointer */ - EIF_REAL_64, /* a_dltotal */ - EIF_REAL_64, /* a_dlnow */ - EIF_REAL_64, /* a_ultotal */ - EIF_REAL_64 /* a_ulnow */ - ); - -typedef EIF_INTEGER (* EIF_CURL_WRITE_PROC) ( -#ifndef EIF_IL_DLL - EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */ -#endif - EIF_POINTER, /* a_data_pointer */ - EIF_INTEGER, /* a_size */ - EIF_INTEGER, /* a_nmemb */ - EIF_POINTER /* a_write_pointer */ - ); - -typedef EIF_INTEGER (* EIF_CURL_READ_PROC) ( -#ifndef EIF_IL_DLL - EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */ -#endif - EIF_POINTER, /* a_data_pointer */ - EIF_INTEGER, /* a_size */ - EIF_INTEGER, /* a_nmemb */ - EIF_POINTER /* a_write_pointer */ - ); - - -typedef EIF_INTEGER (* EIF_CURL_DEBUG_PROC) ( -#ifndef EIF_IL_DLL - EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */ -#endif - EIF_POINTER, /* a_curl_handle */ - EIF_INTEGER, /* a_curl_infotype */ - EIF_POINTER, /* a_char_pointer */ - EIF_INTEGER, /* a_size */ - EIF_POINTER /* a_user_pointer */ - ); - -static EIF_OBJECT eiffel_function_object = NULL; - /* Address of Eiffel object CURL_FUNCTION */ - -static EIF_CURL_PROGRESS_PROC eiffel_progress_function = NULL; - /* Address of Eiffel CURL_FUNCTION.progress_function */ - -static EIF_CURL_WRITE_PROC eiffel_write_function = NULL; - /* Address of Eiffel CURL_FUNCTION.write_function */ - -static EIF_CURL_READ_PROC eiffel_read_function = NULL; - /* Address of Eiffel CURL_FUNCTION.read_function */ - -static EIF_CURL_DEBUG_PROC eiffel_debug_function = NULL; - /* Address of Eiffel CURL_FUNCTION.debug_function */ - -/* Set Eiffel CURL_FUNCTION object address */ -void c_set_object(EIF_REFERENCE a_address) -{ - if (a_address) { - eiffel_function_object = eif_protect (a_address); - } else { - eiffel_function_object = NULL; - } -} - -/* Release Eiffel CURL_FUNCTION object address */ -void c_release_object() -{ - eif_wean (eiffel_function_object); -} - -/* Set CURL_FUNCTOIN.progress_function address */ -void c_set_progress_function_address( EIF_POINTER a_address) -{ - eiffel_progress_function = (EIF_CURL_PROGRESS_PROC) a_address; -} - -/* Set CURL_FUNCTOIN.write_function address */ -void c_set_write_function_address( EIF_POINTER a_address) -{ - eiffel_write_function = (EIF_CURL_WRITE_PROC) a_address; -} - -/* Set CURL_FUNCTOIN.read_function address */ -void c_set_read_function_address( EIF_POINTER a_address) -{ - eiffel_read_function = (EIF_CURL_READ_PROC) a_address; -} - -/* Set CURL_FUNCTOIN.debug_function address */ -void c_set_debug_function_address (EIF_POINTER a_address) -{ - eiffel_debug_function = (EIF_CURL_DEBUG_PROC) a_address; -} - -/* Eiffel adapter function for CURLOPT_WRITEFUNCTION - We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */ -size_t curl_write_function (void *ptr, size_t size, size_t nmemb, void *data) -{ - if (eiffel_function_object) { - return (size_t) ((eiffel_write_function) ( -#ifndef EIF_IL_DLL - (EIF_REFERENCE) eif_access (eiffel_function_object), -#endif - (EIF_POINTER) ptr, - (EIF_INTEGER) size, - (EIF_INTEGER) nmemb, - (EIF_POINTER) data)); - } else { - return 0; - } -} - -/* Eiffel adapter function for CURLOPT_READFUNCTION - We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */ -size_t curl_read_function (void *ptr, size_t size, size_t nmemb, void *data) -{ - if (eiffel_function_object) { - return (size_t) ((eiffel_read_function) ( -#ifndef EIF_IL_DLL - (EIF_REFERENCE) eif_access (eiffel_function_object), -#endif - (EIF_POINTER) ptr, - (EIF_INTEGER) size, - (EIF_INTEGER) nmemb, - (EIF_POINTER) data)); - } else { - return 0; - } -} - - -/* Eiffel adapter function for CURLOPT_PROGRESSFUNCTION - We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */ -size_t curl_progress_function (void * a_object_id, double a_dltotal, double a_dlnow, double a_ultotal, double a_ulnow) - { - if (eiffel_function_object) { - return (size_t) ((eiffel_progress_function) ( -#ifndef EIF_IL_DLL - (EIF_REFERENCE) eif_access (eiffel_function_object), -#endif - (EIF_POINTER) a_object_id, - (EIF_REAL_64) a_dltotal, - (EIF_REAL_64) a_dlnow, - (EIF_REAL_64) a_ultotal, - (EIF_REAL_64) a_ulnow)); - } else { - return 0; - } - } - -/* Eiffel adapter function for CURLOPT_DEBUGFUNCTION - We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */ -size_t curl_debug_function (CURL * a_curl_handle, curl_infotype a_curl_infotype, unsigned char * a_char_pointer, size_t a_size, void * a_object_id) - { - if (eiffel_function_object) { - return (size_t) ((eiffel_debug_function) ( -#ifndef EIF_IL_DLL - (EIF_REFERENCE) eif_access (eiffel_function_object), -#endif - (EIF_POINTER) a_curl_handle, - (EIF_INTEGER) a_curl_infotype, - (EIF_POINTER) a_char_pointer, - (EIF_INTEGER) a_size, - (EIF_POINTER) a_object_id)); - } else { - return 0; - } - } diff --git a/contrib/ise_library/cURL/build.eant b/contrib/ise_library/cURL/build.eant deleted file mode 100644 index 325768ce..00000000 --- a/contrib/ise_library/cURL/build.eant +++ /dev/null @@ -1,28 +0,0 @@ - - - - - description: "cURL library compilation" - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/ise_library/cURL/cURL-safe.ecf b/contrib/ise_library/cURL/cURL-safe.ecf deleted file mode 100644 index 02b15b65..00000000 --- a/contrib/ise_library/cURL/cURL-safe.ecf +++ /dev/null @@ -1,93 +0,0 @@ - - - - cURL: libcURL wrapper library for Eiffel. - Copyright (c) 1984-2006, Eiffel Software and others. - Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt). - - - /\.svn$ - /EIFGEN.{0,1}$ - /temp$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /spec$ - /Clib$ - - - /gtk$ - /mac$ - - - - - - /mswin$ - /gtk$ - - - - - - - /mswin$ - /mac$ - - - - - - - - - - - diff --git a/contrib/ise_library/cURL/cURL.ecf b/contrib/ise_library/cURL/cURL.ecf deleted file mode 100644 index 0707e6ec..00000000 --- a/contrib/ise_library/cURL/cURL.ecf +++ /dev/null @@ -1,93 +0,0 @@ - - - - cURL: libcURL wrapper library for Eiffel. - Copyright (c) 1984-2006, Eiffel Software and others. - Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt). - - - /\.svn$ - /EIFGEN.{0,1}$ - /temp$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /spec$ - /Clib$ - - - /gtk$ - /mac$ - - - - - - /mswin$ - /gtk$ - - - - - - - /mswin$ - /mac$ - - - - - - - - - - - diff --git a/contrib/ise_library/cURL/curl_codes.e b/contrib/ise_library/cURL/curl_codes.e deleted file mode 100644 index d9b320ed..00000000 --- a/contrib/ise_library/cURL/curl_codes.e +++ /dev/null @@ -1,336 +0,0 @@ -note - description: "[ - All possible error codes from all sorts of curl functions. - Future versions may return other values, stay prepared. - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_CODES - -feature -- Eiffel cURL: Constants - - eiffelcurle_error_occurred: INTEGER = -1 - -- Error occurred in Eiffel cURL internals - -feature -- Constants - - curle_ok: INTEGER = 0 - -- Declared as CURLE_OK - - curle_unsupported_protocol: INTEGER = 1 - -- Declared as CURLE_UNSUPPORTED_PROTOCOL - - curle_failed_init: INTEGER = 2 - -- Declared as CURLE_FAILED_INIT - - curle_url_malformat: INTEGER = 3 - -- Declared as CURLE_URL_MALFORMAT - - curle_obsolete4: INTEGER = 4 - -- Declared as CURLE_OBSOLETE4 - -- NOT USED - - curle_couldnt_resolve_proxy: INTEGER = 5 - -- Declared as CURLE_COULDNT_RESOLVE_PROXY - - curle_couldnt_resolve_host: INTEGER = 6 - -- Declared as CURLE_COULDNT_RESOLVE_HOST - - curle_couldnt_connect: INTEGER = 7 - -- Declared as CURLE_COULDNT_CONNECT - - curle_ftp_weird_server_reply: INTEGER = 8 - -- Declared as CURLE_FTP_WEIRD_SERVER_REPLY - - curle_remote_access_denied: INTEGER = 9 - -- Declared as CURLE_REMOTE_ACCESS_DENIED - -- A service was denied by the server due to lack of access - -- when login fails this is not returned. - - curle_obsolete10: INTEGER = 10 - -- Declared as CURLE_OBSOLETE10 NOT USED - - curle_ftp_weird_pass_reply: INTEGER = 11 - -- Declared as CURLE_FTP_WEIRD_PASS_REPLY - - curle_obsolete12: INTEGER = 12 - -- Declared as CURLE_OBSOLETE12 NOT USED - - curle_ftp_weird_pasv_reply: INTEGER = 13 - -- Declared as CURLE_FTP_WEIRD_PASV_REPLY - - curle_ftp_weird_227_format: INTEGER = 14 - -- Declared as CURLE_FTP_WEIRD_227_FORMAT - - curle_ftp_cant_get_host: INTEGER = 15 - -- Declared as CURLE_FTP_CANT_GET_HOST - - curle_obsolete16: INTEGER = 16 - -- Declared as CURLE_OBSOLETE16 - -- NOT USED - - curle_ftp_couldnt_set_type: INTEGER = 17 - -- Declared as CURLE_FTP_COULDNT_SET_TYPE - - curle_partial_file: INTEGER = 18 - -- Declared as CURLE_PARTIAL_FILE - - curle_ftp_couldnt_retr_file: INTEGER = 19 - -- Declared as CURLE_FTP_COULDNT_RETR_FILE - - curle_obsolete20: INTEGER = 20 - -- Declared as CURLE_OBSOLETE20 - -- NOT USED - - curle_quote_error: INTEGER = 21 - -- Declared as CURLE_QUOTE_ERROR - -- quote command failure - - curle_http_returned_error: INTEGER = 22 - -- Declared as CURLE_HTTP_RETURNED_ERROR - - curle_write_error: INTEGER = 23 - -- Declared as CURLE_WRITE_ERROR - - curle_obsolete24: INTEGER = 24 - -- Declared as CURLE_OBSOLETE24 NOT USED - - curle_upload_failed: INTEGER = 25 - -- Declared as CURLE_UPLOAD_FAILED - -- failed upload "command" - - curle_read_error: INTEGER = 26 - -- Declared as CURLE_READ_ERROR - -- couldn't open/read from file - - curle_out_of_memory: INTEGER = 27 - -- Declared as CURLE_OUT_OF_MEMORY - -- Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error - -- instead of a memory allocation error if CURL_DOES_CONVERSIONS - -- is defined - - curle_operation_timedout: INTEGER = 28 - -- Declared as CURLE_OPERATION_TIMEDOUT - -- the timeout time was reached - - curle_obsolete29: INTEGER = 29 - -- Declared as CURLE_OBSOLETE29 - -- NOT USED - - curle_ftp_port_failed: INTEGER = 30 - -- Declared as CURLE_FTP_PORT_FAILED - -- FTP PORT operation failed - - curle_ftp_couldnt_use_rest: INTEGER = 31 - -- Declared as CURLE_FTP_COULDNT_USE_REST - -- the REST command failed - - curle_obsolete32: INTEGER = 32 - -- Declared as CURLE_OBSOLETE32 - -- NOT USED - - curle_range_error: INTEGER = 33 - -- Declared as CURLE_RANGE_ERROR - -- RANGE "command" didn't work - - curle_http_post_error: INTEGER = 34 - -- Declared as CURLE_HTTP_POST_ERROR - - curle_ssl_connect_error: INTEGER = 35 - -- Declared CURLE_SSL_CONNECT_ERROR - -- wrong when connecting with SSL - - curle_bad_download_resume: INTEGER = 36 - -- Declared as CURLE_BAD_DOWNLOAD_RESUME - -- couldn't resume download - - curle_file_couldnt_read_file: INTEGER = 37 - -- Declared as CURLE_FILE_COULDNT_READ_FILE - - curle_ldap_cannot_bind: INTEGER = 38 - -- Declared as CURLE_LDAP_CANNOT_BIND - - curle_ldap_search_failed: INTEGER = 39 - -- Declared as CURLE_LDAP_SEARCH_FAILED - - curle_obsolete40: INTEGER = 40 - -- Declared as CURLE_OBSOLETE40 - -- NOT USED - - curle_function_not_found: INTEGER = 41 - -- Declared as CURLE_FUNCTION_NOT_FOUND - - curle_aborted_by_callback: INTEGER = 42 - -- Declared as CURLE_ABORTED_BY_CALLBACK - - curle_bad_function_argument: INTEGER = 43 - -- Declared as CURLE_BAD_FUNCTION_ARGUMENT - - curle_obsolete44: INTEGER = 44 - -- Declared as CURLE_OBSOLETE44 - -- NOT USED - - curle_interface_failed: INTEGER = 45 - -- Declared as CURLE_INTERFACE_FAILED - -- CURLOPT_INTERFACE failed - - curle_obsolete46: INTEGER = 46 - -- Declared as CURLE_OBSOLETE46 - -- NOT USED - - curle_too_many_redirects: INTEGER = 47 - -- Declared as CURLE_TOO_MANY_REDIRECTS - -- catch endless re-direct loops - - curle_unknown_telnet_option: INTEGER = 48 - -- Declared as CURLE_UNKNOWN_TELNET_OPTION - -- User specified an unknown option - - curle_telnet_option_syntax: INTEGER = 49 - -- Declared as CURLE_TELNET_OPTION_SYNTAX - -- Malformed telnet option - - curle_obsolete50: INTEGER = 50 - -- Declared as CURLE_OBSOLETE50 - -- NOT USED - - curle_ssl_peer_certificate: INTEGER = 51 - -- Declared as CURLE_SSL_PEER_CERTIFICATE - -- peer's certificate wasn't ok - - curle_got_nothing: INTEGER = 52 - -- Declared as CURLE_GOT_NOTHING - -- when this is a specific error - - curle_ssl_engine_notfound: INTEGER = 53 - -- Declared as CURLE_SSL_ENGINE_NOTFOUND - -- SSL crypto engine not found */ - - curle_ssl_engine_setfailed: INTEGER = 54 - -- Declared as CURLE_SSL_ENGINE_SETFAILED - -- can not set SSL crypto engine as default - - curle_send_error: INTEGER = 55 - -- Declared as CURLE_SEND_ERROR - -- failed sending network data - - curle_recv_error: INTEGER = 56 - -- Declared as CURLE_RECV_ERROR - -- failure in receiving network data - - curle_obsolete57: INTEGER = 57 - -- Declared as CURLE_OBSOLETE57 - -- NOT IN USE - - curle_ssl_certproblem: INTEGER = 58 - -- Declared as CURLE_SSL_CERTPROBLEM - -- problem with the local certificate - - curle_ssl_cipher: INTEGER = 59 - -- Declared as CURLE_SSL_CIPHER - -- couldn't use specified cipher - - curle_ssl_cacert: INTEGER = 60 - -- Declared as CURLE_SSL_CACERT - -- problem with the CA cert (path?) - - curle_bad_content_encoding: INTEGER = 61 - -- Declared as CURLE_BAD_CONTENT_ENCODING - -- Unrecognized transfer encoding - - curle_ldap_invalid_url: INTEGER = 62 - -- Declared as CURLE_LDAP_INVALID_URL - -- Invalid LDAP URL - - curle_filesize_exceeded: INTEGER = 63 - -- Declared as CURLE_FILESIZE_EXCEEDED - -- Maximum file size exceeded - - curle_use_ssl_failed: INTEGER = 64 - -- Declared as CURLE_USE_SSL_FAILED - -- Requested FTP SSL level failed - - curle_send_fail_rewind: INTEGER = 65 - -- Declared as CURLE_SEND_FAIL_REWIND - -- Sending the data requires a rewind that failed - - curle_ssl_engine_initfailed: INTEGER = 66 - -- Declared as CURLE_SSL_ENGINE_INITFAILED - -- failed to initialise ENGINE - - curle_login_denied: INTEGER = 67 - -- Declared as CURLE_LOGIN_DENIED - -- user, password or similar was not accepted and we failed to login - - curle_tftp_notfound: INTEGER = 68 - -- Declared as CURLE_TFTP_NOTFOUND - -- file not found on server - - curle_tftp_perm: INTEGER = 69 - -- Declared as CURLE_TFTP_PERM - -- permission problem on server - - curle_remote_disk_full: INTEGER = 70 - -- Declared as CURLE_REMOTE_DISK_FULL - -- out of disk space on server - - curle_tftp_illegal: INTEGER = 71 - -- Declared as CURLE_TFTP_ILLEGAL - -- Illegal TFTP operation - - curle_tftp_unknownid: INTEGER = 72 - -- Declared as CURLE_TFTP_UNKNOWNID - -- Unknown transfer ID - - curle_remote_file_exists: INTEGER = 73 - -- Declared as CURLE_REMOTE_FILE_EXISTS - -- File already exists - - curle_tftp_nosuchuser: INTEGER = 74 - -- Declared as CURLE_TFTP_NOSUCHUSER - -- No such user - - curle_conv_failed: INTEGER = 75 - -- Declared as CURLE_CONV_FAILED - -- conversion failed - - curle_conv_reqd: INTEGER = 76 - -- Declared as CURLE_CONV_REQD - -- caller must register conversion callbacks using curl_easy_setopt options - -- CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPT_CONV_TO_NETWORK_FUNCTION, and - -- CURLOPT_CONV_FROM_UTF8_FUNCTION - - curle_ssl_cacert_badfile: INTEGER = 77 - -- Declared as CURLE_SSL_CACERT_BADFILE - -- could not load CACERT file, missing or wrong format - - curle_remote_file_not_found: INTEGER = 78 - -- Declared as CURLE_REMOTE_FILE_NOT_FOUND - -- remote file not found - - curle_ssh: INTEGER = 79 - -- Declared as CURLE_SSH - -- error from the SSH layer, somewhat generic so the error message will be of - -- interest when this has happened - - curle_ssl_shutdown_failed: INTEGER = 80; - -- Declared as CURLE_SSL_SHUTDOWN_FAILED - -- Failed to shut down the SSL connection - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_default_function.e b/contrib/ise_library/cURL/curl_default_function.e deleted file mode 100644 index 01c1c540..00000000 --- a/contrib/ise_library/cURL/curl_default_function.e +++ /dev/null @@ -1,104 +0,0 @@ -note - description: "[ - Default implementation of CURL_FUNCTION. - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_DEFAULT_FUNCTION - -inherit - CURL_FUNCTION - -create - make - -feature {NONE} -- Initialization - - make - -- Creation method - do - set_object_and_function_address - end - -feature -- Command - - progress_function (a_object_id: POINTER; a_download_total, a_download_now, a_upload_total, a_upload_now: REAL_64): INTEGER - do - end - - write_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER - local - l_c_string: C_STRING - do - -- Returns the number of bytes actually saved into object identified by `a_object_id' - Result := a_size * a_nmemb - create l_c_string.make_shared_from_pointer_and_count (a_data_pointer, Result) - - check attached {CURL_STRING} (create {IDENTIFIED}).id_object (a_object_id.to_integer_32) as l_string then - l_string.append (l_c_string.substring (1, Result)) - end - end - - read_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER - -- A callback readfunction - do - end - - debug_function (a_curl_handle: POINTER; a_curl_infotype: INTEGER; a_char_pointer: POINTER; a_size: INTEGER; a_object_id: POINTER): INTEGER - local - l_c_string: C_STRING - do - inspect - a_curl_infotype - when {CURL_INFO_TYPE}.curlinfo_data_in then - dump ("<= Recv data", a_char_pointer, a_size) - when {CURL_INFO_TYPE}.curlinfo_data_out then - dump ("=> Send data", a_char_pointer, a_size) - when {CURL_INFO_TYPE}.curlinfo_header_in then - dump ("<= Recv header", a_char_pointer, a_size) - when {CURL_INFO_TYPE}.curlinfo_header_out then - dump ("=> Send header", a_char_pointer, a_size) - when {CURL_INFO_TYPE}.curlinfo_ssl_data_in then - dump ("<= Recv SSL data", a_char_pointer, a_size) - when {CURL_INFO_TYPE}.curlinfo_ssl_data_out then - dump ("=> Send SSL data", a_char_pointer, a_size) - when {CURL_INFO_TYPE}.curlinfo_text then - create l_c_string.make_by_pointer_and_count (a_char_pointer, a_size) - print ("%N== Info: " + l_c_string.string) - else - check type_unknow: False end - end - end - -feature {NONE} -- Implementation - - dump (a_text: STRING; a_char_pointer: POINTER; a_size: INTEGER) - -- Dump debug information - require - not_void: a_text /= Void - exists: a_char_pointer /= default_pointer - non_negative: a_size >= 0 - local - l_c_string: C_STRING - do - create l_c_string.make_shared_from_pointer_and_count (a_char_pointer, a_size) - print ("%N" + a_text + "%N" + l_c_string.string) - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_easy_externals.e b/contrib/ise_library/cURL/curl_easy_externals.e deleted file mode 100644 index 5fb94d9a..00000000 --- a/contrib/ise_library/cURL/curl_easy_externals.e +++ /dev/null @@ -1,409 +0,0 @@ -note - description: "[ - cURL easy externals. - For more informaton see: - http://curl.haxx.se/libcurl/c/ - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_EASY_EXTERNALS - -feature -- Command - - init: POINTER - -- Declared as curl_easy_init(). - require - dynamic_library_exists: is_dynamic_library_exists - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_init") - if l_api /= default_pointer then - Result := c_init (l_api) - end - ensure - exists: Result /= default_pointer - end - - setopt_string (a_curl_handle: POINTER; a_opt: INTEGER; a_string: READABLE_STRING_GENERAL) - -- Declared as curl_easy_setopt(). - require - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - not_void: a_string /= Void - local - l_api: POINTER - l_c_str: C_STRING - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - create l_c_str.make (a_string) - c_setopt (l_api, a_curl_handle, a_opt, l_c_str.item) - end - end - - setopt_form (a_curl_handle: POINTER; a_opt: INTEGER; a_form: CURL_FORM) - -- Declared as curl_easy_setopt(). - require - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - not_void: a_form /= Void and then a_form.is_exists - do - setopt_void_star (a_curl_handle, a_opt, a_form.item) - end - - setopt_slist (a_curl_handle: POINTER; a_opt: INTEGER; a_curl_slist: POINTER) - -- Declared as curl_easy_setopt(). - require - exists: a_curl_handle /= default_pointer - valid: a_opt = {CURL_OPT_CONSTANTS}.curlopt_httpheader - exists: a_curl_slist /= default_pointer - do - setopt_void_star (a_curl_handle, a_opt, a_curl_slist) - end - - setopt_curl_string (a_curl_handle: POINTER; a_opt: INTEGER; a_curl_string: CURL_STRING) - -- Declared as curl_easy_setopt(). - require - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - not_void: a_curl_string /= Void - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - c_setopt_int (l_api, a_curl_handle, a_opt, a_curl_string.object_id) - end - end - - setopt_integer (a_curl_handle: POINTER; a_opt: INTEGER; a_integer: INTEGER) - -- Declared as curl_easy_setopt(). - require - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - c_setopt_int (l_api, a_curl_handle, a_opt, a_integer) - end - end - - setopt_file (a_curl_handle: POINTER; a_opt: INTEGER; a_file: FILE) - -- Declared as curl_easy_setopt(). - require - exists: a_curl_handle /= default_pointer - valid: a_opt = {CURL_OPT_CONSTANTS}.curlopt_readdata - readable: a_file /= Void and then a_file.file_readable - do - setopt_void_star (a_curl_handle, a_opt, a_file.file_pointer) - end - - perform (a_curl_handle: POINTER): INTEGER - -- Declared as curl_easy_perform(). - -- Result is one value from {CURL_CODES} - require - exists: a_curl_handle /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_perform") - if l_api /= default_pointer then - Result := c_perform (l_api, a_curl_handle) - else - Result := {CURL_CODES}.eiffelcurle_error_occurred - end - end - - cleanup (a_curl_handle: POINTER) - -- Declared as curl_easy_cleanup(). - require - exists: a_curl_handle /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_cleanup") - if l_api /= default_pointer then - c_cleanup (l_api, a_curl_handle) - end - end - -feature -- Query - - getinfo (a_curl_handle: POINTER; a_info: INTEGER; a_data: CELL [detachable ANY]): INTEGER - -- `curl_getinfo - --|* Request internal information from the curl session with this function. The - --|* third argument MUST be a pointer to a long, a pointer to a char * or a - --|* pointer to a double (as the documentation describes elsewhere). The data - --|* pointed to will be filled in accordingly and can be relied upon only if the - --|* function returns CURLE_OK. This function is intended to get used *AFTER* a - --|* performed transfer, all results from this function are undefined until the - --|* transfer is completed. - require - exists: a_curl_handle /= default_pointer - valid: (create {CURL_INFO_CONSTANTS}).is_valid (a_info) - local - l_api: POINTER - mp: detachable MANAGED_POINTER - l: INTEGER - cs: C_STRING - d: REAL_64 - do - a_data.replace (Void) - l_api := api_loader.api_pointer ("curl_easy_getinfo") - if l_api /= default_pointer then - if a_info & {CURL_INFO_CONSTANTS}.curlinfo_long /= 0 then - create mp.make ({PLATFORM}.integer_32_bytes) - elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_string /= 0 then - create mp.make ({PLATFORM}.pointer_bytes) - elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_double /= 0 then - create mp.make ({PLATFORM}.real_64_bytes) - end - if mp /= Void then - Result := c_getinfo (l_api, a_curl_handle, a_info, mp.item) - if Result = {CURL_CODES}.curle_ok then - if a_info & {CURL_INFO_CONSTANTS}.curlinfo_long /= 0 then - l := mp.read_integer_32 (0) - a_data.put (l) - elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_string /= 0 then - create cs.make_shared_from_pointer (mp.read_pointer (0)) - a_data.put (cs.string) - elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_double /= 0 then - d := mp.read_real_64 (0) - a_data.put (d) - end - end - end - end - end - - is_dynamic_library_exists: BOOLEAN - -- If dll/so files exist? - do - Result := api_loader.is_interface_usable - end - -feature -- Special setting - - set_curl_function (a_curl_function: CURL_FUNCTION) - -- Set `curl_function' with `a_curl_function' - do - internal_curl_function := a_curl_function - ensure - set: a_curl_function /= Void implies curl_function = a_curl_function - end - - curl_function: CURL_FUNCTION - -- cURL functions in curl_easy_setopt. - do - if attached internal_curl_function as l_curl_function then - Result := l_curl_function - else - create {CURL_DEFAULT_FUNCTION} Result.make - internal_curl_function := Result - end - ensure - not_void: Result /= Void - end - - set_write_function (a_curl_handle: POINTER) - -- Set cURL write function - -- Set cURL write function with Eiffel default write function. - -- So we can use CURL_STRING as parameter in {CURL_EASY_EXTERNALS}.setopt_curl_string when the option is {CURL_OPT_CONSTANTS}.curlopt_writedata - require - exists: a_curl_handle /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - curl_function.c_set_write_function (l_api, a_curl_handle) - end - end - - set_read_function (a_curl_handle: POINTER) - -- Set cURL read function - -- Set cURL read function with Eiffel default read function. - -- So we can use a c file pointer as parameter in {CURL_EASY_EXTERNALS}.setopt_file_pointer when the option is {CURL_OPT_CONSTANTS}.curlopt_readdata - require - exists: a_curl_handle /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - curl_function.c_set_read_function (l_api, a_curl_handle) - end - end - - set_progress_function (a_curl_handle: POINTER) - -- Set cURL progress function for upload/download progress. - require - exists: a_curl_handle /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - curl_function.c_set_progress_function (l_api, a_curl_handle) - end - end - - set_debug_function (a_curl_handle: POINTER) - -- Set cURL debug function - require - exists: a_curl_handle /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - curl_function.c_set_debug_function (l_api, a_curl_handle) - end - end - -feature {NONE} -- Implementation - - internal_curl_function: detachable CURL_FUNCTION - -- cURL functions. - - api_loader: DYNAMIC_MODULE - -- Module name. - local - l_utility: CURL_UTILITY - once - create l_utility - Result := l_utility.api_loader - end - - setopt_void_star (a_curl_handle: POINTER; a_opt: INTEGER; a_data:POINTER) - -- Declared as curl_easy_setopt(). - require - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_easy_setopt") - if l_api /= default_pointer then - c_setopt (l_api, a_curl_handle, a_opt, a_data) - end - end - -feature {NONE} -- C externals - - c_init (a_api: POINTER): POINTER - -- Declared curl_easy_init (). - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - return (FUNCTION_CAST(CURL *, ()) $a_api)(); - ]" - end - - c_cleanup (a_api: POINTER; a_curl_handle: POINTER) - -- Decalred as curl_easy_cleanup (). - require - exists: a_api /= default_pointer - exists: a_curl_handle /= default_pointer - external - "C inline use " - alias - "[ - (FUNCTION_CAST(void, (CURL *)) $a_api)((CURL *)$a_curl_handle); - ]" - end - - c_perform (a_api: POINTER; a_curl_handle: POINTER): INTEGER - -- Declared as curl_easy_perform(). - require - exists: a_api /= default_pointer - exists: a_curl_handle /= default_pointer - external - "C inline use " - alias - "[ - return (FUNCTION_CAST(CURLcode, (CURL *)) $a_api) - ((CURL *) $a_curl_handle); - ]" - end - - c_setopt_int (a_api: POINTER; a_curl_handle: POINTER; a_opt: INTEGER; a_data: INTEGER) - -- Same as `c_setopt' except we can pass `a_data' as integer. - require - exists: a_api /= default_pointer - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - external - "C inline use " - alias - "[ - { - (FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_api) - ((CURL *) $a_curl_handle, - (CURLoption)$a_opt, - $a_data); - } - ]" - end - - c_setopt (a_api: POINTER; a_curl_handle: POINTER; a_opt: INTEGER; a_data: POINTER) - -- C implementation of `setopt_void_star'. - -- Declared as curl_easy_setopt (). - require - exists: a_api /= default_pointer - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - external - "C inline use " - alias - "[ - { - (FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_api) - ((CURL *) $a_curl_handle, - (CURLoption)$a_opt, - $a_data); - } - ]" - end - - c_getinfo (a_api: POINTER; a_curl_handle: POINTER; a_opt: INTEGER; a_data: POINTER): INTEGER - -- C implementation of `curl_easy_getinfo'. - -- Declared as curl_easy_setopt (). - require - exists: a_api /= default_pointer - exists: a_curl_handle /= default_pointer - valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt) - external - "C inline use " - alias - "[ - return (FUNCTION_CAST(CURLcode, (CURL *, CURLINFO info, ...)) $a_api) - ((CURL *) $a_curl_handle, - (CURLINFO)$a_opt, - $a_data); - ]" - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2010, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_externals.e b/contrib/ise_library/cURL/curl_externals.e deleted file mode 100644 index 1843e6e6..00000000 --- a/contrib/ise_library/cURL/curl_externals.e +++ /dev/null @@ -1,254 +0,0 @@ -note - description: "[ - cURL externals. - For more information, see: - http://curl.haxx.se/libcurl/c/ - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_EXTERNALS - -feature -- Command - - global_init - -- Declared as curl_global_init(). - require - dynamic_library_exists: is_dynamic_library_exists - local - l_ptr: POINTER - do - l_ptr := api_loader.api_pointer ("curl_global_init") - if l_ptr /= default_pointer then - c_curl_global_init (l_ptr, {CURL_GLOBAL_CONSTANTS}.curl_global_all); - end - end - - global_cleanup - -- Declared as curl_global_cleanup(). - local - l_ptr: POINTER - do - l_ptr := api_loader.api_pointer ("curl_global_cleanup") - if l_ptr /= default_pointer then - c_curl_global_cleanup (l_ptr); - end - end - - formadd_string_string (a_form: CURL_FORM; a_last_pointer: CURL_FORM; a_arg_1: INTEGER; a_arg_1_value: READABLE_STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: READABLE_STRING_GENERAL; a_arg_3: INTEGER) - -- Declared as curl_formadd (). - require - not_void: a_form /= Void - not_void: a_last_pointer /= Void - valid: (create {CURL_FORM_CONSTANTS}).is_valid (a_arg_1) - not_void: a_arg_1_value /= Void - valid: (create {CURL_FORM_CONSTANTS}).is_valid (a_arg_2) - not_void: a_arg_2_value /= Void - valid: (create {CURL_FORM_CONSTANTS}).is_valid (a_arg_3) - local - l_form_pointer, l_last_pointer: POINTER - do - l_form_pointer := a_form.item - l_last_pointer := a_last_pointer.item - - internal_formadd_string_string ($l_form_pointer, $l_last_pointer, a_arg_1, a_arg_1_value, a_arg_2, a_arg_2_value, a_arg_3) - - if a_form.item /= l_form_pointer then - check not_set: a_form.item = default_pointer end - a_form.set_item (l_form_pointer) - end - if a_last_pointer.item /= l_last_pointer then - a_last_pointer.set_item (l_last_pointer) - end - end - - slist_append (a_list: POINTER; a_string: READABLE_STRING_GENERAL): POINTER - -- Declared as curl_slist_append (). - -- note: call with a null `a_list' to get initialized pointer as Result - require - not_void: a_string /= Void - local - l_c_string: C_STRING - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_slist_append") - if l_api /= default_pointer then - create l_c_string.make (a_string) - Result := c_slist_append (l_api, a_list, l_c_string.item) - end - end - - slist_free_all (a_curl_slist: POINTER) - -- Declared as curl_slist_free_all (). - -- See: http://curl.haxx.se/libcurl/c/curl_slist_free_all.html - -- curl_slist_free_all - free an entire curl_slist list - -- This must be called when the data has been used, which typically means after the curl_easy_perform(3) has been called. - require - exists: a_curl_slist /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_slist_free_all") - if l_api /= default_pointer then - c_slist_free_all (l_api, a_curl_slist) - end - end - -feature -- Query - - is_dynamic_library_exists: BOOLEAN - -- If dll/so files exist? - do - Result := api_loader.is_interface_usable - end - -feature {CURL_FORM} -- Internal command - - formfree (a_curl_form: POINTER) - -- Declared as curl_formfree (). - -- See: http://curl.askapache.com/libcurl/c/curl_formfree.html - -- curl_formfree() is used to clean up data previously built/appended with curl_formadd(3). - -- This must be called when the data has been used, which typically means after the curl_easy_perform(3) has been called. - require - exists: a_curl_form /= default_pointer - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_formfree") - if l_api /= default_pointer then - c_formfree (l_api, a_curl_form) - end - end - -feature {NONE} -- Implementation - - api_loader: DYNAMIC_MODULE - -- Module name. - local - l_utility: CURL_UTILITY - once - create l_utility - Result := l_utility.api_loader - end - - internal_formadd_string_string (a_form: TYPED_POINTER [POINTER]; a_last_pointer: TYPED_POINTER [POINTER]; a_arg_1: INTEGER; a_arg_1_value: READABLE_STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: READABLE_STRING_GENERAL; a_arg_3: INTEGER) - -- Declared as curl_formadd (). - local - l_c_string_1, l_c_string_2: C_STRING - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_formadd"); - if l_api /= default_pointer then - create l_c_string_1.make (a_arg_1_value) - create l_c_string_2.make (a_arg_2_value) - c_formadd_string_string (l_api, a_form, a_last_pointer, a_arg_1, l_c_string_1.item, a_arg_2, l_c_string_2.item, a_arg_3) - end - end - -feature {NONE} -- C externals - - c_formadd_string_string (a_api: POINTER; a_form: TYPED_POINTER [POINTER]; a_last_pointer: TYPED_POINTER [POINTER]; a_arg_1: INTEGER; a_arg_1_value: POINTER; a_arg_2: INTEGER; a_arg_2_value: POINTER; a_arg_3: INTEGER) - -- C implementation of formadd_string_string (). - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - { - (FUNCTION_CAST(void, (struct curl_httppost **, struct curl_httppost **, int, char *, int, char *, int)) $a_api) - ((struct curl_httppost **)$a_form, - (struct curl_httppost **)$a_last_pointer, - (int)$a_arg_1, - (char *)$a_arg_1_value, - (int)$a_arg_2, - (char *)$a_arg_2_value, - (int)$a_arg_3); - } - ]" - end - - c_formfree (a_api: POINTER; a_curl_form: POINTER) - -- Declared as curl_formfree (). - require - exists: a_api /= default_pointer - exists: a_curl_form /= default_pointer - external - "C inline use " - alias - "[ - (FUNCTION_CAST(void, (struct curl_httppost *)) $a_api) - ((struct curl_httppost *) $a_curl_form); - ]" - end - - c_curl_global_init (a_api: POINTER; a_opt: NATURAL_64) - -- `a_api' point to API curl_global_init () - -- `a_opt' is intialization option. - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - (FUNCTION_CAST(void, (long)) $a_api)((long) $a_opt); - ]" - end - - c_curl_global_cleanup (a_api: POINTER) - -- `a_api' point to API curl_global_cleanup() - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - (FUNCTION_CAST(void, ()) $a_api)(); - ]" - end - - c_slist_append (a_api: POINTER; a_list_pointer: POINTER; a_string: POINTER): POINTER - -- Declared as curl_slist_append (). - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - { - return (FUNCTION_CAST(void *, (struct curl_slist *, const char *)) $a_api) - ((struct curl_slist *)$a_list_pointer, - (const char *)$a_string); - } - ]" - end - - c_slist_free_all (a_api: POINTER; a_list_pointer: POINTER) - -- Declared as void curl_slist_free_all(struct curl_slist * list) - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - (FUNCTION_CAST(void *, (struct curl_slist *)) $a_api) - ((struct curl_slist *)$a_list_pointer); - ]" - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2010, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_form.e b/contrib/ise_library/cURL/curl_form.e deleted file mode 100644 index 05ff7f69..00000000 --- a/contrib/ise_library/cURL/curl_form.e +++ /dev/null @@ -1,94 +0,0 @@ -note - description: "[ - cURL form. - For more informaton see: - http://curl.haxx.se/libcurl/c/curl_formadd.html - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_FORM - -inherit - DISPOSABLE - -create - make, - share_with_pointer - -feature {NONE} -- Initialization - - make - -- Creation method. - do - end - - share_with_pointer (a_pointer: POINTER) - -- Creation method. - -- `item' share with `a_pointer'. - require - exists: a_pointer /= default_pointer - do - item := a_pointer - ensure - set: item = a_pointer - end - -feature -- Query - - item: POINTER - -- C pointer of Current. - - is_exists: BOOLEAN - -- If C pointer exists? - do - Result := item /= default_pointer - end - -feature -- Command - - dispose - -- Free memory if possible. - local - l_curl: CURL_EXTERNALS - do - if item /= default_pointer then - create l_curl - l_curl.formfree (item) - item := default_pointer - end - end - - release_item - -- Release item - -- NOT free memory! This is useful if Current generated by {CURL_EXTERNALS}.formadd_string_string. - do - item := default_pointer - end - -feature {CURL_EXTERNALS} -- Internal command - - set_item (a_item: POINTER) - -- Set `item' with `a_item' - do - item := a_item - ensure - set: item = a_item - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_form_constants.e b/contrib/ise_library/cURL/curl_form_constants.e deleted file mode 100644 index 260d5761..00000000 --- a/contrib/ise_library/cURL/curl_form_constants.e +++ /dev/null @@ -1,78 +0,0 @@ -note - description: "[ - cURL form constants. - For more informaton see: - http://curl.haxx.se/libcurl/c/curl_formadd.html - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_FORM_CONSTANTS - -feature -- Query - - curlform_copyname: INTEGER - -- Declared as CURLFORM_COPYNAME - external - "C inline use " - alias - "[ - CURLFORM_COPYNAME - ]" - end - - curlform_copycontents: INTEGER - -- Declared as CURLFORM_COPYCONTENTS - external - "C inline use " - alias - "[ - CURLFORM_COPYCONTENTS - ]" - end - - curlform_end: INTEGER - -- Declared as CURLFORM_END - external - "C inline use " - alias - "[ - CURLFORM_END - ]" - end - - curlform_file: INTEGER - -- Declared as CURLFORM_FILE - external - "C inline use " - alias - "[ - CURLFORM_FILE - ]" - end - - is_valid (a_integer: INTEGER): BOOLEAN - -- If `a_integer' valid? - do - Result := a_integer = curlform_copycontents or - a_integer = curlform_copyname or - a_integer = curlform_end or - a_integer = curlform_file - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_function.e b/contrib/ise_library/cURL/curl_function.e deleted file mode 100644 index f5790214..00000000 --- a/contrib/ise_library/cURL/curl_function.e +++ /dev/null @@ -1,257 +0,0 @@ -note - description: "[ - cURL curl_easy_setopt callback functions' Eiffel wrappers. - We need this class since cURL need a c function pointer as value but - Eiffel function need frist parameter of any funciton call is object address. - Client programmers can inherit this class to fit their needs. - - Note: descendants of this class have to call `set_object_and_function_address', - otherwise cURL would not know how to call Eiffel features (such as `write_function'). - See example: $ISE_LIBRARY\examples\cURL\upload_and_read_function - - See http://curl.haxx.se/libcurl/c/curl_easy_setopt.html for libcurl documentation - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -deferred class - CURL_FUNCTION - -inherit - DISPOSABLE - -feature -- Interactive with C - - set_object_and_function_address - -- Set object and function addresses. - -- Call this feature before call `c_set_progress_function', `c_set_debug_function' and `c_set_write_function, c_set_read_function'. - do - c_set_object ($Current) - c_set_progress_function_address ($progress_function) - c_set_write_function_address ($write_function) - c_set_read_function_address ($read_function) - c_set_debug_function_address ($debug_function) - end - - c_set_progress_function (a_setopt_api: POINTER; a_curl_handle: POINTER) - -- Setting CURLOPT_PROGRESSFUNCTION option of `a_curl_handle'. - -- We need this function since cURL need a c function pointer as value. - require - exists: a_setopt_api /= default_pointer - external - "C inline use " - alias - "[ - { - (FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api) - ((CURL *) $a_curl_handle, - (CURLoption)CURLOPT_PROGRESSFUNCTION, - curl_progress_function); - } - ]" - end - - c_set_debug_function (a_setopt_api: POINTER; a_curl_handle: POINTER) - -- Setting CURLOPT_DEBUGFUNCTION option of `a_curl_handle'. - -- We need this function since cURL need a c function pointer as value. - require - exists: a_curl_handle /= default_pointer - external - "C inline use " - alias - "[ - { - (FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api) - ((CURL *) $a_curl_handle, - (CURLoption)CURLOPT_DEBUGFUNCTION, - curl_debug_function); - - } - ]" - end - - c_set_write_function (a_setopt_api: POINTER; a_curl_handle: POINTER) - -- Setting CURLOPT_WRITEFUNCTION option of `a_curl_handle'. - -- We need this function since cURL need a c function pointer as value. - require - exists: a_setopt_api /= default_pointer - external - "C inline use " - alias - "[ - { - (FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api) - ((CURL *) $a_curl_handle, - (CURLoption)CURLOPT_WRITEFUNCTION, - curl_write_function); - } - ]" - end - - c_set_read_function (a_setopt_api: POINTER; a_curl_handle: POINTER) - -- Setting CURLOPT_READFUNCTION option of `a_curl_handle'. - -- We need this function since cURL need a c function pointer as value. - require - exists: a_setopt_api /= default_pointer - external - "C inline use " - alias - "[ - { - (FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api) - ((CURL *) $a_curl_handle, - (CURLoption)CURLOPT_READFUNCTION, - curl_read_function); - } - ]" - end - -feature -- cURL curl_easy_setopt functions - - progress_function (a_object_id: POINTER; a_download_total, a_download_now, a_upload_total, a_upload_now: REAL_64): INTEGER - -- Function correspond to {CURL_OPT_CONSTANTS}.curlopt_progressfunction - -- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which - -- may changed during GC. - deferred - end - - write_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER - -- Function called by libcurl as soon as there is data received that needs to be saved. - -- The size of the data pointed to by `a_data_pointer' is `a_size' multiplied with `a_nmemb', it will not be null terminated. - -- Returns the number of bytes actually taken care of - -- - -- Function corresponds to {CURL_OPT_CONSTANTS}.curlopt_writefunction - -- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which - -- may changed during GC. - --| libcurl doc: - --| Function pointer that should match the following prototype: size_t function( char *ptr, size_t size, size_t nmemb, void *userdata); - --| This function gets called by libcurl as soon as there is data received that needs to be saved. - --| The size of the data pointed to by ptr is size multiplied with nmemb, it will not be zero terminated. - --| Return the number of bytes actually taken care of. - --| If that amount differs from the amount passed to your function, it'll signal an error to the library. - --| This will abort the transfer and return CURLE_WRITE_ERROR. - --| From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will cause writing to this connection to become paused. - --| See curl_easy_pause(3) for further details. - --| - --| This function may be called with zero bytes data if the transferred file is empty. - --| - --| Set this option to NULL to get the internal default function. - --| The internal default function will write the data to the FILE * given with CURLOPT_WRITEDATA. - --| - --| Set the userdata argument with the CURLOPT_WRITEDATA option. - --| - --| The callback function will be passed as much data as possible in all invokes, - --| but you cannot possibly make any assumptions. It may be one byte, it may be thousands. - --| The maximum amount of body data that can be passed to the write callback is defined - --| in the curl.h header file: CURL_MAX_WRITE_SIZE (the usual default is 16K). - --| If you however have CURLOPT_HEADER set, which sends header data to the write callback, - --| you can get up to CURL_MAX_HTTP_HEADER bytes of header data passed into it. This usually means 100K. - deferred - end - - read_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER - -- Function called by libcurl as soon as it needs to read data in order to send it to the peer. - -- The data area pointed at by the pointer `a_data_pointer' may be filled with at most - -- `a_size' multiplied with `a_nmemb' number of bytes. - -- Returns the actual number of bytes stored in that memory area. - -- Returning 0 will signal end-of-file to the library and cause it to stop the current transfer. - -- - -- Function corresponds to {CURL_OPT_CONSTANTS}.curlopt_readfunction - -- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which - -- may changed during GC. - --| libcurl doc: - --| Function pointer that should match the following prototype: size_t function( void *ptr, size_t size, size_t nmemb, void *userdata); - --| This function gets called by libcurl as soon as it needs to read data in order to send it to the peer. - --| The data area pointed at by the pointer ptr may be filled with at most size multiplied with nmemb number of bytes. - --| Your function must return the actual number of bytes that you stored in that memory area. - --| Returning 0 will signal end-of-file to the library and cause it to stop the current transfer. - --| - --| If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it, - --| like when you've said you will upload N bytes and you upload less than N bytes), - --| you may experience that the server "hangs" waiting for the rest of the data that won't come. - --| - --| The read callback may return CURL_READFUNC_ABORT to stop the current operation immediately, - --| resulting in a CURLE_ABORTED_BY_CALLBACK error code from the transfer (Added in 7.12.1) - --| - --| From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause reading from this connection to become paused. - --| See curl_easy_pause(3) for further details. - --| - --| Bugs: when doing TFTP uploads, you must return the exact amount of data that the callback wants, - --| or it will be considered the final packet by the server end and the transfer will end there. - --| - --| If you set this callback pointer to NULL, or don't set it at all, the default internal read function will be used. - --| It is doing an fread() on the FILE * userdata set with CURLOPT_READDATA. - deferred - end - - debug_function (a_curl_handle: POINTER; a_curl_infotype: INTEGER; a_char_pointer: POINTER; a_size: INTEGER; a_object_id: POINTER): INTEGER - -- Function correspond to {CURL_OPT_CONSTANTS}.curlopt_debugfunction - -- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which - -- may changed during GC. - require - vaild: (create {CURL_INFO_TYPE}).is_valid (a_curl_infotype) - deferred - end - -feature {NONE} -- Externals - - c_set_object (a_object: POINTER) - -- Set Current object address. - external - "C signature (EIF_REFERENCE) use %"eiffel_curl.h%"" - end - - c_release_object - -- Release Current pointer in C - external - "C use %"eiffel_curl.h%"" - end - - c_set_progress_function_address (a_address: POINTER) - -- Set progress function address. - external - "C use %"eiffel_curl.h%"" - end - - c_set_write_function_address (a_address: POINTER) - -- Set write function address. - external - "C use %"eiffel_curl.h%"" - end - - c_set_read_function_address (a_address: POINTER) - -- Set read function address. - external - "C use %"eiffel_curl.h%"" - end - - c_set_debug_function_address (a_address: POINTER) - -- Set write function address. - external - "C use %"eiffel_curl.h%"" - end - -feature {NONE} -- Implementation - - dispose - -- Wean `Current' - do - c_release_object - c_set_object (default_pointer) - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_global_constants.e b/contrib/ise_library/cURL/curl_global_constants.e deleted file mode 100644 index 90d4c29a..00000000 --- a/contrib/ise_library/cURL/curl_global_constants.e +++ /dev/null @@ -1,78 +0,0 @@ -note - description: "[ - cURL library constants used by curl_global_init () - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_GLOBAL_CONSTANTS - -feature -- Query - - curl_global_ssl: NATURAL_64 - -- Delcared as CURL_GLOBAL_SSL - external - "C inline use " - alias - "[ - return CURL_GLOBAL_SSL; - ]" - end - - curl_global_win32: NATURAL_64 - -- Delcared as CURL_GLOBAL_WIN32 - external - "C inline use " - alias - "[ - return CURL_GLOBAL_WIN32; - ]" - end - - curl_global_all: NATURAL_64 - -- Delcared as CURL_GLOBAL_ALL - external - "C inline use " - alias - "[ - return CURL_GLOBAL_ALL; - ]" - end - - curl_global_nothing: NATURAL_64 - -- Delcared as CURL_GLOBAL_NOTHING - external - "C inline use " - alias - "[ - return CURL_GLOBAL_NOTHING; - ]" - end - - curl_global_default: NATURAL_64 - -- Delcared as CURL_GLOBAL_DEFAULT - external - "C inline use " - alias - "[ - return CURL_GLOBAL_DEFAULT; - ]" - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end - diff --git a/contrib/ise_library/cURL/curl_info_constants.e b/contrib/ise_library/cURL/curl_info_constants.e deleted file mode 100644 index c8dfd480..00000000 --- a/contrib/ise_library/cURL/curl_info_constants.e +++ /dev/null @@ -1,122 +0,0 @@ -note - description: "[ - cURL library info constants. - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_INFO_CONSTANTS - -feature -- Constants - - curlinfo_string: INTEGER = 0x100000 - -- Declared as CURLINFO_STRING - - curlinfo_long: INTEGER = 0x200000 - -- Declared as CURLINFO_LONG - - curlinfo_double: INTEGER = 0x300000 - -- Declared as CURLINFO_DOUBLE - - curlinfo_slist: INTEGER = 0x400000 - -- Declared as CURLINFO_SLIST - - curlinfo_mask: INTEGER = 0x0fffff - -- Declared as CURLINFO_MASK - - curlinfo_typemask: INTEGER = 0xf00000 - -- Declared as CURLINFO_TYPEMASK - -feature -- Info constants - - curlinfo_effective_url: INTEGER = 0x100001 -- CURLINFO_STRING + 1, - curlinfo_response_code: INTEGER = 0x200002 -- CURLINFO_LONG + 2, - curlinfo_total_time: INTEGER = 0x300003 -- CURLINFO_DOUBLE + 3, - curlinfo_namelookup_time: INTEGER = 0x300004 -- CURLINFO_DOUBLE + 4, - curlinfo_connect_time: INTEGER = 0x300005 -- CURLINFO_DOUBLE + 5, - curlinfo_pretransfer_time: INTEGER = 0x300006 -- CURLINFO_DOUBLE + 6, - curlinfo_size_upload: INTEGER = 0x300007 -- CURLINFO_DOUBLE + 7, - curlinfo_size_download: INTEGER = 0x300008 -- CURLINFO_DOUBLE + 8, - curlinfo_speed_download: INTEGER = 0x300009 -- CURLINFO_DOUBLE + 9, - curlinfo_speed_upload: INTEGER = 0x30000a -- CURLINFO_DOUBLE + 10, - curlinfo_header_size: INTEGER = 0x20000b -- CURLINFO_LONG + 11, - curlinfo_request_size: INTEGER = 0x20000c -- CURLINFO_LONG + 12, - curlinfo_ssl_verifyresult: INTEGER = 0x20000d -- CURLINFO_LONG + 13, - curlinfo_filetime: INTEGER = 0x20000e -- CURLINFO_LONG + 14, - curlinfo_content_length_download: INTEGER = 0x30000f -- CURLINFO_DOUBLE + 15, - curlinfo_content_length_upload: INTEGER = 0x300010 -- CURLINFO_DOUBLE + 16, - curlinfo_starttransfer_time: INTEGER = 0x300011 -- CURLINFO_DOUBLE + 17, - curlinfo_content_type: INTEGER = 0x100012 -- CURLINFO_STRING + 18, - curlinfo_redirect_time: INTEGER = 0x300013 -- CURLINFO_DOUBLE + 19, - curlinfo_redirect_count: INTEGER = 0x200014 -- CURLINFO_LONG + 20, - curlinfo_private: INTEGER = 0x100015 -- CURLINFO_STRING + 21, - curlinfo_http_connectcode: INTEGER = 0x200016 -- CURLINFO_LONG + 22, - curlinfo_httpauth_avail: INTEGER = 0x200017 -- CURLINFO_LONG + 23, - curlinfo_proxyauth_avail: INTEGER = 0x200018 -- CURLINFO_LONG + 24, - curlinfo_os_errno: INTEGER = 0x200019 -- CURLINFO_LONG + 25, - curlinfo_num_connects: INTEGER = 0x20001a -- CURLINFO_LONG + 26, - curlinfo_ssl_engines: INTEGER = 0x40001b -- CURLINFO_SLIST + 27, - curlinfo_cookielist: INTEGER = 0x40001c -- CURLINFO_SLIST + 28, - curlinfo_lastsocket: INTEGER = 0x20001d -- CURLINFO_LONG + 29, - curlinfo_ftp_entry_path: INTEGER = 0x10001e -- CURLINFO_STRING + 30, - -feature -- Contract support - - is_valid (a_code: INTEGER): BOOLEAN - -- Is `a_code' valid? - do - inspect a_code - when - curlinfo_effective_url, - curlinfo_response_code, - curlinfo_total_time, - curlinfo_namelookup_time, - curlinfo_connect_time, - curlinfo_pretransfer_time, - curlinfo_size_upload, - curlinfo_size_download, - curlinfo_speed_download, - curlinfo_speed_upload, - curlinfo_header_size, - curlinfo_request_size, - curlinfo_ssl_verifyresult, - curlinfo_filetime, - curlinfo_content_length_download, - curlinfo_content_length_upload, - curlinfo_starttransfer_time, - curlinfo_content_type, - curlinfo_redirect_time, - curlinfo_redirect_count, - curlinfo_private, - curlinfo_http_connectcode, - curlinfo_httpauth_avail, - curlinfo_proxyauth_avail, - curlinfo_os_errno, - curlinfo_num_connects, - curlinfo_ssl_engines, - curlinfo_cookielist, - curlinfo_lastsocket, - curlinfo_ftp_entry_path - then - Result := True - else - Result := False - end - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_info_type.e b/contrib/ise_library/cURL/curl_info_type.e deleted file mode 100644 index 7137e97e..00000000 --- a/contrib/ise_library/cURL/curl_info_type.e +++ /dev/null @@ -1,69 +0,0 @@ -note - description: "[ - cURL library info type constants. - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_INFO_TYPE - -feature -- Enumeration - - curlinfo_text: INTEGER = 0 - -- Declared as CURLINFO_TEXT - - curlinfo_header_in: INTEGER = 1 - -- Declared as CURLINFO_HEADER_IN - - curlinfo_header_out: INTEGER = 2 - -- Declared as CURLINFO_HEADER_OUT - - curlinfo_data_in: INTEGER = 3 - -- Declared as CURLINFO_DATA_IN - - curlinfo_data_out: INTEGER = 4 - -- Declared as CURLINFO_DATA_OUT - - curlinfo_ssl_data_in: INTEGER = 5 - -- Declared as CURLINFO_SSL_DATA_IN - - curlinfo_ssl_data_out: INTEGER = 6 - -- Declared as CURLINFO_SSL_DATA_OUT - -feature -- Contract support - - is_valid (a_type: INTEGER): BOOLEAN - -- If `a_type' valid? - do - inspect a_type - when - curlinfo_data_in, - curlinfo_data_out, - curlinfo_header_in, - curlinfo_header_out, - curlinfo_ssl_data_in, - curlinfo_ssl_data_out, - curlinfo_text - then - Result := True - else - Result := False - end - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_msg.e b/contrib/ise_library/cURL/curl_msg.e deleted file mode 100644 index 3a318a81..00000000 --- a/contrib/ise_library/cURL/curl_msg.e +++ /dev/null @@ -1,51 +0,0 @@ -note - description: "[ - C CURLMSG enum - ]" - date: "$Date$" - revision: "$Revision$" - -class - CURL_MSG - -feature -- Query - - curlmsg_done: INTEGER - -- Declared as CURLMSG_DONE. - -- This easy handle has completed. - -- 'result' contains the CURLcode of the transfer - external - "C inline use " - alias - "return CURLMSG_DONE;" - end - - curlmsg_none: INTEGER - -- Declared as CURLMSG_NONE. - -- First, not used - external - "C inline use " - alias - "return CURLMSG_NONE;" - end - - curlmsg_last: INTEGER - -- Declared as CURLMSG_LAST. - -- Last, not used - external - "C inline use " - alias - "return CURLMSG_LAST;" - end - -note - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/contrib/ise_library/cURL/curl_msg_struct.e b/contrib/ise_library/cURL/curl_msg_struct.e deleted file mode 100644 index b5e618a1..00000000 --- a/contrib/ise_library/cURL/curl_msg_struct.e +++ /dev/null @@ -1,83 +0,0 @@ -note - description: "[ - - C Struct CURLMsg wrapper - Read multi stack informationals - - This class is used by {CURL_MSG_STRUCT}.info_read - - More info: - http://curl.haxx.se/libcurl/c/curl_multi_info_read.html - ]" - date: "$Date$" - revision: "$Revision$" - -class - CURL_MSG_STRUCT - -create - make - -feature {NONE} -- Initialization - - make (a_pointer: POINTER) - -- Creation method - -- Bind message structure to the address `a_pointer'". - require - not_default: a_pointer /= default_pointer - do - item := a_pointer - ensure - set: item = a_pointer - end - -feature -- Query - - curl_handle: POINTER - -- CURL easy_handle - -- The handle it concerns - do - Result := c_curl_handle (item) - end - - msg: INTEGER - -- What does this message mean? - -- It's one value from {CURLMSG} - do - Result := c_msg (item) - end - -feature {NONE} -- Implementation - - item: POINTER - -- C struct item - -feature {NONE} -- C externals - - c_curl_handle (a_item: POINTER): POINTER - -- cURL easy handle it concerns - external - "C inline use " - alias - "return (CURL *)((CURLMsg *)$a_item)->easy_handle;" - end - - c_msg (a_item: POINTER): INTEGER - -- Get msg - external - "C inline use " - alias - "return (CURLMSG)((CURLMsg *)$a_item)->msg;" - end - -;note - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/contrib/ise_library/cURL/curl_multi_codes.e b/contrib/ise_library/cURL/curl_multi_codes.e deleted file mode 100644 index 44951a36..00000000 --- a/contrib/ise_library/cURL/curl_multi_codes.e +++ /dev/null @@ -1,48 +0,0 @@ -note - description: "[ - The generic return code used by functions in the libcurl multi interface. - Also consider curl_multi_strerror(3). - ]" - date: "$Date$" - revision: "$Revision$" - -class - CURL_MULTI_CODES - -feature -- Query - - curlm_call_multi_perform: INTEGER = -1 - -- This is not really an error. It means you should call curl_multi_perform(3) again without doing select() or similar in between. - - curlm_ok: INTEGER = 0 - -- Things are fine. - - curlm_bad_handle: INTEGER = 1 - -- The passed-in handle is not a valid CURLM handle. - - curlm_bad_easy_handle: INTEGER = 2 - -- An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle. - - curlm_out_of_memory: INTEGER = 3 - -- You are doomed. - - curlm_internal_error: INTEGER = 4 - -- This can only be returned if libcurl bugs. Please report it to us! - - curlm_bad_socket: INTEGER = 5 - -- The passed-in socket is not a valid one that libcurl already knows about. (Added in 7.15.4) - - curlm_unknown_option: INTEGER = 6 - -- curl_multi_setopt() with unsupported option (Added in 7.15.4) - -note - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/contrib/ise_library/cURL/curl_multi_externals.e b/contrib/ise_library/cURL/curl_multi_externals.e deleted file mode 100644 index 2ee944b0..00000000 --- a/contrib/ise_library/cURL/curl_multi_externals.e +++ /dev/null @@ -1,251 +0,0 @@ -note - description: "[ - The multi interface offers several abilities that the easy interface doesn't. They are mainly: - 1. Enable a "pull" interface. The application that uses libcurl decides where and when to ask libcurl to get/send data. - 2. Enable multiple simultaneous transfers in the same thread without making it complicated for the application. - 3. Enable the application to wait for action on its own file descriptors and curl's file descriptors simultaneous easily. - - More info: http://curl.haxx.se/libcurl/c/libcurl-multi.html - ]" - date: "$Date$" - revision: "$Revision$" - -class - CURL_MULTI_EXTERNALS - -feature -- Command - - init - -- Create a multi handle. - -- If success, Result is a cURL multi hanlde just created. - -- This feature maybe failed in some cases: cannot find required DLL, etc. - -- Then the post condition would be violated. - require - dynamic_library_exists: is_dynamic_library_exists - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_multi_init") - if l_api /= default_pointer then - item := c_init (l_api) - end - end - - add_handle (a_easy_handle: POINTER) - -- Add an easy handle to a multi session. - require - dynamic_library_exists: is_dynamic_library_exists - is_multi_handle_exists: is_exists - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_multi_add_handle") - if l_api /= default_pointer then - c_add_handle (l_api, item, a_easy_handle) - end - end - - remove_handle (a_easy_handle: POINTER) - -- Remove an easy handle from a multi session. - require - dynamic_library_exists: is_dynamic_library_exists - is_multi_handle_exists: is_exists - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_multi_remove_handle") - if l_api /= default_pointer then - c_remove_handle (l_api, item, a_easy_handle) - end - end - - cleanup: INTEGER - -- Close down a multi session. - -- Result is one value from {CURL_MULTI_CODES}. - require - dynamic_library_exists: is_dynamic_library_exists - is_multi_handle_exists: is_exists - local - l_api: POINTER - do - l_api := api_loader.api_pointer ("curl_multi_cleanup") - if l_api /= default_pointer then - Result := c_cleanup (l_api, item) - end - end - - perform (a_running_handle: CELL [INTEGER]): INTEGER - -- Reads/writes available data from each easy handle. - -- Result is one value from {CURL_MULTI_CODES}. - require - dynamic_library_exists: is_dynamic_library_exists - is_multi_handle_exists: is_exists - local - l_api: POINTER - l_running_handle: INTEGER - do - l_api := api_loader.api_pointer ("curl_multi_perform") - if l_api /= default_pointer then - Result := c_perform (l_api, item, $l_running_handle) - a_running_handle.put (l_running_handle) - end - end - - info_read (a_msgs_in_queue: CELL [INTEGER]): POINTER - -- Read multi stack informationals. - -- The result is C struct CURLMsg {CURL_MSG_STRUCT}. - -- Repeated calls to this function will return a new struct each time, until a NULL - -- is returned as a signal that there is no more to get at this point. The integer - -- pointed to with msgs_in_queue will contain the number of remaining messages after - -- this function was called. - -- When you fetch a message using this function, it is removed from the internal queue - -- so calling this function again will not return the same message again. It will instead - -- return new messages at each new invoke until the queue is emptied. - require - dynamic_library_exists: is_dynamic_library_exists - is_multi_handle_exists: is_exists - local - l_api: POINTER - l_msgs_in_queue: INTEGER - do - l_api := api_loader.api_pointer ("curl_multi_info_read") - if l_api /= default_pointer then - Result := c_info_read (l_api, item, $l_msgs_in_queue) - a_msgs_in_queue.put (l_msgs_in_queue) - end - end - - is_dynamic_library_exists: BOOLEAN - -- Are required .dll/.so files available? - do - Result := api_loader.is_interface_usable - end - --- Feature not yet wrapped/tested --- curl_multi_assign --- curl_multi_fdset --- curl_multi_setopt --- curl_multi_socket --- curl_multi_socket_action --- curl_multi_strerror --- curl_multi_timeout - -feature -- Query - - is_exists: BOOLEAN - -- If C pointer exists? - do - Result := item /= default_pointer - end - -feature {NONE} -- Implementation - - item: POINTER - -- C pointer item for cURL multi - -feature {NONE} -- C externals - - c_init (a_api: POINTER): POINTER - -- Declared as curl_multi_init (). - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - return (FUNCTION_CAST(CURLM *, ()) $a_api)(); - ]" - end - - c_cleanup (a_api: POINTER; a_multi_handle: POINTER): INTEGER - -- Declared as curl_multi_cleanup (). - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - return (FUNCTION_CAST(CURLMcode, (CURLM *)) $a_api) - ((CURLM *)$a_multi_handle); - ]" - end - - c_add_handle (a_api: POINTER; a_multi_handle: POINTER; a_easy_handle: POINTER) - -- Declared as curl_multi_add_handle (). - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - (FUNCTION_CAST(void, (CURLM *, CURL *)) $a_api) - ((CURLM *) $a_multi_handle, - (CURL *) $a_easy_handle); - ]" - end - - c_remove_handle (a_api: POINTER; a_multi_handle: POINTER; a_easy_handle: POINTER) - -- Declared as curl_multi_remove_handle (). - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - (FUNCTION_CAST(void, (CURLM *, CURL *)) $a_api) - ((CURLM *) $a_multi_handle, - (CURL *) $a_easy_handle); - ]" - end - - c_perform (a_api: POINTER; a_multi_handle: POINTER; a_running_handles: TYPED_POINTER [INTEGER]): INTEGER - -- Declared as curl_multi_perform. - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - return (FUNCTION_CAST(CURLMcode, (CURLM *, int *)) $a_api) - ((CURLM *) $a_multi_handle, - (int *) $a_running_handles); - ]" - end - - c_info_read (a_api: POINTER; a_multi_handle: POINTER; a_msgs_in_queue: TYPED_POINTER [INTEGER]): POINTER - -- Declared as curl_multi_info_read. - require - exists: a_api /= default_pointer - external - "C inline use " - alias - "[ - return (FUNCTION_CAST(CURLMsg *, (CURLM *, int *)) $a_api) - ((CURLM *) $a_multi_handle, - (int *) $a_msgs_in_queue); - ]" - end - -feature {NONE} -- Implementation - - api_loader: DYNAMIC_MODULE - -- Module name. - local - l_utility: CURL_UTILITY - once - create l_utility - Result := l_utility.api_loader - end - - -note - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/contrib/ise_library/cURL/curl_opt_constants.e b/contrib/ise_library/cURL/curl_opt_constants.e deleted file mode 100644 index 372e3f27..00000000 --- a/contrib/ise_library/cURL/curl_opt_constants.e +++ /dev/null @@ -1,1117 +0,0 @@ -note - description: "[ - libcurl library opt constants - For more informaton see: - - http://curl.haxx.se/libcurl/c/curl_easy_setopt.html - - Code related to LIBCURL_VERSION: 7.17.0 - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_OPT_CONSTANTS - -feature -- Version - - libcurl_version: STRING - -- String representation of LIBCURL_VERSION - do - create Result.make_from_c (libcurl_version_pointer) - end - - libcurl_version_pointer: POINTER - -- String pointer declared as LIBCURL_VERSION - external - "C inline use " - alias - "return LIBCURL_VERSION;" - end - - libcurl_version_major: INTEGER - -- Declared as LIBCURL_VERSION_MAJOR - external - "C inline use " - alias - "return LIBCURL_VERSION_MAJOR;" - end - - libcurl_version_minor: INTEGER - -- Declared as LIBCURL_VERSION_MINOR - external - "C inline use " - alias - "return LIBCURL_VERSION_MINOR;" - end - - libcurl_version_patch: INTEGER - -- Declared as LIBCURL_VERSION_PATCH - external - "C inline use " - alias - "return LIBCURL_VERSION_PATCH;" - end - -feature -- Behavior - - curlopt_verbose: INTEGER - -- Declared as CURLOPT_VERBOSE. - external - "C inline use " - alias - "return CURLOPT_VERBOSE;" - end - - curlopt_header: INTEGER - -- Declared as CURLOPT_HEADER. - external - "C inline use " - alias - "return CURLOPT_HEADER;" - end - - curlopt_noprogress: INTEGER - -- Declared as CURLOPT_NOPROGRESS - external - "C inline use " - alias - "return CURLOPT_NOPROGRESS;" - end - -feature -- Callback - - curlopt_writefunction: INTEGER - -- Declared as CURLOPT_WRITEFUNCTION. - external - "C inline use " - alias - "return CURLOPT_WRITEFUNCTION;" - end - - curlopt_writedata: INTEGER - -- Declared as CURLOPT_WRITEDATA. - external - "C inline use " - alias - "return CURLOPT_WRITEDATA;" - end - - curlopt_readfunction: INTEGER - -- Declared as CURLOPT_READFUNCTION. - external - "C inline use " - alias - "return CURLOPT_READFUNCTION;" - end - - curlopt_readdata: INTEGER - -- Declared as CURLOPT_READDATA. - external - "C inline use " - alias - "return CURLOPT_READDATA;" - end - - curlopt_debugfunction: INTEGER - -- Declared as CURLOPT_DEBUGFUNCTION. - external - "C inline use " - alias - "return CURLOPT_DEBUGFUNCTION;" - end - - curlopt_progressfunction: INTEGER - -- Declared as CURLOPT_PROGRESSFUNCTION - external - "C inline use " - alias - "return CURLOPT_PROGRESSFUNCTION;" - end - - curlopt_progressdata: INTEGER - -- Declared as CURLOPT_PROGRESSDATA - external - "C inline use " - alias - "return CURLOPT_PROGRESSDATA;" - end - - curlopt_writeheader: INTEGER - -- Declared as CURLOPT_WRITEHEADER. - external - "C inline use " - alias - "return CURLOPT_WRITEHEADER;" - end - -feature -- Network - - curlopt_url: INTEGER - -- Declared as CURLOPT_URL. - external - "C inline use " - alias - "return CURLOPT_URL;" - end - - curlopt_proxy: INTEGER - -- Declared as CURLOPT_PROXY. - external - "C inline use " - alias - "return CURLOPT_PROXY;" - end - - curlopt_proxyport: INTEGER - -- Declared as CURLOPT_PROXYPORT. - external - "C inline use " - alias - "return CURLOPT_PROXYPORT;" - end - - curlopt_proxytype: INTEGER - -- Declared as CURLOPT_PROXYTYPE. - external - "C inline use " - alias - "return CURLOPT_PROXYTYPE;" - end - - curlopt_httpproxytunnel: INTEGER - -- Declared as CURLOPT_HTTPPROXYTUNNEL. - external - "C inline use " - alias - "return CURLOPT_HTTPPROXYTUNNEL;" - end - - curlopt_interface: INTEGER - -- Declared as CURLOPT_INTERFACE. - external - "C inline use " - alias - "return CURLOPT_INTERFACE;" - end - - curlopt_localport: INTEGER - -- Declared as CURLOPT_LOCALPORT - external - "C inline use " - alias - "return CURLOPT_LOCALPORT;" - end - - curlopt_localportrange: INTEGER - -- Declared as CURLOPT_LOCALPORTRANGE - external - "C inline use " - alias - "return CURLOPT_LOCALPORTRANGE;" - end - - curlopt_buffersize: INTEGER - -- Declared as CURLOPT_BUFFERSIZE - external - "C inline use " - alias - "return CURLOPT_BUFFERSIZE" - end - - curlopt_port: INTEGER - -- Declared as CURLOPT_PORT - external - "C inline use " - alias - "return CURLOPT_PORT;" - end - - curlopt_tcp_nodelay: INTEGER - -- Declared as CURLOPT_TCP_NODELAY - external - "C inline use " - alias - "return CURLOPT_TCP_NODELAY;" - end - -feature -- Names and Passwords (Authentication) - - curlopt_userpwd: INTEGER - -- Declared as CURLOPT_USERPWD. - external - "C inline use " - alias - "return CURLOPT_USERPWD;" - end - - curlopt_proxyuserpwd: INTEGER - -- Declared as CURLOPT_PROXYUSERPWD - external - "C inline use " - alias - "return CURLOPT_PROXYUSERPWD;" - end - - curlopt_httpauth: INTEGER - -- Declared as CURLOPT_HTTPAUTH. - external - "C inline use " - alias - "return CURLOPT_HTTPAUTH;" - end - - curlauth_none: INTEGER - -- Declared as CURLAUTH_NONE. - external - "C inline use " - alias - "return CURLAUTH_NONE;" - end - - curlauth_basic: INTEGER - -- Declared as CURLAUTH_BASIC. - external - "C inline use " - alias - "return CURLAUTH_BASIC;" - end - - curlauth_digest: INTEGER - -- Declared as CURLAUTH_DIGEST. - external - "C inline use " - alias - "return CURLAUTH_DIGEST;" - end - - curlauth_any: INTEGER - -- Declared as CURLAUTH_ANY. - external - "C inline use " - alias - "return CURLAUTH_ANY;" - end - - curlauth_anysafe: INTEGER - -- Declared as CURLAUTH_ANYSAFE. - external - "C inline use " - alias - "return CURLAUTH_ANYSAFE;" - end - - curlopt_proxyauth: INTEGER - -- Declared as CURLOPT_PROXYAUTH - external - "C inline use " - alias - "return CURLOPT_PROXYAUTH;" - end - -feature -- HTTP - - curlopt_autoreferer: INTEGER - -- Declared as CURLOPT_AUTOREFERER - external - "C inline use " - alias - "return CURLOPT_AUTOREFERER;" - end - - curlopt_encoding: INTEGER - -- Declared as CURLOPT_ENCODING. - -- in future version, this is called CURLOPT_ACCEPT_ENCODING - external - "C inline use " - alias - "return CURLOPT_ENCODING;" - end - - curlopt_followlocation: INTEGER - -- Declared as CURLOPT_FOLLOWLOCATION - external - "C inline use " - alias - "return CURLOPT_FOLLOWLOCATION;" - end - - curlopt_unrestricted_auth: INTEGER - -- Declared as CURLOPT_UNRESTRICTED_AUTH - external - "C inline use " - alias - "return CURLOPT_UNRESTRICTED_AUTH;" - end - - curlopt_maxredirs: INTEGER - -- Declared as CURLOPT_MAXREDIRS - external - "C inline use " - alias - "return CURLOPT_MAXREDIRS;" - end - - curlopt_put: INTEGER - -- Declared as CURLOPT_PUT. - external - "C inline use " - alias - "return CURLOPT_PUT;" - end - - curlopt_post: INTEGER - -- Declared as CURLOPT_POST. - external - "C inline use " - alias - "return CURLOPT_POST;" - end - - curlopt_postfields: INTEGER - -- Declared as CURLOPT_POSTFIELDS. - external - "C inline use " - alias - "return CURLOPT_POSTFIELDS;" - end - - curlopt_postfieldsize: INTEGER - -- Declared as CURLOPT_POSTFIELDSIZE - external - "C inline use " - alias - "return CURLOPT_POSTFIELDSIZE;" - end - - curlopt_postfieldsize_large: INTEGER - -- Declared as CURLOPT_POSTFIELDSIZE_LARGE - external - "C inline use " - alias - "return CURLOPT_POSTFIELDSIZE_LARGE;" - end - - curlopt_httppost: INTEGER - -- Declared as CURLOPT_HTTPPOST. - external - "C inline use " - alias - "return CURLOPT_HTTPPOST;" - end - - curlopt_referer: INTEGER - -- Declared as CURLOPT_REFERER - external - "C inline use " - alias - "return CURLOPT_REFERER;" - end - - curlopt_useragent: INTEGER - -- Declared as CURLOPT_USERAGENT. - external - "C inline use " - alias - "return CURLOPT_USERAGENT;" - end - - curlopt_httpheader: INTEGER - -- Declared as CURLOPT_HTTPHEADER. - external - "C inline use " - alias - "return CURLOPT_HTTPHEADER;" - end - - curlopt_cookie: INTEGER - -- Declared as CURLOPT_COOKIE. - external - "C inline use " - alias - "return CURLOPT_COOKIE;" - end - - curlopt_cookiefile: INTEGER - -- Declared as CURLOPT_COOKIEFILE. - external - "C inline use " - alias - "return CURLOPT_COOKIEFILE;" - end - - curlopt_cookiejar: INTEGER - -- Declared as CURLOPT_COOKIEJAR - external - "C inline use " - alias - "return CURLOPT_COOKIEJAR;" - end - - curlopt_cookiesession: INTEGER - -- Declared as CURLOPT_COOKIESESSION - external - "C inline use " - alias - "return CURLOPT_COOKIESESSION;" - end - - curlopt_cookielist: INTEGER - -- Declared as CURLOPT_COOKIELIST. - external - "C inline use " - alias - "return CURLOPT_COOKIELIST" - end - - curlopt_httpget: INTEGER - -- Declared as CURLOPT_HTTPGET - -- Pass a long. If the long is non-zero, this forces the HTTP request to get back to GET. usable if a POST, HEAD, PUT or a custom request have been used previously using the same curl handle. - -- When setting CURLOPT_HTTPGET to a non-zero value, it will automatically set CURLOPT_NOBODY to 0 (since 7.14.1). - external - "C inline use " - alias - "return CURLOPT_HTTPGET;" - end - - curlopt_http_version: INTEGER - -- Declared as CURLOPT_HTTP_VERSION - external - "C inline use " - alias - "return CURLOPT_HTTP_VERSION;" - end - - curlopt_ignore_content_length: INTEGER - -- Declared as CURLOPT_IGNORE_CONTENT_LENGTH - external - "C inline use " - alias - "return CURLOPT_IGNORE_CONTENT_LENGTH;" - end - - curlopt_http_content_decoding: INTEGER - -- Declared as CURLOPT_HTTP_CONTENT_DECODING - external - "C inline use " - alias - "return CURLOPT_HTTP_CONTENT_DECODING;" - end - -feature -- Protocol - - curlopt_transfertext: INTEGER - -- Declared as CURLOPT_TRANSFERTEXT - external - "C inline use " - alias - "return CURLOPT_TRANSFERTEXT;" - end - - curlopt_crlf: INTEGER - -- Declared as CURLOPT_CRLF - external - "C inline use " - alias - "return CURLOPT_CRLF;" - end - - curlopt_resume_from: INTEGER - -- Declared as CURLOPT_RESUME_FROM - external - "C inline use " - alias - "return CURLOPT_RESUME_FROM;" - end - - curlopt_resume_from_large: INTEGER - -- Declared as CURLOPT_RESUME_FROM_LARGE - external - "C inline use " - alias - "return CURLOPT_RESUME_FROM_LARGE;" - end - - curlopt_customrequest: INTEGER - -- Declared as CURLOPT_CUSTOMREQUEST - external - "C inline use " - alias - "return CURLOPT_CUSTOMREQUEST" - end - - curlopt_filetime: INTEGER - -- Declared as CURLOPT_FILETIME - external - "C inline use " - alias - "return CURLOPT_FILETIME;" - end - - curlopt_nobody: INTEGER - -- Declared as CURLOPT_NOBODY - external - "C inline use " - alias - "return CURLOPT_NOBODY;" - end - - curlopt_infilesize: INTEGER - -- Declared as CURLOPT_INFILESIZE - external - "C inline use " - alias - "return CURLOPT_INFILESIZE;" - end - - curlopt_infilesize_large: INTEGER - -- Declared as CURLOPT_INFILESIZE_LARGE. - external - "C inline use " - alias - "return CURLOPT_INFILESIZE_LARGE;" - end - - curlopt_upload: INTEGER - -- Declared as CURLOPT_UPLOAD. - external - "C inline use " - alias - "return CURLOPT_UPLOAD;" - end - - curlopt_maxfilesize: INTEGER - -- Declared as CURLOPT_MAXFILESIZE - external - "C inline use " - alias - "return CURLOPT_MAXFILESIZE;" - end - - curlopt_maxfilesize_large: INTEGER - -- Declared as CURLOPT_MAXFILESIZE_LARGE - external - "C inline use " - alias - "return CURLOPT_MAXFILESIZE_LARGE;" - end - - curlopt_timecondition: INTEGER - -- Declared as CURLOPT_TIMECONDITION - external - "C inline use " - alias - "return CURLOPT_TIMECONDITION;" - end - - curlopt_timevalue: INTEGER - -- Declared as CURLOPT_TIMEVALUE - external - "C inline use " - alias - "return CURLOPT_TIMEVALUE;" - end - -feature -- Connection - - curlopt_timeout: INTEGER - -- Declared as CURLOPT_TIMEOUT. - external - "C inline use " - alias - "return CURLOPT_TIMEOUT" - end - - curlopt_connect_timeout: INTEGER - -- The number of seconds to wait while trying to connect. Use 0 to wait indefinitely. - -- Declared as CURLOPT_CONNECTTIMEOUT - external - "C inline use " - alias - "[ - return CURLOPT_CONNECTTIMEOUT - ]" - end - - curlopt_timeout_ms: INTEGER - -- Declared as CURLOPT_TIMEOUT_MS - external - "C inline use " - alias - "return CURLOPT_TIMEOUT_MS;" - end - - curlopt_low_speed_limit: INTEGER - -- Declared as CURLOPT_LOW_SPEED_LIMIT - external - "C inline use " - alias - "return CURLOPT_LOW_SPEED_LIMIT;" - end - - curlopt_low_speed_time: INTEGER - -- Declared as CURLOPT_LOW_SPEED_TIME - external - "C inline use " - alias - "return CURLOPT_LOW_SPEED_TIME;" - end - - curlopt_max_send_speed_large: INTEGER - -- Declared as CURLOPT_MAX_SEND_SPEED_LARGE - external - "C inline use " - alias - "return CURLOPT_MAX_SEND_SPEED_LARGE;" - end - - curlopt_max_recv_speed_large: INTEGER - -- Declared as CURLOPT_MAX_RECV_SPEED_LARGE - external - "C inline use " - alias - "return CURLOPT_MAX_RECV_SPEED_LARGE;" - end - - curlopt_maxconnects: INTEGER - -- Declared as CURLOPT_MAXCONNECTS - external - "C inline use " - alias - "return CURLOPT_MAXCONNECTS;" - end - - curlopt_fresh_connect: INTEGER - -- Declared as CURLOPT_FRESH_CONNECT - external - "C inline use " - alias - "return CURLOPT_FRESH_CONNECT;" - end - - curlopt_forbid_reuse: INTEGER - -- Declared as CURLOPT_FORBID_REUSE - external - "C inline use " - alias - "return CURLOPT_FORBID_REUSE;" - end - - curlopt_connecttimeout: INTEGER - -- Declared as CURLOPT_CONNECTTIMEOUT. - external - "C inline use " - alias - "return CURLOPT_CONNECTTIMEOUT" - end - - curlopt_ipresolve: INTEGER - -- Declared as CURLOPT_IPRESOLVE - external - "C inline use " - alias - "return CURLOPT_IPRESOLVE;" - end - - curl_ipresolve_whatever: INTEGER - -- Declared as CURL_IPRESOLVE_WHATEVER - external - "C inline use " - alias - "return CURL_IPRESOLVE_WHATEVER;" - end - - curl_ipresolve_v4: INTEGER - -- Declared as CURL_IPRESOLVE_V4 - external - "C inline use " - alias - "return CURL_IPRESOLVE_V4;" - end - - curl_ipresolve_v6: INTEGER - -- Declared as CURL_IPRESOLVE_V6 - external - "C inline use " - alias - "return CURL_IPRESOLVE_V6;" - end - - curlopt_connect_only: INTEGER - -- Declared as CURLOPT_CONNECT_ONLY - external - "C inline use " - alias - "return CURLOPT_CONNECT_ONLY;" - end - - curlopt_use_ssl: INTEGER - -- Declared as CURLOPT_USE_SSL - external - "C inline use " - alias - "return CURLOPT_USE_SSL;" - end - - curlusessl_none: INTEGER - -- Declared as CURLUSESSL_NONE - external - "C inline use " - alias - "return CURLUSESSL_NONE;" - end - - curlusessl_try: INTEGER - -- Declared as CURLUSESSL_TRY - external - "C inline use " - alias - "return CURLUSESSL_TRY;" - end - - curlusessl_control: INTEGER - -- Declared as CURLUSESSL_CONTROL - external - "C inline use " - alias - "return CURLUSESSL_CONTROL;" - end - - curlusessl_all: INTEGER - -- Declared as CURLUSESSL_ALL - external - "C inline use " - alias - "return CURLUSESSL_ALL;" - end - -feature -- SSL and Security - - curlopt_sslcert: INTEGER - -- Declared as CURLOPT_SSLCERT - external - "C inline use " - alias - "return CURLOPT_SSLCERT;" - end - - curlopt_sslcerttype: INTEGER - -- Declared as CURLOPT_SSLCERTTYPE - external - "C inline use " - alias - "return CURLOPT_SSLCERTTYPE;" - end - - curlopt_sslkey: INTEGER - -- Declared as CURLOPT_SSLKEY - external - "C inline use " - alias - "return CURLOPT_SSLKEY;" - end - - curlopt_sslkeytype: INTEGER - -- Declared as CURLOPT_SSLKEYTYPE - external - "C inline use " - alias - "return CURLOPT_SSLKEYTYPE;" - end - - curlopt_keypasswd: INTEGER - -- Declared as CURLOPT_KEYPASSWD - external - "C inline use " - alias - "return CURLOPT_KEYPASSWD;" - end - - curlopt_sslengine: INTEGER - -- Declared as CURLOPT_SSLENGINE - external - "C inline use " - alias - "return CURLOPT_SSLENGINE;" - end - - curlopt_sslengine_default: INTEGER - -- Declared as CURLOPT_SSLENGINE_DEFAULT - external - "C inline use " - alias - "return CURLOPT_SSLENGINE_DEFAULT;" - end - - curlopt_sslversion: INTEGER - -- Declared as CURLOPT_SSLVERSION - external - "C inline use " - alias - "return CURLOPT_SSLVERSION;" - end - - curl_sslversion_default: INTEGER - -- Declared as CURL_SSLVERSION_DEFAULT - external - "C inline use " - alias - "return CURL_SSLVERSION_DEFAULT;" - end - - curl_sslversion_tlsv1: INTEGER - -- Declared as CURL_SSLVERSION_TLSv1 - external - "C inline use " - alias - "return CURL_SSLVERSION_TLSv1;" - end - - curl_sslversion_sslv2: INTEGER - -- Declared as CURL_SSLVERSION_SSLv2 - external - "C inline use " - alias - "return CURL_SSLVERSION_SSLv2;" - end - - curl_sslversion_sslv3: INTEGER - -- Declared as CURL_SSLVERSION_SSLv3 - external - "C inline use " - alias - "return CURL_SSLVERSION_SSLv3;" - end - - curlopt_ssl_verifypeer: INTEGER - -- Declared as CURLOPT_SSL_VERIFYPEER. - external - "C inline use " - alias - "return CURLOPT_SSL_VERIFYPEER;" - end - - curlopt_cainfo: INTEGER - -- Declared as CURLOPT_CAINFO - external - "C inline use " - alias - "return CURLOPT_CAINFO;" - end - - curlopt_capath: INTEGER - -- Declared as CURLOPT_CAPATH - external - "C inline use " - alias - "return CURLOPT_CAPATH;" - end - - curlopt_ssl_verifyhost: INTEGER - -- Declared as CURLOPT_SSL_VERIFYHOST - external - "C inline use " - alias - "return CURLOPT_SSL_VERIFYHOST;" - end - - curlopt_random_file: INTEGER - -- Declared as CURLOPT_RANDOM_FILE - external - "C inline use " - alias - "return CURLOPT_RANDOM_FILE;" - end - - curlopt_egdsocket: INTEGER - -- Declared as CURLOPT_EGDSOCKET - external - "C inline use " - alias - "return CURLOPT_EGDSOCKET;" - end - - curlopt_ssl_cipher_list: INTEGER - -- Declared as CURLOPT_SSL_CIPHER_LIST - external - "C inline use " - alias - "return CURLOPT_SSL_CIPHER_LIST;" - end - - curlopt_ssl_sessionid_cache: INTEGER - -- Declared as CURLOPT_SSL_SESSIONID_CACHE - external - "C inline use " - alias - "return CURLOPT_SSL_SESSIONID_CACHE;" - end - - curlopt_krblevel: INTEGER - -- Declared as CURLOPT_KRBLEVEL - external - "C inline use " - alias - "return CURLOPT_KRBLEVEL;" - end - -feature -- SSH - - curlopt_ssh_auth_types: INTEGER - -- Declared as CURLOPT_SSH_AUTH_TYPES - external - "C inline use " - alias - "return CURLOPT_SSH_AUTH_TYPES;" - end - - curlopt_ssh_public_keyfile: INTEGER - -- Declared as CURLOPT_SSH_PUBLIC_KEYFILE - external - "C inline use " - alias - "return CURLOPT_SSH_PUBLIC_KEYFILE;" - end - - curlopt_ssh_private_keyfile: INTEGER - -- Declared as CURLOPT_SSH_PRIVATE_KEYFILE - external - "C inline use " - alias - "return CURLOPT_SSH_PRIVATE_KEYFILE;" - end - -feature -- Status report - - is_valid (v: INTEGER): BOOLEAN - -- If `v' value valid? - do - Result := v = curlopt_verbose or - v = curlopt_header or - v = curlopt_noprogress or - v = curlopt_writefunction or - v = curlopt_writedata or - v = curlopt_readfunction or - v = curlopt_readdata or - v = curlopt_debugfunction or - v = curlopt_progressfunction or - v = curlopt_progressdata or - v = curlopt_writeheader or - v = curlopt_url or - v = curlopt_proxy or - v = curlopt_proxyport or - v = curlopt_proxytype or - v = curlopt_httpproxytunnel or - v = curlopt_interface or - v = curlopt_localport or - v = curlopt_localportrange or - v = curlopt_buffersize or - v = curlopt_port or - v = curlopt_tcp_nodelay or - v = curlopt_userpwd or - v = curlopt_proxyuserpwd or - v = curlopt_httpauth or - v = curlauth_none or - v = curlauth_basic or - v = curlauth_digest or - v = curlauth_any or - v = curlauth_anysafe or - v = curlopt_proxyauth or - v = curlopt_autoreferer or - v = curlopt_encoding or - v = curlopt_followlocation or - v = curlopt_unrestricted_auth or - v = curlopt_maxredirs or - v = curlopt_put or - v = curlopt_post or - v = curlopt_postfields or - v = curlopt_postfieldsize or - v = curlopt_postfieldsize_large or - v = curlopt_httppost or - v = curlopt_referer or - v = curlopt_useragent or - v = curlopt_httpheader or - v = curlopt_cookie or - v = curlopt_cookiefile or - v = curlopt_cookiejar or - v = curlopt_cookiesession or - v = curlopt_cookielist or - v = curlopt_httpget or - v = curlopt_http_version or - v = curlopt_ignore_content_length or - v = curlopt_http_content_decoding or - v = curlopt_transfertext or - v = curlopt_crlf or - v = curlopt_resume_from or - v = curlopt_resume_from_large or - v = curlopt_customrequest or - v = curlopt_filetime or - v = curlopt_nobody or - v = curlopt_infilesize or - v = curlopt_infilesize_large or - v = curlopt_upload or - v = curlopt_maxfilesize or - v = curlopt_maxfilesize_large or - v = curlopt_timecondition or - v = curlopt_timevalue or - v = curlopt_timeout or - v = curlopt_timeout_ms or - v = curlopt_low_speed_limit or - v = curlopt_low_speed_time or - v = curlopt_max_send_speed_large or - v = curlopt_max_recv_speed_large or - v = curlopt_maxconnects or - v = curlopt_fresh_connect or - v = curlopt_forbid_reuse or - v = curlopt_connecttimeout or - v = curlopt_ipresolve or - v = curl_ipresolve_whatever or - v = curl_ipresolve_v4 or - v = curl_ipresolve_v6 or - v = curlopt_connect_only or - v = curlopt_use_ssl or - v = curlusessl_none or - v = curlusessl_try or - v = curlusessl_control or - v = curlusessl_all or - v = curlopt_sslcert or - v = curlopt_sslcerttype or - v = curlopt_sslkey or - v = curlopt_sslkeytype or - v = curlopt_keypasswd or - v = curlopt_sslengine or - v = curlopt_sslengine_default or - v = curlopt_sslversion or - v = curl_sslversion_default or - v = curl_sslversion_tlsv1 or - v = curl_sslversion_sslv2 or - v = curl_sslversion_sslv3 or - v = curlopt_ssl_verifypeer or - v = curlopt_cainfo or - v = curlopt_capath or - v = curlopt_ssl_verifyhost or - v = curlopt_random_file or - v = curlopt_egdsocket or - v = curlopt_ssl_cipher_list or - v = curlopt_ssl_sessionid_cache or - v = curlopt_krblevel or - v = curlopt_ssh_auth_types or - v = curlopt_ssh_public_keyfile or - v = curlopt_ssh_private_keyfile - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/curl_string.e b/contrib/ise_library/cURL/curl_string.e deleted file mode 100644 index 5f38934c..00000000 --- a/contrib/ise_library/cURL/curl_string.e +++ /dev/null @@ -1,50 +0,0 @@ -note - description: "[ - String used by cURL wrapper library. - Only added features from IDENTIFIED. - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_STRING - -inherit - STRING - select - is_equal, - copy, - out - end - - IDENTIFIED - rename - is_equal as identified_is_equal, - copy as identified_copy, - out as identified_out - end - -create - make, - make_empty, - make_filled, - make_from_string, - make_from_c, - make_from_cil - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end - diff --git a/contrib/ise_library/cURL/curl_utility.e b/contrib/ise_library/cURL/curl_utility.e deleted file mode 100644 index 941e822b..00000000 --- a/contrib/ise_library/cURL/curl_utility.e +++ /dev/null @@ -1,51 +0,0 @@ -note - description: "[ - Utilities for Eiffel cURL wrapper library. - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - CURL_UTILITY - -feature -- Query - - api_loader: DYNAMIC_MODULE - -- API dynamic loader - local - l_platform: PLATFORM - once - create l_platform - if l_platform.is_unix or l_platform.is_mac then - create Result.make_with_version (module_name, "3") - else - check is_window: l_platform.is_windows end - create Result.make (module_name) - end - ensure - not_void: Result /= Void - end - - module_name: STRING - -- Module name. - once - Result := "libcurl" - ensure - not_void: Result /= Void - end - -note - library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/implementation/mac/api_loader_imp.e b/contrib/ise_library/cURL/implementation/mac/api_loader_imp.e deleted file mode 100644 index e2eaf163..00000000 --- a/contrib/ise_library/cURL/implementation/mac/api_loader_imp.e +++ /dev/null @@ -1,65 +0,0 @@ -note - description: "[ - Interactive with native system APIs for dynamic loading. - Cocoa verson. - ]" - status: "See notice at end of class." - legal: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" - -class - API_LOADER_IMP - -feature -- Command - - load_module (a_name: STRING): POINTER - -- Load module with `a_name'. - require - exists: a_name /= Void - do - -- fixme: implement - end - - loal_api (a_module: POINTER; a_name: STRING): POINTER - -- Load api which name is `a_name' in `a_module' - require - exists: a_module /= default_pointer - exists: a_name /= Void - do - -- fixme: implement - end - -note - copyright: "Copyright (c) 1984-2007, Eiffel Software" - license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" - licensing_options: "http://www.eiffel.com/licensing" - copying: "[ - This file is part of Eiffel Software's Eiffel Development Environment. - - Eiffel Software's Eiffel Development Environment is free - software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published - by the Free Software Foundation, version 2 of the License - (available at the URL listed under "license" above). - - Eiffel Software's Eiffel Development Environment is - distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with Eiffel Software's Eiffel Development - Environment; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - ]" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/contrib/ise_library/cURL/license.lic b/contrib/ise_library/cURL/license.lic deleted file mode 100644 index c929225f..00000000 --- a/contrib/ise_library/cURL/license.lic +++ /dev/null @@ -1 +0,0 @@ -reference:forum2 diff --git a/contrib/ise_library/cURL/readme.txt b/contrib/ise_library/cURL/readme.txt deleted file mode 100644 index aaf6c644..00000000 --- a/contrib/ise_library/cURL/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -When your Eiffel executable running, Eiffel cURL library needs 3 DLLs, they are: - -libcurl.dll, libeay32.dll and ssleay32.dll - -Please make sure the 3 DLLs files can be found in your environment PATH or in same folder of your executable. \ No newline at end of file diff --git a/contrib/ise_library/cURL/spec/include/curl/curl.h b/contrib/ise_library/cURL/spec/include/curl/curl.h deleted file mode 100644 index e7f5ec59..00000000 --- a/contrib/ise_library/cURL/spec/include/curl/curl.h +++ /dev/null @@ -1,1714 +0,0 @@ -#ifndef __CURL_CURL_H -#define __CURL_CURL_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id$ - ***************************************************************************/ - -/* If you have problems, all libcurl docs and details are found here: - http://curl.haxx.se/libcurl/ -*/ - -#include "curlver.h" /* the libcurl version defines */ - -#include -#include - -/* The include stuff here below is mainly for time_t! */ -#ifdef vms -# include -# include -#else -# include -# include -#endif /* defined (vms) */ - -typedef void CURL; - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Decorate exportable functions for Win32 DLL linking. - * This avoids using a .def file for building libcurl.dll. - */ -#if (defined(WIN32) || defined(_WIN32)) && !defined(CURL_STATICLIB) -#if defined(BUILDING_LIBCURL) -#define CURL_EXTERN __declspec(dllexport) -#else -#define CURL_EXTERN __declspec(dllimport) -#endif -#else - -#ifdef CURL_HIDDEN_SYMBOLS -/* - * This definition is used to make external definitions visibile in the - * shared library when symbols are hidden by default. It makes no - * difference when compiling applications whether this is set or not, - * only when compiling the library. - */ -#define CURL_EXTERN CURL_EXTERN_SYMBOL -#else -#define CURL_EXTERN -#endif -#endif - -/* - * We want the typedef curl_off_t setup for large file support on all - * platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf - * format strings when outputting a variable of type curl_off_t. - * - * Note: "pocc -Ze" is MSVC compatibily mode and this sets _MSC_VER! - */ - -#if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && defined(WIN32)) -/* MSVC */ -#ifdef _WIN32_WCE - typedef long curl_off_t; -#define CURL_FORMAT_OFF_T "%ld" -#else - typedef signed __int64 curl_off_t; -#define CURL_FORMAT_OFF_T "%I64d" -#endif -#else /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */ -#if (defined(__GNUC__) && defined(WIN32)) || defined(__WATCOMC__) -/* gcc on windows or Watcom */ - typedef long long curl_off_t; -#define CURL_FORMAT_OFF_T "%I64d" -#else /* GCC or Watcom on Windows */ -#if defined(__ILEC400__) -/* OS400 C compiler. */ - typedef long long curl_off_t; -#define CURL_FORMAT_OFF_T "%lld" -#else /* OS400 C compiler. */ - -/* "normal" POSIX approach, do note that this does not necessarily mean that - the type is >32 bits, see the SIZEOF_CURL_OFF_T define for that! */ - typedef off_t curl_off_t; - -/* Check a range of defines to detect large file support. On Linux it seems - none of these are set by default, so if you don't explicitly switches on - large file support, this define will be made for "small file" support. */ -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 0 /* to prevent warnings in the check below */ -#define UNDEF_FILE_OFFSET_BITS -#endif -#ifndef FILESIZEBITS -#define FILESIZEBITS 0 /* to prevent warnings in the check below */ -#define UNDEF_FILESIZEBITS -#endif - -#if defined(_LARGE_FILES) || (_FILE_OFFSET_BITS > 32) || (FILESIZEBITS > 32) \ - || defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE) - /* For now, we assume at least one of these to be set for large files to - work! */ -#define CURL_FORMAT_OFF_T "%lld" -#else /* LARGE_FILE support */ -#define CURL_FORMAT_OFF_T "%ld" -#endif -#endif /* OS400 C compiler. */ -#endif /* GCC or Watcom on Windows */ -#endif /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */ - -#ifdef UNDEF_FILE_OFFSET_BITS -/* this was defined above for our checks, undefine it again */ -#undef _FILE_OFFSET_BITS -#endif - -#ifdef UNDEF_FILESIZEBITS -/* this was defined above for our checks, undefine it again */ -#undef FILESIZEBITS -#endif - -#if defined(_WIN32) && !defined(WIN32) -/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we - make this adjustment to catch this. */ -#define WIN32 1 -#endif - -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \ - !defined(__CYGWIN__) || defined(__MINGW32__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include -#endif -#else - -/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish - libc5-based Linux systems. Only include it on system that are known to - require it! */ -#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix) -#include -#endif - -#ifndef _WIN32_WCE -#include -#endif -#ifndef __WATCOMC__ -#include -#endif -#include -#endif - -#ifndef curl_socket_typedef -/* socket typedef */ -#ifdef WIN32 -typedef SOCKET curl_socket_t; -#define CURL_SOCKET_BAD INVALID_SOCKET -#else -typedef int curl_socket_t; -#define CURL_SOCKET_BAD -1 -#endif -#define curl_socket_typedef -#endif /* curl_socket_typedef */ - -struct curl_httppost { - struct curl_httppost *next; /* next entry in the list */ - char *name; /* pointer to allocated name */ - long namelength; /* length of name length */ - char *contents; /* pointer to allocated data contents */ - long contentslength; /* length of contents field */ - char *buffer; /* pointer to allocated buffer contents */ - long bufferlength; /* length of buffer field */ - char *contenttype; /* Content-Type */ - struct curl_slist* contentheader; /* list of extra headers for this form */ - struct curl_httppost *more; /* if one field name has more than one - file, this link should link to following - files */ - long flags; /* as defined below */ -#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ -#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ -#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer - do not free in formfree */ -#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer - do not free in formfree */ -#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ -#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ - - char *showfilename; /* The file name to show. If not set, the - actual file name will be used (if this - is a file part) */ -}; - -typedef int (*curl_progress_callback)(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow); - -#ifndef CURL_MAX_WRITE_SIZE - /* Tests have proven that 20K is a very bad buffer size for uploads on - Windows, while 16K for some odd reason performed a lot better. - We do the ifndef check to allow this value to easier be changed at build - time for those who feel adventurous. */ -#define CURL_MAX_WRITE_SIZE 16384 -#endif - -typedef size_t (*curl_write_callback)(char *buffer, - size_t size, - size_t nitems, - void *outstream); - -/* This is a return code for the read callback that, when returned, will - signal libcurl to immediately abort the current transfer. */ -#define CURL_READFUNC_ABORT 0x10000000 -typedef size_t (*curl_read_callback)(char *buffer, - size_t size, - size_t nitems, - void *instream); - -typedef enum { - CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ - CURLSOCKTYPE_LAST /* never use */ -} curlsocktype; - -typedef int (*curl_sockopt_callback)(void *clientp, - curl_socket_t curlfd, - curlsocktype purpose); - -#ifndef CURL_NO_OLDIES - /* not used since 7.10.8, will be removed in a future release */ -typedef int (*curl_passwd_callback)(void *clientp, - const char *prompt, - char *buffer, - int buflen); -#endif - -typedef enum { - CURLIOE_OK, /* I/O operation successful */ - CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ - CURLIOE_FAILRESTART, /* failed to restart the read */ - CURLIOE_LAST /* never use */ -} curlioerr; - -typedef enum { - CURLIOCMD_NOP, /* no operation */ - CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ - CURLIOCMD_LAST /* never use */ -} curliocmd; - -typedef curlioerr (*curl_ioctl_callback)(CURL *handle, - int cmd, - void *clientp); - -/* - * The following typedef's are signatures of malloc, free, realloc, strdup and - * calloc respectively. Function pointers of these types can be passed to the - * curl_global_init_mem() function to set user defined memory management - * callback routines. - */ -typedef void *(*curl_malloc_callback)(size_t size); -typedef void (*curl_free_callback)(void *ptr); -typedef void *(*curl_realloc_callback)(void *ptr, size_t size); -typedef char *(*curl_strdup_callback)(const char *str); -typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); - -/* the kind of data that is passed to information_callback*/ -typedef enum { - CURLINFO_TEXT = 0, - CURLINFO_HEADER_IN, /* 1 */ - CURLINFO_HEADER_OUT, /* 2 */ - CURLINFO_DATA_IN, /* 3 */ - CURLINFO_DATA_OUT, /* 4 */ - CURLINFO_SSL_DATA_IN, /* 5 */ - CURLINFO_SSL_DATA_OUT, /* 6 */ - CURLINFO_END -} curl_infotype; - -typedef int (*curl_debug_callback) - (CURL *handle, /* the handle/transfer this concerns */ - curl_infotype type, /* what kind of data */ - char *data, /* points to the data */ - size_t size, /* size of the data pointed to */ - void *userptr); /* whatever the user please */ - -/* All possible error codes from all sorts of curl functions. Future versions - may return other values, stay prepared. - - Always add new return codes last. Never *EVER* remove any. The return - codes must remain the same! - */ - -typedef enum { - CURLE_OK = 0, - CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ - CURLE_FAILED_INIT, /* 2 */ - CURLE_URL_MALFORMAT, /* 3 */ - CURLE_OBSOLETE4, /* 4 - NOT USED */ - CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ - CURLE_COULDNT_RESOLVE_HOST, /* 6 */ - CURLE_COULDNT_CONNECT, /* 7 */ - CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ - CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server - due to lack of access - when login fails - this is not returned. */ - CURLE_OBSOLETE10, /* 10 - NOT USED */ - CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ - CURLE_OBSOLETE12, /* 12 - NOT USED */ - CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ - CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ - CURLE_FTP_CANT_GET_HOST, /* 15 */ - CURLE_OBSOLETE16, /* 16 - NOT USED */ - CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ - CURLE_PARTIAL_FILE, /* 18 */ - CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ - CURLE_OBSOLETE20, /* 20 - NOT USED */ - CURLE_QUOTE_ERROR, /* 21 - quote command failure */ - CURLE_HTTP_RETURNED_ERROR, /* 22 */ - CURLE_WRITE_ERROR, /* 23 */ - CURLE_OBSOLETE24, /* 24 - NOT USED */ - CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ - CURLE_READ_ERROR, /* 26 - could open/read from file */ - CURLE_OUT_OF_MEMORY, /* 27 */ - /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error - instead of a memory allocation error if CURL_DOES_CONVERSIONS - is defined - */ - CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ - CURLE_OBSOLETE29, /* 29 - NOT USED */ - CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ - CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ - CURLE_OBSOLETE32, /* 32 - NOT USED */ - CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ - CURLE_HTTP_POST_ERROR, /* 34 */ - CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ - CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ - CURLE_FILE_COULDNT_READ_FILE, /* 37 */ - CURLE_LDAP_CANNOT_BIND, /* 38 */ - CURLE_LDAP_SEARCH_FAILED, /* 39 */ - CURLE_OBSOLETE40, /* 40 - NOT USED */ - CURLE_FUNCTION_NOT_FOUND, /* 41 */ - CURLE_ABORTED_BY_CALLBACK, /* 42 */ - CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ - CURLE_OBSOLETE44, /* 44 - NOT USED */ - CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ - CURLE_OBSOLETE46, /* 46 - NOT USED */ - CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ - CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ - CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ - CURLE_OBSOLETE50, /* 50 - NOT USED */ - CURLE_SSL_PEER_CERTIFICATE, /* 51 - peer's certificate wasn't ok */ - CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ - CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ - CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as - default */ - CURLE_SEND_ERROR, /* 55 - failed sending network data */ - CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ - CURLE_OBSOLETE57, /* 57 - NOT IN USE */ - CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ - CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ - CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ - CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ - CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ - CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ - CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ - CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind - that failed */ - CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ - CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not - accepted and we failed to login */ - CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ - CURLE_TFTP_PERM, /* 69 - permission problem on server */ - CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ - CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ - CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ - CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ - CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ - CURLE_CONV_FAILED, /* 75 - conversion failed */ - CURLE_CONV_REQD, /* 76 - caller must register conversion - callbacks using curl_easy_setopt options - CURLOPT_CONV_FROM_NETWORK_FUNCTION, - CURLOPT_CONV_TO_NETWORK_FUNCTION, and - CURLOPT_CONV_FROM_UTF8_FUNCTION */ - CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing - or wrong format */ - CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ - CURLE_SSH, /* 79 - error from the SSH layer, somewhat - generic so the error message will be of - interest when this has happened */ - - CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL - connection */ - CURL_LAST /* never use! */ -} CURLcode; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2009 */ - -/* The following were added in 7.17.0 */ -#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */ -#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 -#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 -#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 -#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 -#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 -#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 -#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 -#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 -#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 -#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 -#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 -#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4 - -#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED -#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE -#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR -#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL -#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS -#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR -#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED - -/* The following were added earlier */ - -#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT - -#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR -#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED -#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED - -#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE -#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME - -/* This was the error code 50 in 7.7.3 and a few earlier versions, this - is no longer used by libcurl but is instead #defined here only to not - make programs break */ -#define CURLE_ALREADY_COMPLETE 99999 - -#endif /*!CURL_NO_OLDIES*/ - -/* This prototype applies to all conversion callbacks */ -typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); - -typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ - void *ssl_ctx, /* actually an - OpenSSL SSL_CTX */ - void *userptr); - -typedef enum { - CURLPROXY_HTTP = 0, - CURLPROXY_SOCKS4 = 4, - CURLPROXY_SOCKS5 = 5 -} curl_proxytype; - -#define CURLAUTH_NONE 0 /* nothing */ -#define CURLAUTH_BASIC (1<<0) /* Basic (default) */ -#define CURLAUTH_DIGEST (1<<1) /* Digest */ -#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */ -#define CURLAUTH_NTLM (1<<3) /* NTLM */ -#define CURLAUTH_ANY ~0 /* all types set */ -#define CURLAUTH_ANYSAFE (~CURLAUTH_BASIC) - -#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ -#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ -#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ -#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ -#define CURLSSH_AUTH_HOST (1<<2) /* host key files */ -#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ -#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY - -#define CURL_ERROR_SIZE 256 - -/* parameter for the CURLOPT_USE_SSL option */ -typedef enum { - CURLUSESSL_NONE, /* do not attempt to use SSL */ - CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ - CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ - CURLUSESSL_ALL, /* SSL for all communication or fail */ - CURLUSESSL_LAST /* not an option, never use */ -} curl_usessl; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2009 */ - -#define CURLFTPSSL_NONE CURLUSESSL_NONE -#define CURLFTPSSL_TRY CURLUSESSL_TRY -#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL -#define CURLFTPSSL_ALL CURLUSESSL_ALL -#define CURLFTPSSL_LAST CURLUSESSL_LAST -#define curl_ftpssl curl_usessl -#endif /*!CURL_NO_OLDIES*/ - -/* parameter for the CURLOPT_FTP_SSL_CCC option */ -typedef enum { - CURLFTPSSL_CCC_NONE, /* do not send CCC */ - CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ - CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ - CURLFTPSSL_CCC_LAST /* not an option, never use */ -} curl_ftpccc; - -/* parameter for the CURLOPT_FTPSSLAUTH option */ -typedef enum { - CURLFTPAUTH_DEFAULT, /* let libcurl decide */ - CURLFTPAUTH_SSL, /* use "AUTH SSL" */ - CURLFTPAUTH_TLS, /* use "AUTH TLS" */ - CURLFTPAUTH_LAST /* not an option, never use */ -} curl_ftpauth; - -/* parameter for the CURLOPT_FTP_FILEMETHOD option */ -typedef enum { - CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ - CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ - CURLFTPMETHOD_NOCWD, /* no CWD at all */ - CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ - CURLFTPMETHOD_LAST /* not an option, never use */ -} curl_ftpmethod; - -/* long may be 32 or 64 bits, but we should never depend on anything else - but 32 */ -#define CURLOPTTYPE_LONG 0 -#define CURLOPTTYPE_OBJECTPOINT 10000 -#define CURLOPTTYPE_FUNCTIONPOINT 20000 -#define CURLOPTTYPE_OFF_T 30000 - -/* name is uppercase CURLOPT_, - type is one of the defined CURLOPTTYPE_ - number is unique identifier */ -#ifdef CINIT -#undef CINIT -#endif -/* - * Figure out if we can use the ## operator, which is supported by ISO/ANSI C - * and C++. Some compilers support it without setting __STDC__ or __cplusplus - * so we need to carefully check for them too. We don't use configure-checks - * for these since we want these headers to remain generic and working for all - * platforms. - */ -#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ - defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ - defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ - defined(__ILEC400__) - /* This compiler is believed to have an ISO compatible preprocessor */ -#define CURL_ISOCPP -#else - /* This compiler is believed NOT to have an ISO compatible preprocessor */ -#undef CURL_ISOCPP -#endif - -#ifdef CURL_ISOCPP -#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLOPT_/**/name = type + number -#endif - -/* - * This macro-mania below setups the CURLOPT_[what] enum, to be used with - * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] - * word. - */ - -typedef enum { - /* This is the FILE * or void * the regular output should be written to. */ - CINIT(FILE, OBJECTPOINT, 1), - - /* The full URL to get/put */ - CINIT(URL, OBJECTPOINT, 2), - - /* Port number to connect to, if other than default. */ - CINIT(PORT, LONG, 3), - - /* Name of proxy to use. */ - CINIT(PROXY, OBJECTPOINT, 4), - - /* "name:password" to use when fetching. */ - CINIT(USERPWD, OBJECTPOINT, 5), - - /* "name:password" to use with proxy. */ - CINIT(PROXYUSERPWD, OBJECTPOINT, 6), - - /* Range to get, specified as an ASCII string. */ - CINIT(RANGE, OBJECTPOINT, 7), - - /* not used */ - - /* Specified file stream to upload from (use as input): */ - CINIT(INFILE, OBJECTPOINT, 9), - - /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE - * bytes big. If this is not used, error messages go to stderr instead: */ - CINIT(ERRORBUFFER, OBJECTPOINT, 10), - - /* Function that will be called to store the output (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), - - /* Function that will be called to read the input (instead of fread). The - * parameters will use fread() syntax, make sure to follow them. */ - CINIT(READFUNCTION, FUNCTIONPOINT, 12), - - /* Time-out the read operation after this amount of seconds */ - CINIT(TIMEOUT, LONG, 13), - - /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about - * how large the file being sent really is. That allows better error - * checking and better verifies that the upload was succcessful. -1 means - * unknown size. - * - * For large file support, there is also a _LARGE version of the key - * which takes an off_t type, allowing platforms with larger off_t - * sizes to handle larger files. See below for INFILESIZE_LARGE. - */ - CINIT(INFILESIZE, LONG, 14), - - /* POST input fields. */ - CINIT(POSTFIELDS, OBJECTPOINT, 15), - - /* Set the referer page (needed by some CGIs) */ - CINIT(REFERER, OBJECTPOINT, 16), - - /* Set the FTP PORT string (interface name, named or numerical IP address) - Use i.e '-' to use default address. */ - CINIT(FTPPORT, OBJECTPOINT, 17), - - /* Set the User-Agent string (examined by some CGIs) */ - CINIT(USERAGENT, OBJECTPOINT, 18), - - /* If the download receives less than "low speed limit" bytes/second - * during "low speed time" seconds, the operations is aborted. - * You could i.e if you have a pretty high speed connection, abort if - * it is less than 2000 bytes/sec during 20 seconds. - */ - - /* Set the "low speed limit" */ - CINIT(LOW_SPEED_LIMIT, LONG, 19), - - /* Set the "low speed time" */ - CINIT(LOW_SPEED_TIME, LONG, 20), - - /* Set the continuation offset. - * - * Note there is also a _LARGE version of this key which uses - * off_t types, allowing for large file offsets on platforms which - * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. - */ - CINIT(RESUME_FROM, LONG, 21), - - /* Set cookie in request: */ - CINIT(COOKIE, OBJECTPOINT, 22), - - /* This points to a linked list of headers, struct curl_slist kind */ - CINIT(HTTPHEADER, OBJECTPOINT, 23), - - /* This points to a linked list of post entries, struct HttpPost */ - CINIT(HTTPPOST, OBJECTPOINT, 24), - - /* name of the file keeping your private SSL-certificate */ - CINIT(SSLCERT, OBJECTPOINT, 25), - - /* password for the SSL or SSH private key */ - CINIT(KEYPASSWD, OBJECTPOINT, 26), - - /* send TYPE parameter? */ - CINIT(CRLF, LONG, 27), - - /* send linked-list of QUOTE commands */ - CINIT(QUOTE, OBJECTPOINT, 28), - - /* send FILE * or void * to store headers to, if you use a callback it - is simply passed to the callback unmodified */ - CINIT(WRITEHEADER, OBJECTPOINT, 29), - - /* point to a file to read the initial cookies from, also enables - "cookie awareness" */ - CINIT(COOKIEFILE, OBJECTPOINT, 31), - - /* What version to specifly try to use. - See CURL_SSLVERSION defines below. */ - CINIT(SSLVERSION, LONG, 32), - - /* What kind of HTTP time condition to use, see defines */ - CINIT(TIMECONDITION, LONG, 33), - - /* Time to use with the above condition. Specified in number of seconds - since 1 Jan 1970 */ - CINIT(TIMEVALUE, LONG, 34), - - /* 35 = OBSOLETE */ - - /* Custom request, for customizing the get command like - HTTP: DELETE, TRACE and others - FTP: to use a different list command - */ - CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), - - /* HTTP request, for odd commands like DELETE, TRACE and others */ - CINIT(STDERR, OBJECTPOINT, 37), - - /* 38 is not used */ - - /* send linked-list of post-transfer QUOTE commands */ - CINIT(POSTQUOTE, OBJECTPOINT, 39), - - /* Pass a pointer to string of the output using full variable-replacement - as described elsewhere. */ - CINIT(WRITEINFO, OBJECTPOINT, 40), - - CINIT(VERBOSE, LONG, 41), /* talk a lot */ - CINIT(HEADER, LONG, 42), /* throw the header out too */ - CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ - CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ - CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ - CINIT(UPLOAD, LONG, 46), /* this is an upload */ - CINIT(POST, LONG, 47), /* HTTP POST method */ - CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */ - - CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ - - /* Specify whether to read the user+password from the .netrc or the URL. - * This must be one of the CURL_NETRC_* enums below. */ - CINIT(NETRC, LONG, 51), - - CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ - - CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ - CINIT(PUT, LONG, 54), /* HTTP PUT */ - - /* 55 = OBSOLETE */ - - /* Function that will be called instead of the internal progress display - * function. This function should be defined as the curl_progress_callback - * prototype defines. */ - CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), - - /* Data passed to the progress callback */ - CINIT(PROGRESSDATA, OBJECTPOINT, 57), - - /* We want the referer field set automatically when following locations */ - CINIT(AUTOREFERER, LONG, 58), - - /* Port of the proxy, can be set in the proxy string as well with: - "[host]:[port]" */ - CINIT(PROXYPORT, LONG, 59), - - /* size of the POST input data, if strlen() is not good to use */ - CINIT(POSTFIELDSIZE, LONG, 60), - - /* tunnel non-http operations through a HTTP proxy */ - CINIT(HTTPPROXYTUNNEL, LONG, 61), - - /* Set the interface string to use as outgoing network interface */ - CINIT(INTERFACE, OBJECTPOINT, 62), - - /* Set the krb4/5 security level, this also enables krb4/5 awareness. This - * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string - * is set but doesn't match one of these, 'private' will be used. */ - CINIT(KRBLEVEL, OBJECTPOINT, 63), - - /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ - CINIT(SSL_VERIFYPEER, LONG, 64), - - /* The CApath or CAfile used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAINFO, OBJECTPOINT, 65), - - /* 66 = OBSOLETE */ - /* 67 = OBSOLETE */ - - /* Maximum number of http redirects to follow */ - CINIT(MAXREDIRS, LONG, 68), - - /* Pass a long set to 1 to get the date of the requested document (if - possible)! Pass a zero to shut it off. */ - CINIT(FILETIME, LONG, 69), - - /* This points to a linked list of telnet options */ - CINIT(TELNETOPTIONS, OBJECTPOINT, 70), - - /* Max amount of cached alive connections */ - CINIT(MAXCONNECTS, LONG, 71), - - /* What policy to use when closing connections when the cache is filled - up */ - CINIT(CLOSEPOLICY, LONG, 72), - - /* 73 = OBSOLETE */ - - /* Set to explicitly use a new connection for the upcoming transfer. - Do not use this unless you're absolutely sure of this, as it makes the - operation slower and is less friendly for the network. */ - CINIT(FRESH_CONNECT, LONG, 74), - - /* Set to explicitly forbid the upcoming transfer's connection to be re-used - when done. Do not use this unless you're absolutely sure of this, as it - makes the operation slower and is less friendly for the network. */ - CINIT(FORBID_REUSE, LONG, 75), - - /* Set to a file name that contains random data for libcurl to use to - seed the random engine when doing SSL connects. */ - CINIT(RANDOM_FILE, OBJECTPOINT, 76), - - /* Set to the Entropy Gathering Daemon socket pathname */ - CINIT(EGDSOCKET, OBJECTPOINT, 77), - - /* Time-out connect operations after this amount of seconds, if connects - are OK within this time, then fine... This only aborts the connect - phase. [Only works on unix-style/SIGALRM operating systems] */ - CINIT(CONNECTTIMEOUT, LONG, 78), - - /* Function that will be called to store headers (instead of fwrite). The - * parameters will use fwrite() syntax, make sure to follow them. */ - CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), - - /* Set this to force the HTTP request to get back to GET. Only really usable - if POST, PUT or a custom request have been used first. - */ - CINIT(HTTPGET, LONG, 80), - - /* Set if we should verify the Common name from the peer certificate in ssl - * handshake, set 1 to check existence, 2 to ensure that it matches the - * provided hostname. */ - CINIT(SSL_VERIFYHOST, LONG, 81), - - /* Specify which file name to write all known cookies in after completed - operation. Set file name to "-" (dash) to make it go to stdout. */ - CINIT(COOKIEJAR, OBJECTPOINT, 82), - - /* Specify which SSL ciphers to use */ - CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), - - /* Specify which HTTP version to use! This must be set to one of the - CURL_HTTP_VERSION* enums set below. */ - CINIT(HTTP_VERSION, LONG, 84), - - /* Specificly switch on or off the FTP engine's use of the EPSV command. By - default, that one will always be attempted before the more traditional - PASV command. */ - CINIT(FTP_USE_EPSV, LONG, 85), - - /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ - CINIT(SSLCERTTYPE, OBJECTPOINT, 86), - - /* name of the file keeping your private SSL-key */ - CINIT(SSLKEY, OBJECTPOINT, 87), - - /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ - CINIT(SSLKEYTYPE, OBJECTPOINT, 88), - - /* crypto engine for the SSL-sub system */ - CINIT(SSLENGINE, OBJECTPOINT, 89), - - /* set the crypto engine for the SSL-sub system as default - the param has no meaning... - */ - CINIT(SSLENGINE_DEFAULT, LONG, 90), - - /* Non-zero value means to use the global dns cache */ - CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */ - - /* DNS cache timeout */ - CINIT(DNS_CACHE_TIMEOUT, LONG, 92), - - /* send linked-list of pre-transfer QUOTE commands (Wesley Laxton)*/ - CINIT(PREQUOTE, OBJECTPOINT, 93), - - /* set the debug function */ - CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), - - /* set the data for the debug function */ - CINIT(DEBUGDATA, OBJECTPOINT, 95), - - /* mark this as start of a cookie session */ - CINIT(COOKIESESSION, LONG, 96), - - /* The CApath directory used to validate the peer certificate - this option is used only if SSL_VERIFYPEER is true */ - CINIT(CAPATH, OBJECTPOINT, 97), - - /* Instruct libcurl to use a smaller receive buffer */ - CINIT(BUFFERSIZE, LONG, 98), - - /* Instruct libcurl to not use any signal/alarm handlers, even when using - timeouts. This option is useful for multi-threaded applications. - See libcurl-the-guide for more background information. */ - CINIT(NOSIGNAL, LONG, 99), - - /* Provide a CURLShare for mutexing non-ts data */ - CINIT(SHARE, OBJECTPOINT, 100), - - /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), - CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */ - CINIT(PROXYTYPE, LONG, 101), - - /* Set the Accept-Encoding string. Use this to tell a server you would like - the response to be compressed. */ - CINIT(ENCODING, OBJECTPOINT, 102), - - /* Set pointer to private data */ - CINIT(PRIVATE, OBJECTPOINT, 103), - - /* Set aliases for HTTP 200 in the HTTP Response header */ - CINIT(HTTP200ALIASES, OBJECTPOINT, 104), - - /* Continue to send authentication (user+password) when following locations, - even when hostname changed. This can potentionally send off the name - and password to whatever host the server decides. */ - CINIT(UNRESTRICTED_AUTH, LONG, 105), - - /* Specificly switch on or off the FTP engine's use of the EPRT command ( it - also disables the LPRT attempt). By default, those ones will always be - attempted before the good old traditional PORT command. */ - CINIT(FTP_USE_EPRT, LONG, 106), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_USERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(HTTPAUTH, LONG, 107), - - /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx - in second argument. The function must be matching the - curl_ssl_ctx_callback proto. */ - CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), - - /* Set the userdata for the ssl context callback function's third - argument */ - CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), - - /* FTP Option that causes missing dirs to be created on the remote server */ - CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), - - /* Set this to a bitmask value to enable the particular authentications - methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. - Note that setting multiple bits may cause extra network round-trips. */ - CINIT(PROXYAUTH, LONG, 111), - - /* FTP option that changes the timeout, in seconds, associated with - getting a response. This is different from transfer timeout time and - essentially places a demand on the FTP server to acknowledge commands - in a timely manner. */ - CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), - - /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to - tell libcurl to resolve names to those IP versions only. This only has - affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ - CINIT(IPRESOLVE, LONG, 113), - - /* Set this option to limit the size of a file that will be downloaded from - an HTTP or FTP server. - - Note there is also _LARGE version which adds large file support for - platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ - CINIT(MAXFILESIZE, LONG, 114), - - /* See the comment for INFILESIZE above, but in short, specifies - * the size of the file being uploaded. -1 means unknown. - */ - CINIT(INFILESIZE_LARGE, OFF_T, 115), - - /* Sets the continuation offset. There is also a LONG version of this; - * look above for RESUME_FROM. - */ - CINIT(RESUME_FROM_LARGE, OFF_T, 116), - - /* Sets the maximum size of data that will be downloaded from - * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. - */ - CINIT(MAXFILESIZE_LARGE, OFF_T, 117), - - /* Set this option to the file name of your .netrc file you want libcurl - to parse (using the CURLOPT_NETRC option). If not set, libcurl will do - a poor attempt to find the user's home directory and check for a .netrc - file in there. */ - CINIT(NETRC_FILE, OBJECTPOINT, 118), - - /* Enable SSL/TLS for FTP, pick one of: - CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise - CURLFTPSSL_CONTROL - SSL for the control connection or fail - CURLFTPSSL_ALL - SSL for all communication or fail - */ - CINIT(USE_SSL, LONG, 119), - - /* The _LARGE version of the standard POSTFIELDSIZE option */ - CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), - - /* Enable/disable the TCP Nagle algorithm */ - CINIT(TCP_NODELAY, LONG, 121), - - /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 123 OBSOLETE. Gone in 7.16.0 */ - /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ - /* 127 OBSOLETE. Gone in 7.16.0 */ - /* 128 OBSOLETE. Gone in 7.16.0 */ - - /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option - can be used to change libcurl's default action which is to first try - "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK - response has been received. - - Available parameters are: - CURLFTPAUTH_DEFAULT - let libcurl decide - CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS - CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL - */ - CINIT(FTPSSLAUTH, LONG, 129), - - CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), - CINIT(IOCTLDATA, OBJECTPOINT, 131), - - /* 132 OBSOLETE. Gone in 7.16.0 */ - /* 133 OBSOLETE. Gone in 7.16.0 */ - - /* zero terminated string for pass on to the FTP server when asked for - "account" info */ - CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), - - /* feed cookies into cookie engine */ - CINIT(COOKIELIST, OBJECTPOINT, 135), - - /* ignore Content-Length */ - CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), - - /* Set to non-zero to skip the IP address received in a 227 PASV FTP server - response. Typically used for FTP-SSL purposes but is not restricted to - that. libcurl will then instead use the same IP address it used for the - control connection. */ - CINIT(FTP_SKIP_PASV_IP, LONG, 137), - - /* Select "file method" to use when doing FTP, see the curl_ftpmethod - above. */ - CINIT(FTP_FILEMETHOD, LONG, 138), - - /* Local port number to bind the socket to */ - CINIT(LOCALPORT, LONG, 139), - - /* Number of ports to try, including the first one set with LOCALPORT. - Thus, setting it to 1 will make no additional attempts but the first. - */ - CINIT(LOCALPORTRANGE, LONG, 140), - - /* no transfer, set up connection and let application use the socket by - extracting it with CURLINFO_LASTSOCKET */ - CINIT(CONNECT_ONLY, LONG, 141), - - /* Function that will be called to convert from the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), - - /* Function that will be called to convert to the - network encoding (instead of using the iconv calls in libcurl) */ - CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), - - /* Function that will be called to convert from UTF8 - (instead of using the iconv calls in libcurl) - Note that this is used only for SSL certificate processing */ - CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), - - /* if the connection proceeds too quickly then need to slow it down */ - /* limit-rate: maximum number of bytes per second to send or receive */ - CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), - CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), - - /* Pointer to command string to send if USER/PASS fails. */ - CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), - - /* callback function for setting socket options */ - CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), - CINIT(SOCKOPTDATA, OBJECTPOINT, 149), - - /* set to 0 to disable session ID re-use for this transfer, default is - enabled (== 1) */ - CINIT(SSL_SESSIONID_CACHE, LONG, 150), - - /* allowed SSH authentication methods */ - CINIT(SSH_AUTH_TYPES, LONG, 151), - - /* Used by scp/sftp to do public/private key authentication */ - CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), - CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), - - /* Send CCC (Clear Command Channel) after authentication */ - CINIT(FTP_SSL_CCC, LONG, 154), - - /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ - CINIT(TIMEOUT_MS, LONG, 155), - CINIT(CONNECTTIMEOUT_MS, LONG, 156), - - /* set to zero to disable the libcurl's decoding and thus pass the raw body - data to the appliction even when it is encoded/compressed */ - CINIT(HTTP_TRANSFER_DECODING, LONG, 157), - CINIT(HTTP_CONTENT_DECODING, LONG, 158), - - /* Permission used when creating new files and directories on the remote - server for protocols that support it, SFTP/SCP/FILE */ - CINIT(NEW_FILE_PERMS, LONG, 159), - CINIT(NEW_DIRECTORY_PERMS, LONG, 160), - - CURLOPT_LASTENTRY /* the last unused */ -} CURLoption; - -#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all - the obsolete stuff removed! */ - -/* Backwards compatibility with older names */ -/* These are scheduled to disappear by 2009 */ - -/* The following were added in 7.17.0 */ -#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_FTPAPPEND CURLOPT_APPEND -#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY -#define CURLOPT_FTP_SSL CURLOPT_USE_SSL - -/* The following were added earlier */ - -#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD -#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL - -#else -/* This is set if CURL_NO_OLDIES is defined at compile-time */ -#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ -#endif - - - /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host - name resolves addresses using more than one IP protocol version, this - option might be handy to force libcurl to use a specific IP version. */ -#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP - versions that your system allows */ -#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ -#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ - - /* three convenient "aliases" that follow the name scheme better */ -#define CURLOPT_WRITEDATA CURLOPT_FILE -#define CURLOPT_READDATA CURLOPT_INFILE -#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER - - /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ -enum { - CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd - like the library to choose the best possible - for us! */ - CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ - CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ - - CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ -}; - - /* These enums are for use with the CURLOPT_NETRC option. */ -enum CURL_NETRC_OPTION { - CURL_NETRC_IGNORED, /* The .netrc will never be read. - * This is the default. */ - CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred - * to one in the .netrc. */ - CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. - * Unless one is set programmatically, the .netrc - * will be queried. */ - CURL_NETRC_LAST -}; - -enum { - CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, - CURL_SSLVERSION_SSLv2, - CURL_SSLVERSION_SSLv3, - - CURL_SSLVERSION_LAST /* never use, keep last */ -}; - - -typedef enum { - CURL_TIMECOND_NONE, - - CURL_TIMECOND_IFMODSINCE, - CURL_TIMECOND_IFUNMODSINCE, - CURL_TIMECOND_LASTMOD, - - CURL_TIMECOND_LAST -} curl_TimeCond; - -#ifdef __BEOS__ -#include -#endif - - -/* curl_strequal() and curl_strnequal() are subject for removal in a future - libcurl, see lib/README.curlx for details */ -CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2); -CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n); - -/* name is uppercase CURLFORM_ */ -#ifdef CFINIT -#undef CFINIT -#endif - -#ifdef CURL_ISOCPP -#define CFINIT(name) CURLFORM_ ## name -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define CFINIT(name) CURLFORM_/**/name -#endif - -typedef enum { - CFINIT(NOTHING), /********* the first one is unused ************/ - - /* */ - CFINIT(COPYNAME), - CFINIT(PTRNAME), - CFINIT(NAMELENGTH), - CFINIT(COPYCONTENTS), - CFINIT(PTRCONTENTS), - CFINIT(CONTENTSLENGTH), - CFINIT(FILECONTENT), - CFINIT(ARRAY), - CFINIT(OBSOLETE), - CFINIT(FILE), - - CFINIT(BUFFER), - CFINIT(BUFFERPTR), - CFINIT(BUFFERLENGTH), - - CFINIT(CONTENTTYPE), - CFINIT(CONTENTHEADER), - CFINIT(FILENAME), - CFINIT(END), - CFINIT(OBSOLETE2), - - CURLFORM_LASTENTRY /* the last unusued */ -} CURLformoption; - -#undef CFINIT /* done */ - -/* structure to be used as parameter for CURLFORM_ARRAY */ -struct curl_forms { - CURLformoption option; - const char *value; -}; - -/* use this for multipart formpost building */ -/* Returns code for curl_formadd() - * - * Returns: - * CURL_FORMADD_OK on success - * CURL_FORMADD_MEMORY if the FormInfo allocation fails - * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form - * CURL_FORMADD_NULL if a null pointer was given for a char - * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed - * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used - * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) - * CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated - * CURL_FORMADD_MEMORY if some allocation for string copying failed. - * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array - * - ***************************************************************************/ -typedef enum { - CURL_FORMADD_OK, /* first, no error */ - - CURL_FORMADD_MEMORY, - CURL_FORMADD_OPTION_TWICE, - CURL_FORMADD_NULL, - CURL_FORMADD_UNKNOWN_OPTION, - CURL_FORMADD_INCOMPLETE, - CURL_FORMADD_ILLEGAL_ARRAY, - CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ - - CURL_FORMADD_LAST /* last */ -} CURLFORMcode; - -/* - * NAME curl_formadd() - * - * DESCRIPTION - * - * Pretty advanved function for building multi-part formposts. Each invoke - * adds one part that together construct a full post. Then use - * CURLOPT_HTTPPOST to send it off to libcurl. - */ -CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, - struct curl_httppost **last_post, - ...); - -/* - * callback function for curl_formget() - * The void *arg pointer will be the one passed as second argument to curl_formget(). - * The character buffer passed to it must not be freed. - * Should return the buffer length passed to it as the argument "len" on success. - */ -typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); - -/* - * NAME curl_formget() - * - * DESCRIPTION - * - * Serialize a curl_httppost struct built with curl_formadd(). - * Accepts a void pointer as second argument which will be passed to - * the curl_formget_callback function. - * Returns 0 on success. - */ -CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, - curl_formget_callback append); -/* - * NAME curl_formfree() - * - * DESCRIPTION - * - * Free a multipart formpost previously built with curl_formadd(). - */ -CURL_EXTERN void curl_formfree(struct curl_httppost *form); - -/* - * NAME curl_getenv() - * - * DESCRIPTION - * - * Returns a malloc()'ed string that MUST be curl_free()ed after usage is - * complete. DEPRECATED - see lib/README.curlx - */ -CURL_EXTERN char *curl_getenv(const char *variable); - -/* - * NAME curl_version() - * - * DESCRIPTION - * - * Returns a static ascii string of the libcurl version. - */ -CURL_EXTERN char *curl_version(void); - -/* - * NAME curl_easy_escape() - * - * DESCRIPTION - * - * Escapes URL strings (converts all letters consider illegal in URLs to their - * %XX versions). This function returns a new allocated string or NULL if an - * error occurred. - */ -CURL_EXTERN char *curl_easy_escape(CURL *handle, - const char *string, - int length); - -/* the previous version: */ -CURL_EXTERN char *curl_escape(const char *string, - int length); - - -/* - * NAME curl_easy_unescape() - * - * DESCRIPTION - * - * Unescapes URL encoding in strings (converts all %XX codes to their 8bit - * versions). This function returns a new allocated string or NULL if an error - * occurred. - * Conversion Note: On non-ASCII platforms the ASCII %XX codes are - * converted into the host encoding. - */ -CURL_EXTERN char *curl_easy_unescape(CURL *handle, - const char *string, - int length, - int *outlength); - -/* the previous version */ -CURL_EXTERN char *curl_unescape(const char *string, - int length); - -/* - * NAME curl_free() - * - * DESCRIPTION - * - * Provided for de-allocation in the same translation unit that did the - * allocation. Added in libcurl 7.10 - */ -CURL_EXTERN void curl_free(void *p); - -/* - * NAME curl_global_init() - * - * DESCRIPTION - * - * curl_global_init() should be invoked exactly once for each application that - * uses libcurl - */ -CURL_EXTERN CURLcode curl_global_init(long flags); - -/* - * NAME curl_global_init_mem() - * - * DESCRIPTION - * - * curl_global_init() or curl_global_init_mem() should be invoked exactly once - * for each application that uses libcurl. This function can be used to - * initialize libcurl and set user defined memory management callback - * functions. Users can implement memory management routines to check for - * memory leaks, check for mis-use of the curl library etc. User registered - * callback routines with be invoked by this library instead of the system - * memory management routines like malloc, free etc. - */ -CURL_EXTERN CURLcode curl_global_init_mem(long flags, - curl_malloc_callback m, - curl_free_callback f, - curl_realloc_callback r, - curl_strdup_callback s, - curl_calloc_callback c); - -/* - * NAME curl_global_cleanup() - * - * DESCRIPTION - * - * curl_global_cleanup() should be invoked exactly once for each application - * that uses libcurl - */ -CURL_EXTERN void curl_global_cleanup(void); - -/* linked-list structure for the CURLOPT_QUOTE option (and other) */ -struct curl_slist { - char *data; - struct curl_slist *next; -}; - -/* - * NAME curl_slist_append() - * - * DESCRIPTION - * - * Appends a string to a linked list. If no list exists, it will be created - * first. Returns the new list, after appending. - */ -CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, - const char *); - -/* - * NAME curl_slist_free_all() - * - * DESCRIPTION - * - * free a previously built curl_slist. - */ -CURL_EXTERN void curl_slist_free_all(struct curl_slist *); - -/* - * NAME curl_getdate() - * - * DESCRIPTION - * - * Returns the time, in seconds since 1 Jan 1970 of the time string given in - * the first argument. The time argument in the second parameter is unused - * and should be set to NULL. - */ -CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); - -#define CURLINFO_STRING 0x100000 -#define CURLINFO_LONG 0x200000 -#define CURLINFO_DOUBLE 0x300000 -#define CURLINFO_SLIST 0x400000 -#define CURLINFO_MASK 0x0fffff -#define CURLINFO_TYPEMASK 0xf00000 - -typedef enum { - CURLINFO_NONE, /* first, never use this */ - CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, - CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, - CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, - CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, - CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, - CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, - CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, - CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, - CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, - CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, - CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, - CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, - CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, - CURLINFO_FILETIME = CURLINFO_LONG + 14, - CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, - CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, - CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, - CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, - CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, - CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, - CURLINFO_PRIVATE = CURLINFO_STRING + 21, - CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, - CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, - CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, - CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, - CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, - CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, - CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, - CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, - CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, - /* Fill in new entries below here! */ - - CURLINFO_LASTONE = 30 -} CURLINFO; - -/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as - CURLINFO_HTTP_CODE */ -#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE - -typedef enum { - CURLCLOSEPOLICY_NONE, /* first, never use this */ - - CURLCLOSEPOLICY_OLDEST, - CURLCLOSEPOLICY_LEAST_RECENTLY_USED, - CURLCLOSEPOLICY_LEAST_TRAFFIC, - CURLCLOSEPOLICY_SLOWEST, - CURLCLOSEPOLICY_CALLBACK, - - CURLCLOSEPOLICY_LAST /* last, never use this */ -} curl_closepolicy; - -#define CURL_GLOBAL_SSL (1<<0) -#define CURL_GLOBAL_WIN32 (1<<1) -#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) -#define CURL_GLOBAL_NOTHING 0 -#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL - - -/***************************************************************************** - * Setup defines, protos etc for the sharing stuff. - */ - -/* Different data locks for a single share */ -typedef enum { - CURL_LOCK_DATA_NONE = 0, - /* CURL_LOCK_DATA_SHARE is used internaly to say that - * the locking is just made to change the internal state of the share - * itself. - */ - CURL_LOCK_DATA_SHARE, - CURL_LOCK_DATA_COOKIE, - CURL_LOCK_DATA_DNS, - CURL_LOCK_DATA_SSL_SESSION, - CURL_LOCK_DATA_CONNECT, - CURL_LOCK_DATA_LAST -} curl_lock_data; - -/* Different lock access types */ -typedef enum { - CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ - CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ - CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ - CURL_LOCK_ACCESS_LAST /* never use */ -} curl_lock_access; - -typedef void (*curl_lock_function)(CURL *handle, - curl_lock_data data, - curl_lock_access locktype, - void *userptr); -typedef void (*curl_unlock_function)(CURL *handle, - curl_lock_data data, - void *userptr); - -typedef void CURLSH; - -typedef enum { - CURLSHE_OK, /* all is fine */ - CURLSHE_BAD_OPTION, /* 1 */ - CURLSHE_IN_USE, /* 2 */ - CURLSHE_INVALID, /* 3 */ - CURLSHE_NOMEM, /* out of memory */ - CURLSHE_LAST /* never use */ -} CURLSHcode; - -typedef enum { - CURLSHOPT_NONE, /* don't use */ - CURLSHOPT_SHARE, /* specify a data type to share */ - CURLSHOPT_UNSHARE, /* specify shich data type to stop sharing */ - CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ - CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ - CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock - callback functions */ - CURLSHOPT_LAST /* never use */ -} CURLSHoption; - -CURL_EXTERN CURLSH *curl_share_init(void); -CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); -CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); - -/**************************************************************************** - * Structures for querying information about the curl library at runtime. - */ - -typedef enum { - CURLVERSION_FIRST, - CURLVERSION_SECOND, - CURLVERSION_THIRD, - CURLVERSION_FOURTH, - CURLVERSION_LAST /* never actually use this */ -} CURLversion; - -/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by - basicly all programs ever, that want to get version information. It is - meant to be a built-in version number for what kind of struct the caller - expects. If the struct ever changes, we redefine the NOW to another enum - from above. */ -#define CURLVERSION_NOW CURLVERSION_FOURTH - -typedef struct { - CURLversion age; /* age of the returned struct */ - const char *version; /* LIBCURL_VERSION */ - unsigned int version_num; /* LIBCURL_VERSION_NUM */ - const char *host; /* OS/host/cpu/machine when configured */ - int features; /* bitmask, see defines below */ - const char *ssl_version; /* human readable string */ - long ssl_version_num; /* not used anymore, always 0 */ - const char *libz_version; /* human readable string */ - /* protocols is terminated by an entry with a NULL protoname */ - const char * const *protocols; - - /* The fields below this were added in CURLVERSION_SECOND */ - const char *ares; - int ares_num; - - /* This field was added in CURLVERSION_THIRD */ - const char *libidn; - - /* These field were added in CURLVERSION_FOURTH */ - - /* Same as '_libiconv_version' if built with HAVE_ICONV */ - int iconv_ver_num; - - const char *libssh_version; /* human readable string */ - -} curl_version_info_data; - -#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ -#define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */ -#define CURL_VERSION_SSL (1<<2) /* SSL options are present */ -#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ -#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ -#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */ -#define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */ -#define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */ -#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */ -#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */ -#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */ -#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */ -#define CURL_VERSION_CONV (1<<12) /* character conversions are - supported */ - -/* - * NAME curl_version_info() - * - * DESCRIPTION - * - * This function returns a pointer to a static copy of the version info - * struct. See above. - */ -CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); - -/* - * NAME curl_easy_strerror() - * - * DESCRIPTION - * - * The curl_easy_strerror function may be used to turn a CURLcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_easy_strerror(CURLcode); - -/* - * NAME curl_share_strerror() - * - * DESCRIPTION - * - * The curl_share_strerror function may be used to turn a CURLSHcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. - */ -CURL_EXTERN const char *curl_share_strerror(CURLSHcode); - -#ifdef __cplusplus -} -#endif - -/* unfortunately, the easy.h and multi.h include files need options and info - stuff before they can be included! */ -#include "easy.h" /* nothing in curl is fun without the easy stuff */ -#include "multi.h" - -#endif /* __CURL_CURL_H */ diff --git a/contrib/ise_library/cURL/spec/include/curl/curlver.h b/contrib/ise_library/cURL/spec/include/curl/curlver.h deleted file mode 100644 index 1936c317..00000000 --- a/contrib/ise_library/cURL/spec/include/curl/curlver.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef __CURL_CURLVER_H -#define __CURL_CURLVER_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id$ - ***************************************************************************/ - -/* This header file contains nothing but libcurl version info, generated by - a script at release-time. This was made its own header file in 7.11.2 */ - -/* This is the version number of the libcurl package from which this header - file origins: */ -#define LIBCURL_VERSION "7.17.0" - -/* The numeric version number is also available "in parts" by using these - defines: */ -#define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 17 -#define LIBCURL_VERSION_PATCH 0 - -/* This is the numeric version of the libcurl version number, meant for easier - parsing and comparions by programs. The LIBCURL_VERSION_NUM define will - always follow this syntax: - - 0xXXYYZZ - - Where XX, YY and ZZ are the main version, release and patch numbers in - hexadecimal (using 8 bits each). All three numbers are always represented - using two digits. 1.2 would appear as "0x010200" while version 9.11.7 - appears as "0x090b07". - - This 6-digit (24 bits) hexadecimal number does not show pre-release number, - and it is always a greater number in a more recent release. It makes - comparisons with greater than and less than work. -*/ -#define LIBCURL_VERSION_NUM 0x071100 - -/* - * This is the date and time when the full source package was created. The - * timestamp is not stored in CVS, as the timestamp is properly set in the - * tarballs by the maketgz script. - * - * The format of the date should follow this template: - * - * "Mon Feb 12 11:35:33 UTC 2007" - */ -#define LIBCURL_TIMESTAMP "Thu Sep 13 20:22:24 UTC 2007" - -#endif /* __CURL_CURLVER_H */ diff --git a/contrib/ise_library/cURL/spec/include/curl/easy.h b/contrib/ise_library/cURL/spec/include/curl/easy.h deleted file mode 100644 index 17de2107..00000000 --- a/contrib/ise_library/cURL/spec/include/curl/easy.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __CURL_EASY_H -#define __CURL_EASY_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id$ - ***************************************************************************/ -#ifdef __cplusplus -extern "C" { -#endif - -CURL_EXTERN CURL *curl_easy_init(void); -CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); -CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); -CURL_EXTERN void curl_easy_cleanup(CURL *curl); - -/* - * NAME curl_easy_getinfo() - * - * DESCRIPTION - * - * Request internal information from the curl session with this function. The - * third argument MUST be a pointer to a long, a pointer to a char * or a - * pointer to a double (as the documentation describes elsewhere). The data - * pointed to will be filled in accordingly and can be relied upon only if the - * function returns CURLE_OK. This function is intended to get used *AFTER* a - * performed transfer, all results from this function are undefined until the - * transfer is completed. - */ -CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); - - -/* - * NAME curl_easy_duphandle() - * - * DESCRIPTION - * - * Creates a new curl session handle with the same options set for the handle - * passed in. Duplicating a handle could only be a matter of cloning data and - * options, internal state info and things like persistant connections cannot - * be transfered. It is useful in multithreaded applications when you can run - * curl_easy_duphandle() for each new thread to avoid a series of identical - * curl_easy_setopt() invokes in every thread. - */ -CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); - -/* - * NAME curl_easy_reset() - * - * DESCRIPTION - * - * Re-initializes a CURL handle to the default values. This puts back the - * handle to the same state as it was in when it was just created. - * - * It does keep: live connections, the Session ID cache, the DNS cache and the - * cookies. - */ -CURL_EXTERN void curl_easy_reset(CURL *curl); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/contrib/ise_library/cURL/spec/include/curl/mprintf.h b/contrib/ise_library/cURL/spec/include/curl/mprintf.h deleted file mode 100644 index 5c526882..00000000 --- a/contrib/ise_library/cURL/spec/include/curl/mprintf.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef __CURL_MPRINTF_H -#define __CURL_MPRINTF_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id$ - ***************************************************************************/ - -#include -#include /* needed for FILE */ - -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -CURL_EXTERN int curl_mprintf(const char *format, ...); -CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); -CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); -CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...); -CURL_EXTERN int curl_mvprintf(const char *format, va_list args); -CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); -CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); -CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args); -CURL_EXTERN char *curl_maprintf(const char *format, ...); -CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); - -#ifdef _MPRINTF_REPLACE -# undef printf -# undef fprintf -# undef sprintf -# undef vsprintf -# undef snprintf -# undef vprintf -# undef vfprintf -# undef vsnprintf -# undef aprintf -# undef vaprintf -# define printf curl_mprintf -# define fprintf curl_mfprintf -#ifdef CURLDEBUG -/* When built with CURLDEBUG we define away the sprintf() functions since we - don't want internal code to be using them */ -# define sprintf sprintf_was_used -# define vsprintf vsprintf_was_used -#else -# define sprintf curl_msprintf -# define vsprintf curl_mvsprintf -#endif -# define snprintf curl_msnprintf -# define vprintf curl_mvprintf -# define vfprintf curl_mvfprintf -# define vsnprintf curl_mvsnprintf -# define aprintf curl_maprintf -# define vaprintf curl_mvaprintf -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __CURL_MPRINTF_H */ diff --git a/contrib/ise_library/cURL/spec/include/curl/multi.h b/contrib/ise_library/cURL/spec/include/curl/multi.h deleted file mode 100644 index 094c6484..00000000 --- a/contrib/ise_library/cURL/spec/include/curl/multi.h +++ /dev/null @@ -1,346 +0,0 @@ -#ifndef __CURL_MULTI_H -#define __CURL_MULTI_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id$ - ***************************************************************************/ -/* - This is an "external" header file. Don't give away any internals here! - - GOALS - - o Enable a "pull" interface. The application that uses libcurl decides where - and when to ask libcurl to get/send data. - - o Enable multiple simultaneous transfers in the same thread without making it - complicated for the application. - - o Enable the application to select() on its own file descriptors and curl's - file descriptors simultaneous easily. - -*/ - -/* - * This header file should not really need to include "curl.h" since curl.h - * itself includes this file and we expect user applications to do #include - * without the need for especially including multi.h. - * - * For some reason we added this include here at one point, and rather than to - * break existing (wrongly written) libcurl applications, we leave it as-is - * but with this warning attached. - */ -#include "curl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void CURLM; - -typedef enum { - CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or - curl_multi_socket*() soon */ - CURLM_OK, - CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ - CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ - CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ - CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ - CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ - CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ - CURLM_LAST -} CURLMcode; - -/* just to make code nicer when using curl_multi_socket() you can now check - for CURLM_CALL_MULTI_SOCKET too in the same style it works for - curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ -#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM - -typedef enum { - CURLMSG_NONE, /* first, not used */ - CURLMSG_DONE, /* This easy handle has completed. 'result' contains - the CURLcode of the transfer */ - CURLMSG_LAST /* last, not used */ -} CURLMSG; - -struct CURLMsg { - CURLMSG msg; /* what this message means */ - CURL *easy_handle; /* the handle it concerns */ - union { - void *whatever; /* message-specific data */ - CURLcode result; /* return code for transfer */ - } data; -}; -typedef struct CURLMsg CURLMsg; - -/* - * Name: curl_multi_init() - * - * Desc: inititalize multi-style curl usage - * - * Returns: a new CURLM handle to use in all 'curl_multi' functions. - */ -CURL_EXTERN CURLM *curl_multi_init(void); - -/* - * Name: curl_multi_add_handle() - * - * Desc: add a standard curl handle to the multi stack - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_remove_handle() - * - * Desc: removes a curl handle from the multi stack again - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, - CURL *curl_handle); - - /* - * Name: curl_multi_fdset() - * - * Desc: Ask curl for its fd_set sets. The app can use these to select() or - * poll() on. We want curl_multi_perform() called as soon as one of - * them are ready. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, - fd_set *read_fd_set, - fd_set *write_fd_set, - fd_set *exc_fd_set, - int *max_fd); - - /* - * Name: curl_multi_perform() - * - * Desc: When the app thinks there's data available for curl it calls this - * function to read/write whatever there is right now. This returns - * as soon as the reads and writes are done. This function does not - * require that there actually is data available for reading or that - * data can be written, it can be called just in case. It returns - * the number of handles that still transfer data in the second - * argument's integer-pointer. - * - * Returns: CURLMcode type, general multi error code. *NOTE* that this only - * returns errors etc regarding the whole multi stack. There might - * still have occurred problems on invidual transfers even when this - * returns OK. - */ -CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, - int *running_handles); - - /* - * Name: curl_multi_cleanup() - * - * Desc: Cleans up and removes a whole multi stack. It does not free or - * touch any individual easy handles in any way. We need to define - * in what state those handles will be if this function is called - * in the middle of a transfer. - * - * Returns: CURLMcode type, general multi error code. - */ -CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); - -/* - * Name: curl_multi_info_read() - * - * Desc: Ask the multi handle if there's any messages/informationals from - * the individual transfers. Messages include informationals such as - * error code from the transfer or just the fact that a transfer is - * completed. More details on these should be written down as well. - * - * Repeated calls to this function will return a new struct each - * time, until a special "end of msgs" struct is returned as a signal - * that there is no more to get at this point. - * - * The data the returned pointer points to will not survive calling - * curl_multi_cleanup(). - * - * The 'CURLMsg' struct is meant to be very simple and only contain - * very basic informations. If more involved information is wanted, - * we will provide the particular "transfer handle" in that struct - * and that should/could/would be used in subsequent - * curl_easy_getinfo() calls (or similar). The point being that we - * must never expose complex structs to applications, as then we'll - * undoubtably get backwards compatibility problems in the future. - * - * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out - * of structs. It also writes the number of messages left in the - * queue (after this read) in the integer the second argument points - * to. - */ -CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, - int *msgs_in_queue); - -/* - * Name: curl_multi_strerror() - * - * Desc: The curl_multi_strerror function may be used to turn a CURLMcode - * value into the equivalent human readable error string. This is - * useful for printing meaningful error messages. - * - * Returns: A pointer to a zero-terminated error message. - */ -CURL_EXTERN const char *curl_multi_strerror(CURLMcode); - -/* - * Name: curl_multi_socket() and - * curl_multi_socket_all() - * - * Desc: An alternative version of curl_multi_perform() that allows the - * application to pass in one of the file descriptors that have been - * detected to have "action" on them and let libcurl perform. - * See man page for details. - */ -#define CURL_POLL_NONE 0 -#define CURL_POLL_IN 1 -#define CURL_POLL_OUT 2 -#define CURL_POLL_INOUT 3 -#define CURL_POLL_REMOVE 4 - -#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD - -#define CURL_CSELECT_IN 0x01 -#define CURL_CSELECT_OUT 0x02 -#define CURL_CSELECT_ERR 0x04 - -typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ - curl_socket_t s, /* socket */ - int what, /* see above */ - void *userp, /* private callback - pointer */ - void *socketp); /* private socket - pointer */ -/* - * Name: curl_multi_timer_callback - * - * Desc: Called by libcurl whenever the library detects a change in the - * maximum number of milliseconds the app is allowed to wait before - * curl_multi_socket() or curl_multi_perform() must be called - * (to allow libcurl's timed events to take place). - * - * Returns: The callback should return zero. - */ -typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ - long timeout_ms, /* see above */ - void *userp); /* private callback - pointer */ - -CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, - int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, - curl_socket_t s, - int ev_bitmask, - int *running_handles); - -CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, - int *running_handles); - -#ifndef CURL_ALLOW_OLD_MULTI_SOCKET -/* This macro below was added in 7.16.3 to push users who recompile to use - the new curl_multi_socket_action() instead of the old curl_multi_socket() -*/ -#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) -#endif - -/* - * Name: curl_multi_timeout() - * - * Desc: Returns the maximum number of milliseconds the app is allowed to - * wait before curl_multi_socket() or curl_multi_perform() must be - * called (to allow libcurl's timed events to take place). - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, - long *milliseconds); - -#undef CINIT /* re-using the same name as in curl.h */ - -#ifdef CURL_ISOCPP -#define CINIT(name,type,number) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + number -#else -/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ -#define LONG CURLOPTTYPE_LONG -#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT -#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT -#define OFF_T CURLOPTTYPE_OFF_T -#define CINIT(name,type,number) CURLMOPT_/**/name = type + number -#endif - -typedef enum { - /* This is the socket callback function pointer */ - CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), - - /* This is the argument passed to the socket callback */ - CINIT(SOCKETDATA, OBJECTPOINT, 2), - - /* set to 1 to enable pipelining for this multi handle */ - CINIT(PIPELINING, LONG, 3), - - /* This is the timer callback function pointer */ - CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), - - /* This is the argument passed to the timer callback */ - CINIT(TIMERDATA, OBJECTPOINT, 5), - - /* maximum number of entries in the connection cache */ - CINIT(MAXCONNECTS, LONG, 6), - - CURLMOPT_LASTENTRY /* the last unused */ -} CURLMoption; - - -/* - * Name: curl_multi_setopt() - * - * Desc: Sets options for the multi handle. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, - CURLMoption option, ...); - - -/* - * Name: curl_multi_assign() - * - * Desc: This function sets an association in the multi handle between the - * given socket and a private pointer of the application. This is - * (only) useful for curl_multi_socket uses. - * - * Returns: CURLM error code. - */ -CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, - curl_socket_t sockfd, void *sockp); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif diff --git a/contrib/ise_library/cURL/spec/include/curl/stdcheaders.h b/contrib/ise_library/cURL/spec/include/curl/stdcheaders.h deleted file mode 100644 index 11c1e2f6..00000000 --- a/contrib/ise_library/cURL/spec/include/curl/stdcheaders.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __STDC_HEADERS_H -#define __STDC_HEADERS_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id$ - ***************************************************************************/ - -#include - -size_t fread (void *, size_t, size_t, FILE *); -size_t fwrite (const void *, size_t, size_t, FILE *); - -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, size_t); - -#endif diff --git a/contrib/ise_library/cURL/spec/include/curl/types.h b/contrib/ise_library/cURL/spec/include/curl/types.h deleted file mode 100644 index d37d6ae9..00000000 --- a/contrib/ise_library/cURL/spec/include/curl/types.h +++ /dev/null @@ -1 +0,0 @@ -/* not used */ diff --git a/contrib/ise_library/cURL/spec/include/eiffel_curl.h b/contrib/ise_library/cURL/spec/include/eiffel_curl.h deleted file mode 100644 index 3dd9b005..00000000 --- a/contrib/ise_library/cURL/spec/include/eiffel_curl.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -indexing - description: "Functions used by the class CURL_FUNCTION." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -*/ - -#ifndef _eiffel_curl_h_ -#define _eiffel_curl_h_ - -#include "eif_eiffel.h" - -/* unix-specific */ -#ifndef EIF_WINDOWS -#include -#include -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -extern void c_set_object(EIF_REFERENCE a_address); -extern void c_release_object(void); -extern void c_set_progress_function_address( EIF_POINTER a_address); -extern void c_set_read_function_address( EIF_POINTER a_address); -extern void c_set_write_function_address( EIF_POINTER a_address); -extern void c_set_debug_function_address (EIF_POINTER a_address); -extern size_t curl_write_function (void *ptr, size_t size, size_t nmemb, void *data); -extern size_t curl_read_function (void *ptr, size_t size, size_t nmemb, void *data); -extern size_t curl_progress_function (void * a_object_id, double a_dltotal, double a_dlnow, double a_ultotal, double a_ulnow); -extern size_t curl_debug_function (CURL * a_curl_handle, curl_infotype a_curl_infotype, unsigned char * a_char_pointer, size_t a_size, void * a_object_id); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/contrib/ise_library/text/uri/license.lic b/contrib/ise_library/text/uri/license.lic deleted file mode 100644 index c929225f..00000000 --- a/contrib/ise_library/text/uri/license.lic +++ /dev/null @@ -1 +0,0 @@ -reference:forum2 diff --git a/contrib/ise_library/text/uri/src/iri.e b/contrib/ise_library/text/uri/src/iri.e deleted file mode 100644 index 81fd1a97..00000000 --- a/contrib/ise_library/text/uri/src/iri.e +++ /dev/null @@ -1,352 +0,0 @@ -note - description : "[ - Object that represents an IRI Scheme - - See http://en.wikipedia.org/wiki/Internationalized_Resource_Identifier - See http://tools.ietf.org/html/rfc3987 (IRI) - - ]" - author: "$Author: manus $" - date: "$Date: 2013-01-26 01:40:46 +0100 (sam., 26 janv. 2013) $" - revision: "$Revision: 90880 $" - EIS: "name=IRI-RFC3987", "protocol=URI", "src=http://tools.ietf.org/html/rfc3987" - EIS: "name=IRI-Wikipedia", "protocol=URI", "src=http://en.wikipedia.org/wiki/Internationalized_Resource_Identifier" - -class - IRI - -inherit - URI - rename - make_from_string as make_from_uri_string, - userinfo as uri_userinfo, - path as uri_path, path_segments as uri_path_segments, - query as uri_query, query_items as uri_query_items, - fragment as uri_fragment, - username_password as uri_username_password, - username as uri_username, password as uri_password, - hier as uri_hier, - authority as uri_authority, - string as uri_string - end - -create - make_from_string, - make_from_uri - -feature {NONE} -- Initialization - - make_from_string (a_string: READABLE_STRING_GENERAL) - -- Make from Internationalized resource identifier text `a_string' - note - EIS: "name=IRI-RFC3987", "protocol=URI", "src=http://tools.ietf.org/html/rfc3987" - EIS: "name=IRI-Wikipedia", "protocol=URI", "src=http://en.wikipedia.org/wiki/Internationalized_Resource_Identifier" - local - l_uri_string: STRING_8 - do - create l_uri_string.make (a_string.count) - iri_into_uri (a_string, l_uri_string) - make_from_uri_string (l_uri_string) - end - - make_from_uri (a_uri: URI) - -- Make Current Internationalized resource identifier from `uri' object - do - make_from_uri_string (a_uri.string) - end - -feature -- Access - - userinfo: detachable READABLE_STRING_32 - -- User information. - --| username:password - --| RFC3986: userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) - do - Result := to_internationalized_percent_encoded_string (uri_userinfo) - end - - path: READABLE_STRING_32 - -- Path component containing data, usually organized in hierarchical form. - do - Result := to_attached_internationalized_percent_encoded_string (uri_path) - end - - query: detachable READABLE_STRING_32 - -- Query string. - do - Result := to_internationalized_percent_encoded_string (uri_query) - end - - fragment: detachable READABLE_STRING_32 - -- The fragment identifier component of a URI allows indirect - -- identification of a secondary resource by reference to a primary - -- resource and additional identifying information. - do - Result := to_internationalized_percent_encoded_string (uri_fragment) - end - -feature -- Access - - path_segments: LIST [READABLE_STRING_32] - -- Segments composing `path'. - do - Result := path.split ('/') - end - - query_items: detachable LIST [TUPLE [name: READABLE_STRING_32; value: detachable READABLE_STRING_32]] - -- Query items composing the `query'. - local - lst: LIST [READABLE_STRING_32] - i: INTEGER - do - if attached query as q then - lst := q.split ('&') - create {ARRAYED_LIST [like query_items.item]} Result.make (lst.count) - across - lst as e - loop - i := e.item.index_of ('=', 1) - if i > 0 then - Result.force ([e.item.substring (1, i - 1), e.item.substring (i + 1, e.item.count)]) - else - Result.force ([e.item, Void]) - end - end - end - end - -feature -- Query - - hier: READABLE_STRING_32 - -- Hier part. - -- hier-part = "//" authority path-abempty - -- / path-absolute - -- / path-rootless - -- / path-empty - local - s: STRING_32 - do - create s.make (10) - if attached authority as l_authority then - s.append_character ('/') - s.append_character ('/') - s.append (l_authority) - end - s.append (path) - Result := s - end - - username_password: detachable TUPLE [username: READABLE_STRING_32; password: detachable READABLE_STRING_32] - -- Username and password value extrated from `userinfo'. - --| userinfo = username:password - local - i: INTEGER - u,p: detachable READABLE_STRING_32 - do - if attached userinfo as t then - i := t.index_of (':', 1) - if i > 0 then - p := t.substring (i + 1, t.count) - u := t.substring (1, i - 1) - else - u := t - p := Void - end - Result := [u, p] - end - end - - username: detachable READABLE_STRING_32 - -- Eventual username. - do - if attached username_password as up then - Result := up.username - end - end - - password: detachable READABLE_STRING_32 - -- Eventual password. - do - if attached username_password as up then - Result := up.password - end - end - - authority: detachable READABLE_STRING_32 - -- Hierarchical element for naming authority. - --| RFC3986: authority = [ userinfo "@" ] host [ ":" port ] - local - s: STRING_32 - do - if attached host as h then - if attached userinfo as u then - create s.make_from_string (u) - s.append_character ('@') - s.append_string_general (h) - else - create s.make (h.count) - s.append_string_general (h) - end - if port /= 0 then - s.append_character (':') - s.append_integer (port) - end - Result := s - else - check not is_valid or else (userinfo = Void and port = 0) end - end - end - -feature -- Conversion - - string: READABLE_STRING_32 - -- String representation. - -- scheme://username:password@hostname/path?query#fragment - local - s: STRING_32 - do - if attached scheme as l_scheme and then not l_scheme.is_empty then - create s.make (l_scheme.count) - s.append_string_general (l_scheme) - s.append_character (':') - else - create s.make_empty - end - s.append (hier) - if attached query as q then - s.append_character ('?') - s.append (q) - end - if attached fragment as f then - s.append_character ('#') - s.append (f) - end - Result := s - end - - to_uri: URI - do - create Result.make_from_string (uri_string) - end - -feature {NONE} -- Implementation: Internationalization - - iri_into_uri (a_string: READABLE_STRING_GENERAL; a_result: STRING_8) - require - is_valid_iri: True - local - i,n: INTEGER - c: NATURAL_32 - do - from - i := 1 - n := a_string.count - until - i > n - loop - c := a_string.code (i) - if c > 0x7F then - -- extended ASCII and/or Unicode - append_percent_encoded_character_code_to (c, a_result) --- elseif c = 37 then -- '%' --- -- Check for %u + code --- if i + 1 <= n then --- c := a_string.code (i + 1) --- if c = 85 or c = 117 then -- 85 'U' 117 'u' --- TODO: Convert it to standard percent-encoding without %U... --- end --- else --- a_result.append_code (c) --- end - else - -- keep as it is - a_result.append_code (c) - end - i := i + 1 - end - end - - to_internationalized_percent_encoded_string (s: detachable READABLE_STRING_8): detachable STRING_32 - -- Convert string `s' to Internationalized Resource Identifier string - -- Result is Void if `s' is Void. - do - if s /= Void then - create Result.make (s.count) - append_percent_encoded_string_into_internationalized_percent_encoded_string (s, Result) - end - end - - to_attached_internationalized_percent_encoded_string (s: READABLE_STRING_8): STRING_32 - -- Convert string `s' to Internationalized Resource Identifier string - do - create Result.make (s.count) - append_percent_encoded_string_into_internationalized_percent_encoded_string (s, Result) - end - - append_percent_encoded_string_into_internationalized_percent_encoded_string (v: READABLE_STRING_GENERAL; a_result: STRING_32) - -- Append to `a_result' the Internationalized URL-decoded equivalent of the given percent-encoded string `v' - -- It simply decode any percent-encoded Unicode character and kept the rest untouched - -- "http://example.com/summer/%C3%A9t%C3%A9" will be converted to IRI "http://example.com/summer/été" - local - i,n: INTEGER - c1, - c: NATURAL_32 - pr: CELL [INTEGER] - do - from - i := 1 - create pr.put (i) - n := v.count - until - i > n - loop - c := v.code (i) - inspect c - when 43 then -- 43 '+' - -- Some implementation are replacing spaces with "+" instead of "%20" - -- Here fix this bad behavior - a_result.append_code (37) -- 37 '%' - a_result.append_code (50) -- 50 '2' - a_result.append_code (48) -- 48 '0' - when 37 then -- 37 '%%' - -- An escaped character ? - if i = n then -- Error? - a_result.append_code (c) - elseif i + 1 <= n then - c1 := v.code (i + 1) - if c1 = 85 or c1 = 117 then -- 117 'u' 85 'U' - -- %u + UTF-32 code - pr.replace (i) - c1 := next_percent_decoded_character_code (v, pr) - i := pr.item - a_result.append_code (c1) - else - pr.replace (i) - c1 := next_percent_decoded_unicode_character_code (v, pr) - if c1 > 0x7F then - a_result.append_code (c1) - i := pr.item - else - a_result.append_code (c) - end - end - end - else - a_result.append_code (c) - end - i := i + 1 - end - end - - -;note - copyright: "Copyright (c) 1984-2013, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/contrib/ise_library/text/uri/src/uri.e b/contrib/ise_library/text/uri/src/uri.e deleted file mode 100644 index b34a5249..00000000 --- a/contrib/ise_library/text/uri/src/uri.e +++ /dev/null @@ -1,971 +0,0 @@ -note - description : "[ - Object that represent a URI Scheme - - See http://en.wikipedia.org/wiki/URI_scheme - See http://en.wikipedia.org/wiki/Uniform_resource_identifier - See http://en.wikipedia.org/wiki/Uniform_resource_locator - See http://tools.ietf.org/html/rfc3986 (URI) - - Global syntax element: - pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - pct-encoded = "%" HEXDIG HEXDIG - unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - reserved = gen-delims / sub-delims - gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" - sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - / "*" / "+" / "," / ";" / "=" - ]" - date: "$Date: 2013-01-21 10:25:01 +0100 (lun., 21 janv. 2013) $" - revision: "$Revision: 90748 $" - EIS: "name=URI-RFC3986 Generic syntax", "protocol=URI", "src=http://tools.ietf.org/html/rfc3986" - EIS: "name=URI-Wikipedia", "protocol=URI", "src=http://en.wikipedia.org/wiki/URI_scheme" - EIS: "name=IRI-RFC3987", "protocol=URI", "src=http://tools.ietf.org/html/rfc3987" - EIS: "name=IRI-Wikipedia", "protocol=URI", "src=http://en.wikipedia.org/wiki/Internationalized_Resource_Identifier" - EIS: "name=Percent-encoding", "protocol=URI", "src=http://en.wikipedia.org/wiki/Percent-encoding" - - EIS: "name=url-RFC1738", "protocol=URI", "src=http://tools.ietf.org/html/rfc1738" - EIS: "name=mailto-RFC2368", "protocol=URI", "src=http://tools.ietf.org/html/rfc2368" - EIS: "name=ipv6-RFC2373", "protocol=URI", "src=http://tools.ietf.org/html/rfc2373" - EIS: "name=ipv6-RFC2373 in URL", "protocol=URI", "src=http://tools.ietf.org/html/rfc2732" - -class - URI - -inherit - ANY - - PERCENT_ENCODER - export - {NONE} all - end - - DEBUG_OUTPUT - -create - make_from_string - -feature {NONE} -- Initialization - - make_from_string (a_string: READABLE_STRING_8) - -- Parse `a_string' as a URI as specified by RFC3986 - --| Note: for now the result of the parsing does not check the strict validity of each part. - --| URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] - note - EIS: "name=Syntax Components", "protocol=URI", "src=http://tools.ietf.org/html/rfc3986#section-3" - local - p,q: INTEGER - s, t: STRING_8 - do - is_valid := True - p := a_string.index_of (':', 1) - if p > 0 then - set_scheme (a_string.substring (1, p - 1)) - if a_string.count > p + 1 and then a_string[p+1] = '/' and then a_string[p+2] = '/' then - --| Starts by scheme:// - --| waiting for hierarchical part username:password@hostname:port - p := p + 2 - q := a_string.index_of ('@', p + 1) - if q > 0 then - --| found user:passwd - t := a_string.substring (p + 1, q - 1) - set_userinfo (t) - p := q - end - q := a_string.index_of ('/', p + 1) - if q > 0 then - t := a_string.substring (p + 1, q - 1) - else - q := a_string.count - t := a_string.substring (p + 1, q) - q := 0 --| end of processing - end - if not t.is_empty and then t[1] = '[' then - p := t.index_of (']', 2) - if p > 0 then - p := t.index_of (':', p + 1) - else - is_valid := False - end - else - p := t.index_of (':', 1) - end - if p > 0 then - set_hostname (t.substring (1, p - 1)) - t.remove_head (p) - if t.is_integer then - set_port (t.to_integer) - else - set_port (0) - is_valid := False - end - else - set_hostname (t) - set_port (0) - end - else - --| Keep eventual '/' as part of the path - q := p + 1 - set_hostname (Void) - end - - if q > 0 and q <= a_string.count then - --| found query - t := a_string.substring (q, a_string.count) - q := t.index_of ('?', 1) - if q > 0 then - s := t.substring (1, q - 1) - if is_valid_in_uri_string (s) then - set_path (s) - else - set_path ("") - is_valid := False - end - t.remove_head (q) - q := t.index_of ('#', 1) - if q > 0 then - set_query (t.substring (1, q - 1)) - t.remove_head (q) - set_fragment (t) - else - set_query (t) - end - else - if is_valid_in_uri_string (t) then - set_path (t) - else - set_path ("") - is_valid := False - end - end - else - set_path ("") - end - else - set_scheme ("") - set_hostname (Void) - set_path ("") - end - if is_valid then - check_validity (True) - end - ensure - same_if_valid: is_valid and not is_corrected implies a_string.starts_with (string) - end - -feature -- Basic operation - - check_validity (a_fixing: BOOLEAN) - -- Check validity of URI - -- If `a_fixing' is True, attempt to correct input URI. - local - s: STRING_8 - do - -- check scheme - -- TODO: RFC3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if not is_valid_scheme (scheme) then - is_valid := False - end - - -- check userinfo - -- TODO: RFC3986: userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) - if not is_valid_userinfo (userinfo) then - is_valid := False - end - - -- check host - -- TODO: RFC3986: host = IP-literal / IPv4address / reg-name - if not is_valid_host (host) then - is_valid := False - end - - -- Check path - -- TODO: no space, all character well escaped, ... - if path.has (' ') then - -- Fix bad URI - if a_fixing then - create s.make_from_string (path) - s.replace_substring_all (" ", "%%20") - set_path (s) - is_corrected := True - end - end - if not is_valid_path (path) then - is_valid := False - end - - -- Check query - -- TODO: no space, all character well escaped, ... - if attached query as q then - if q.has (' ') then - -- Fix bad URI - if a_fixing then - create s.make_from_string (q) - s.replace_substring_all (" ", "%%20") - set_query (s) - is_corrected := True - else - is_valid := False - end - end - end - if not is_valid_query (query) then - is_valid := True - end - - -- Check fragment - if not is_valid_fragment (fragment) then - is_valid := False - end - end - -feature -- Status - - is_valid: BOOLEAN - -- Is Current valid? - - is_corrected: BOOLEAN - -- Is Current valid after eventual correction? - - has_authority: BOOLEAN - do - Result := host /= Void - end - - has_query: BOOLEAN - do - Result := query /= Void - end - - has_path: BOOLEAN - do - Result := not path.is_empty - end - - has_fragment: BOOLEAN - do - Result := fragment /= Void - end - -feature -- Access - - scheme: IMMUTABLE_STRING_8 - -- Scheme name. - --| scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - - userinfo: detachable IMMUTABLE_STRING_8 - -- User information. - --| username:password - --| RFC3986: userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) - - host: detachable IMMUTABLE_STRING_8 - -- Host name. - --| RFC3986: host = IP-literal / IPv4address / reg-name - - port: INTEGER - -- Associated port, if `0' this is not defined. - -- RFC3986: port = *DIGIT - - path: IMMUTABLE_STRING_8 - -- Path component containing data, usually organized in hierarchical form. - - query: detachable IMMUTABLE_STRING_8 - -- Query string. - - fragment: detachable IMMUTABLE_STRING_8 - -- The fragment identifier component of a URI allows indirect - -- identification of a secondary resource by reference to a primary - -- resource and additional identifying information. - -feature -- Access - - decoded_path: READABLE_STRING_32 - -- Decoded `path' - local - s: STRING_32 - do - create s.make (path.count) - append_decoded_www_form_urlencoded_string_to (path, s) - Result := s - end - - path_segments: LIST [READABLE_STRING_8] - -- Segments composing `path'. - do - Result := path.split ('/') - end - - decoded_path_segments: LIST [READABLE_STRING_32] - -- Decoded Segments composing `path'. - local - lst: like path_segments - do - lst := path_segments - create {ARRAYED_LIST [READABLE_STRING_32]} Result.make (lst.count) - across - lst as e - loop - Result.force (decoded_www_form_urlencoded_string (e.item)) - end - end - - query_items: detachable LIST [TUPLE [name: READABLE_STRING_8; value: detachable READABLE_STRING_8]] - -- Query items composing the `query'. - local - lst: LIST [READABLE_STRING_8] - i: INTEGER - do - if attached query as q then - lst := q.split ('&') - create {ARRAYED_LIST [like query_items.item]} Result.make (lst.count) - across - lst as e - loop - i := e.item.index_of ('=', 1) - if i > 0 then - Result.force ([e.item.substring (1, i - 1), e.item.substring (i + 1, e.item.count)]) - else - Result.force ([e.item, Void]) - end - end - end - end - - decoded_query_items: detachable LIST [TUPLE [name: READABLE_STRING_32; value: detachable READABLE_STRING_32]] - -- Decoded query items composing the `query'. - do - if attached query_items as lst then - create {ARRAYED_LIST [like decoded_query_items.item]} Result.make (lst.count) - across - lst as e - loop - if attached e.item.value as l_val then - Result.force ([decoded_www_form_urlencoded_string (e.item.name), decoded_www_form_urlencoded_string (l_val)]) - else - Result.force ([decoded_www_form_urlencoded_string (e.item.name), Void]) - end - end - end - end - -feature -- Query - - hier: READABLE_STRING_8 - -- Hier part. - -- hier-part = "//" authority path-abempty - -- / path-absolute - -- / path-rootless - -- / path-empty - local - s: STRING_8 - do - create s.make (10) - if attached authority as l_authority then - s.append_character ('/') - s.append_character ('/') - s.append (l_authority) - end - s.append (path) - Result := s - end - - username_password: detachable TUPLE [username: READABLE_STRING_8; password: detachable READABLE_STRING_8] - -- Username and password value extrated from `userinfo'. - --| userinfo = username:password - local - i: INTEGER - u,p: detachable READABLE_STRING_8 - do - if attached userinfo as t then - i := t.index_of (':', 1) - if i > 0 then - p := t.substring (i + 1, t.count) - u := t.substring (1, i - 1) - else - u := t - p := Void - end - Result := [u, p] - end - end - - username: detachable READABLE_STRING_8 - -- Eventual username. - do - if attached username_password as up then - Result := up.username - end - end - - password: detachable READABLE_STRING_8 - -- Eventual password. - do - if attached username_password as up then - Result := up.password - end - end - - authority: detachable READABLE_STRING_8 - -- Hierarchical element for naming authority. - --| RFC3986: authority = [ userinfo "@" ] host [ ":" port ] - local - s: STRING_8 - do - if attached host as h then - if attached userinfo as u then - create s.make_from_string (u) - s.append_character ('@') - s.append (h) - else - create s.make_from_string (h) - end - if port /= 0 then - s.append_character (':') - s.append_integer (port) - end - Result := s - else - check not is_valid or else (userinfo = Void and port = 0) end - end - end - -feature -- Conversion - - string: READABLE_STRING_8 - -- String representation. - -- scheme://username:password@hostname/path?query#fragment - local - s: STRING_8 - do - if attached scheme as l_scheme and then not l_scheme.is_empty then - create s.make_from_string (l_scheme) - s.append_character (':') - else - create s.make_empty - end - s.append (hier) - if attached query as q then - s.append_character ('?') - s.append (q) - end - if attached fragment as f then - s.append_character ('#') - s.append (f) - end - Result := s - end - - resolved_uri: URI - -- Resolved URI, i.e remove segment-component from `path' - local - p: STRING_8 - lst: like path_segments - l_first: BOOLEAN - do - from - lst := path_segments - lst.start - until - lst.off - loop - if lst.item.same_string (".") then - lst.remove - elseif lst.item.same_string ("..") then - lst.back - if not lst.before then - lst.remove - lst.remove - else - lst.forth - lst.remove - end - else - lst.forth - end - end - create p.make (path.count) - l_first := True - across - lst as c - loop - if l_first then - l_first := False - else - p.append_character ('/') - end - p.append (c.item) - end - if p.is_empty then - else - if p.item (1) /= '/' then - if not path.is_empty and then path.item (1) = '/' then - p.prepend_character ('/') - end - end - end - create Result.make_from_string (string) - Result.set_path (p) - end - -feature -- Comparison - - is_same_uri (a_uri: URI): BOOLEAN - -- Is `a_uri' same as Current ? - --| See http://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_unreserved_characters - do - Result := decoded_www_form_urlencoded_string (string).same_string (decoded_www_form_urlencoded_string (a_uri.string)) - end - -feature -- Element Change - - set_scheme (v: READABLE_STRING_8) - -- Set `scheme' to `v' - require - is_valid_scheme (v) - do - create scheme.make_from_string (v) - ensure - scheme_set: scheme.same_string (v) - end - - set_userinfo (v: detachable READABLE_STRING_8) - require - is_valid_userinfo (v) - do - if v = Void then - userinfo := Void - else - create userinfo.make_from_string (v.as_string_8) - end - ensure - userinfo_set: is_same_string (v, userinfo) - end - - set_hostname (v: detachable READABLE_STRING_8) - -- Set `host' to `v' - require - is_valid_host (v) - do - if v = Void then - host := Void - else - create host.make_from_string (v) - end - ensure - hostname_set: is_same_string (v, host) - end - - set_port (v: like port) - -- Set `port' to `v' - do - port := v - ensure - port_set: port = v - end - - set_path (a_path: READABLE_STRING_8) - -- Set `path' to `a_path' - require - is_valid_path (a_path) - do - create path.make_from_string (a_path) - ensure - path_set: path.same_string_general (a_path) - end - - set_query (v: detachable READABLE_STRING_8) - -- Set `query' to `v' - require - is_valid_query (v) - do - if v = Void then - query := Void - else - create query.make_from_string (v) - end - ensure - query_set: is_same_string (v, query) - end - - set_fragment (v: detachable READABLE_STRING_8) - -- Set `fragment' to `v' - require - is_valid_fragment (v) - do - if v = Void then - fragment := Void - else - create fragment.make_from_string (v) - end - ensure - fragment_set: is_same_string (v, fragment) - end - -feature -- Change: query - - remove_query - -- Remove query from Current URI - do - query := Void - end - - add_query_parameter (a_name: READABLE_STRING_GENERAL; a_value: detachable READABLE_STRING_GENERAL) - -- Add non percent-encoded parameters - local - q: detachable STRING - do - if attached query as l_query then - create q.make_from_string (l_query) - else - create q.make_empty - end - if not q.is_empty then - q.append_character ('&') - end - - q.append (www_form_urlencoded_string (a_name)) - if a_value /= Void then - q.append_character ('=') - q.append (www_form_urlencoded_string (a_value)) - end - create query.make_from_string (q) - end - - add_query_parameters (lst: ITERABLE [TUPLE [name: READABLE_STRING_GENERAL; value: detachable READABLE_STRING_GENERAL]]) - -- Add non percent-encoded parameters from manifest - do - across - lst as c - loop - add_query_parameter (c.item.name, c.item.value) - end - end - - add_query_parameters_from_table (tb: TABLE_ITERABLE [detachable READABLE_STRING_GENERAL, READABLE_STRING_GENERAL]) - -- Add non percent-encoded parameters from table - do - across - tb as c - loop - add_query_parameter (c.key, c.item) - end - end - -feature -- Status report - - is_valid_scheme (s: READABLE_STRING_GENERAL): BOOLEAN - -- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - local - i,n: INTEGER - c: CHARACTER_32 - do - if s.is_empty then - Result := False -- Check for URI-reference .. - else - from - i := 1 - n := s.count - Result := is_alpha_character (string_item (s, i)) - i := 2 - until - not Result or i > n - loop - c := string_item (s, i) - Result := is_alpha_or_digit_character (c) or c = '+' or c = '-' or c = '.' - i := i + 1 - end - end - end - - is_valid_userinfo (s: detachable READABLE_STRING_GENERAL): BOOLEAN - -- userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) - local - i,n: INTEGER - c: CHARACTER_32 - do - Result := True - if s /= Void then - from - i := 1 - n := s.count - until - not Result or i > n - loop - c := string_item (s, i) - -- unreserved - if is_unreserved_character (c) - or is_sub_delims_character (c) - or c = ':' - then - -- True - elseif c = '%%' then - if - i + 2 <= n and then - is_hexa_decimal_character (string_item (s, i+ 1)) and is_hexa_decimal_character (string_item (s, i + 2)) - then - -- True - i := i + 2 - else - Result := False - end - else - Result := False - end - i := i + 1 - end - end - end - - is_valid_host (s: detachable READABLE_STRING_GENERAL): BOOLEAN - -- host = IP-literal / IPv4address / reg-name - -- IP-literal = "[" ( IPv6address / IPvFuture ) "]" - -- IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) - -- IPv6address = 6( h16 ":" ) ls32 - -- / "::" 5( h16 ":" ) ls32 - -- / [ h16 ] "::" 4( h16 ":" ) ls32 - -- / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - -- / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - -- / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - -- / [ *4( h16 ":" ) h16 ] "::" ls32 - -- / [ *5( h16 ":" ) h16 ] "::" h16 - -- / [ *6( h16 ":" ) h16 ] "::" - -- - -- ls32 = ( h16 ":" h16 ) / IPv4address - -- ; least-significant 32 bits of address - -- - -- h16 = 1*4HEXDIG - -- ; 16 bits of address represented in hexadecimal - -- - -- IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet - -- - -- dec-octet = DIGIT ; 0-9 - -- / %x31-39 DIGIT ; 10-99 - -- / "1" 2DIGIT ; 100-199 - -- / "2" %x30-34 DIGIT ; 200-249 - -- / "25" %x30-35 ; 250-255 - -- - -- reg-name = *( unreserved / pct-encoded / sub-delims ) - do - Result := True - if s /= Void and then not s.is_empty then - if string_item (s, 1) = '[' and string_item (s, s.count) = ']' then - Result := True -- IPV6 : to complete - else - Result := is_hexa_decimal_character (string_item (s, 1)) -- IPV4 or reg-name : to complete - end - end - end - - is_valid_path (s: READABLE_STRING_GENERAL): BOOLEAN - -- path = path-abempty ; begins with "/" or is empty - -- / path-absolute ; begins with "/" but not "//" - -- / path-noscheme ; begins with a non-colon segment - -- / path-rootless ; begins with a segment - -- / path-empty ; zero characters - -- - -- path-abempty = *( "/" segment ) - -- path-absolute = "/" [ segment-nz *( "/" segment ) ] - -- path-noscheme = segment-nz-nc *( "/" segment ) - -- path-rootless = segment-nz *( "/" segment ) - -- path-empty = 0 - -- segment = *pchar - -- segment-nz = 1*pchar - -- segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) - -- ; non-zero-length segment without any colon ":" - -- - -- pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - do - if s.is_empty or string_item (s, 1) = '/' then - Result := is_valid_in_uri_string (s) - elseif has_authority then - if string_item (s, 1) = '/' and (s.count > 1 implies string_item (s, 2) /= '/') then - Result := is_valid_in_uri_string (s) - end - elseif s.is_empty then - Result := True - else - Result := is_valid_in_uri_string (s) - end - -- TO COMPLETE - end - - is_valid_query (s: detachable READABLE_STRING_GENERAL): BOOLEAN - -- query = *( pchar / "/" / "?" ) - local - i,n: INTEGER - c: CHARACTER_32 - do - Result := True - if s /= Void then - from - i := 1 - n := s.count - until - not Result or i > n - loop - c := string_item (s, i) - -- pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - if -- pchar - is_unreserved_character (c) - or is_sub_delims_character (c) - or c = ':' or c = '@' - then - Result := True - elseif c = '/' or c = '?' then - Result := True - elseif c = '%%' then - if - i + 2 <= n and then - is_hexa_decimal_character (string_item (s, i + 1)) and is_hexa_decimal_character (string_item (s, i + 2)) - then - -- True - i := i + 2 - else - Result := False - end - else - Result := False - end - i := i + 1 - end - end - end - - is_valid_fragment (s: detachable READABLE_STRING_GENERAL): BOOLEAN - --fragment = *( pchar / "/" / "?" ) - local - i,n: INTEGER - c: CHARACTER_32 - do - Result := True - if s /= Void then - from - i := 1 - n := s.count - until - not Result or i > n - loop - c := string_item (s, i) - -- pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - if -- pchar - is_unreserved_character (c) - or is_sub_delims_character (c) - or c = ':' or c = '@' - then - Result := True - elseif c = '/' or c = '?' then - Result := True - elseif c = '%%' then - if - i + 2 <= n and then - is_alpha_or_digit_character (string_item (s, i + 1)) and is_alpha_or_digit_character (string_item (s, i + 2)) - then - i := i + 2 - else - Result := False - end - else - Result := False - end - i := i + 1 - end - end - end - -feature -- Helper - - string_item (s: READABLE_STRING_GENERAL; i: INTEGER): CHARACTER_32 - do - Result := s.code (i).to_character_32 - end - - append_www_form_urlencoded_string_to (a_string: READABLE_STRING_GENERAL; a_target: STRING_GENERAL) - -- The application/x-www-form-urlencoded encoded string for `a_string'. - -- character encoding is UTF-8. - -- See http://www.w3.org/TR/html5/forms.html#url-encoded-form-data - do - append_percent_encoded_string_to (a_string, a_target) - end - - www_form_urlencoded_string (a_string: READABLE_STRING_GENERAL): STRING_8 - -- The application/x-www-form-urlencoded encoded string for `a_string'. - -- character encoding is UTF-8. - -- See http://www.w3.org/TR/html5/forms.html#url-encoded-form-data - do - create Result.make (a_string.count) - append_percent_encoded_string_to (a_string, Result) - end - - append_decoded_www_form_urlencoded_string_to (a_string: READABLE_STRING_GENERAL; a_target: STRING_GENERAL) - -- The string decoded from application/x-www-form-urlencoded encoded string `a_string'. - -- character encoding is UTF-8. - -- See http://www.w3.org/TR/html5/forms.html#url-encoded-form-data - do - append_percent_decoded_string_to (a_string, a_target) - end - - decoded_www_form_urlencoded_string (a_string: READABLE_STRING_GENERAL): STRING_32 - -- The string decoded from application/x-www-form-urlencoded encoded string `a_string'. - -- character encoding is UTF-8. - -- See http://www.w3.org/TR/html5/forms.html#url-encoded-form-data - do - create Result.make (a_string.count) - append_percent_decoded_string_to (a_string, Result) - end - -feature -- Assertion helper - - is_valid_in_uri_string (s: READABLE_STRING_GENERAL): BOOLEAN - -- Is `s' composed only of ASCII character? - local - i,n: INTEGER - do - from - Result := True - i := 1 - n := s.count - until - not Result or i > n - loop - if s.code (i) > 0x7F then - Result := False - end - i := i + 1 - end - end - - is_same_string (s1, s2: detachable READABLE_STRING_GENERAL): BOOLEAN - -- `s1' and `s2' have same string content? - do - if s1 = Void then - Result := s2 = Void - elseif s2 = Void then - Result := False - else - Result := s1.same_string (s2) - end - end - -feature -- Status report - - debug_output: STRING - -- String that should be displayed in debugger to represent `Current'. - local - s: STRING - do - create s.make_empty - s.append (string) - Result := s - end - -;note - copyright: "Copyright (c) 1984-2013, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/contrib/ise_library/text/uri/uri-safe.ecf b/contrib/ise_library/text/uri/uri-safe.ecf deleted file mode 100644 index 7ae5299d..00000000 --- a/contrib/ise_library/text/uri/uri-safe.ecf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - - diff --git a/contrib/library/network/server/nino/library/tcp_stream_socket.e b/contrib/library/network/server/nino/library/tcp_stream_socket.e index f51873cd..5c3ccf07 100644 --- a/contrib/library/network/server/nino/library/tcp_stream_socket.e +++ b/contrib/library/network/server/nino/library/tcp_stream_socket.e @@ -8,6 +8,9 @@ class inherit NETWORK_STREAM_SOCKET + redefine + make + end create make_server_by_address_and_port, @@ -18,6 +21,13 @@ create {NETWORK_STREAM_SOCKET} feature {NONE} -- Initialization + make + -- Create a network stream socket. + do + Precursor + set_reuse_address + end + make_server_by_address_and_port (an_address: INET_ADDRESS; a_port: INTEGER) -- Create server socket on `an_address' and `a_port'. require diff --git a/doc/wiki/Doc_Getting_Started.mediawiki b/doc/wiki/Doc_Getting_Started.mediawiki new file mode 100644 index 00000000..550862d8 --- /dev/null +++ b/doc/wiki/Doc_Getting_Started.mediawiki @@ -0,0 +1,57 @@ +Menu :: [[Doc_Getting_Started|Getting Started]] :: [[Doc_Community|Community]] + += Getting Started = +This page will help you to get started with EWF. We will first see how to install EWF and then how to compile and run the venerable Hello World example. + +== Installation == +=== EiffelStudio 7.2 === +EWF is already included in EiffelStudio 7.2: you don't have to do anything in this case! This is the recommanded solution if you are a new developer or are new to Eiffel. + +=== Other EiffelStudio versions === +If you have another version of EiffelStudio than 7.2, you have to + +* dowload EWF +* create a directory where you will put your custum Eiffel libraries +* extract EWF in the newly created directory +* define the environment variable EIFFEL_LIBRARY to point to the newly created directory + +=== Source code === +The source code is available on Github. You can get it by running the command: + +git clone git://github.com/EiffelWebFramework/EWF.git + +== Hello World == +The hello world example is located in the directory $ISE_EIFFEL/contrib/examples/web/ewf/simple. Just double click on the simple.ecf file and select the simple target or if you prefer the command line, run the command: +estudio -config simple.ecf -target simple + +Once the project is compiled, we will adapt the root class to point to port number 9090. + +'''Note''': By default, the application listens on port 80, which is often already used by standard webservers (Apache, nginx, ...). Moreover, on Linux, ports below 1024 can only be opened by root. + +To do this, we will redefine the feature initialize as follows: + + + class + APPLICATION + + inherit + WSF_DEFAULT_SERVICE + redefine + initialize + end + + create + make_and_launch + + feature {NONE} -- Initialization + + initialize + -- Initialize current service + do + set_service_option ("port", 9090) + end + end + + +After one more compile, you can now launch the application and point your browser to [http://localhost:9090]. +You should now see a simple page with Hello World. \ No newline at end of file diff --git a/doc/wiki/Doc_Index.mediawiki b/doc/wiki/Doc_Index.mediawiki new file mode 100644 index 00000000..90016448 --- /dev/null +++ b/doc/wiki/Doc_Index.mediawiki @@ -0,0 +1,7 @@ +Menu :: [[Doc_Getting_Started|Getting Started]] :: [[Doc_Community|Community]] + += Eiffel Web Framework = +Framework to build web applications in Eiffel + +[ [http://github.com/EiffelWebFramework/EWF/zipball/ Download Current] ] +[ [http://github.com/EiffelWebFramework/EWF/zipball/release-0.3 Download v0.3] ] \ No newline at end of file diff --git a/doc/wiki/Home.md b/doc/wiki/Home.md index 4da5d7b7..23fa81e5 100644 --- a/doc/wiki/Home.md +++ b/doc/wiki/Home.md @@ -6,7 +6,7 @@ The official documentation/wiki is located at https://github.com/EiffelWebFramew ## Organization ## - Mailing list: please visit and subscribe to the mailing list page [[http://groups.google.com/group/eiffel-web-framework]] ![logo](http://groups.google.com/intl/en/images/logos/groups_logo_sm.gif) - Most of the topics are discussed on the mailing list (google group). -- For time to time we have web meeting, and less frequently physical meetings that occurs usually during other Eiffel related events. +- For time to time we have [[web meetings|meetings]], and less frequently [[physical meetings|meetings]] that occurs usually during other Eiffel related events. ## Documentation ## - to redo diff --git a/doc/wiki/Meetings.md b/doc/wiki/Meetings.md new file mode 100644 index 00000000..a75a124f --- /dev/null +++ b/doc/wiki/Meetings.md @@ -0,0 +1,4 @@ +# Previous and future meetings + +* [[Web-meeting: 2012-09-18|Web-meeting-2012-09-18]] +* For previous meetings, check the ["meeting" topics](https://groups.google.com/forum/?fromgroups=#!tags/eiffel-web-framework/meeting) on the [forum](http://groups.google.com/group/eiffel-web-framework) diff --git a/doc/wiki/Projects-new-suggestions.md b/doc/wiki/Projects-new-suggestions.md index b7278fee..6093b9c9 100644 --- a/doc/wiki/Projects-new-suggestions.md +++ b/doc/wiki/Projects-new-suggestions.md @@ -12,3 +12,9 @@ For any entry, please use this template ---- +## Add support for Swagger +* _Suggested by **Olivier**_ +* _Description_: Build a Swagger Eiffel implementation +* _References_: http://swagger.wordnik.com/ + +---- diff --git a/doc/wiki/Projects.md b/doc/wiki/Projects.md index ad4f235f..2aaa7a50 100644 --- a/doc/wiki/Projects.md +++ b/doc/wiki/Projects.md @@ -96,6 +96,7 @@ If you are a student, don't hesitate to pick one, or even suggest a new project, * _Suggested by **Jocelyn**_ * _Supervisor_: * _Suitability_: TODO +* _Status_: started, and open for contribution, collaboration, please contact Jocelyn. * _Description_: Using EWF, Build a simple CMS (Content Management System) framework and then an example. It should provide common features such as: - user management (register, login, lost password -> send email) - page editing @@ -225,6 +226,13 @@ If you are a student, don't hesitate to pick one, or even suggest a new project, * This should reuse and improve the "http_client" provided by EWF. Eventually also write the EiffelNet implementation to be independant from cURL * **Requirement**: OAuth client eiffel component +## Build a ESI preprocessor, or proxy +* _Suggested by **Jocelyn**_ +* _Supervisor_: +* _Suitability_: TODO +* _Description_: TODO +* See: http://en.wikipedia.org/wiki/Edge_Side_Includes + ---- # Feel free to add new idea below this line ---- diff --git a/doc/wiki/Useful-links.md b/doc/wiki/Useful-links.md new file mode 100644 index 00000000..29c810b7 --- /dev/null +++ b/doc/wiki/Useful-links.md @@ -0,0 +1,14 @@ +## Eiffel + +* http://www.scoop.it/t/eiffel-resources +* http://www.scoop.it/t/eiffel + +## Hypermedia + +* http://www.scoop.it/t/hyper-media-apis +* http://www.scoop.it/t/hypermedia-api + +## ETags + +* http://www.mnot.net/blog/2007/08/07/etags +* http://bitworking.org/news/150/REST-Tip-Deep-etags-give-you-more-benefits \ No newline at end of file diff --git a/doc/wiki/Web-meeting-2012-09-18.md b/doc/wiki/Web-meeting-2012-09-18.md new file mode 100644 index 00000000..65f538af --- /dev/null +++ b/doc/wiki/Web-meeting-2012-09-18.md @@ -0,0 +1,62 @@ +## Participants + +* Jocelyn Fiat +* Berend de Boer +* Olivier Ligot +* Javier Velilla + +## Information + +### When ? +* Tuesday 18th of september, 19:00 - 20:00 UTC/GMT time (see 3rd time in http://www.doodle.com/8v2sekiyebp4dpyh) + +### Where ? +Web meeting using webex + +* Short url: http://goo.gl/wBz11 +* Long url: https://eiffel.webex.com/eiffel/j.php?ED=211265702&UID=0&PW=NZWNiMjBiZWIz&RT=MiMyMA%3D%3D +* Related Google group topic: https://groups.google.com/d/topic/eiffel-web-framework/A7ADPAT3nj8/discussion + +## Agenda + +* Current status of EWF + * Focus on new design for the router system, and take decision + * decide if this replace the previous system, + * or if this is provided as another solution (we would then have 2 routers system). + * It might be possible to implement the previous uri and uri-template router with the new design, and mark them obsolete, this would avoid breaking existing code, but if no-one ask for it, no need to spend time doing it. + * Current activities + * Technology forecasting about REST, Hypermedia API, Collection/JSON, HAL, ... + * Building a CMS framework inspired by Drupal, and using EWF + * Libraries in-progress or draft: OAuth (consumer), Google API, Github API, Template engine, Wikitext parser, CMS (including sub libraries which will be part of EWF, such as session handling, mailer, ...) + * Documentation + * Remaining issues + * Review design in relation to concurrency, and provide example demonstrating concurrency with EWF + * Review design to allow easier extension/customization of EWF, such as using its own MIME handlers. + * Demo for a CMS built with EWF (inspired by Drupal) +* Future tasks + * [graphviz-server](https://github.com/EiffelWebFramework/graphviz-server) + * Improving Eiffel Web Nino: to support persistent connection, and better concurrency design. + * Provide friendly components to generate HTML (DHTML, HTML5, ...), (coders do not want to learn HTML and +CSS) +* Users feedback, suggestions and requests + * ... +* Next meeting + +## Materials + +## Minutes +* swagger: see if we could generate EWF code from a swagger specification +* Jocelyn will publish its attempt to build a CMS with EWF + * CMS demo: ... as announced ... some parts look very like drupal. +* Jocelyn will publish a few in-progress draft libraries +* Javier will focus on graphviz-server and hypermedia API +* Berend may send a short note on how he uses EWF (and generate code from description) +* Jocelyn will try to find time to complete the thread and SCOOP implementation of Eiffel Web Nino +* Olivier will have a closer look at swagger +* EWF will adopt the new WSF_ROUTER design as no-one expressed opposition. Olivier said converting his code is not a big task. Same for other users. +* The current state of EWF/WSF seems to be ok for users, we can focus on libraries on top of EWF/WSF +* We might need an HTML parser, if we want to support HTML as an hypermedia API (maybe we can require XHTML for now) +* No high priority to improve Eiffel Web Nino , for now it is mainly used during development. + +* It seems RESTful + Hypermedia API is the top priority for EWF. + diff --git a/draft/application/cms/.gitignore b/draft/application/cms/.gitignore deleted file mode 100644 index f998b949..00000000 --- a/draft/application/cms/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_storage_ diff --git a/draft/application/cms/README.md b/draft/application/cms/README.md index 79620c23..32472422 100644 --- a/draft/application/cms/README.md +++ b/draft/application/cms/README.md @@ -1,2 +1,2 @@ -Experimental a simple CMS using EWF. -Inspired by Drupal +The "cms" component moved. +Please visit https://github.com/EiffelWebFramework/cms to follow the project. diff --git a/draft/application/cms/cms-safe.ecf b/draft/application/cms/cms-safe.ecf deleted file mode 100644 index 51accbb1..00000000 --- a/draft/application/cms/cms-safe.ecf +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - /EIFGENs$ - /CVS$ - /.svn$ - - - - - - - - - - - - - - - - - - diff --git a/draft/application/cms/cms.ecf b/draft/application/cms/cms.ecf deleted file mode 100644 index 0eb505c1..00000000 --- a/draft/application/cms/cms.ecf +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - /EIFGENs$ - /CVS$ - /.svn$ - - - - - - - - - - - - - - - - - - - - diff --git a/draft/application/cms/example/cms.ini b/draft/application/cms/example/cms.ini deleted file mode 100644 index 7de4d96e..00000000 --- a/draft/application/cms/example/cms.ini +++ /dev/null @@ -1,8 +0,0 @@ -site.name=EWF Web CMS -#site.base_url=/demo -site.email=your@email.com -root-dir=../www -var-dir=var -files-dir=files -themes-dir=${root-dir}/themes -#theme=test diff --git a/draft/application/cms/example/cms_demo-safe.ecf b/draft/application/cms/example/cms_demo-safe.ecf deleted file mode 100644 index 2696592f..00000000 --- a/draft/application/cms/example/cms_demo-safe.ecf +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - - - - - - - - - diff --git a/draft/application/cms/example/ewf.ini b/draft/application/cms/example/ewf.ini deleted file mode 100644 index 6a794d69..00000000 --- a/draft/application/cms/example/ewf.ini +++ /dev/null @@ -1,4 +0,0 @@ -# For nino connector, use port 9999 -port=9090 - -#verbose=true diff --git a/draft/application/cms/example/src/module/demo/demo_module.e b/draft/application/cms/example/src/module/demo/demo_module.e deleted file mode 100644 index 4576957a..00000000 --- a/draft/application/cms/example/src/module/demo/demo_module.e +++ /dev/null @@ -1,82 +0,0 @@ -note - description: "Summary description for {CMS_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEMO_MODULE - -inherit - CMS_MODULE - redefine - links - end - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_AUTO_REGISTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "demo" - version := "1.0" - description := "demo" - package := "misc" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - service := a_service - a_service.map_uri_template ("/demo/widget{/args}", agent handle_widget_demo (a_service, ?, ?)) - a_service.map_uri_template ("/demo/date/{arg}", agent handle_date_time_demo (a_service, ?, ?)) - a_service.map_uri_template ("/demo/format/{arg}", agent handle_format_demo (a_service, ?, ?)) - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK --- opts: CMS_API_OPTIONS - do - create lnk.make ("Demo::widget", "/demo/widget/") - a_menu_system.management_menu.extend (lnk) - end - -feature -- Hooks - - links: HASH_TABLE [CMS_MODULE_LINK, STRING] - -- Link indexed by path - local - lnk: CMS_MODULE_LINK - do - Result := Precursor - create lnk.make ("Date/time demo") --- lnk.set_callback (agent process_date_time_demo, <<"arg">>) --- Result["/demo/date/{arg}"] := lnk - end - - handle_date_time_demo (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ANY_CMS_EXECUTION}.make_with_text (req, res, cms, "

Demo::date/time

")).execute - end - - handle_format_demo (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ANY_CMS_EXECUTION}.make_with_text (req, res, cms, "

Demo::format

")).execute - end - - handle_widget_demo (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {DEMO_WIDGET_CMS_EXECUTION}.make (req, res, cms)).execute - end - -end diff --git a/draft/application/cms/example/src/module/demo/demo_widget_cms_execution.e b/draft/application/cms/example/src/module/demo/demo_widget_cms_execution.e deleted file mode 100644 index 58083ee5..00000000 --- a/draft/application/cms/example/src/module/demo/demo_widget_cms_execution.e +++ /dev/null @@ -1,97 +0,0 @@ -note - description : "Objects that ..." - author : "$Author$" - date : "$Date$" - revision : "$Revision$" - -class - DEMO_WIDGET_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - local - args: like arguments - l_table: like new_table - s: STRING - do - args := arguments - if args.is_empty then - set_title ("Widgets") - set_main_content ("...") - else - - end - l_table := new_table - - create s.make_empty - l_table.append_to_html (theme, s) - set_main_content (s) - end - - new_table: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8] - local - l_table: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8] - do - create l_table.make - l_table.add_css_style ("width: 85%%; border: solid 1px #999; padding: 2px;") - - l_table.set_column_count (3) - l_table.column (1).set_title ("First") - l_table.column (2).set_title ("Second") - l_table.column (3).set_title ("Third") - - l_table.column (1).add_css_style ("width: 20%%") - l_table.column (2).add_css_style ("width: 40px") - l_table.column (3).add_css_style ("width: 40px") - - l_table.set_data (<<"foo", "bar", "foobar">>) - l_table.set_foot_data (<<"abc", "def">>) - l_table.set_compute_item_function (agent (d: READABLE_STRING_8): WSF_WIDGET_TABLE_ROW - local - i: INTEGER - w: WSF_WIDGET_TABLE_ITEM - do - create Result.make (d.count) - if d.is_case_insensitive_equal ("bar") then - Result.add_css_style ("background-color: #ccf;") - end - across - d as c - loop - i := i + 1 - create w.make_with_text (c.item.out) - if i = 1 then - w.add_css_style ("background-color: #333; color: white; font-weight: bold;") - elseif i > 3 then - w.add_css_style ("color: red; border: solid 1px red; padding: 3px;") - end - Result.force (w) - end - end) - - Result := l_table - end - - arguments: ARRAY [READABLE_STRING_32] - -- Path parameters arguments related to {/vars} - do - if - attached {WSF_TABLE} request.path_parameter ("args") as lst and then - attached lst.as_array_of_string as arr - then - Result := arr - else - create Result.make_empty - end - - Result.rebase (1) - end - -end diff --git a/draft/application/cms/example/src/module/shutdown/shutdown_cms_execution.e b/draft/application/cms/example/src/module/shutdown/shutdown_cms_execution.e deleted file mode 100644 index 4c61e9c9..00000000 --- a/draft/application/cms/example/src/module/shutdown/shutdown_cms_execution.e +++ /dev/null @@ -1,33 +0,0 @@ -note - description: "Summary description for {SHUTDOWN_CMS_EXECUTION}." - date: "$Date$" - revision: "$Revision$" - -class - SHUTDOWN_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - local - b: STRING - do - create b.make_empty - set_title ("Shutting down the service ...") - if has_permission ("admin shutdown") then - if attached {WGI_NINO_CONNECTOR} request.wgi_connector as nino then - nino.server.shutdown_server - end - else - b.append ("Access denied") - end - set_main_content (b) - end - -end diff --git a/draft/application/cms/example/src/module/shutdown/shutdown_module.e b/draft/application/cms/example/src/module/shutdown/shutdown_module.e deleted file mode 100644 index 3c250f7b..00000000 --- a/draft/application/cms/example/src/module/shutdown/shutdown_module.e +++ /dev/null @@ -1,69 +0,0 @@ -note - description: "Summary description for {SHUTDOWN_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - SHUTDOWN_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "shutdown" - version := "1.0" - description := "Shutdown the service if this is EWF Nino or FCGI" - package := "server" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - a_service.map_uri ("/admin/shutdown/", agent handle_shutdown) - - a_service.add_menu_alter_hook (Current) - service := a_service - end - -feature -- Hooks - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - Result.extend ("shutdown") - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - do - create lnk.make ("Shutdown", "/admin/shutdown/") - lnk.set_permission_arguments (<<"shutdown">>) - a_menu_system.management_menu.extend (lnk) - end - - handle_shutdown (req: WSF_REQUEST; res: WSF_RESPONSE) - do - if attached service as l_service then - (create {SHUTDOWN_CMS_EXECUTION}.make (req, res, l_service)).execute ; - else - res.set_status_code ({HTTP_STATUS_CODE}.expectation_failed) - end - end - -end diff --git a/draft/application/cms/example/src/web_cms.e b/draft/application/cms/example/src/web_cms.e deleted file mode 100644 index 0ccfd7da..00000000 --- a/draft/application/cms/example/src/web_cms.e +++ /dev/null @@ -1,135 +0,0 @@ -note - description: "[ - This class implements the Demo of WEB CMS service - - ]" - -class - WEB_CMS - -inherit - WSF_DEFAULT_SERVICE - redefine - initialize - end - -create - make_and_launch - -feature {NONE} -- Initialization - - initialize - local - args: ARGUMENTS - cfg: detachable STRING - i,n: INTEGER - do - --| Arguments - create args - from - i := 1 - n := args.argument_count - until - i > n or cfg /= Void - loop - if attached args.argument (i) as s then - if s.same_string ("--config") or s.same_string ("-c") then - if i < n then - cfg := args.argument (i + 1) - end - end - end - i := i + 1 - end - if cfg = Void then - if file_exists ("cms.ini") then - cfg := "cms.ini" - end - end - - --| EWF settings - service_options := create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI}.make_from_file ("ewf.ini") - Precursor - - --| CMS initialization - launch_cms (cms_setup (cfg)) - end - - cms_setup (a_cfg_fn: detachable READABLE_STRING_8): CMS_CUSTOM_SETUP - do - if a_cfg_fn /= Void then - create Result.make_from_file (a_cfg_fn) - else - create Result -- Default - end - setup_modules (Result) - setup_storage (Result) - end - - launch_cms (a_setup: CMS_SETUP) - local - cms: CMS_SERVICE - do - create cms.make (a_setup) - on_launched (cms) - cms_service := cms - end - -feature -- Execution - - cms_service: CMS_SERVICE - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - do - cms_service.execute (req, res) - end - -feature -- Access - - setup_modules (a_setup: CMS_SETUP) - local - m: CMS_MODULE - do - create {DEMO_MODULE} m.make - m.enable - a_setup.add_module (m) - - create {SHUTDOWN_MODULE} m.make - m.enable - a_setup.add_module (m) - - create {DEBUG_MODULE} m.make - m.enable - a_setup.add_module (m) - - create {OPENID_MODULE} m.make - m.enable - a_setup.add_module (m) - end - - setup_storage (a_setup: CMS_SETUP) - do - - end - -feature -- Event - - on_launched (cms: CMS_SERVICE) - local - e: CMS_EMAIL - do - create e.make (cms.site_email, cms.site_email, "[" + cms.site_name + "] launched...", "The site [" + cms.site_name + "] was launched at " + (create {DATE_TIME}.make_now_utc).out + " UTC.") - cms.mailer.safe_process_email (e) - end - -feature -- Helper - - file_exists (fn: STRING): BOOLEAN - local - f: RAW_FILE - do - create f.make (fn) - Result := f.exists and then f.is_readable - end - -end diff --git a/draft/application/cms/src/cms_configuration.e b/draft/application/cms/src/cms_configuration.e deleted file mode 100644 index c229c5f1..00000000 --- a/draft/application/cms/src/cms_configuration.e +++ /dev/null @@ -1,303 +0,0 @@ -note - description: "Summary description for {CMS_CONFIGURATION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_CONFIGURATION - -create - make, - make_from_file - -feature {NONE} -- Initialization - - make - do - create options.make (10) - analyze - end - - make_from_file (a_filename: READABLE_STRING_32) - -- Initialize `Current'. - do - make - configuration_location := a_filename - import (a_filename) - analyze - end - - analyze - do - get_root_location - get_var_location - get_themes_location - get_files_location - end - -feature -- Access - - configuration_location: detachable READABLE_STRING_8 - - option (a_name: READABLE_STRING_GENERAL): detachable ANY - do - Result := options.item (a_name.as_string_8.as_lower) - end - - options: HASH_TABLE [STRING, STRING] - -feature -- Conversion - - append_to_string (s: STRING) - do - s.append ("Options:%N") - across - options as c - loop - s.append (c.key) - s.append_character ('=') - s.append (c.key) - s.append_character ('%N') - end - - s.append ("Specific:%N") - s.append ("root_location=" + root_location + "%N") - s.append ("var_location=" + var_location + "%N") - s.append ("files_location=" + files_location + "%N") - s.append ("themes_location=" + themes_location + "%N") - end - -feature -- Element change - - set_option (a_name: READABLE_STRING_GENERAL; a_value: STRING) - do - options.force (a_value, a_name.as_string_8) - end - -feature -- Access - - var_location: READABLE_STRING_8 - - root_location: READABLE_STRING_8 - - files_location: STRING - - themes_location: STRING - - theme_name (dft: detachable like theme_name): READABLE_STRING_8 - do - if attached options.item ("theme") as s then - Result := s - elseif dft /= Void then - Result := dft - else - Result := "default" - end - end - - site_id: READABLE_STRING_8 - do - if attached options.item ("site.id") as s then - Result := s - else - Result := "_EWF_CMS_NO_ID_" - end - end - - site_name (dft: like site_name): READABLE_STRING_8 - do - if attached options.item ("site.name") as s then - Result := s - else - Result := dft - end - end - - site_url (dft: like site_url): READABLE_STRING_8 - do - if attached options.item ("site.url") as s then - Result := s - else - Result := dft - end - if Result /= Void then - if Result.is_empty then - -- ok - elseif not Result.ends_with ("/") then - Result := Result + "/" - end - end - end - - site_script_url (dft: like site_script_url): detachable READABLE_STRING_8 - do - if attached options.item ("site.script_url") as s then - Result := s - else - Result := dft - end - if Result /= Void then - if Result.is_empty then - elseif not Result.ends_with ("/") then - Result := Result + "/" - end - end - end - - site_email (dft: like site_email): READABLE_STRING_8 - do - if attached options.item ("site.email") as s then - Result := s - else - Result := dft - end - end - -feature -- Change - - get_var_location - local - res: STRING_32 - do - if attached options.item ("var-dir") as s then - res := s - else - res := execution_environment.current_working_directory - end - if res.ends_with ("/") then - res.remove_tail (1) - end - var_location := res - end - - get_root_location - local - res: STRING_32 - do - if attached options.item ("root-dir") as s then - res := s - else - res := execution_environment.current_working_directory - end - if res.ends_with ("/") then - res.remove_tail (1) - end - root_location := res - end - - get_files_location - do - if attached options.item ("files-dir") as s then - files_location := s - else - files_location := "files" - end - end - - get_themes_location - local - dn: DIRECTORY_NAME - do - if attached options.item ("themes-dir") as s then - themes_location := s - else - create dn.make_from_string (root_location) - dn.extend ("themes") - themes_location := dn.string - end - end - -feature {NONE} -- Implementation - - import (a_filename: READABLE_STRING_32) - -- Import ini file content - local - f: PLAIN_TEXT_FILE - l,v: STRING_8 - p: INTEGER - do - --FIXME: handle unicode filename here. - create f.make (a_filename) - if f.exists and f.is_readable then - f.open_read - from - f.read_line - until - f.exhausted - loop - l := f.last_string - l.left_adjust - if not l.is_empty then - if l[1] = '#' then - -- commented line - else - p := l.index_of ('=', 1) - if p > 1 then - v := l.substring (p + 1, l.count) - l.keep_head (p - 1) - v.left_adjust - v.right_adjust - l.right_adjust - - if l.is_case_insensitive_equal ("@include") then - import (resolved_string (v)) - else - set_option (l.as_lower, resolved_string (v)) - end - end - end - end - f.read_line - end - f.close - end - end - -feature {NONE} -- Environment - - Execution_environment: EXECUTION_ENVIRONMENT - once - create Result - end - - resolved_string (s: READABLE_STRING_8): STRING - -- Resolved `s' using `options' or else environment variables. - local - i,n,b,e: INTEGER - k: detachable READABLE_STRING_8 - do - from - i := 1 - n := s.count - create Result.make (s.count) - until - i > n - loop - if i + 1 < n and then s[i] = '$' and then s[i+1] = '{' then - b := i + 2 - e := s.index_of ('}', b) - 1 - if e > 0 then - k := s.substring (b, e) - if attached option (k) as v then - Result.append (v.out) - i := e + 1 - elseif attached execution_environment.get (k) as v then - Result.append (v) - i := e + 1 - else - Result.extend (s[i]) - end - else - Result.extend (s[i]) - end - else - Result.extend (s[i]) - end - i := i + 1 - end - end - - - -end diff --git a/draft/application/cms/src/cms_custom_setup.e b/draft/application/cms/src/cms_custom_setup.e deleted file mode 100644 index bc37ed0f..00000000 --- a/draft/application/cms/src/cms_custom_setup.e +++ /dev/null @@ -1,18 +0,0 @@ -note - description: "Summary description for {CMS_CUSTOM_SETUP}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_CUSTOM_SETUP - -inherit - CMS_DEFAULT_SETUP - -create - default_create, - make, - make_from_file - -end diff --git a/draft/application/cms/src/cms_default_setup.e b/draft/application/cms/src/cms_default_setup.e deleted file mode 100644 index f9b61bea..00000000 --- a/draft/application/cms/src/cms_default_setup.e +++ /dev/null @@ -1,134 +0,0 @@ -note - description: "Summary description for {CMS_DEFAULT_SETUP}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_DEFAULT_SETUP - -inherit - CMS_SETUP - redefine - default_create - end - -create - default_create, - make, - make_from_file - -feature {NONE} -- Initialization - - make (a_cfg: CMS_CONFIGURATION) - do - configuration := a_cfg - default_create - end - - make_from_file (fn: READABLE_STRING_8) - local - cfg: CMS_CONFIGURATION - do - create cfg.make_from_file (fn) - make (cfg) - end - - default_create - do - Precursor - build_modules - build_storage - build_session_manager - build_auth_engine - build_mailer - end - -feature -- Access - - modules: ARRAYED_LIST [CMS_MODULE] - - storage: CMS_STORAGE - -- CMS persistent layer - - session_manager: WSF_SESSION_MANAGER - -- CMS Session manager - - auth_engine: CMS_AUTH_ENGINE - -- CMS Authentication engine - - mailer: CMS_MAILER - -feature {NONE} -- Initialization - - build_modules - local - m: CMS_MODULE - do - create modules.make (3) - - -- Core - create {USER_MODULE} m.make - m.enable - modules.extend (m) - - create {ADMIN_MODULE} m.make - m.enable - modules.extend (m) - - create {NODE_MODULE} m.make - m.enable - modules.extend (m) - end - - build_storage - local - dn: DIRECTORY_NAME - do - if attached configuration as cfg and then attached cfg.var_location as l_site_var_dir then - create dn.make_from_string (l_site_var_dir) - else - create dn.make - end - dn.extend ("_storage_") - create {CMS_SED_STORAGE} storage.make (dn.string) - end - - build_session_manager - local - dn: DIRECTORY_NAME - do - if attached configuration as cfg and then attached cfg.var_location as l_site_var_dir then - create dn.make_from_string (l_site_var_dir) - else - create dn.make - end - dn.extend ("_storage_") - dn.extend ("_sessions_") - create {WSF_FS_SESSION_MANAGER} session_manager.make_with_folder (dn.string) - end - - build_auth_engine - do - create {CMS_STORAGE_AUTH_ENGINE} auth_engine.make (storage) - end - - build_mailer - local - ch_mailer: CMS_CHAIN_MAILER - st_mailer: CMS_STORAGE_MAILER - do - create st_mailer.make (storage) - create ch_mailer.make (st_mailer) - ch_mailer.set_next (create {CMS_SENDMAIL_MAILER}) - mailer := ch_mailer - end - -feature -- Change - - add_module (m: CMS_MODULE) - do - modules.force (m) - end - -end diff --git a/draft/application/cms/src/cms_execution.e b/draft/application/cms/src/cms_execution.e deleted file mode 100644 index 06e1f8db..00000000 --- a/draft/application/cms/src/cms_execution.e +++ /dev/null @@ -1,715 +0,0 @@ -note - description: "[ - This is the execution of the cms handler request - It builds the content to get process to render the output - ]" - -deferred class - CMS_EXECUTION - -inherit - CMS_COMMON_API - -feature {NONE} -- Initialization - - make (req: WSF_REQUEST; res: WSF_RESPONSE; a_service: like service) - do - status_code := {HTTP_STATUS_CODE}.ok - service := a_service - request := req - response := res - create header.make - initialize - end - - initialize - do - is_front := service.is_front_page (request) - has_js := True -- by default it is true, check cookie to see if this is not supported. - if attached request.cookie ("has_js") as c_has_js then - has_js := c_has_js.same_string ("0") - end - get_theme - controller := service.session_controller (request) - create menu_system.make - create blocks.make (3) - - if attached {like message} session_item (pending_messages_session_item_name) as m then - message := m - end - remove_session_item (pending_messages_session_item_name) - end - -feature -- Access - - service: CMS_SERVICE - request: WSF_REQUEST - -feature {CMS_SESSION_CONTROLER} -- Access: restricted - - response: WSF_RESPONSE - - controller: CMS_SESSION_CONTROLER - - pending_messages_session_item_name: STRING = "cms.pending_messages" - -- Session item name to get the pending messages. - -feature -- Access: CMS - - site_name: STRING_32 - do - Result := service.site_name - end - - front_page_url: READABLE_STRING_8 - do - Result := url ("/", Void) - end - -feature -- Permission - - frozen has_permissions (lst: detachable ITERABLE [READABLE_STRING_8]): BOOLEAN - do - if lst = Void then - Result := True - else - Result := across lst as c all has_permission (c.item) end - end - end - - frozen has_permission (s: detachable READABLE_STRING_8): BOOLEAN - -- Anonymous or Current `user' has permission for `s' - --| `s' could be "create page", - local - u: detachable CMS_USER - do - if s = Void then - Result := True - else - if s.same_string ("authenticated") then - Result := authenticated - else - u := user - if u /= Void and then u.is_admin then - Result := True - else - Result := service.user_has_permission (u, s) - end - end - end - end - -feature -- Status - - is_front: BOOLEAN - - has_js: BOOLEAN - -- Client has javascript enabled? - -- FIXME: not yet implemented - - is_mobile: BOOLEAN - -- Is Client on mobile device? - -- FIXME: not yet implemented - -feature -- Theme - - theme: CMS_THEME - - get_theme - do - create {DEFAULT_CMS_THEME} theme.make (service) - end - -feature -- Access: User - - authenticated: BOOLEAN - do - Result := user /= Void - end - - user: detachable CMS_USER - do - if attached {CMS_USER} session_item ("user") as u then - Result := u - end - end - - last_user_access_date: detachable DATE_TIME - do - if attached {DATE_TIME} session_item ("last_access") as dt then - Result := dt - end - end - -feature -- Element change: user - - login (u: attached like user; req: WSF_REQUEST) - do - controller.start_session (req) - u.set_last_login_date_now - storage.save_user (u) - set_user (u) - init_last_user_access_date - log ("user", "user %"" + u.name + "%" signed in.", 0, user_local_link (u)) - end - - logout (req: WSF_REQUEST) - require - authenticated - do - if attached user as u then - log ("user", "user %"" + u.name + "%" signed out.", 0, user_local_link (u)) - end - set_user (Void) - controller.start_session (req) - end - -feature -- Logging - - log (a_category: READABLE_STRING_8; a_message: READABLE_STRING_8; a_level: INTEGER; a_link: detachable CMS_LINK) - local - l_log: CMS_LOG - do - create l_log.make (a_category, a_message, a_level, Void) - if a_link /= Void then - l_log.set_link (a_link) - end - l_log.set_info (request.http_user_agent) - service.storage.save_log (l_log) - end - -feature -- Menu - - menu_system: CMS_MENU_SYSTEM - - main_menu: CMS_MENU - do - Result := menu_system.main_menu - end - - management_menu: CMS_MENU - do - Result := menu_system.management_menu - end - - navigation_menu: CMS_MENU - do - Result := menu_system.navigation_menu - end - - user_menu: CMS_MENU - do - Result := menu_system.user_menu - end - - primary_tabs: CMS_MENU - do - Result := menu_system.primary_tabs - end - -feature -- Menu: change - - add_to_main_menu (lnk: CMS_LINK) - do - if attached {CMS_LOCAL_LINK} lnk as l_local then - l_local.get_is_active (request) - end - main_menu.extend (lnk) - end - - add_to_menu (lnk: CMS_LINK; m: CMS_MENU) - do - if attached {CMS_LOCAL_LINK} lnk as l_local then - l_local.get_is_active (request) - end - m.extend (lnk) - end - -feature -- Message - - add_message (a_msg: READABLE_STRING_8; a_category: detachable READABLE_STRING_8) - local - m: like message - do - m := message - if m = Void then - create m.make (a_msg.count + 9) - message := m - end - if a_category /= Void then - m.append ("
  • ") - else - m.append ("
  • ") - end - m.append (a_msg + "
  • ") - end - - add_notice_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "notice") - end - - add_warning_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "warning") - end - - add_error_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "error") - end - - add_success_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "success") - end - - report_form_errors (fd: WSF_FORM_DATA) - require - has_error: not fd.is_valid - do - if attached fd.errors as errs then - across - errs as err - loop - if attached err.item as e then - if attached e.field as l_field then - if attached e.message as e_msg then - add_error_message (e_msg) --"Field [" + l_field.name + "] is invalid. " + e_msg) - else - add_error_message ("Field [" + l_field.name + "] is invalid.") - end - elseif attached e.message as e_msg then - add_error_message (e_msg) - end - end - end - end - end - - message: detachable STRING_8 - -feature -- Blocks - - formats: CMS_FORMATS - once - create Result - end - - blocks: ARRAYED_LIST [TUPLE [block: CMS_BLOCK; name: READABLE_STRING_8; region: READABLE_STRING_8]] - - add_block (b: CMS_BLOCK; a_region: detachable READABLE_STRING_8) - do - if a_region /= Void then - blocks.extend ([b, b.name, a_region]) - elseif attached block_region (b) as l_region then - blocks.extend ([b, b.name, l_region]) - end - end - - block_region (b: CMS_BLOCK): detachable READABLE_STRING_8 - local - l_name: READABLE_STRING_8 - do - l_name := b.name - if l_name.starts_with ("footer") then - Result := "footer" - elseif l_name.starts_with ("management") then - Result := "first_sidebar" - elseif l_name.starts_with ("navigation") then - Result := "first_sidebar" - elseif l_name.starts_with ("user") then - Result := "first_sidebar" - else - Result := "first_sidebar" - end - -- FIXME: let the user choose ... - end - - get_blocks - local - b: CMS_CONTENT_BLOCK - s: STRING_8 - m: CMS_MENU - do - m := management_menu - if not m.is_empty then - add_block (create {CMS_MENU_BLOCK}.make (m), Void) - end - - m := navigation_menu - if not m.is_empty then - add_block (create {CMS_MENU_BLOCK}.make (m), Void) - end - - m := user_menu - if not m.is_empty then - add_block (create {CMS_MENU_BLOCK}.make (m), Void) - end - --- create s.make_empty --- s.append ("This site demonstrates a first implementation of CMS using EWF.%N") --- create b.make ("about", "About", s, formats.plain_text) --- add_block (b, "second_sidebar") - - create s.make_empty - s.append ("Made with EWF") - create b.make ("made_with", Void, s, formats.full_html) - add_block (b, "footer") - - service.hook_block_view (Current) - end - -feature -- Access - - status_code: INTEGER - - header: WSF_HEADER - - title: detachable READABLE_STRING_32 - -- HTML>head>title value - - page_title: detachable READABLE_STRING_32 - -- Page title - - additional_page_head_lines: detachable LIST [READABLE_STRING_8] - -- HTML>head>...extra lines - - main_content: detachable STRING_8 - - redirection: detachable READABLE_STRING_8 - -feature -- Generation - - prepare_menu_system (a_menu_system: CMS_MENU_SYSTEM) - do - across - a_menu_system as c - loop - prepare_links (c.item) - end - end - - prepare_links (a_menu: CMS_LINK_COMPOSITE) - local - to_remove: ARRAYED_LIST [CMS_LINK] - do - create to_remove.make (0) - across - a_menu as c - loop - if attached {CMS_LOCAL_LINK} c.item as lm then - if attached lm.permission_arguments as perms and then not has_permissions (perms) then - to_remove.force (lm) - else - -- if lm.permission_arguments is Void , this is permitted - lm.get_is_active (request) - if attached {CMS_LINK_COMPOSITE} lm as comp then - prepare_links (comp) - end - end - elseif attached {CMS_LINK_COMPOSITE} c.item as comp then - prepare_links (comp) - end - end - across - to_remove as c - loop - a_menu.remove (c.item) - end - end - - prepare (page: CMS_HTML_PAGE) - local - s: STRING_8 - do - if attached additional_page_head_lines as l_head_lines then - across - l_head_lines as hl - loop - page.head_lines.force (hl.item) - end - end - - add_to_main_menu (create {CMS_LOCAL_LINK}.make ("Home", "/")) - - service.call_menu_alter_hooks (menu_system, Current) - prepare_menu_system (menu_system) - - get_blocks - - if attached title as l_title then - page.set_title (l_title) - else - page.set_title ("CMS::" + request.path_info) - end - - page.add_to_header_region (top_header_region) - page.add_to_header_region (header_region) - if attached message as m and then not m.is_empty then - page.add_to_content_region ("
    " + m + "
    ") - end - page.add_to_content_region ("%N") - if attached page_title as l_page_title then - page.add_to_content_region ("

    "+ l_page_title +"

    %N") - end - if attached primary_tabs as tabs_menu and then not tabs_menu.is_empty then - page.add_to_content_region (theme.menu_html (tabs_menu, True)) - end - page.add_to_content_region (content_region) - - -- blocks - across - blocks as c - loop - if attached c.item as b_info then - create s.make_from_string ("
    ") - if attached b_info.block.title as l_title then - s.append ("
    " + html_encoded (l_title) + "
    ") - end - s.append ("
    ") - s.append (b_info.block.to_html (theme)) - s.append ("
    ") - s.append ("
    ") - page.add_to_region (s, b_info.region) - end - end - end - - logo_location: STRING - do - Result := url ("/theme/logo.png", Void) - end - - top_header_region: STRING_8 - do - Result := "
    " + html_encoded (site_name) + "
    " - Result.append ("
    ") - Result.append (theme.menu_html (main_menu, True)) - Result.append ("
    ") - end - - header_region: STRING_8 - do - Result := "" - end - - content_region: STRING_8 - do - if attached main_content as l_content then - Result := l_content - else - Result := "" - debug - Result := "No Content" - end - end - end - -feature -- Head customization - - add_additional_head_line (s: READABLE_STRING_8; a_allow_duplication: BOOLEAN) - local - lst: like additional_page_head_lines - do - lst := additional_page_head_lines - if lst = Void then - create {ARRAYED_LIST [like additional_page_head_lines.item]} lst.make (1) - additional_page_head_lines := lst - end - if a_allow_duplication or else across lst as c all not c.item.same_string (s) end then - lst.extend (s) - end - end - - add_style (a_href: STRING; a_media: detachable STRING) - local - s: STRING_8 - do - s := "") - add_additional_head_line (s, False) - end - - add_javascript_url (a_src: STRING) - local - s: STRING_8 - do - s := "" - add_additional_head_line (s, False) - end - - add_javascript_content (a_script: STRING) - local - s: STRING_8 - do - s := "" - add_additional_head_line (s, True) - end - -feature -- Element change - - set_title (t: like title) - do - title := t - set_page_title (t) - end - - set_page_title (t: like page_title) - do - page_title := t - end - - set_main_content (s: like main_content) - do - main_content := s - end - - set_redirection (a_url: like redirection) - do - if a_url /= Void and then a_url.same_string (request.path_info) and request.is_get_request_method then - redirection := Void - else - redirection := a_url - end - end - -feature -- Execution - - execute - do - begin - process - terminate - end - -feature {NONE} -- Execution - - begin - do - end - - process - deferred - end - - frozen terminate - local - cms_page: CMS_HTML_PAGE - page: CMS_HTML_PAGE_RESPONSE - do - create cms_page.make - prepare (cms_page) - - create page.make (theme.page_html (cms_page)) - if attached redirection as l_redirection then - if attached message as m then - set_session_item ("cms.pending_messages", m) - end - page.set_status_code ({HTTP_STATUS_CODE}.found) - page.header.put_location (l_redirection) - else - page.set_status_code (status_code) - end - - controller.session_commit (page, Current) - response.send (page) - on_terminated - end - - on_terminated - do - - end - -feature {NONE} -- Implementation - - set_user (u: like user) - do - set_session_item ("user", u) - end - - init_last_user_access_date - do - set_session_item ("last_access", (create {DATE_TIME}.make_now_utc)) - end - -feature -- Access: Session - - session_item (k: READABLE_STRING_GENERAL): detachable ANY - do - Result := controller.session.item (k) - end - - set_session_item (k: READABLE_STRING_GENERAL; v: detachable ANY) - do - controller.session.remember (v, k) - end - - remove_session_item (k: READABLE_STRING_GENERAL) - do - controller.session.forget (k) - end - -feature -- Storage - - storage: CMS_STORAGE - do - Result := service.storage - end - -feature -- Helper: output - - user_local_link (u: CMS_USER): CMS_LINK - do - create {CMS_LOCAL_LINK} Result.make (u.name, user_url (u)) - end - - node_local_link (n: CMS_NODE): CMS_LINK - do - create {CMS_LOCAL_LINK} Result.make (n.title, node_url (n)) - end - - truncated_string (s: READABLE_STRING_8; nb: INTEGER; a_ellipsis: detachable READABLE_STRING_8): STRING_8 - -- Truncated string `s' to `nb' character - require - a_ellipsis /= Void implies a_ellipsis.count < nb - local - f: CMS_NO_HTML_FILTER - do - if s.count <= nb then - Result := s.string - else - create f - create Result.make_from_string (s) - f.filter (Result) - if Result.count > nb then - if a_ellipsis /= Void and then not a_ellipsis.is_empty then - Result.keep_head (nb - a_ellipsis.count) - Result.append (a_ellipsis) - else - Result.keep_head (nb - 3) - Result.append ("...") - end - end - end - end - -feature -- Helper: request - - non_empty_string_path_parameter (a_name: READABLE_STRING_GENERAL): detachable STRING - do - if - attached {WSF_STRING} request.path_parameter (a_name) as p and then - not p.is_empty - then - Result := p.value - end - end - -invariant - -end diff --git a/draft/application/cms/src/cms_html_page_response.e b/draft/application/cms/src/cms_html_page_response.e deleted file mode 100644 index 97af15fb..00000000 --- a/draft/application/cms/src/cms_html_page_response.e +++ /dev/null @@ -1,77 +0,0 @@ -note - description: "Summary description for {CMS_HTML_PAGE_RESPONSE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_PAGE_RESPONSE - -inherit - WSF_RESPONSE_MESSAGE - -create - make - -feature {NONE} -- Initialization - - make (a_html: like html) - do - html := a_html - status_code := {HTTP_STATUS_CODE}.ok - create header.make - header.put_content_type_text_html - end - -feature -- Status - - status_code: INTEGER - -feature -- Header - - header: HTTP_HEADER - -feature -- Html access - - html: STRING - -feature -- Element change - - set_status_code (c: like status_code) - do - status_code := c - end - -feature {WSF_RESPONSE} -- Output - - send_to (res: WSF_RESPONSE) - local - h: like header - s: STRING_8 - do - h := header - res.set_status_code (status_code) - s := html - - if not h.has_content_length then - h.put_content_length (s.count) - end - if not h.has_content_type then - h.put_content_type_text_html - end - res.put_header_text (h.string) - res.put_string (s) - end - -note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end - diff --git a/draft/application/cms/src/cms_service.e b/draft/application/cms/src/cms_service.e deleted file mode 100644 index d47e5b0b..00000000 --- a/draft/application/cms/src/cms_service.e +++ /dev/null @@ -1,452 +0,0 @@ -note - description: "[ - This class implements the CMS service - - It could be used to implement the main EWF service, or - even for a specific handler. - ]" - -class - CMS_SERVICE - -inherit - WSF_SERVICE - -create - make - -feature {NONE} -- Initialization - - make (a_setup: CMS_SETUP) - local - cfg: detachable CMS_CONFIGURATION - do - cfg := a_setup.configuration - if cfg = Void then - create cfg.make - end - - configuration := cfg - base_url := a_setup.base_url - - site_id := cfg.site_id - site_url := cfg.site_url ("") - site_name := cfg.site_name ("EWF::CMS") - site_email := cfg.site_email ("webmaster") - site_dir := cfg.root_location - site_var_dir := cfg.var_location - files_location := cfg.files_location - themes_location := cfg.themes_location - theme_name := cfg.theme_name ("default") - - set_script_url (cfg.site_script_url (Void)) -- Temporary value - - compute_theme_resource_location - - create content_types.make (3) - - modules := a_setup.modules - storage := a_setup.storage - session_manager := a_setup.session_manager - auth_engine := a_setup.auth_engine - mailer := a_setup.mailer - - initialize_storage - initialize_auth_engine - initialize_session_manager - initialize_mailer - initialize_router - initialize_modules - end - - initialize_session_manager --- local --- dn: DIRECTORY_NAME - do --- create dn.make_from_string (site_var_dir) --- dn.extend ("_storage_") --- dn.extend ("_sessions_") --- create {WSF_FS_SESSION_MANAGER} session_manager.make_with_folder (dn.string) - end - - initialize_storage - do - if not storage.has_user then - initialize_users - end - end - - initialize_users - require - has_no_user: not storage.has_user - local - u: CMS_USER - ur: CMS_USER_ROLE - do - create u.make_new ("admin") - u.set_password ("istrator") - storage.save_user (u) - - create ur.make_with_id (1, "anonymous") - storage.save_user_role (ur) - create ur.make_with_id (2, "authenticated") - ur.add_permission ("create page") - ur.add_permission ("edit page") - storage.save_user_role (ur) - end - - initialize_mailer - local --- ch_mailer: CMS_CHAIN_MAILER --- st_mailer: CMS_STORAGE_MAILER - do --- create st_mailer.make (storage) --- create ch_mailer.make (st_mailer) --- ch_mailer.set_next (create {CMS_SENDMAIL_MAILER}) --- mailer := ch_mailer - end - - initialize_router - local --- h: CMS_HANDLER - file_hdl: CMS_FILE_SYSTEM_HANDLER - dn: DIRECTORY_NAME - do - create router.make (10) - router.set_base_url (base_url) - - router.map (create {WSF_URI_MAPPING}.make ("/", create {CMS_HANDLER}.make (agent handle_home))) - router.map (create {WSF_URI_MAPPING}.make ("/favicon.ico", create {CMS_HANDLER}.make (agent handle_favicon))) - - create file_hdl.make (files_location) - file_hdl.disable_index - file_hdl.set_max_age (8*60*60) - router.map (create {WSF_STARTS_WITH_MAPPING}.make ("/files/", file_hdl)) - - create dn.make_from_string (theme_resource_location) - create file_hdl.make (theme_resource_location) - file_hdl.set_max_age (8*60*60) - router.map (create {WSF_STARTS_WITH_MAPPING}.make ("/theme/", file_hdl)) - end - - initialize_modules - do - across - modules as m - loop - if m.item.is_enabled then - m.item.register (Current) - if attached {CMS_HOOK_AUTO_REGISTER} m.item as h_auto then - h_auto.hook_auto_register (Current) - end - end - end - end - - initialize_auth_engine - do --- create {CMS_STORAGE_AUTH_ENGINE} auth_engine.make (storage) - end - -feature -- Access - - configuration: CMS_CONFIGURATION - - auth_engine: CMS_AUTH_ENGINE - - modules: LIST [CMS_MODULE] - -feature -- Hook: menu_alter - - add_menu_alter_hook (h: like menu_alter_hooks.item) - local - lst: like menu_alter_hooks - do - lst := menu_alter_hooks - if lst = Void then - create lst.make (1) - menu_alter_hooks := lst - end - if not lst.has (h) then - lst.force (h) - end - end - - menu_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_MENU_ALTER] - - call_menu_alter_hooks (m: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - do - if attached menu_alter_hooks as lst then - across - lst as c - loop - c.item.menu_alter (m, a_execution) - end - end - end - -feature -- Hook: form_alter - - add_form_alter_hook (h: like form_alter_hooks.item) - local - lst: like form_alter_hooks - do - lst := form_alter_hooks - if lst = Void then - create lst.make (1) - form_alter_hooks := lst - end - if not lst.has (h) then - lst.force (h) - end - end - - form_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_FORM_ALTER] - - call_form_alter_hooks (f: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION) - do - if attached form_alter_hooks as lst then - across - lst as c - loop - c.item.form_alter (f, a_form_data, a_execution) - end - end - end - -feature -- Hook: block - - add_block_hook (h: like block_hooks.item) - local - lst: like block_hooks - do - lst := block_hooks - if lst = Void then - create lst.make (1) - block_hooks := lst - end - if not lst.has (h) then - lst.force (h) - end - end - - block_hooks: detachable ARRAYED_LIST [CMS_HOOK_BLOCK] - - hook_block_view (a_execution: CMS_EXECUTION) - do - if attached block_hooks as lst then - across - lst as c - loop - across - c.item.block_list as blst - loop - c.item.get_block_view (blst.item, a_execution) - end - end - end - end - -feature -- Router - - site_id: READABLE_STRING_8 - - site_name: READABLE_STRING_32 - - site_email: READABLE_STRING_8 - - site_url: READABLE_STRING_8 - - site_dir: READABLE_STRING_8 - - site_var_dir: READABLE_STRING_8 - - files_location: READABLE_STRING_8 - - themes_location: READABLE_STRING_8 - - compute_theme_resource_location - local - dn: DIRECTORY_NAME - do - create dn.make_from_string (themes_location) - dn.extend (theme_name) - dn.extend ("res") - theme_resource_location := dn.string - end - - theme_resource_location: READABLE_STRING_8 - - theme_name: READABLE_STRING_32 - - router: WSF_ROUTER - - map_uri_template (tpl: STRING; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]) - do - router.map (create {WSF_URI_TEMPLATE_MAPPING}.make_from_template (tpl, create {CMS_HANDLER}.make (proc))) - end - - map_uri (a_uri: STRING; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]) - do - router.map (create {WSF_URI_MAPPING}.make (a_uri, create {CMS_HANDLER}.make (proc))) - end - -feature -- URL related - - front_path: STRING - do - if attached base_url as l_base_url then - Result := l_base_url + "/" - else - Result := "/" - end - end - - urls_set: BOOLEAN - - initialize_urls (req: WSF_REQUEST) - local - u: like base_url - do - if not urls_set then - u := base_url - if u = Void then - u := "" - end - urls_set := True - if site_url.is_empty then - site_url := req.absolute_script_url (u) - end - set_script_url (req.script_url (u)) - end - end - - base_url: detachable READABLE_STRING_8 - -- Base url (related to the script path). - - script_url: detachable READABLE_STRING_8 - - set_script_url (a_url: like script_url) - local - s: STRING_8 - do - if a_url = Void then - script_url := Void - elseif not a_url.is_empty then - if a_url.ends_with ("/") then - create s.make_from_string (a_url) - else - create s.make (a_url.count + 1) - s.append (a_url) - s.append_character ('/') - end - script_url := s - end - ensure - attached script_url as l_url implies l_url.ends_with ("/") - end - -feature -- Report - - is_front_page (req: WSF_REQUEST): BOOLEAN - do - Result := req.path_info.same_string (front_path) - end - -feature {CMS_EXECUTION, CMS_MODULE} -- Security report - - user_has_permission (u: detachable CMS_USER; s: detachable READABLE_STRING_8): BOOLEAN - -- Anonymous or user `u' has permission for `s' ? - --| `s' could be "create page", - do - Result := storage.user_has_permission (u, s) - end - -feature -- Storage - - session_controller (req: WSF_REQUEST): CMS_SESSION_CONTROLER - -- New session controller for request `req' - do - create Result.make (req, session_manager, site_id) - end - - session_manager: WSF_SESSION_MANAGER - -- CMS Session manager - - storage: CMS_STORAGE - -feature -- Logging - - log (a_category: READABLE_STRING_8; a_message: READABLE_STRING_8; a_level: INTEGER; a_link: detachable CMS_LINK) - local - l_log: CMS_LOG - do - create l_log.make (a_category, a_message, a_level, Void) - if a_link /= Void then - l_log.set_link (a_link) - end - storage.save_log (l_log) - end - -feature -- Content type - - content_types: ARRAYED_LIST [CMS_CONTENT_TYPE] - -- Available content types - - add_content_type (a_type: CMS_CONTENT_TYPE) - do - content_types.force (a_type) - end - - content_type (a_name: READABLE_STRING_8): detachable CMS_CONTENT_TYPE - do - across - content_types as t - until - Result /= Void - loop - if t.item.name.same_string (a_name) then - Result := t.item - end - end - end - -feature -- Notification - - mailer: CMS_MAILER - -feature -- Core Execution - - handle_favicon (req: WSF_REQUEST; res: WSF_RESPONSE) - local - fres: WSF_FILE_RESPONSE - fn: FILE_NAME - do - create fn.make_from_string (theme_resource_location) - fn.set_file_name ("favicon.ico") - create fres.make (fn.string) - fres.set_expires_in_seconds (7 * 24 * 60 * 60) -- 7 jours - res.send (fres) - end - - handle_home (req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {HOME_CMS_EXECUTION}.make (req, res, Current)).execute - end - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Default request handler if no other are relevant - local - e: CMS_EXECUTION - sess: WSF_ROUTER_SESSION - do - initialize_urls (req) - create sess - router.dispatch (req, res, sess) - if not sess.dispatched then - create {NOT_FOUND_CMS_EXECUTION} e.make (req, res, Current) - e.execute - end - end - -end diff --git a/draft/application/cms/src/cms_setup.e b/draft/application/cms/src/cms_setup.e deleted file mode 100644 index 2ed8c7e0..00000000 --- a/draft/application/cms/src/cms_setup.e +++ /dev/null @@ -1,55 +0,0 @@ -note - description: "Summary description for {CMS_SETUP}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_SETUP - -feature -- Access - - configuration: detachable CMS_CONFIGURATION - - base_url: detachable READABLE_STRING_8 - - modules: LIST [CMS_MODULE] - deferred - end - - storage: CMS_STORAGE - -- CMS persistent layer - deferred - end - - session_manager: WSF_SESSION_MANAGER - -- CMS Session manager - deferred - end - - auth_engine: CMS_AUTH_ENGINE - -- CMS Authentication engine - deferred - end - - mailer: CMS_MAILER - -- CMS email engine - deferred - end - -feature -- Change - - set_base_url (a_base_url: like base_url) - do - if a_base_url /= Void and then not a_base_url.is_empty then - base_url := a_base_url - else - base_url := Void - end - end - - add_module (m: CMS_MODULE) - deferred - end - -end diff --git a/draft/application/cms/src/default_theme/default_cms_html_template.e b/draft/application/cms/src/default_theme/default_cms_html_template.e deleted file mode 100644 index 89994bca..00000000 --- a/draft/application/cms/src/default_theme/default_cms_html_template.e +++ /dev/null @@ -1,81 +0,0 @@ -note - description: "Summary description for {CMS_HTML_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEFAULT_CMS_HTML_TEMPLATE - -inherit - CMS_HTML_TEMPLATE - -create - make - -feature {NONE} -- Initialization - - make (t: DEFAULT_CMS_THEME) - do - theme := t - create variables.make (0) - end - - variables: HASH_TABLE [detachable ANY, STRING] - -feature -- Access - - register (v: STRING_8; k: STRING_8) - do - variables.force (v, k) - end - - theme: DEFAULT_CMS_THEME - - prepare (page: CMS_HTML_PAGE) - do - variables.make (10) - if attached page.title as l_title then - variables.force (l_title, "title") - variables.force (l_title, "head_title") - else - variables.force ("", "title") - variables.force ("", "head_title") - end - - variables.force (page.language, "language") - variables.force (page.head_lines_to_string, "head_lines") - end - - to_html (page: CMS_HTML_PAGE): STRING - do - -- Process html generation - create Result.make_from_string (template) - apply_template_engine (Result) - end - -feature {NONE} -- Implementation - - template: STRING - once - Result := "[ - - - - $head - $head_title - $styles - $scripts - $head_lines - - - $page_top - $page - $page_bottom - - - ]" - end - - -end diff --git a/draft/application/cms/src/default_theme/default_cms_page_template.e b/draft/application/cms/src/default_theme/default_cms_page_template.e deleted file mode 100644 index e31dc329..00000000 --- a/draft/application/cms/src/default_theme/default_cms_page_template.e +++ /dev/null @@ -1,84 +0,0 @@ -note - description: "Summary description for {CMS_PAGE_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEFAULT_CMS_PAGE_TEMPLATE - -inherit - CMS_PAGE_TEMPLATE - -create - make - -feature {NONE} -- Initialization - - make (t: DEFAULT_CMS_THEME) - do - theme := t - create variables.make (0) - end - - variables: HASH_TABLE [detachable ANY, STRING] - -feature -- Access - - theme: DEFAULT_CMS_THEME - - prepare (page: CMS_HTML_PAGE) - do - variables.make (10) - - if attached page.title as l_title then - variables.force (l_title, "title") - else - variables.force ("", "title") - end - across - theme.regions as r - loop - variables.force (page.region (r.item), r.item) - end - end - - to_html (page: CMS_HTML_PAGE): STRING - do - -- Process html generation - create Result.make_from_string (template) - apply_template_engine (Result) - end - -feature -- Registration - - register (v: STRING_8; k: STRING_8) - do - variables.force (v, k) - end - -feature {NONE} -- Implementation - - template: STRING - once - Result := "[ -
    -
    - -
    -
    - -
    $content
    - -
    -
    - -
    -
    - ]" - end - - -end diff --git a/draft/application/cms/src/default_theme/default_cms_theme.e b/draft/application/cms/src/default_theme/default_cms_theme.e deleted file mode 100644 index 00a0334d..00000000 --- a/draft/application/cms/src/default_theme/default_cms_theme.e +++ /dev/null @@ -1,85 +0,0 @@ -note - description: "Summary description for {CMS_THEME}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEFAULT_CMS_THEME - -inherit - CMS_THEME - -create - make - -feature {NONE} -- Initialization - - make (a_service: like service) - do - service := a_service - end - - service: CMS_SERVICE - -feature -- Access - - name: STRING = "CMS" - - regions: ARRAY [STRING] - once - Result := <<"header", "content", "footer", "first_sidebar", "second_sidebar">> - end - - html_template: DEFAULT_CMS_HTML_TEMPLATE - local - tpl: like internal_html_template - do - tpl := internal_html_template - if tpl = Void then - create tpl.make (Current) - internal_html_template := tpl - end - Result := tpl - end - - page_template: DEFAULT_CMS_PAGE_TEMPLATE - local - tpl: like internal_page_template - do - tpl := internal_page_template - if tpl = Void then - create tpl.make (Current) - internal_page_template := tpl - end - Result := tpl - end - -feature -- Conversion - - prepare (page: CMS_HTML_PAGE) - do - page.add_style (url ("/theme/style.css", Void), Void) - end - - page_html (page: CMS_HTML_PAGE): STRING_8 - local - l_content: STRING_8 - do - prepare (page) - page_template.prepare (page) - l_content := page_template.to_html (page) - html_template.prepare (page) - html_template.register (l_content, "page") - Result := html_template.to_html (page) - end - -feature {NONE} -- Internal - - internal_page_template: detachable like page_template - - internal_html_template: detachable like html_template - -invariant - attached internal_page_template as inv_p implies inv_p.theme = Current -end diff --git a/draft/application/cms/src/form/cms_form.e b/draft/application/cms/src/form/cms_form.e deleted file mode 100644 index b0746d51..00000000 --- a/draft/application/cms/src/form/cms_form.e +++ /dev/null @@ -1,43 +0,0 @@ -note - description: "Summary description for {CMS_FORM}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_FORM - -inherit - WSF_FORM - rename - process as process_form - end - -create - make - -feature -- Basic operation - - prepare (a_execution: CMS_EXECUTION) - do - a_execution.service.call_form_alter_hooks (Current, Void, a_execution) - end - - process (a_execution: CMS_EXECUTION) - do - process_form (a_execution.request, agent on_prepared (a_execution, ?), agent on_processed (a_execution, ?)) - end - - on_prepared (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA) - do - a_execution.service.call_form_alter_hooks (Current, fd, a_execution) - end - - on_processed (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA) - do - if not fd.is_valid or fd.has_error then - a_execution.report_form_errors (fd) - end - end - -end diff --git a/draft/application/cms/src/handler/any_cms_execution.e b/draft/application/cms/src/handler/any_cms_execution.e deleted file mode 100644 index 882e5205..00000000 --- a/draft/application/cms/src/handler/any_cms_execution.e +++ /dev/null @@ -1,61 +0,0 @@ -note - description: "[ - This class implements the web service - - It inherits from WSF_DEFAULT_SERVICE to get default EWF connector ready - And from WSF_URI_TEMPLATE_ROUTED_SERVICE to use the router service - - `initialize' can be redefine to provide custom options if needed. - ]" - -class - ANY_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make, - make_with_text - -feature {NONE} -- Initialization - - make_with_text (req: WSF_REQUEST; res: WSF_RESPONSE; h: like service; t: like text) - do - make (req, res, h) - text := t - end - - text: detachable STRING - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - s: STRING - do - if attached main_content as m then - -- ok - elseif attached text as t then - create b.make_empty - s := request.path_info - if attached service.script_url as l_script_url then - if s.starts_with (l_script_url) then - s.remove_head (l_script_url.count) - if s.starts_with ("/") then - s.remove_head (1) - end - end - end - set_title (s) - b.append (t) - set_main_content (b) - else - set_title ("...") - set_main_content ("") - end - end - -end diff --git a/draft/application/cms/src/handler/cms_file_system_handler.e b/draft/application/cms/src/handler/cms_file_system_handler.e deleted file mode 100644 index b90630dc..00000000 --- a/draft/application/cms/src/handler/cms_file_system_handler.e +++ /dev/null @@ -1,16 +0,0 @@ -note - description: "Summary description for {CMS_FILE_SYSTEM_HANDLER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_FILE_SYSTEM_HANDLER - -inherit - WSF_FILE_SYSTEM_HANDLER - -create - make - -end diff --git a/draft/application/cms/src/handler/cms_handler.e b/draft/application/cms/src/handler/cms_handler.e deleted file mode 100644 index f678e879..00000000 --- a/draft/application/cms/src/handler/cms_handler.e +++ /dev/null @@ -1,64 +0,0 @@ -note - description: "Summary description for {CMS_HANDLER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HANDLER - -inherit - WSF_URI_HANDLER - rename - execute as execute_uri - undefine - new_mapping - end - - WSF_URI_TEMPLATE_HANDLER - rename - execute as execute_uri_template - end - - WSF_STARTS_WITH_HANDLER - rename - execute as execute_starts_with - undefine - new_mapping - end - -create - make - -feature {NONE} -- Initialization - - make (e: like action) - do - action := e - end - - action: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]] - -feature -- Execution - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - do - action.call ([req, res]) - end - - execute_uri (req: WSF_REQUEST; res: WSF_RESPONSE) - do - execute (req, res) - end - - execute_uri_template (req: WSF_REQUEST; res: WSF_RESPONSE) - do - execute_uri (req, res) - end - - execute_starts_with (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) - do - execute_uri (req, res) - end - -end diff --git a/draft/application/cms/src/handler/home_cms_execution.e b/draft/application/cms/src/handler/home_cms_execution.e deleted file mode 100644 index fe79855e..00000000 --- a/draft/application/cms/src/handler/home_cms_execution.e +++ /dev/null @@ -1,52 +0,0 @@ -note - description: "[ - ]" - -class - HOME_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local --- l_url: READABLE_STRING_8 - b: STRING_8 - do - set_title ("Home") - set_page_title (Void) - create b.make_empty - if attached service.storage.recent_nodes (1, 10) as l_nodes then - across - l_nodes as c - loop - b.append ("
    ") - b.append (c.item.to_html (theme)) - b.append ("
    %N") - end - end - --- b.append ("
      %N") --- l_url := url ("/", Void) --- b.append ("
    • Home
    • %N") --- l_url := url ("/info/", Void) --- b.append ("
    • EWF Info
    • %N") - --- b.append ("
    %N") - - debug ("cms") - if attached controller.session as sess then - b.append ("
    Session#" + sess.uuid + "
    %N") - end - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/handler/not_found_cms_execution.e b/draft/application/cms/src/handler/not_found_cms_execution.e deleted file mode 100644 index 8756855c..00000000 --- a/draft/application/cms/src/handler/not_found_cms_execution.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description: "[ - This class implements the web service - - It inherits from WSF_DEFAULT_SERVICE to get default EWF connector ready - And from WSF_URI_TEMPLATE_ROUTED_SERVICE to use the router service - - `initialize' can be redefine to provide custom options if needed. - ]" - -class - NOT_FOUND_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - status_code := {HTTP_STATUS_CODE}.not_found - create b.make_empty - set_title ("Page Not Found") - b.append ("The requested page could not be found.%N") - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/handler/theme_cms_execution.e b/draft/application/cms/src/handler/theme_cms_execution.e deleted file mode 100644 index 32999ade..00000000 --- a/draft/application/cms/src/handler/theme_cms_execution.e +++ /dev/null @@ -1,47 +0,0 @@ -note - description: "[ - ]" - -class - THEME_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local --- l_url: READABLE_STRING_8 - b: STRING_8 - do - set_title ("Home") - create b.make_empty - - b.append ("

    Home

    %N") - if attached service.storage.recent_nodes (1, 10) as l_nodes then - across - l_nodes as c - loop - b.append ("
    ") - b.append (c.item.to_html (theme)) - b.append ("
    %N") - end - end - --- b.append ("
      %N") --- l_url := url ("/", Void) --- b.append ("
    • Home
    • %N") --- l_url := url ("/info/", Void) --- b.append ("
    • EWF Info
    • %N") - --- b.append ("
    %N") - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook.e b/draft/application/cms/src/hooks/cms_hook.e deleted file mode 100644 index 9e6ae0e7..00000000 --- a/draft/application/cms/src/hooks/cms_hook.e +++ /dev/null @@ -1,10 +0,0 @@ -note - description: "Summary description for {CMS_HOOK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK - -end diff --git a/draft/application/cms/src/hooks/cms_hook_auto_register.e b/draft/application/cms/src/hooks/cms_hook_auto_register.e deleted file mode 100644 index 8bade763..00000000 --- a/draft/application/cms/src/hooks/cms_hook_auto_register.e +++ /dev/null @@ -1,33 +0,0 @@ -note - description: "[ - Summary description for {CMS_HOOK_AUTO_REGISTER}. - When inheriting from this class, the declared hooks are automatically - registered, otherwise, each descendant has to add it to the cms service - itself. - ]" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_AUTO_REGISTER - -inherit - CMS_HOOK - -feature -- Hook - - hook_auto_register (a_service: CMS_SERVICE) - do - if attached {CMS_HOOK_MENU_ALTER} Current as h_menu_alter then - a_service.add_menu_alter_hook (h_menu_alter) - end - if attached {CMS_HOOK_BLOCK} Current as h_block then - a_service.add_block_hook (h_block) - end - if attached {CMS_HOOK_FORM_ALTER} Current as h_block then - a_service.add_form_alter_hook (h_block) - end - - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook_block.e b/draft/application/cms/src/hooks/cms_hook_block.e deleted file mode 100644 index 4f55b8b6..00000000 --- a/draft/application/cms/src/hooks/cms_hook_block.e +++ /dev/null @@ -1,23 +0,0 @@ -note - description: "Summary description for {CMS_HOOK_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_BLOCK - -inherit - CMS_HOOK - -feature -- Hook - - block_list: ITERABLE [like {CMS_BLOCK}.name] - deferred - end - - get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) - deferred - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook_form_alter.e b/draft/application/cms/src/hooks/cms_hook_form_alter.e deleted file mode 100644 index afc45305..00000000 --- a/draft/application/cms/src/hooks/cms_hook_form_alter.e +++ /dev/null @@ -1,19 +0,0 @@ -note - description: "Summary description for {CMS_HOOK_FORM_ALTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_FORM_ALTER - -inherit - CMS_HOOK - -feature -- Hook - - form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION) - deferred - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook_menu_alter.e b/draft/application/cms/src/hooks/cms_hook_menu_alter.e deleted file mode 100644 index b3737ab7..00000000 --- a/draft/application/cms/src/hooks/cms_hook_menu_alter.e +++ /dev/null @@ -1,19 +0,0 @@ -note - description: "Summary description for {CMS_HOOK_MENU_ALTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_MENU_ALTER - -inherit - CMS_HOOK - -feature -- Hook - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - deferred - end - -end diff --git a/draft/application/cms/src/kernel/api/cms_api_options.e b/draft/application/cms/src/kernel/api/cms_api_options.e deleted file mode 100644 index 1fbfa52c..00000000 --- a/draft/application/cms/src/kernel/api/cms_api_options.e +++ /dev/null @@ -1,26 +0,0 @@ -note - description: "Summary description for {CMS_API_OPTIONS}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_API_OPTIONS - -inherit - WSF_API_OPTIONS - -create - make, - make_from_manifest - -convert - make_from_manifest ({ ARRAY [TUPLE [key: STRING; value: detachable ANY]], - ARRAY [TUPLE [STRING_8, ARRAY [TUPLE [STRING_8, STRING_32]]]], - ARRAY [TUPLE [STRING_8, ARRAY [TUPLE [STRING_8, STRING_8]]]] - }) - -feature {NONE} -- Initialization - - -end diff --git a/draft/application/cms/src/kernel/api/cms_common_api.e b/draft/application/cms/src/kernel/api/cms_common_api.e deleted file mode 100644 index c8a7fc0c..00000000 --- a/draft/application/cms/src/kernel/api/cms_common_api.e +++ /dev/null @@ -1,102 +0,0 @@ -note - description: "Summary description for {WSF_CMS_COMMON_API}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_COMMON_API - -inherit - WSF_API_UTILITIES - -feature {NONE} -- Access - - service: CMS_SERVICE - deferred - end - - site_url: READABLE_STRING_8 - do - Result := service.site_url - end - - base_url: detachable READABLE_STRING_8 - -- Base url if any. - do - Result := service.script_url - end - -feature -- Access - - user_link (u: CMS_USER): like link - do - Result := link (u.name, "/user/" + u.id.out, Void) - end - - node_link (n: CMS_NODE): like link - do - Result := link (n.title, "/node/" + n.id.out, Void) - end - - user_url (u: CMS_USER): like url - do - Result := url ("/user/" + u.id.out, Void) - end - - node_url (n: CMS_NODE): like url - do - Result := url ("/node/" + n.id.out, Void) - end - -feature -- Helper - - is_empty (s: detachable READABLE_STRING_GENERAL): BOOLEAN - -- Is `s' is Void or empty ? - do - Result := s = Void or else s.is_empty - end - - unix_timestamp (dt: DATE_TIME): INTEGER_64 - do - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp (dt) - end - - unix_timestamp_to_date_time (t: INTEGER_64): DATE_TIME - do - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp_to_date_time (t) - end - - string_unix_timestamp_to_date_time (s: READABLE_STRING_8): DATE_TIME - do - if s.is_integer_64 then - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp_to_date_time (s.to_integer_64) - else - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp_to_date_time (0) - end - end - -feature {NONE} -- Implementation - - options_boolean (opts: HASH_TABLE [detachable ANY, STRING]; k: STRING; dft: BOOLEAN): BOOLEAN - do - if attached {BOOLEAN} opts.item (k) as h then - Result := h - else - Result := dft - end - end - - options_string (opts: HASH_TABLE [detachable ANY, STRING]; k: STRING): detachable STRING - do - if attached {STRING} opts.item (k) as s then - Result := s - end - end - --- html_encoder: HTML_ENCODER --- once ("thread") --- create Result --- end - -end diff --git a/draft/application/cms/src/kernel/api/cms_url_api_options.e b/draft/application/cms/src/kernel/api/cms_url_api_options.e deleted file mode 100644 index 5133d15a..00000000 --- a/draft/application/cms/src/kernel/api/cms_url_api_options.e +++ /dev/null @@ -1,25 +0,0 @@ -note - description: "Summary description for {CMS_URL_API_OPTIONS}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_URL_API_OPTIONS - -inherit - CMS_API_OPTIONS - -create - make, - make_absolute - -feature {NONE} -- Initialization - - make_absolute - do - make (1) - force (True, "absolute") - end - -end diff --git a/draft/application/cms/src/kernel/auth/cms_auth_engine.e b/draft/application/cms/src/kernel/auth/cms_auth_engine.e deleted file mode 100644 index 47561f30..00000000 --- a/draft/application/cms/src/kernel/auth/cms_auth_engine.e +++ /dev/null @@ -1,16 +0,0 @@ -note - description: "Summary description for {CMS_AUTH_ENGINE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_AUTH_ENGINE - -feature -- Status - - valid_credential (u,p: READABLE_STRING_32): BOOLEAN - deferred - end - -end diff --git a/draft/application/cms/src/kernel/auth/cms_storage_auth_engine.e b/draft/application/cms/src/kernel/auth/cms_storage_auth_engine.e deleted file mode 100644 index f213f56a..00000000 --- a/draft/application/cms/src/kernel/auth/cms_storage_auth_engine.e +++ /dev/null @@ -1,32 +0,0 @@ -note - description: "Summary description for {CMS_STORAGE_AUTH_ENGINE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_STORAGE_AUTH_ENGINE - -inherit - CMS_AUTH_ENGINE - -create - make - -feature {NONE} -- Initialization - - make (a_storage: like storage) - do - storage := a_storage - end - - storage: CMS_STORAGE - -feature -- Status - - valid_credential (u,p: READABLE_STRING_32): BOOLEAN - do - Result := storage.is_valid_credential (u, p) - end - -end diff --git a/draft/application/cms/src/kernel/cms_html_page.e b/draft/application/cms/src/kernel/cms_html_page.e deleted file mode 100644 index 2ccc7405..00000000 --- a/draft/application/cms/src/kernel/cms_html_page.e +++ /dev/null @@ -1,225 +0,0 @@ -note - description: "Summary description for {CMS_HTML_PAGE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_PAGE - -create - make - -feature {NONE} -- Initialization - - make - do - create regions.make (5) - language := "en" - - status_code := {HTTP_STATUS_CODE}.ok - create header.make - create {ARRAYED_LIST [STRING]} head_lines.make (5) - header.put_content_type_text_html - end - -feature -- Status - - status_code: INTEGER - -feature -- Header - - header: HTTP_HEADER - -feature -- Region - - regions: HASH_TABLE [STRING_8, STRING_8] - -- header - -- content - -- footer - -- could have sidebar first, sidebar second, ... - - region (n: STRING_8): STRING_8 - do - if attached regions.item (n) as r then - Result := r - else - Result := "" - debug - Result := "{{" + n + "}}" - end - end - end - - html_head: STRING_8 - local - t: like title - lines: like head_lines - do - t := title - lines := head_lines - if t /= Void or else lines.count > 0 then - create Result.make (50) - if t /= Void then - Result.append ("" + t + "%N") - end - Result.append_character ('%N') - across - lines as l - loop - Result.append (l.item) - Result.append_character ('%N') - end - else - create Result.make_empty - end - end - - header_region: STRING_8 - do - Result := region ("header") - end - - content_region: STRING_8 - do - Result := region ("content") - end - - footer_region: STRING_8 - do - Result := region ("content") - end - -feature -- Element change - - add_to_region (s: STRING; k: STRING) - local - r: detachable STRING - do - r := regions.item (k) - if r = Void then - create r.make_from_string (s) - set_region (r, k) - else - r.append (s) - end - end - - add_to_header_region (s: STRING) - do - add_to_region (s, "header") - end - - add_to_content_region (s: STRING) - do - add_to_region (s, "content") - end - - add_to_footer_region (s: STRING) - do - add_to_region (s, "footer") - end - - set_region (s: STRING; k: STRING) - do - regions.force (s, k) - end - --- set_header_region (s: STRING) --- do --- set_region (s, "header") --- end - --- set_content_region (s: STRING) --- do --- set_region (s, "content") --- end - --- set_footer_region (s: STRING) --- do --- set_region (s, "footer") --- end - -feature -- Access - - title: detachable STRING - - language: STRING - - head_lines: LIST [STRING] - - head_lines_to_string: STRING - do - create Result.make_empty - across - head_lines as h - loop - Result.append (h.item) - Result.append_character ('%N') - end - end - --- variables: HASH_TABLE [detachable ANY, STRING_8] - -feature -- Element change - - set_status_code (c: like status_code) - do - status_code := c - end - - set_language (s: like language) - do - language := s - end - - set_title (s: like title) - do - title := s - end - - add_meta_name_content (a_name: STRING; a_content: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - - add_meta_http_equiv (a_http_equiv: STRING; a_content: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - - add_style (a_href: STRING; a_media: detachable STRING) - local - s: STRING_8 - do - s := "") - head_lines.extend (s) - end - - add_javascript_url (a_src: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - - add_javascript_content (a_script: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - -end diff --git a/draft/application/cms/src/kernel/cms_session_controler.e b/draft/application/cms/src/kernel/cms_session_controler.e deleted file mode 100644 index 9f78ac6f..00000000 --- a/draft/application/cms/src/kernel/cms_session_controler.e +++ /dev/null @@ -1,139 +0,0 @@ -note - description: "[ - Summary description for CMS_SESSION_CONTROLER. - ]" - date: "$Date$" - revision: "$Revision$" - -class - CMS_SESSION_CONTROLER - -inherit - ANY - - WSF_SESSION_FACTORY [WSF_SESSION] - -create - make - -feature -- Initialization - - make (req: WSF_REQUEST; a_mngr: like session_manager; a_site_id: READABLE_STRING_8) - do - site_id := a_site_id - session_manager := a_mngr - initialize - create discarded_sessions.make - get_session (req) - end - - initialize - do - session_id_name := "_EWF_CMS_SESSID__" + site_id - end - -feature -- Session access - - site_id: READABLE_STRING_8 - -- Associated CMS site id. - - session: WSF_SESSION - - has_pending_session: BOOLEAN - - discarded_sessions: LINKED_LIST [like session] - -feature -- Session operation - - session_commit (page: CMS_HTML_PAGE_RESPONSE; e: CMS_EXECUTION) - do - if has_pending_session then - session.apply_to (page.header, e.request, e.request.script_url ("/")) - end - session.commit - end - - apply_sessions_to (h: HTTP_HEADER; req: WSF_REQUEST; a_path: detachable READABLE_STRING_8) - do - session.apply_to (h, req, a_path) - across - discarded_sessions as c - loop - c.item.apply_to (h, req, a_path) - end - end - - start_session (req: WSF_REQUEST) - -- Start a new session - local - s: like session - do - close_session (req) - s := new_session (req, False, session_manager) - req.set_execution_variable (session_request_variable_name, s) - session := s - if s.is_pending then - has_pending_session := True - end - ensure - session_attached: session /= Void - end - - get_session (req: WSF_REQUEST) - -- Get existing session, or start a new one - local - s: like session - do - if attached {like session} req.execution_variable (session_request_variable_name) as r_session then - session := r_session - else - s := new_session (req, True, session_manager) --- create {CMS_SESSION} s.make (req, "_EWF_CMS_SESSID") - if s.is_pending then - has_pending_session := True - end - session := s - req.set_execution_variable (session_request_variable_name, s) - end - if session.expired then - start_session (req) - end - end - - close_session (req: WSF_REQUEST) - -- Close `session' if any - do - if session.is_pending then - has_pending_session := has_pending_session or not discarded_sessions.is_empty - else - has_pending_session := True - discarded_sessions.extend (session) - end - session.destroy - end - -feature -- Session internal - - session_manager: WSF_SESSION_MANAGER - - new_session (req: WSF_REQUEST; a_reuse: BOOLEAN; m: WSF_SESSION_MANAGER): like session - local - s: CMS_SESSION - dt: DATE_TIME - do - if a_reuse then - create s.make (req, session_id_name, m) - else - create s.make_new (session_id_name, m) - create dt.make_now_utc - dt.day_add (31) - s.set_expiration (dt) - end - Result := s - end - - session_request_variable_name: STRING = "_EWF_CMS_SESSION_" - - session_id_name: READABLE_STRING_8 - -end diff --git a/draft/application/cms/src/kernel/cms_user.e b/draft/application/cms/src/kernel/cms_user.e deleted file mode 100644 index 1521bbd4..00000000 --- a/draft/application/cms/src/kernel/cms_user.e +++ /dev/null @@ -1,195 +0,0 @@ -note - description: "Summary description for {CMS_USER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_USER - -inherit - DEBUG_OUTPUT - -create - make_new, - make - -feature {NONE} -- Initialization - - make (a_id: like id; n: like name; dt: like creation_date) - require - a_id > 0 - do - id := a_id - creation_date := dt - name := n - ensure - valid_password: password = Void - end - - make_new (n: like name) - do - name := n - create creation_date.make_now_utc - end - -feature -- Access - - is_admin: BOOLEAN - do - Result := id = 1 - end - - id: INTEGER - - name: STRING_8 - - password: detachable READABLE_STRING_32 - - email: detachable READABLE_STRING_8 - - profile: detachable CMS_USER_PROFILE - - creation_date: DATE_TIME - - last_login_date: detachable DATE_TIME - - data: detachable HASH_TABLE [detachable ANY, STRING] - - data_item (k: STRING): detachable ANY - do - if attached data as l_data then - Result := l_data.item (k) - end - end - -feature -- Permission - - roles: detachable LIST [INTEGER] - -- Associated roles - -- Note: does not include "authenticated" and "anonymous". - - has_role (r: CMS_USER_ROLE): BOOLEAN - do - Result := attached roles as lst and then lst.has (r.id) - end - - clear_roles - do - roles := Void - end - - add_role_by_id (r_id: INTEGER) - local - lst: like roles - do - lst := roles - if r_id <= 2 then -- Anonymous=1 and Authenticated=2 - lst := roles - if lst /= Void and then lst.is_empty then - clear_roles - end - else - if lst = Void then - create {ARRAYED_SET [INTEGER]} lst.make (1) - roles := lst - end - lst.force (r_id) - end - end - -feature -- Status report - - has_id: BOOLEAN - do - Result := id > 0 - end - - has_email: BOOLEAN - do - Result := attached email as e and then not e.is_empty - end - - debug_output: STRING - do - Result := name - end - - same_as (u: detachable CMS_USER): BOOLEAN - do - Result := u /= Void and then id = u.id - end - -feature -- Element change - - set_id (a_id: like id) - do - id := a_id - end - - set_password (p: like password) - do - password := p - end - - set_email (m: like email) - do - email := m - end - - set_profile (prof: like profile) - do - profile := prof - end - - set_data_item (k: READABLE_STRING_8; d: like data_item) - local - l_data: like data - do - l_data := data - if l_data = Void then - create l_data.make (1) - data := l_data - end - l_data.force (d, k) - end - - remove_data_item (k: READABLE_STRING_8) - do - if attached data as l_data then - l_data.remove (k) - end - end - - set_profile_item (k: READABLE_STRING_8; v: READABLE_STRING_8) - local - prof: like profile - do - prof := profile - if prof = Void then - create prof.make - profile := prof - end - prof.force (v, k) - end - - set_last_login_date (dt: like last_login_date) - do - last_login_date := dt - end - - set_last_login_date_now - do - set_last_login_date (create {DATE_TIME}.make_now_utc) - end - -feature {CMS_STORAGE} -- Security - - encoded_password: detachable READABLE_STRING_8 - - set_encoded_password (p: like encoded_password) - do - encoded_password := p - end - -end diff --git a/draft/application/cms/src/kernel/cms_user_profile.e b/draft/application/cms/src/kernel/cms_user_profile.e deleted file mode 100644 index 80d4b773..00000000 --- a/draft/application/cms/src/kernel/cms_user_profile.e +++ /dev/null @@ -1,51 +0,0 @@ -note - description: "Summary description for {CMS_USER_PROFILE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_USER_PROFILE - -inherit - TABLE_ITERABLE [READABLE_STRING_8, READABLE_STRING_8] - -create - make - -feature {NONE} -- Initialization - - make - do - create items.make (0) - end - -feature -- Access - - item (k: READABLE_STRING_8): detachable READABLE_STRING_8 - do - Result := items.item (k.as_string_8) - end - -feature -- Change - - force (v: READABLE_STRING_8; k: READABLE_STRING_8) - do - items.force (v, k.as_string_8) - end - -feature -- Access - - new_cursor: TABLE_ITERATION_CURSOR [READABLE_STRING_8, READABLE_STRING_8] - -- Fresh cursor associated with current structure - do - Result := items.new_cursor - end - -feature {NONE} -- Implementation - - items: HASH_TABLE [READABLE_STRING_8, STRING_8] - -invariant - -end diff --git a/draft/application/cms/src/kernel/cms_user_role.e b/draft/application/cms/src/kernel/cms_user_role.e deleted file mode 100644 index 75587c72..00000000 --- a/draft/application/cms/src/kernel/cms_user_role.e +++ /dev/null @@ -1,85 +0,0 @@ -note - description: "Summary description for {CMS_USER_ROLE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_USER_ROLE - -inherit - ANY - redefine - is_equal - end - -create - make, - make_with_id - -feature {NONE} -- Initialization - - make_with_id (a_id: like id; a_name: like name) - do - id := a_id - make (a_name) - end - - make (a_name: like name) - do - name := a_name - create {ARRAYED_LIST [READABLE_STRING_8]} permissions.make (0) - end - -feature -- Status report - - has_id: BOOLEAN - do - Result := id > 0 - end - - has_permission (p: READABLE_STRING_8): BOOLEAN - do - Result := across permissions as c some c.item.is_case_insensitive_equal (p) end - end - -feature -- Access - - id: INTEGER - - name: READABLE_STRING_8 - - permissions: LIST [READABLE_STRING_8] - -feature -- Comparison - - same_user_role (r: CMS_USER_ROLE): BOOLEAN - do - Result := r.id = id - end - - is_equal (other: like Current): BOOLEAN - -- Is `other' attached to an object considered - -- equal to current object? - do - Result := id = other.id - end - -feature -- Change - - set_id (a_id: like id) - do - id := a_id - end - - set_name (a_name: like name) - do - name := a_name - end - - add_permission (n: READABLE_STRING_8) - do - permissions.force (n) - end - -end diff --git a/draft/application/cms/src/kernel/content/cms_block.e b/draft/application/cms/src/kernel/content/cms_block.e deleted file mode 100644 index a96c3bc9..00000000 --- a/draft/application/cms/src/kernel/content/cms_block.e +++ /dev/null @@ -1,32 +0,0 @@ -note - description: "Summary description for {CMS_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_BLOCK - -feature -- Access - - name: READABLE_STRING_8 - deferred - end - - title: detachable READABLE_STRING_32 - deferred - end - -feature -- status report - - is_enabled: BOOLEAN - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - deferred - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_content_block.e b/draft/application/cms/src/kernel/content/cms_content_block.e deleted file mode 100644 index f3f65c28..00000000 --- a/draft/application/cms/src/kernel/content/cms_content_block.e +++ /dev/null @@ -1,46 +0,0 @@ -note - description: "Summary description for {CMS_CONTENT_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_CONTENT_BLOCK - -inherit - CMS_BLOCK - -create - make - -feature {NONE} -- Initialization - - make (a_name: like name; a_title: like title; a_body: like body; a_format: like format) - do - is_enabled := True - name := a_name - title := a_title - body := a_body - format := a_format - end - -feature -- Access - - name: READABLE_STRING_8 - - title: detachable READABLE_STRING_32 - - body: READABLE_STRING_8 - - format: CMS_FORMAT - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - do - Result := format.to_html (body) - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_content_type.e b/draft/application/cms/src/kernel/content/cms_content_type.e deleted file mode 100644 index ebddfea9..00000000 --- a/draft/application/cms/src/kernel/content/cms_content_type.e +++ /dev/null @@ -1,60 +0,0 @@ -note - description: "Summary description for {CMS_CONTENT_TYPE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_CONTENT_TYPE - -feature -- Access - - name: READABLE_STRING_8 - -- Internal name - deferred - end - - title: READABLE_STRING_8 - deferred - end - - description: detachable READABLE_STRING_8 - -- Optional description - deferred - end - - available_formats: LIST [CMS_FORMAT] - deferred - end - -feature -- Factory - - fill_edit_form (f: CMS_FORM; a_node: detachable CMS_NODE) - -- Fill the edit form `f' - deferred - end - - change_node (a_execution: CMS_EXECUTION; a_form_data: WSF_FORM_DATA; a_node: like new_node) - -- Apply data from `a_form_data' to a_node - require - a_node.has_id - deferred - end - - new_node (a_execution: CMS_EXECUTION; a_form_data: WSF_FORM_DATA; a_node: detachable like new_node): CMS_NODE - -- New content created with `a_form_data' - deferred - ensure - a_node /= Void implies a_node = Result - end - -feature {NONE} -- Implementation: helper - - formats: CMS_FORMATS - once - create Result - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_menu_block.e b/draft/application/cms/src/kernel/content/cms_menu_block.e deleted file mode 100644 index 9d825726..00000000 --- a/draft/application/cms/src/kernel/content/cms_menu_block.e +++ /dev/null @@ -1,45 +0,0 @@ -note - description: "Summary description for {CMS_MENU_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MENU_BLOCK - -inherit - CMS_BLOCK - -create - make - -feature {NONE} -- Initialization - - make (a_menu: like menu) - do - is_enabled := True - menu := a_menu - name := a_menu.name - title := a_menu.title - end - -feature -- Access - - menu: CMS_MENU - - name: READABLE_STRING_8 - - title: detachable READABLE_STRING_32 - - is_horizontal: BOOLEAN - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - do - Result := a_theme.menu_html (menu, is_horizontal) - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_node.e b/draft/application/cms/src/kernel/content/cms_node.e deleted file mode 100644 index 545020b8..00000000 --- a/draft/application/cms/src/kernel/content/cms_node.e +++ /dev/null @@ -1,101 +0,0 @@ -note - description: "Summary description for {WSF_CMS_NODE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_NODE - -feature -- Access - - id: INTEGER - -- Unique identifier of Current. - - title: detachable READABLE_STRING_32 - -- Associated title (optional). - deferred - end - - body: detachable READABLE_STRING_8 - -- Body of Current. - deferred - end - - format: CMS_FORMAT - -- Format associated with `body' - deferred - end - - content_type_name: STRING - -- Associated content type name - deferred - end - -feature -- status report - - has_id: BOOLEAN - do - Result := id > 0 - end - -feature -- Access: status - - author: detachable CMS_USER - - creation_date: DATE_TIME - - modification_date: DATE_TIME - -feature -- Change - - set_id (a_id: like id) - require - not has_id - do - id := a_id - end - - set_author (u: like author) - do - author := u - end - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - local - d: STRING - do - Result := "
    " - if attached title as l_title then - Result.append ("
    " + a_theme.node_link (Current) + "
    ") - end - create d.make_empty - if attached author as u then - d.append ("by " + a_theme.user_link (u) + " ") - end - if attached modification_date as dt then - d.append ("last modified: " + dt.year.out + "/" + dt.month.out + "/" + dt.day.out + "") - end - if not d.is_empty then - Result.append ("
    ") - Result.append (d) - Result.append ("
    ") - end - if attached body as b then - Result.append ("
    ") - Result.append (format.to_html (b)) - Result.append ("
    ") - end - Result.append ("
    ") - end - -feature {NONE} -- Implementation: helper - - formats: CMS_FORMATS - once - create Result - end - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_filtered_html_format.e b/draft/application/cms/src/kernel/content/format/cms_filtered_html_format.e deleted file mode 100644 index 43febb3e..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_filtered_html_format.e +++ /dev/null @@ -1,44 +0,0 @@ -note - description : "[ - Filtered html format - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_FILTERED_HTML_FORMAT - -inherit - CMS_FORMAT - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - create filters.make (3) - filters.force (create {CMS_URL_FILTER}) - filters.force (create {CMS_HTML_FILTER}) - filters.force (create {CMS_LINE_BREAK_CONVERTER_FILTER}) - --- help := "
    • Web page addresses and e-mail addresses turn into links automatically.
    • Allowed HTML tags: " --- across --- allowed_html_tags as c --- loop --- help.append ("<" + c.item + "> ") --- end --- help.append ("
    • Lines and paragraphs break automatically.
    ") - end - -feature -- Access - - name: STRING = "filtered_html" - - title: STRING_8 = "Filtered HTML" - - filters: ARRAYED_LIST [CMS_FILTER] - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_format.e b/draft/application/cms/src/kernel/content/format/cms_format.e deleted file mode 100644 index fe9d8dd3..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_format.e +++ /dev/null @@ -1,46 +0,0 @@ -note - description: "Summary description for {WSF_CMS_FORMAT}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_FORMAT - -feature -- Access - - name: STRING - deferred - end - - title: READABLE_STRING_8 - deferred - end - - help: STRING - do - create Result.make (0) - across - filters as c - loop - if attached c.item.help as h and then not h.is_empty then - Result.append ("
  • " + h + "
  • ") - end - end - end - - filters: LIST [CMS_FILTER] - deferred - end - - to_html (a_text: READABLE_STRING_8): STRING_8 - do - create Result.make_from_string (a_text) - across - filters as c - loop - c.item.filter (Result) - end - end - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_formats.e b/draft/application/cms/src/kernel/content/format/cms_formats.e deleted file mode 100644 index 5c82e097..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_formats.e +++ /dev/null @@ -1,54 +0,0 @@ -note - description: "Summary description for {CMS_FORMATS}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_FORMATS - -feature -- Access - - format (a_name: like {CMS_FORMAT}.name): detachable CMS_FORMAT - do - across - all_formats as c - until - Result /= Void - loop - if c.item.name.same_string (a_name) then - Result := c.item - end - end - end - - all_formats: LIST [CMS_FORMAT] - once - create {ARRAYED_LIST [CMS_FORMAT]} Result.make (3) - Result.force (plain_text) - Result.force (full_html) - Result.force (filtered_html) - end - - default_format: CMS_FORMAT - do - Result := plain_text --FIXME - end - - plain_text: CMS_PLAIN_TEXT_FORMAT - once - create Result - end - - full_html: CMS_FULL_HTML_FORMAT - once - create Result - end - - filtered_html: CMS_FILTERED_HTML_FORMAT - once - create Result - end - - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_full_html_format.e b/draft/application/cms/src/kernel/content/format/cms_full_html_format.e deleted file mode 100644 index c486e975..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_full_html_format.e +++ /dev/null @@ -1,35 +0,0 @@ -note - description : "[ - Full html format - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_FULL_HTML_FORMAT - -inherit - CMS_FORMAT - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - create filters.make (2) - filters.force (create {CMS_URL_FILTER}) - filters.force (create {CMS_LINE_BREAK_CONVERTER_FILTER}) - end - -feature -- Access - - name: STRING = "full_html" - - title: STRING_8 = "Full HTML" - - filters: ARRAYED_LIST [CMS_FILTER] - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_plain_text_format.e b/draft/application/cms/src/kernel/content/format/cms_plain_text_format.e deleted file mode 100644 index 76b05d4e..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_plain_text_format.e +++ /dev/null @@ -1,49 +0,0 @@ -note - description : "[ - Plain Text format - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_PLAIN_TEXT_FORMAT - -inherit - CMS_FORMAT - redefine - default_create, - help - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - create filters.make (2) - filters.force (create {CMS_HTML_TO_TEXT_FILTER}) - filters.force (create {CMS_LINE_BREAK_CONVERTER_FILTER}) - end - - -feature -- Access - - name: STRING = "plain_text" - - title: STRING_8 = "Plain text" - - help: STRING - do - Result := "
  • No HTML tags allowed.
  • " - Result.append (Precursor) - end ---
      ---
    • No HTML tags allowed.
    • ---
    • Web page addresses and e-mail addresses turn into links automatically.
    • ---
    • Lines and paragraphs break automatically.
    • ---
    --- ]" - - filters: ARRAYED_LIST [CMS_FILTER] - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_filter.e deleted file mode 100644 index 1b49552a..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_filter.e +++ /dev/null @@ -1,35 +0,0 @@ -note - description: "Summary description for {CMS_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_FILTER - -feature -- Access - - name: READABLE_STRING_8 - deferred - end - - title: READABLE_STRING_8 - deferred - end - - description: READABLE_STRING_8 - deferred - end - - help: READABLE_STRING_8 - do - Result := description - end - -feature -- Conversion - - filter (s: STRING_8) - deferred - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_html_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_html_filter.e deleted file mode 100644 index bc35b4eb..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_html_filter.e +++ /dev/null @@ -1,129 +0,0 @@ -note - description: "Summary description for {CMS_HTML_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_FILTER - -inherit - CMS_FILTER - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - allowed_html_tags := <<"a", "em", "strong", "cite", "blockquote", "code", "ul", "ol", "li", "dl">> - description := "Allowed HTML tags: " - across - allowed_html_tags as c - loop - description.append ("<" + c.item + "> ") - end - end - -feature -- Access - - name: STRING_8 = "html_filter" - - title: STRING_8 = "HTML filter" - - description: STRING_8 - - allowed_html_tags: ITERABLE [READABLE_STRING_8] - -feature -- Conversion - - filter (a_text: STRING_8) - local - l_new: STRING_8 - i: INTEGER - n: INTEGER - in_tag: BOOLEAN - t: READABLE_STRING_8 - p1, p2: INTEGER - do - create l_new.make (a_text.count) - from - p1 := 1 - i := a_text.index_of ('<', 1) - if i > 0 then - l_new.append (a_text.substring (1, i - 1)) - end - n := a_text.count - until - i = 0 or i > n - loop - if a_text[i] = '<' then - in_tag := True - p1 := i - p2 := a_text.index_of ('>', i + 1) - if p2 = 0 then - -- next '<' - i := a_text.index_of ('<', i + 1) - if i > 0 then - l_new.append (a_text.substring (p1, i - 1)) - end - else - if is_authorized (a_text.substring (p1, p2)) then - l_new.append (a_text.substring (p1, p2)) - i := a_text.index_of ('<', p2 + 1) - else - i := a_text.index_of ('<', p2 + 1) - end - if i = 0 then - p1 := p2 + 1 - else - l_new.append (a_text.substring (p2 + 1, i - 1)) - end - end - else - i := i + 1 - end - end - l_new.append (a_text.substring (p1, n)) - a_text.wipe_out - a_text.append (l_new) - end - - is_authorized (s: READABLE_STRING_8): BOOLEAN - -- Is `s' authorized? - --| `s' has either "<....>" or "<..../>" or "" - local - l_tagname: detachable STRING - i,n,p1: INTEGER - do --- create l_tagname.make_empty - from - i := 2 -- skip first '<' - n := s.count - until - i > n or l_tagname /= Void - loop - if p1 > 0 then - if s[i].is_space or s[i] = '/' or s[i] = '>' then - l_tagname := s.substring (p1, i - 1) - end - else - if s[i].is_space or s[i] = '/' then - else - p1 := i - end - end - i := i + 1 - end - if l_tagname /= Void then - l_tagname.to_lower - Result := across allowed_html_tags as c some c.item.same_string (l_tagname) end - else - Result := True - end - end - - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_html_to_text_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_html_to_text_filter.e deleted file mode 100644 index ebc81bcd..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_html_to_text_filter.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description: "Summary description for {CMS_HTML_TO_TEXT_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_TO_TEXT_FILTER - -inherit - CMS_FILTER - -feature -- Access - - name: STRING_8 = "html_to_text" - - title: STRING_8 = "HTML to text" - - description: STRING_8 = "Replaces HTML tags and entities with plain text formatting, moving links at the end. This filter is just for text messages and it isn't safe for rendering content on a web page." - -feature -- Conversion - - filter (a_text: STRING_8) - local - enc: HTML_ENCODER - s: STRING_8 - do - create enc - s := enc.encoded_string (a_text) - a_text.wipe_out - a_text.append (s) - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_line_break_converter_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_line_break_converter_filter.e deleted file mode 100644 index 995cd267..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_line_break_converter_filter.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description: "Summary description for {CMS_HTML_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_LINE_BREAK_CONVERTER_FILTER - -inherit - CMS_FILTER - redefine - help - end - -feature -- Access - - name: STRING_8 = "line_break_converter" - - title: STRING_8 = "Line break converter" - - help: STRING = "Lines and paragraphs break automatically" - - description: STRING_8 = "Converts line breaks into HTML (i.e. <br> and <p> tags)." - -feature -- Conversion - - filter (a_text: STRING_8) - do - a_text.replace_substring_all ("%N", "
    %N") - -- FIXME jfiat [2012/09/12] :also use

    ... - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_no_html_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_no_html_filter.e deleted file mode 100644 index 8092bce2..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_no_html_filter.e +++ /dev/null @@ -1,77 +0,0 @@ -note - description: "Summary description for {CMS_NO_HTML_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_NO_HTML_FILTER - -inherit - CMS_FILTER - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - end - -feature -- Access - - name: STRING_8 = "no_html_filter" - - title: STRING_8 = "No HTML filter" - - description: STRING_8 = "HTML tags removed! " - -feature -- Conversion - - filter (a_text: STRING_8) - local - l_new: STRING_8 - i: INTEGER - n: INTEGER - in_tag: BOOLEAN - p1, p2: INTEGER - do - create l_new.make (a_text.count) - from - p1 := 1 - i := a_text.index_of ('<', 1) - if i > 0 then - l_new.append (a_text.substring (1, i - 1)) - end - n := a_text.count - until - i = 0 or i > n - loop - if a_text[i] = '<' then - in_tag := True - p1 := i - p2 := a_text.index_of ('>', i + 1) - if p2 = 0 then - -- next '<' - i := a_text.index_of ('<', i + 1) - if i > 0 then - l_new.append (a_text.substring (p1, i - 1)) - end - else - i := a_text.index_of ('<', p2 + 1) - if i > 0 then - l_new.append (a_text.substring (p2 + 1, i - 1)) - end - end - else - i := i + 1 - end - end - l_new.append (a_text.substring (p1, n)) - a_text.wipe_out - a_text.append (l_new) - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_url_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_url_filter.e deleted file mode 100644 index a53be807..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_url_filter.e +++ /dev/null @@ -1,33 +0,0 @@ -note - description: "Summary description for {CMS_URL_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_URL_FILTER - -inherit - CMS_FILTER - redefine - help - end - -feature -- Access - - name: STRING_8 = "url" - - title: STRING_8 = "URL filter" - - description: STRING_8 = "Turns web and e-mail addresses into clickable links." - - help: STRING = "Web page addresses and e-mail addresses turn into links automatically." - -feature -- Conversion - - filter (a_text: STRING_8) - do - --| FIXME jfiat [2012/09/12] : todo - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_external_link.e b/draft/application/cms/src/kernel/link/cms_external_link.e deleted file mode 100644 index 74e3ccee..00000000 --- a/draft/application/cms/src/kernel/link/cms_external_link.e +++ /dev/null @@ -1,38 +0,0 @@ -note - description: "Summary description for {CMS_EXTERNAL_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_EXTERNAL_LINK - -inherit - CMS_LINK - -create - make - -feature {NONE} -- Initialization - - make (a_title: like title; a_location: like location) - do - title := a_title - location := a_location - end - -feature -- Status report - - is_active: BOOLEAN = False - - is_expanded: BOOLEAN = False - - is_expandable: BOOLEAN = False - - has_children: BOOLEAN = False - - children: detachable LIST [CMS_LINK] - do - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_link.e b/draft/application/cms/src/kernel/link/cms_link.e deleted file mode 100644 index 66deadfe..00000000 --- a/draft/application/cms/src/kernel/link/cms_link.e +++ /dev/null @@ -1,71 +0,0 @@ -note - description: "Summary description for {CMS_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_LINK - -inherit - REFACTORING_HELPER - - DEBUG_OUTPUT - - ITERABLE [CMS_LINK] - -feature -- Access - - title: READABLE_STRING_32 - - location: READABLE_STRING_8 - - options: detachable CMS_API_OPTIONS - -feature -- status report - - is_active: BOOLEAN - deferred - end - - is_expanded: BOOLEAN - deferred - end - - is_expandable: BOOLEAN - deferred - end - - has_children: BOOLEAN - deferred - end - -feature -- Query - - parent: detachable CMS_LINK - - children: detachable LIST [CMS_LINK] - deferred - end - -feature -- Access - - new_cursor: ITERATION_CURSOR [CMS_LINK] - -- Fresh cursor associated with current structure - do - if attached children as lst then - Result := lst.new_cursor - else - Result := (create {ARRAYED_LIST [CMS_LINK]}.make (0)).new_cursor - end - end - -feature -- Status report - - debug_output: STRING - -- String that should be displayed in debugger to represent `Current'. - do - Result := title.as_string_8 + " -> " + location - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_link_composite.e b/draft/application/cms/src/kernel/link/cms_link_composite.e deleted file mode 100644 index 3a9c7dac..00000000 --- a/draft/application/cms/src/kernel/link/cms_link_composite.e +++ /dev/null @@ -1,27 +0,0 @@ -note - description: "Summary description for {CMS_LINK_COMPOSITE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_LINK_COMPOSITE - -inherit - ITERABLE [CMS_LINK] - -feature -- Access - - items: detachable LIST [CMS_LINK] - deferred - end - - extend (lnk: CMS_LINK) - deferred - end - - remove (lnk: CMS_LINK) - deferred - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_local_link.e b/draft/application/cms/src/kernel/link/cms_local_link.e deleted file mode 100644 index e5652880..00000000 --- a/draft/application/cms/src/kernel/link/cms_local_link.e +++ /dev/null @@ -1,129 +0,0 @@ -note - description: "Summary description for {CMS_LOCAL_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_LOCAL_LINK - -inherit - CMS_LINK - - CMS_LINK_COMPOSITE - rename - items as children, - extend as add_link, - remove as remove_link - end - -create - make - -feature {NONE} -- Initialization - - make (a_title: detachable like title; a_location: like location) - do - if a_title /= Void then - title := a_title - else - title := a_location - end - location := a_location - end - -feature -- Status report - - is_active: BOOLEAN - - is_expanded: BOOLEAN - do - Result := is_expandable and then internal_is_expanded - end - - is_expandable: BOOLEAN - do - Result := internal_is_expandable or internal_is_expanded or has_children - end - - has_children: BOOLEAN - do - Result := attached children as l_children and then not l_children.is_empty - end - - permission_arguments: detachable ITERABLE [READABLE_STRING_8] - - children: detachable LIST [CMS_LINK] - - internal_is_expandable: BOOLEAN - - internal_is_expanded: BOOLEAN - -feature -- Element change - - add_link (lnk: CMS_LINK) - local - lst: like children - do - lst := children - if lst = Void then - create {ARRAYED_LIST [CMS_LINK]} lst.make (1) - children := lst - end - lst.force (lnk) - end - - remove_link (lnk: CMS_LINK) - local - lst: like children - do - lst := children - if lst /= Void then - lst.prune_all (lnk) - if lst.is_empty then - children := Void - end - end - end - - set_children (lst: like children) - do - children := lst - end - - set_expanded (b: like is_expanded) - do - internal_is_expanded := b - end - - set_expandable (b: like is_expandable) - do - internal_is_expandable := b - end - - get_is_active (req: WSF_REQUEST) - local - qs: STRING - do - create qs.make_from_string (req.path_info) - is_active := qs.same_string (location) - if not is_active then - if attached req.query_string as l_query_string and then not l_query_string.is_empty then - qs.append_character ('?') - qs.append (l_query_string) - end - is_active := qs.same_string (location) - end - end - - set_permission_arguments (args: like permission_arguments) - do - permission_arguments := args - end - - set_options (opts: like options) - do - options := opts - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_menu.e b/draft/application/cms/src/kernel/link/cms_menu.e deleted file mode 100644 index e766027c..00000000 --- a/draft/application/cms/src/kernel/link/cms_menu.e +++ /dev/null @@ -1,73 +0,0 @@ -note - description: "Summary description for {CMS_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MENU - -inherit - CMS_LINK_COMPOSITE - -create - make, - make_with_title - -feature {NONE} -- Initialization - - make (a_name: like name; n: INTEGER) - do - name := a_name - create items.make (n) - end - - make_with_title (a_name: like name; a_title: READABLE_STRING_32; n: INTEGER) - do - make (a_name, n) - set_title (a_title) - end - -feature -- Access - - name: READABLE_STRING_8 - - title: detachable READABLE_STRING_32 - - items: ARRAYED_LIST [CMS_LINK] - - extend (lnk: CMS_LINK) - do - items.extend (lnk) - end - - remove (lnk: CMS_LINK) - do - items.prune_all (lnk) - end - -feature -- status report - - is_empty: BOOLEAN - do - Result := items.is_empty - end - -feature -- Element change - - set_title (t: like title) - do - title := t - end - -feature -- Access - - new_cursor: ITERATION_CURSOR [CMS_LINK] - -- Fresh cursor associated with current structure - do - Result := items.new_cursor - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/link/cms_menu_system.e b/draft/application/cms/src/kernel/link/cms_menu_system.e deleted file mode 100644 index 095c70a6..00000000 --- a/draft/application/cms/src/kernel/link/cms_menu_system.e +++ /dev/null @@ -1,88 +0,0 @@ -note - description: "Summary description for {CMS_MENU_SYSTEM}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MENU_SYSTEM - -inherit - ITERABLE [CMS_MENU] - -create - make - -feature {NONE} -- Initialization - - make - do - create items.make (5) - force (create {CMS_MENU}.make ("main-menu", 3)) - force (create {CMS_MENU}.make_with_title ("management", "Management", 3)) - force (create {CMS_MENU}.make_with_title ("navigation", "Navigation", 3)) - force (create {CMS_MENU}.make_with_title ("user", "User", 3)) - end - -feature -- Access - - item (n: like {CMS_MENU}.name): CMS_MENU - local - m: detachable CMS_MENU - do - m := items.item (n) - if m = Void then - create m.make (n, 3) - force (m) - end - Result := m - end - - main_menu: CMS_MENU - do - Result := item ("main-menu") - end - - management_menu: CMS_MENU - do - Result := item ("management") - end - - navigation_menu: CMS_MENU - do - Result := item ("navigation") - end - - user_menu: CMS_MENU - do - Result := item ("user") - end - - primary_tabs: CMS_MENU - do - Result := item ("primary-tabs") - end - -feature -- Change - - force (m: CMS_MENU) - do - items.force (m, m.name) - end - -feature -- Access - - new_cursor: ITERATION_CURSOR [CMS_MENU] - -- Fresh cursor associated with current structure - do - Result := items.new_cursor - end - -feature {NONE} -- Implementation - - items: HASH_TABLE [CMS_MENU, like {CMS_MENU}.name] --- items: ARRAYED_LIST [CMS_MENU] - -invariant - -end diff --git a/draft/application/cms/src/kernel/link/cms_pager.e b/draft/application/cms/src/kernel/link/cms_pager.e deleted file mode 100644 index 7cafd9a0..00000000 --- a/draft/application/cms/src/kernel/link/cms_pager.e +++ /dev/null @@ -1,17 +0,0 @@ -note - description: "Summary description for {CMS_PAGER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PAGER - -inherit - WSF_WIDGET_PAGER - -create - make - - -end diff --git a/draft/application/cms/src/kernel/log/cms_log.e b/draft/application/cms/src/kernel/log/cms_log.e deleted file mode 100644 index d5b02f43..00000000 --- a/draft/application/cms/src/kernel/log/cms_log.e +++ /dev/null @@ -1,152 +0,0 @@ -note - description: "Summary description for {CMS_LOG}." - date: "$Date$" - revision: "$Revision$" - -class - CMS_LOG - -create - make - -feature {NONE} -- Initialization - - make (a_category: like category; a_message: like message; a_level: like level; a_date: detachable like date) - do - category := a_category - message := a_message - set_level (a_level) - if a_date = Void then - create date.make_now_utc - else - date := a_date - end - end - - make_with_id (a_id: like id; a_category: like category; a_message: like message; a_level: like level; a_date: detachable like date) - do - id := a_id - make (a_category, a_message, a_level, a_date) - end - -feature -- Access - - id: INTEGER - -- Unique identifier of Current. - - category: READABLE_STRING_8 - -- Associated title (optional). - - message: READABLE_STRING_8 - -- Log message - - level: INTEGER - -- Severity level - - level_name: STRING - do - Result := level_to_string (level) - end - - info: detachable READABLE_STRING_8 - - link: detachable CMS_LINK - - date: DATE_TIME - -feature -- status report - - has_id: BOOLEAN - do - Result := id > 0 - end - -feature -- Change - - set_id (a_id: like id) - require - not has_id - do - id := a_id - end - - set_level (a_level: like level) - do - if a_level = 0 then - level := level_notice - else - level := a_level - end - end - - set_link (lnk: like link) - do - link := lnk - end - - set_info (inf: like info) - do - info := inf - end - -feature -- Conversion - - to_html (a_theme: WSF_THEME): STRING_8 - do - Result := "

    " - Result.append ("
    ") - Result.append (message) - if attached info as l_info then - Result.append ("
    Information: ") - Result.append (l_info) - end - if attached link as lnk then - Result.append ("
    Associated link: ") - Result.append (a_theme.link (lnk.title, lnk.location, lnk.options)) - end - Result.append ("
    ") - Result.append ("
    ") - Result.append ("(date: " + date.year.out + "/" + date.month.out + "/" + date.day.out + ")") - Result.append ("
    ") - - Result.append ("
    ") - end - -feature -- Constants - - level_to_string (a_level: INTEGER): STRING - do - inspect a_level - when level_emergency then - Result := "emergency" - when level_alert then - Result := "alert" - when level_critical then - Result := "critical" - when level_error then - Result := "error" - when level_warning then - Result := "warning" - when level_notice then - Result := "notice" - when level_info then - Result := "info" - when level_debug then - Result := "debug" - else - Result := "level-" + a_level.out - end - end - - level_emergency: INTEGER = 1 - level_alert: INTEGER = 2 - level_critical: INTEGER = 3 - level_error: INTEGER = 4 - level_warning: INTEGER = 5 - level_notice: INTEGER = 6 - level_info: INTEGER = 7 - level_debug: INTEGER = 8 - - - -end diff --git a/draft/application/cms/src/modules/admin/admin_blocks_cms_execution.e b/draft/application/cms/src/modules/admin/admin_blocks_cms_execution.e deleted file mode 100644 index 27ccfdd7..00000000 --- a/draft/application/cms/src/modules/admin/admin_blocks_cms_execution.e +++ /dev/null @@ -1,57 +0,0 @@ -note - description: "Summary description for {ADMIN_BLOCKS_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_BLOCKS_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Blocks") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate blocks") then - b.append ("
      ") - across - blocks as c - loop - if attached c.item as b_info then - if b_info.block.is_enabled then - b.append ("
    • ") - else - b.append ("
    • ") - end - b.append ("" + b_info.name + " (region=" + b_info.region + ")") - if b_info.block.is_enabled then - b.append (" [disable]") - else - b.append (" [enable]") - end - if attached b_info.block.title as l_title then - b.append ("
      title=" + l_title + "
      ") - end - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_cms_execution.e b/draft/application/cms/src/modules/admin/admin_cms_execution.e deleted file mode 100644 index 30816c59..00000000 --- a/draft/application/cms/src/modules/admin/admin_cms_execution.e +++ /dev/null @@ -1,46 +0,0 @@ -note - description: "Summary description for {CMS_ADMIN_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Administration") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate modules") then - b.append ("
  • " + link ("Modules", "/admin/modules/", Void) + "
  • ") - end - if has_permission ("administrate blocks") then - b.append ("
  • " + link ("Blocks", "/admin/blocks/", Void) + "
  • ") - end - if has_permission ("administrate user-roles") then - b.append ("
  • " + link ("User roles", "/admin/roles/", Void) + "
  • ") - end - if has_permission ("administrate users") then - b.append ("
  • " + link ("Users", "/admin/users/", Void) + "
  • ") - end - if has_permission ("administrate logs") then - b.append ("
  • " + link ("Logs", "/admin/logs/", Void) + "
  • ") - end - - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_logs_cms_execution.e b/draft/application/cms/src/modules/admin/admin_logs_cms_execution.e deleted file mode 100644 index 1df94bd2..00000000 --- a/draft/application/cms/src/modules/admin/admin_logs_cms_execution.e +++ /dev/null @@ -1,47 +0,0 @@ -note - description: "Summary description for {ADMIN_LOGS_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_LOGS_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Logs") - -- check Permission !!! - create b.make_empty - if has_permission ("admin logs") then - b.append ("
      ") - across - storage.recent_logs (1, 25) as c - loop - if attached c.item as l_log then - b.append ("
    • ") - b.append (link ("[" + l_log.id.out + "]", "/admin/log/" + l_log.id.out, Void)) - b.append (" " + l_log.category + " (level=" + l_log.level_name + ")") - b.append (": " + truncated_string (l_log.message, 60, "...")) - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_module.e b/draft/application/cms/src/modules/admin/admin_module.e deleted file mode 100644 index 4eed1758..00000000 --- a/draft/application/cms/src/modules/admin/admin_module.e +++ /dev/null @@ -1,112 +0,0 @@ -note - description: "Summary description for {ADMIN_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "admin" - version := "1.0" - description := "Set of service to administrate the site" - package := "core" - - enable - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - service := a_service - a_service.map_uri ("/admin/", agent handle_admin (a_service, ?, ?)) - a_service.map_uri ("/admin/users/", agent handle_admin_users (a_service, ?, ?)) - a_service.map_uri ("/admin/roles/", agent handle_admin_user_roles (a_service, ?, ?)) - a_service.map_uri ("/admin/blocks/", agent handle_admin_blocks (a_service, ?, ?)) - a_service.map_uri ("/admin/modules/", agent handle_admin_modules (a_service, ?, ?)) - a_service.map_uri ("/admin/logs/", agent handle_admin_logs (a_service, ?, ?)) - a_service.map_uri_template ("/admin/log/{log-id}", agent handle_admin_log_view (a_service, ?, ?)) - - a_service.add_menu_alter_hook (Current) - end - -feature -- Hooks - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - do - create lnk.make ("Administer", "/admin/") - lnk.set_permission_arguments (<<"administer">>) - a_menu_system.management_menu.extend (lnk) - end - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - Result.extend ("administer") - Result.extend ("administer users") - Result.extend ("administer user roles") - Result.extend ("administer content") - Result.extend ("administer logs") - Result.extend ("administer blocks") - Result.extend ("administer modules") - end - -feature -- Handler - - handle_admin (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_users (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_USERS_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_user_roles (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_USER_ROLES_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_blocks (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_BLOCKS_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_modules (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_MODULES_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_logs (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_LOGS_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_log_view (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {LOG_VIEW_CMS_EXECUTION}.make (req, res, cms)).execute - end - - -end diff --git a/draft/application/cms/src/modules/admin/admin_modules_cms_execution.e b/draft/application/cms/src/modules/admin/admin_modules_cms_execution.e deleted file mode 100644 index c674b553..00000000 --- a/draft/application/cms/src/modules/admin/admin_modules_cms_execution.e +++ /dev/null @@ -1,57 +0,0 @@ -note - description: "Summary description for {ADMIN_MODULES_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_MODULES_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Modules") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate modules") then - b.append ("
      ") - across - service.modules as m - loop - if attached m.item as mod then - if mod.is_enabled then - b.append ("
    • ") - else - b.append ("
    • ") - end - b.append ("" + mod.name + " (version:" + mod.version + ")") - b.append (" package=" + mod.package) - if mod.is_enabled then - b.append (" [disable]") - else - b.append (" [enable]") - end - b.append ("
      " + mod.description + "
      ") - - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_user_roles_cms_execution.e b/draft/application/cms/src/modules/admin/admin_user_roles_cms_execution.e deleted file mode 100644 index 5fe6fb6b..00000000 --- a/draft/application/cms/src/modules/admin/admin_user_roles_cms_execution.e +++ /dev/null @@ -1,211 +0,0 @@ -note - description: "Summary description for {ADMIN_USER_ROLES_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_USER_ROLES_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - do - if request.is_post_request_method then - process_post - else - process_get - end - end - - process_get - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - l_roles: LIST [CMS_USER_ROLE] - do - set_title ("User roles") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate user roles") then - l_roles := service.storage.user_roles - f := new_edit_form (url (request.path_info, Void), l_roles, True) - f.append_to_html (theme, b) - else - b.append ("
    Access denied
    ") - end - set_main_content (b) - end - - process_post - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - l_roles: LIST [CMS_USER_ROLE] - do - set_title ("User roles") - create b.make_empty - - debug ("cms") - across - request.form_parameters as c - loop - b.append ("
  • ") - b.append (html_encoded (c.item.name)) - b.append ("=") - b.append (html_encoded (c.item.string_representation)) - b.append ("
  • ") - end - end - - if has_permission ("administer user roles") then - l_roles := service.storage.user_roles - f := new_edit_form (url (request.path_info, Void), l_roles, False) - f.submit_actions.extend (agent edit_form_submit (?, l_roles)) - f.process (Current) - f.append_to_html (theme, b) - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -feature -- Forms - - edit_form_submit (fd: WSF_FORM_DATA; a_roles: LIST [CMS_USER_ROLE]) - local - l_role: CMS_USER_ROLE - do - if fd.item_same_string ("op", "Apply") then - across - a_roles as r - loop - if attached fd.table_item (r.item.name) as perms then - r.item.permissions.wipe_out - across - perms as c - loop - if attached {WSF_STRING} c.item as s then - r.item.add_permission (s.value) - end - end - service.storage.save_user_role (r.item) - end - end - elseif fd.item_same_string ("op", "Add role") then - if attached fd.string_item ("new-role") as l_new_role then - create l_role.make (l_new_role) - service.storage.save_user_role (l_role) - set_redirection (url (request.path_info, Void)) - end - elseif fd.item_same_string ("op", "Add permission") then - if attached fd.string_item ("new-permission") as l_new_permission then - l_role := service.storage.authenticated_user_role - l_role.add_permission (l_new_permission) - service.storage.save_user_role (l_role) - set_redirection (url (request.path_info, Void)) - end - end - end - - new_edit_form (a_action: READABLE_STRING_8; a_roles: LIST [CMS_USER_ROLE]; a_use_data: BOOLEAN): CMS_FORM - local - perms: ARRAYED_SET [READABLE_STRING_8] - tb: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8] - i: INTEGER - tf: WSF_FORM_TEXT_INPUT - do - create perms.make (10) - perms.compare_objects - across - service.modules as m - loop - across - m.item.permissions (service) as p - loop - perms.extend (p.item.name) - end - end - across - a_roles as c - loop - across - c.item.permissions as p - loop - perms.extend (p.item) - end - end - - create tb.make - tb.set_column_count (1 + a_roles.count) - i := 1 - tb.column (i).set_title ("Permissions") - across - a_roles as r - loop - i := i + 1 - tb.column (i).set_title (r.item.name) - end - - tb.add_css_style ("border: solid 1px #999;") - tb.set_data (perms) - tb.set_compute_item_function (agent (p: READABLE_STRING_8; ia_roles: LIST [CMS_USER_ROLE]; ia_use_data: BOOLEAN): WSF_WIDGET_TABLE_ROW - local - it: WSF_WIDGET_TABLE_ITEM - cb: WSF_FORM_CHECKBOX_INPUT - do - create Result.make (1 + ia_roles.count) - create it.make_with_text (p) - Result.set_item (it, 1) - across - ia_roles as r - loop - create cb.make (r.item.name + "[" + p + "]") - cb.set_text_value (p) - - if ia_use_data then - if r.item.has_permission (p) then - cb.set_checked (True) - else - cb.set_checked (False) - end - end - create it.make_with_content (cb) - Result.add_item (it) - end - end(?, a_roles, a_use_data) - ) - - create Result.make (a_action, "edit-user-roles") - Result.set_method_post - Result.extend (tb.to_computed_table) - Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Apply")) - - create tf.make ("new-role") - tf.add_css_class ("horizontal") - tf.set_size (24) - tf.set_label ("New user role") - Result.extend (tf) - Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add role")) - - create tf.make ("new-permission") - tf.add_css_class ("horizontal") - tf.set_size (24) - tf.set_label ("New permission") - Result.extend (tf) - Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add permission")) - - - - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_users_cms_execution.e b/draft/application/cms/src/modules/admin/admin_users_cms_execution.e deleted file mode 100644 index e785bdbd..00000000 --- a/draft/application/cms/src/modules/admin/admin_users_cms_execution.e +++ /dev/null @@ -1,56 +0,0 @@ -note - description: "Summary description for {ADMIN_USERS_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_USERS_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Users") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate users") then - - b.append ("
      ") - across - service.storage.all_users as c - loop - if attached c.item as u then - b.append ("
    • ") - b.append ("" + user_link (u) + " (id=" + u.id.out + ")") - if attached u.email as l_email then - b.append (" ["+ l_email +"]") - end - if attached u.creation_date as dt then - b.append (" - created: " + dt.out) - end - if attached u.last_login_date as dt then - b.append (" - last signed: " + dt.out) - end - - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/log_view_cms_execution.e b/draft/application/cms/src/modules/admin/log_view_cms_execution.e deleted file mode 100644 index a9fe8718..00000000 --- a/draft/application/cms/src/modules/admin/log_view_cms_execution.e +++ /dev/null @@ -1,39 +0,0 @@ -note - description: "Summary description for {LOG_VIEW_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - LOG_VIEW_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - if attached {WSF_STRING} request.path_parameter ("log-id") as p_id and then p_id.is_integer then - create b.make_empty - - if attached storage.log (p_id.integer_value) as l_log then - set_title ("Log #" + l_log.id.out) - b.append (l_log.to_html (theme)) - else - set_title ("Log [" + p_id.value + "] does not exists!") - end - set_main_content (b) - else - set_redirection ("/admin/logs") - set_main_content ("not found") - end - end - -end diff --git a/draft/application/cms/src/modules/cms_module.e b/draft/application/cms/src/modules/cms_module.e deleted file mode 100644 index e188c9bf..00000000 --- a/draft/application/cms/src/modules/cms_module.e +++ /dev/null @@ -1,58 +0,0 @@ -note - description: "Summary description for {WSF_CMS_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_MODULE - -feature -- Access - - is_enabled: BOOLEAN - - name: STRING - - description: STRING - - package: STRING - - version: STRING - -feature {CMS_SERVICE} -- Registration - - register (a_service: CMS_SERVICE) - deferred - end - -feature -- Settings - - enable - do - is_enabled := True - end - - disable - do - is_enabled := False - end - -feature -- Hooks - - help_text (a_path: STRING): STRING - do - create Result.make_empty - end - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - create {ARRAYED_SET [CMS_PERMISSION]} Result.make (0) - end - - links: HASH_TABLE [CMS_MODULE_LINK, STRING] - -- Link indexed by path - do - create Result.make (0) - end - -end diff --git a/draft/application/cms/src/modules/cms_module_link.e b/draft/application/cms/src/modules/cms_module_link.e deleted file mode 100644 index 490db5a7..00000000 --- a/draft/application/cms/src/modules/cms_module_link.e +++ /dev/null @@ -1,50 +0,0 @@ -note - description: "Summary description for {CMS_MODULE_LINK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MODULE_LINK - -create - make - -feature {NONE} -- Initialization - - make (a_title: like title) - do - title := a_title - end - -feature -- Access - - title: STRING_32 - - description: detachable STRING_32 - - callback: detachable PROCEDURE [ANY, TUPLE [cms: detachable CMS_EXECUTION; args: detachable ITERABLE [STRING]]] - callback_arguments: detachable ITERABLE [STRING] - - permission: detachable LIST [STRING] - - parent: detachable CMS_MODULE_LINK - -feature -- Element change - - set_callback (cb: like callback; args: like callback_arguments) - do - callback := cb - callback_arguments := args - end - -feature -- Execution - - execute - do - if attached callback as cb then - cb.call ([Void, callback_arguments]) - end - end - -end diff --git a/draft/application/cms/src/modules/cms_permission.e b/draft/application/cms/src/modules/cms_permission.e deleted file mode 100644 index c0e23cff..00000000 --- a/draft/application/cms/src/modules/cms_permission.e +++ /dev/null @@ -1,36 +0,0 @@ -note - description: "Summary description for {CMS_PERMISSION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PERMISSION - -create - make - -convert - make ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8}) - -feature {NONE} -- Initialization - - make (n: like name) - do - name := n - end - -feature -- Access - - name: READABLE_STRING_8 - - description: detachable READABLE_STRING_8 - -feature -- Change - - set_description (s: like description) - do - description := s - end - -end diff --git a/draft/application/cms/src/modules/debug/debug_module.e b/draft/application/cms/src/modules/debug/debug_module.e deleted file mode 100644 index 1c472116..00000000 --- a/draft/application/cms/src/modules/debug/debug_module.e +++ /dev/null @@ -1,123 +0,0 @@ -note - description: "Summary description for {DEBUG_MODULE}." - date: "$Date$" - revision: "$Revision$" - -class - DEBUG_MODULE - -inherit - CMS_MODULE - --- CMS_HOOK_BLOCK - - CMS_HOOK_AUTO_REGISTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "debug" - version := "1.0" - description := "Debug" - package := "cms" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - service := a_service - a_service.map_uri_template ("/debug/", agent handle_debug (a_service, ?, ?)) - end - -feature -- Hooks - --- block_list: ITERABLE [like {CMS_BLOCK}.name] --- do --- Result := <<"debug-info">> --- end - --- get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) --- local --- b: CMS_CONTENT_BLOCK --- do --- create b.make ("debug-info", "Debug", "... ", a_execution.formats.plain_text) --- a_execution.add_block (b, Void) --- end - -feature -- Handler - - handle_debug (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - local - e: CMS_EXECUTION - s: STRING - do - if req.is_get_request_method then - create {ANY_CMS_EXECUTION} e.make (req, res, cms) - e.set_title ("DEBUG") - - create s.make_empty - append_info_to ("Name", cms.site_name, e, s) - append_info_to ("Url", cms.site_url, e, s) - - if attached cms.configuration as cfg and then attached cfg.configuration_location as l_loc then - s.append ("
    ") - append_info_to ("Configuration file", l_loc, e, s) - end - - s.append ("
    ") - - append_info_to ("Current dir", (create {EXECUTION_ENVIRONMENT}).current_working_directory, e, s) - append_info_to ("Base url", cms.base_url, e, s) - append_info_to ("Script url", cms.script_url, e, s) - s.append ("
    ") - append_info_to ("Dir", cms.site_dir, e, s) - append_info_to ("Var dir", cms.site_var_dir, e, s) - s.append ("
    ") - append_info_to ("Theme", cms.theme_name, e, s) - append_info_to ("Theme location", cms.theme_resource_location, e, s) - s.append ("
    ") - append_info_to ("Files location", cms.files_location, e, s) - s.append ("
    ") - - append_info_to ("Url", e.url ("/", Void), e, s) - if attached e.user as u then - append_info_to ("User", u.name, e, s) - append_info_to ("User url", e.user_url (u), e, s) - - end - - e.set_main_content (s) - else - create {NOT_FOUND_CMS_EXECUTION} e.make (req, res, cms) - end - e.execute - end - - append_info_to (n: READABLE_STRING_8; v: detachable READABLE_STRING_GENERAL; e: CMS_EXECUTION; t: STRING) - do - t.append ("
  • ") - t.append ("" + n + ": ") - if v /= Void then - t.append (e.html_encoded (v)) - end - t.append ("
  • ") - end - -note - copyright: "Copyright (c) 1984-2013, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/draft/application/cms/src/modules/node/cms_page.e b/draft/application/cms/src/modules/node/cms_page.e deleted file mode 100644 index 79cb4033..00000000 --- a/draft/application/cms/src/modules/node/cms_page.e +++ /dev/null @@ -1,75 +0,0 @@ -note - description: "Summary description for {CMS_PAGE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PAGE - -inherit - CMS_NODE - -create - make_new, - make - -feature {NONE} -- Initialization - - make (a_id: like id; a_title: like title; dt: like creation_date) - require - a_id > 0 - do - set_id (a_id) - creation_date := dt - modification_date := dt - title := a_title - initialize - end - - make_new (a_title: like title) - do - title := a_title - create creation_date.make_now_utc - modification_date := creation_date - initialize - end - - initialize - do - format := formats.default_format - end - -feature -- Access - - title: detachable READABLE_STRING_32 - - body: detachable READABLE_STRING_8 - - format: CMS_FORMAT - - content_type_name: STRING = "page" - -feature -- Change - - set_title (a_title: like title) - -- Set `title' to `a_title' - do - title := a_title - end - - set_body (a_body: like body; a_format: like format) - -- Set `body' and associated `format' - do - body := a_body - format := a_format - end - -feature -- Conversion - --- to_html (a_theme: CMS_THEME): STRING_8 --- do --- Result := Precursor (a_theme) --- end - -end diff --git a/draft/application/cms/src/modules/node/cms_page_content_type.e b/draft/application/cms/src/modules/node/cms_page_content_type.e deleted file mode 100644 index 948d8e4d..00000000 --- a/draft/application/cms/src/modules/node/cms_page_content_type.e +++ /dev/null @@ -1,176 +0,0 @@ -note - description: "Summary description for {CMS_PAGE_CONTENT_TYPE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PAGE_CONTENT_TYPE - -inherit - CMS_CONTENT_TYPE - -create - make - -feature {NONE} -- Initialization - - make - do - create {ARRAYED_LIST [like available_formats.item]} available_formats.make (1) - available_formats.extend (formats.plain_text) - available_formats.extend (formats.filtered_html) - available_formats.extend (formats.full_html) - end - -feature -- Access - - name: STRING = "page" - - title: STRING = "basic page" - - description: detachable READABLE_STRING_8 - -- Optional description - do - Result := "Use basic pages for your static content, such as an 'About us' page." - end - - available_formats: LIST [CMS_FORMAT] - -feature -- Factory - - fill_edit_form (f: CMS_FORM; a_node: detachable CMS_NODE) - local - ti: WSF_FORM_TEXT_INPUT - fset: WSF_FORM_FIELD_SET - ta: WSF_FORM_TEXTAREA - tselect: WSF_FORM_SELECT - opt: WSF_FORM_SELECT_OPTION - do - create ti.make ("title") - ti.set_label ("Title") - ti.set_size (70) - if a_node /= Void then - ti.set_text_value (a_node.title) - end - ti.set_is_required (True) - f.extend (ti) - - f.extend_text ("
    ") - - create ta.make ("body") - ta.set_rows (10) - ta.set_cols (70) - if a_node /= Void then - ta.set_text_value (a_node.body) - end --- ta.set_label ("Body") - ta.set_description ("This is the main content") - ta.set_is_required (False) - - create fset.make - fset.set_legend ("Body") - fset.extend (ta) - - fset.extend_text ("
    ") - - create tselect.make ("format") - tselect.set_label ("Body's format") - tselect.set_is_required (True) - across - available_formats as c - loop - create opt.make (c.item.name, c.item.title) - if attached c.item.help as f_help then - opt.set_description ("
      " + f_help + "
    ") - end - tselect.add_option (opt) - end - if a_node /= Void then - tselect.set_text_by_value (a_node.format.name) - end - - fset.extend (tselect) - - f.extend (fset) - - end - - change_node (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA; a_node: like new_node) - local - b: detachable READABLE_STRING_8 - f: detachable CMS_FORMAT - do - if attached fd.integer_item ("id") as l_id and then l_id > 0 then - check a_node.id = l_id end - end - if attached fd.string_item ("title") as l_title then - a_node.set_title (l_title) - end - - if attached fd.string_item ("body") as l_body then - b := l_body - end - if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then - f := f_format - elseif a_node /= Void then - f := a_node.format - else - f := formats.default_format - end - if b /= Void then - a_node.set_body (b, f) - end - end - - new_node (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA; a_node: detachable like new_node): CMS_PAGE - -- - local - b: detachable READABLE_STRING_8 - f: detachable CMS_FORMAT - l_node: detachable like new_node - do - l_node := a_node - if attached fd.integer_item ("id") as l_id and then l_id > 0 then - if l_node /= Void then - check l_node.id = l_id end - else - if attached {like new_node} a_execution.service.storage.node (l_id) as n then - l_node := n - else - -- FIXME: Error - end - end - end - if attached fd.string_item ("title") as l_title then - if l_node = Void then - create l_node.make_new (l_title) - else - l_node.set_title (l_title) - end - else - if l_node = Void then - create l_node.make_new ("...") - end - end - l_node.set_author (a_execution.user) - - if attached fd.string_item ("body") as l_body then - b := l_body - end - if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then - f := f_format - elseif a_node /= Void then - f := a_node.format - else - f := formats.default_format - end - if b /= Void then - l_node.set_body (b, f) - end - Result := l_node - end - -invariant - -end diff --git a/draft/application/cms/src/modules/node/node_add_cms_execution.e b/draft/application/cms/src/modules/node/node_add_cms_execution.e deleted file mode 100644 index 6b3357e3..00000000 --- a/draft/application/cms/src/modules/node/node_add_cms_execution.e +++ /dev/null @@ -1,61 +0,0 @@ -note - description: "[ - ]" - -class - NODE_ADD_CMS_EXECUTION - -inherit - NODE_CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: like edit_form - fd: detachable WSF_FORM_DATA - do - create b.make_empty - if attached non_empty_string_path_parameter ("type") as s_type then - if attached service.content_type (s_type) as l_type then - f := edit_form (Void, url (request.path_info, Void), "add-" + l_type.name, l_type) - set_title ("Create " + l_type.title) - if has_permission ("create " + l_type.name) then - if request.is_post_request_method then - f.validation_actions.extend (agent edit_form_validate (?, b)) - f.submit_actions.extend (agent edit_form_submit (?, Void, l_type, b)) - f.process (Current) - fd := f.last_data - end - f.append_to_html (theme, b) - else - set_title ("Access denied") - end - else - set_title ("Unknown content type [" + s_type + "]") - end - else - set_title ("Create new content ...") - b.append ("
      ") - across - service.content_types as c - loop - if has_permission ("create " + c.item.name) then - b.append ("
    • " + link (c.item.name, "/node/add/" + c.item.name, Void)) - if attached c.item.description as d then - b.append ("
      " + d + "
      ") - end - b.append ("
    • ") - end - end - b.append ("
    ") - end - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/node/node_cms_execution.e b/draft/application/cms/src/modules/node/node_cms_execution.e deleted file mode 100644 index 075649b9..00000000 --- a/draft/application/cms/src/modules/node/node_cms_execution.e +++ /dev/null @@ -1,141 +0,0 @@ -note - description: "Summary description for {NODE_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - NODE_CMS_EXECUTION - -inherit - CMS_EXECUTION - -feature -- Form - - edit_form_validate (fd: WSF_FORM_DATA; b: STRING) - local - l_preview: BOOLEAN - l_format: detachable CMS_FORMAT - do - l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") - if l_preview then - b.append ("Preview
    ") - if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then - l_format := f_format - end - if attached fd.string_item ("title") as l_title then - b.append ("Title:
    " + html_encoded (l_title) + "
    ") - end - if attached fd.string_item ("body") as l_body then - b.append ("Body:
    ") - if l_format /= Void then - b.append (l_format.to_html (l_body)) - else - b.append (html_encoded (l_body)) - end - b.append ("
    ") - end - b.append ("
    ") - end - end - - edit_form_submit (fd: WSF_FORM_DATA; a_node: detachable CMS_NODE; a_type: CMS_CONTENT_TYPE; b: STRING) - local - l_preview: BOOLEAN - l_node: detachable CMS_NODE - s: STRING - do - l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") - if not l_preview then - debug ("cms") - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - end - if a_node /= Void then - l_node := a_node - a_type.change_node (Current, fd, a_node) - s := "modified" - else - l_node := a_type.new_node (Current, fd, Void) - s := "created" - end - service.storage.save_node (l_node) - if attached user as u then - service.log ("node", "User %"" + user_link (u) + "%" " + s + " node " + link (a_type.name +" #" + l_node.id.out, "/node/" + l_node.id.out , Void), 0, node_local_link (l_node)) - else - service.log ("node", "Anonymous " + s + " node " + a_type.name +" #" + l_node.id.out, 0, node_local_link (l_node)) - end - add_success_message ("Node #" + l_node.id.out + " saved.") - set_redirection (node_url (l_node)) - end - end - --- edit_form_submit (fd: WSF_FORM_DATA; a_type: CMS_CONTENT_TYPE; b: STRING) --- local --- l_preview: BOOLEAN --- do --- l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") --- if not l_preview then --- debug ("cms") --- across --- fd as c --- loop --- b.append ("
  • " + html_encoded (c.key) + "=") --- if attached c.item as v then --- b.append (html_encoded (v.string_representation)) --- end --- b.append ("
  • ") --- end --- end --- if attached a_type.new_node (Current, fd, Void) as l_node then --- service.storage.save_node (l_node) --- if attached user as u then --- service.log ("node", "User %"" + user_link (u) + "%" created node " + link (a_type.name +" #" + l_node.id.out, "/node/" + l_node.id.out , Void), 0, node_local_link (l_node)) --- else --- service.log ("node", "Anonymous created node "+ a_type.name +" #" + l_node.id.out, 0, node_local_link (l_node)) --- end --- add_success_message ("Node #" + l_node.id.out + " saved.") --- set_redirection (node_url (l_node)) --- end --- end --- end - - edit_form (a_node: detachable CMS_NODE; a_url: READABLE_STRING_8; a_name: STRING; a_type: CMS_CONTENT_TYPE): CMS_FORM - local - f: CMS_FORM - ts: WSF_FORM_SUBMIT_INPUT - th: WSF_FORM_HIDDEN_INPUT - do - create f.make (a_url, a_name) - - create th.make ("node-id") - if a_node /= Void then - th.set_text_value (a_node.id.out) - else - th.set_text_value ("0") - end - f.extend (th) - - a_type.fill_edit_form (f, a_node) - - f.extend_text ("
    ") - - create ts.make ("op") - ts.set_default_value ("Save") - f.extend (ts) - - create ts.make ("op") - ts.set_default_value ("Preview") - f.extend (ts) - - Result := f - end - -end diff --git a/draft/application/cms/src/modules/node/node_edit_cms_execution.e b/draft/application/cms/src/modules/node/node_edit_cms_execution.e deleted file mode 100644 index ebe46173..00000000 --- a/draft/application/cms/src/modules/node/node_edit_cms_execution.e +++ /dev/null @@ -1,166 +0,0 @@ -note - description: "[ - ]" - -class - NODE_EDIT_CMS_EXECUTION - -inherit - NODE_CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: like edit_form - fd: detachable WSF_FORM_DATA - do - create b.make_empty - if - attached {WSF_STRING} request.path_parameter ("nid") as p_nid and then - p_nid.is_integer and then - attached service.storage.node (p_nid.integer_value) as l_node - then - if attached service.content_type (l_node.content_type_name) as l_type then - if has_permission ("edit " + l_type.name) then - f := edit_form (l_node, url (request.path_info, Void), "edit-" + l_type.name, l_type) - if request.is_post_request_method then - f.validation_actions.extend (agent edit_form_validate (?, b)) - f.submit_actions.extend (agent edit_form_submit (?, l_node, l_type, b)) - f.process (Current) - fd := f.last_data - end - - set_title ("Edit #" + l_node.id.out) - - add_to_menu (create {CMS_LOCAL_LINK}.make ("View", node_url (l_node)), primary_tabs) - add_to_menu (create {CMS_LOCAL_LINK}.make ("Edit", "/node/" + l_node.id.out + "/edit"), primary_tabs) - - f.append_to_html (theme, b) - else - b.append ("

    Access denied

    ") - end - else - set_title ("Unknown node") - end - else - set_title ("Create new content ...") - b.append ("
      ") - across - service.content_types as c - loop - if has_permission ("create " + c.item.name) then - b.append ("
    • " + link (c.item.name, "/node/add/" + c.item.name, Void)) - if attached c.item.description as d then - b.append ("
      " + d + "
      ") - end - b.append ("
    • ") - end - end - b.append ("
    ") - end - set_main_content (b) - end - --- edit_form_validate (fd: CMS_FORM_DATA; b: STRING) --- local --- l_preview: BOOLEAN --- l_format: detachable CMS_FORMAT --- do --- l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") --- if l_preview then --- b.append ("Preview
    ") --- if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then --- l_format := f_format --- end --- if attached fd.string_item ("title") as l_title then --- b.append ("Title:
    " + html_encoded (l_title) + "
    ") --- end --- if attached fd.string_item ("body") as l_body then --- b.append ("Body:
    ") --- if l_format /= Void then --- b.append (l_format.to_html (l_body)) --- else --- b.append (html_encoded (l_body)) --- end --- b.append ("
    ") --- end --- b.append ("
    ") --- end --- end - --- edit_form_submit (fd: CMS_FORM_DATA; a_node: detachable CMS_NODE; a_type: CMS_CONTENT_TYPE; b: STRING) --- local --- l_preview: BOOLEAN --- l_node: detachable CMS_NODE --- s: STRING --- do --- l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") --- if not l_preview then --- debug ("cms") --- across --- fd as c --- loop --- b.append ("
  • " + html_encoded (c.key) + "=") --- if attached c.item as v then --- b.append (html_encoded (v.string_representation)) --- end --- b.append ("
  • ") --- end --- end --- if a_node /= Void then --- l_node := a_node --- a_type.change_node (Current, fd, a_node) --- s := "modified" --- else --- l_node := a_type.new_node (Current, fd, Void) --- s := "created" --- end --- service.storage.save_node (l_node) --- if attached user as u then --- service.log ("node", "User %"" + user_link (u) + "%" " + s + " node " + link (a_type.name +" #" + l_node.id.out, "/node/" + l_node.id.out , Void), 0, node_local_link (l_node)) --- else --- service.log ("node", "Anonymous " + s + " node " + a_type.name +" #" + l_node.id.out, 0, node_local_link (l_node)) --- end --- add_success_message ("Node #" + l_node.id.out + " saved.") --- set_redirection (node_url (l_node)) --- end --- end - --- edit_form (a_node: detachable CMS_NODE; a_url: READABLE_STRING_8; a_name: STRING; a_type: CMS_CONTENT_TYPE): CMS_FORM --- local --- f: CMS_FORM --- ts: CMS_FORM_SUBMIT_INPUT --- th: CMS_FORM_HIDDEN_INPUT --- do --- create f.make (a_url, a_name) - --- create th.make ("node-id") --- if a_node /= Void then --- th.set_text_value (a_node.id.out) --- else --- th.set_text_value ("0") --- end --- f.extend (th) - --- a_type.fill_edit_form (f, a_node) - --- f.extend_text ("
    ") - --- create ts.make ("op") --- ts.set_default_value ("Save") --- f.extend (ts) - --- create ts.make ("op") --- ts.set_default_value ("Preview") --- f.extend (ts) - --- Result := f --- end - -end diff --git a/draft/application/cms/src/modules/node/node_module.e b/draft/application/cms/src/modules/node/node_module.e deleted file mode 100644 index 54155056..00000000 --- a/draft/application/cms/src/modules/node/node_module.e +++ /dev/null @@ -1,127 +0,0 @@ -note - description: "Summary description for {NODE_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - NODE_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_BLOCK - -create - make - -feature {NONE} -- Initialization - - make - do - name := "node" - version := "1.0" - description := "Service to manage content based on 'node'" - package := "core" - - enable - end - -feature -- Access - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - across - a_service.content_types as c - loop - Result.extend ("create " + c.item.name) - Result.extend ("edit " + c.item.name) - Result.extend ("delete " + c.item.name) - end - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - local - h: CMS_HANDLER - do - service := a_service - a_service.map_uri ("/node/add", agent handle_node_add (a_service, ?, ?)) - a_service.map_uri_template ("/node/add/{type}", agent handle_node_add (a_service, ?, ?)) - - create {CMS_HANDLER} h.make (agent handle_node_view (a_service, ?, ?)) - a_service.router.map (create {WSF_URI_TEMPLATE_MAPPING}.make ("/node/{nid}", h)) - a_service.router.map (create {WSF_URI_TEMPLATE_MAPPING}.make ("/node/{nid}/view", h)) - - a_service.map_uri_template ("/node/{nid}/edit", agent handle_node_edit (a_service, ?, ?)) - - a_service.add_content_type (create {CMS_PAGE_CONTENT_TYPE}.make) - - a_service.add_menu_alter_hook (Current) - a_service.add_block_hook (Current) - - end - -feature -- Hooks - - block_list: ITERABLE [like {CMS_BLOCK}.name] - do - Result := <<"node-info">> - end - - get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) --- local --- b: CMS_CONTENT_BLOCK - do --- if --- a_execution.is_front and then --- attached a_execution.user as u --- then --- create b.make ("node-info", "Node", "Node ...", a_execution.formats.plain_text) --- a_execution.add_block (b, Void) --- end - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - perms: detachable ARRAYED_LIST [READABLE_STRING_8] - do - if attached a_execution.service.content_types as lst then - create perms.make (lst.count) - across - lst as c - loop - perms.force ("create " + c.item.name) - end - end - create lnk.make ("Add content", "/node/add/") - lnk.set_permission_arguments (perms) - a_menu_system.navigation_menu.extend (lnk) - end - - handle_node_view (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {NODE_VIEW_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_node_edit (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {NODE_EDIT_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_node_add (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {NODE_ADD_CMS_EXECUTION}.make (req, res, cms)).execute - end - -end diff --git a/draft/application/cms/src/modules/node/node_view_cms_execution.e b/draft/application/cms/src/modules/node/node_view_cms_execution.e deleted file mode 100644 index 028c5480..00000000 --- a/draft/application/cms/src/modules/node/node_view_cms_execution.e +++ /dev/null @@ -1,41 +0,0 @@ -note - description: "[ - ]" - -class - NODE_VIEW_CMS_EXECUTION - -inherit - NODE_CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - if attached {WSF_STRING} request.path_parameter ("nid") as p_nid and then p_nid.is_integer then - create b.make_empty - - if attached storage.node (p_nid.integer_value) as l_node then - set_title ("Node [" + l_node.id.out + "]") - add_to_menu (create {CMS_LOCAL_LINK}.make ("View", node_url (l_node)), primary_tabs) - add_to_menu (create {CMS_LOCAL_LINK}.make ("Edit", "/node/" + l_node.id.out + "/edit"), primary_tabs) - - b.append (l_node.to_html (theme)) - else - set_title ("Node [" + p_nid.value + "] does not exists!") - end - set_main_content (b) - else - set_title ("Node ...") - create b.make_empty - set_main_content (b) - end - end - -end diff --git a/draft/application/cms/src/modules/openid/openid_cms_execution.e b/draft/application/cms/src/modules/openid/openid_cms_execution.e deleted file mode 100644 index 53bbdbf9..00000000 --- a/draft/application/cms/src/modules/openid/openid_cms_execution.e +++ /dev/null @@ -1,149 +0,0 @@ -note - description: "Summary description for {OPENID_CMS_EXECUTION}." - date: "$Date$" - revision: "$Revision$" - -class - OPENID_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - local - b: STRING - f: CMS_FORM - tf: WSF_FORM_TEXT_INPUT - ts: WSF_FORM_SUBMIT_INPUT - o: OPENID_CONSUMER - v: OPENID_CONSUMER_VALIDATION - tb: HASH_TABLE [READABLE_STRING_8, STRING_8] - l_uid: INTEGER - do - create b.make_empty - set_title ("OpenID identities") - if attached request.string_item ("openid.mode") as l_openid_mode then - -- Callback - create o.make (request.absolute_script_url ("/openid/login")) - o.ask_email (True) - o.ask_nickname (False) --- o.ask_all_info (False) - - create v.make_from_items (o, request.items_as_string_items) - v.validate - if v.is_valid then - if attached v.identity as l_identity then - if attached user as u then - if attached service.storage.custom_value (l_identity, "openid") as obj then - l_uid := user_id_from_custom_value (obj) - if l_uid > 0 and then l_uid = u.id then - -- Authenticated - b.append ("OpenID already associated to user %""+ user_link (u) +"%"") - else - -- Wrong USER !!! - b.append ("OpenID already associated to another user !!!") - end - else - -- New OpenID association - create tb.make (1) - tb.force (l_identity, "openid_identity") - tb.force (u.id.out, "uid") - service.storage.set_custom_value (l_identity, tb, "openid") - - b.append ("OpenID %""+ l_identity +"%" is now associated with user %""+ user_link (u) +"%"") - end - else - if - attached service.storage.custom_value (l_identity, "openid") as obj and then - attached user_id_from_custom_value (obj) as obj_uid and then - obj_uid > 0 and then - attached service.storage.user_by_id (obj_uid.to_integer) as u - then - -- Authenticated - set_user (u) - b.append ("Authenticated as %""+ user_link (u) +"%"") - set_redirection (user_url (u)) - else - -- Register new account - b.append ("Register new account associated with Openid %"" + l_identity + "%"?") - across - v.attributes as c - loop - b.append ("
  • " + c.key + "=" + c.item + "
  • ") - end - set_session_item ("openid.identity", l_identity) - if attached v.email_attribute as att_email then - set_session_item ("openid.email", att_email) - end - if attached v.nickname_attribute as att_nickname then - set_session_item ("openid.nickname", att_nickname) - end - b.append ("Create new account from your OpenID ") - b.append (link ("Register new account", "/user/register", Void)) - set_redirection (url ("/user/register", Void)) - end - end - end - else - b.append ("User authentication failed!!") - end - elseif attached request.string_item ("openid") as p_openid then - b.append ("Check openID: " + p_openid) - create o.make (request.absolute_script_url ("/openid/login")) - o.ask_email (True) - o.ask_all_info (False) - if attached o.auth_url (p_openid) as l_url then - set_redirection (l_url) - else - b.append ("Failure") - end - else - if attached user as u then - if attached service.storage.custom_value_names_where ("uid", u.id.out, "openid") as lst then - across - lst as c - loop - b.append ("
  • OpenID: " + c.item + "
  • ") - end - else - b.append ("No OpenID associated with current account") - end - end - create f.make (url ("/openid/login", Void), "openid-login") - create tf.make ("openid") - tf.set_size (50) - tf.set_text_value ("") - tf.set_label ("OpenID identifier") - f.extend (tf) - create ts.make_with_text ("op", "Validate") - f.extend (ts) - f.prepare (Current) - f.append_to_html (theme, b) - end - set_main_content (b) - end - - user_id_from_custom_value (lst: TABLE_ITERABLE [READABLE_STRING_8, STRING_8]): INTEGER - local - l_uid: detachable READABLE_STRING_8 - do - across - lst as c - until - l_uid /= Void - loop - if c.key.same_string ("uid") then - l_uid := c.item - end - end - if l_uid /= Void and then l_uid.is_integer then - Result := l_uid.to_integer - end - end - -end diff --git a/draft/application/cms/src/modules/openid/openid_module.e b/draft/application/cms/src/modules/openid/openid_module.e deleted file mode 100644 index 2f3a073f..00000000 --- a/draft/application/cms/src/modules/openid/openid_module.e +++ /dev/null @@ -1,141 +0,0 @@ -note - description: "Summary description for {OPENID_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - OPENID_MODULE - -inherit - CMS_MODULE - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_FORM_ALTER - - CMS_HOOK_AUTO_REGISTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "openid" - version := "1.0" - description := "OpenID login support" - package := "server" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - a_service.map_uri ("/openid/login", agent handle_login) - - a_service.add_menu_alter_hook (Current) - service := a_service - end - -feature -- Hooks - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - req: WSF_REQUEST - do - req := a_execution.request - if req.path_info.starts_with ("/user") then - if a_execution.authenticated then - create lnk.make ("Openid identities", "/openid/login") - else - create lnk.make ("Login with Openid", "/openid/login") - end - -- a_menu_system.management_menu.extend (lnk) - a_menu_system.primary_tabs.extend (lnk) - end - end - - form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION) - local - i: WSF_FORM_DIV - fh: WSF_FORM_HIDDEN_INPUT - do - if a_form.id.same_string ("openid-login") then - create i.make_with_text_and_css_id ( - "Login with " + a_execution.link ("OpenID", "/openid/login", Void) - + " , " + a_execution.link ("Google", "/openid/login?openid=https://www.google.com/accounts/o8/id", Void) - + " , " + a_execution.link ("Yahoo", "/openid/login?openid=https://me.yahoo.com/", Void) - , - "openid" - ) - a_form.extend (i) - elseif a_form.id.same_string ("user-login") then - create i.make_with_text_and_css_id ( - "Login with " + a_execution.link ("OpenID", "/openid/login", Void) - + " , " + a_execution.link ("Google", "/openid/login?openid=https://www.google.com/accounts/o8/id", Void) - + " , " + a_execution.link ("Yahoo", "/openid/login?openid=https://me.yahoo.com/", Void) - , - "openid" - ) - if attached a_form.items_by_type ({WSF_WIDGET_TEXT}) as lst and then not lst.is_empty then - a_form.insert_before (i, lst.last) - else - a_form.extend (i) - end - elseif a_form.id.same_string ("user-register") then - if attached {READABLE_STRING_GENERAL} a_execution.session_item ("openid.identity") as l_openid_identity then - create fh.make_with_text ("openid-identity", l_openid_identity.to_string_32) - a_execution.remove_session_item ("openid.identity") - a_form.extend (fh) - a_form.extend_text ("The new account will be associated with OpenID %""+ a_execution.html_encoded (l_openid_identity) +"%"") - if attached {READABLE_STRING_GENERAL} a_execution.session_item ("openid.nickname") as l_openid_nickname then - if attached a_form.fields_by_name ("username") as f_lst then - across - f_lst as c - loop - if attached {WSF_FORM_TEXT_INPUT} c.item as txt then - txt.set_text_value (l_openid_nickname.to_string_32) - end - end - end - a_execution.remove_session_item ("openid.nickname") - end - if attached {READABLE_STRING_GENERAL} a_execution.session_item ("openid.email") as l_openid_email then - if attached a_form.fields_by_name ("email") as f_lst then - across - f_lst as c - loop - if attached {WSF_FORM_TEXT_INPUT} c.item as txt then - txt.set_text_value (l_openid_email.to_string_32) - end - end - end - a_execution.remove_session_item ("openid.email") - end - a_form.submit_actions.extend (agent openid_user_register_submitted) - end - end - end - - openid_user_register_submitted (a_form_data: WSF_FORM_DATA) - do - - end - -feature -- Access - - handle_login (req: WSF_REQUEST; res: WSF_RESPONSE) - do - if attached service as l_service then - (create {OPENID_CMS_EXECUTION}.make (req, res, l_service)).execute - else - res.set_status_code ({HTTP_STATUS_CODE}.expectation_failed) - end - end - -end diff --git a/draft/application/cms/src/modules/user/user_account_cms_execution.e b/draft/application/cms/src/modules/user/user_account_cms_execution.e deleted file mode 100644 index 3dc2fadf..00000000 --- a/draft/application/cms/src/modules/user/user_account_cms_execution.e +++ /dev/null @@ -1,59 +0,0 @@ -note - description: "[ - ]" - -class - USER_ACCOUNT_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - vars: detachable ARRAY [READABLE_STRING_32] - n: INTEGER --- vars: detachable WSF_TABLE - do - if attached {WSF_TABLE} request.path_parameter ("vars") as tb then - vars := tb.as_array_of_string - end - if vars = Void or else vars.is_empty then - set_title ("Account") - create b.make_empty - b.append ("Account") - set_main_content (b) - else - n := vars.count - create b.make_empty - if n >= 1 then - if vars[1].same_string ("password") then - set_title ("Password") - if n >= 2 then - if vars[2].same_string ("reset") then - b.append ("Reset password") - else - b.append ("password ???") - end - end - elseif vars[1].same_string ("register") then - set_title ("Registration") - b.append ("Register new account") - else - b.append ("???") - end - else - set_title ("Account/") - b.append ("...") - end - set_main_content (b) - end - end - -end diff --git a/draft/application/cms/src/modules/user/user_cms_execution.e b/draft/application/cms/src/modules/user/user_cms_execution.e deleted file mode 100644 index 89e0762f..00000000 --- a/draft/application/cms/src/modules/user/user_cms_execution.e +++ /dev/null @@ -1,206 +0,0 @@ -note - description: "[ - ]" - -class - USER_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - u: detachable CMS_USER - l_first: BOOLEAN - do - if attached {WSF_STRING} request.path_parameter ("uid") as p_uid then - if p_uid.is_integer then - u := service.storage.user_by_id (p_uid.integer_value) - else - u := service.storage.user_by_name (p_uid.value) - end - else - u := user - end - initialize_primary_tabs (u) - - if u /= Void then - if not u.same_as (user) and then not has_permission ("admin view users") then - set_main_content ("Access denied") - else - service.storage.fill_user_profile (u) - create b.make_empty - set_title ("User [" + u.name + "]") - b.append ("
      %N") - if attached u.email as l_email then - b.append ("
    • Email: "+ l_email +"
    • ") - end - if has_permission ("administer users") and attached u.roles as u_roles then - b.append ("
    • Roles:") - l_first := True - across - u_roles as r - loop - if l_first then - l_first := False - else - b.append (", ") - end - if attached service.storage.user_role_by_id (r.item) as ur then - b.append (ur.name) - else - b.append (r.item.out) - end - end - b.append ("
    • ") - end - b.append ("
    • Created: "+ u.creation_date.out +"
    • %N") - if attached u.last_login_date as dt then - b.append ("
    • Last signed: "+ dt.out +"
    • %N") - else - b.append ("
    • Never signed yet
    • %N") - end - if u = user and then attached last_user_access_date as dt then - b.append ("
    • Session date: "+ dt.out +"
    • %N") - end - - service.storage.fill_user_profile (u) - if attached u.profile as prof then - across - prof as p - loop - b.append ("
    • " + p.key + "=" + p.item +"
    • %N") - end - end - b.append ("
    ") - set_main_content (b) - end - else - process_login - end - end - - process_login - local - l_url: detachable READABLE_STRING_8 - b: STRING_8 - f: CMS_FORM - fd: detachable WSF_FORM_DATA - do - if - attached {WSF_STRING} request.item ("destination") as s_dest - then - l_url := request.script_url (s_dest.value) - end - if l_url = Void then - l_url := request.script_url ("/user") - end - f := login_form (url ("/user", Void), "user-login", l_url) - if request.is_request_method ("post") then - f.submit_actions.extend (agent on_form_submitted) - f.process (Current) - fd := f.last_data - else - f.prepare (Current) - end - - if authenticated then - if - fd /= Void and then fd.is_valid and then - attached {WSF_STRING} fd.integer_item ("form-destination") as s_dest - then - l_url := request.script_url (s_dest.value) - end - - set_redirection (l_url) - set_title ("Login") - create b.make_empty - set_main_content (b) - set_redirection (url ("/user", Void)) - else - set_title ("Login") - create b.make_empty - f.append_to_html (theme, b) - set_main_content (b) - end - end - - on_form_submitted (fd: WSF_FORM_DATA) - local - u: detachable CMS_USER - do - if attached {WSF_STRING} fd.item (form_username_or_email_name) as s_name and then not s_name.is_empty then - u := service.storage.user_by_name (s_name.value) - if u = Void then - u := service.storage.user_by_email (s_name.value) - end - end - if u = Void then - fd.report_error ("Sorry, unrecognized username/email or password. " + link ("Have you forgotten your password?", "/user/password", Void)) - else - if attached {WSF_STRING} fd.item (form_password_name) as s_passwd and then not s_passwd.is_empty then - if service.auth_engine.valid_credential (u.name, s_passwd.value) then - login (u, request) - else - fd.report_error ("Sorry, unrecognized username/email or password. " + link ("Have you forgotten your password?", "/user/password", Void)) - end - end - end - end - - login_form (a_action: READABLE_STRING_8; a_form_name: READABLE_STRING_8; a_destination: READABLE_STRING_8): CMS_FORM - local - th: WSF_FORM_HIDDEN_INPUT - ti: WSF_FORM_TEXT_INPUT - tp: WSF_FORM_PASSWORD_INPUT - ts: WSF_FORM_SUBMIT_INPUT - l_logo: WSF_FORM_RAW_TEXT - d: WSF_FORM_DIV - do - create Result.make (a_action, a_form_name) - - create th.make ("form-destination") - th.set_default_value (a_destination) - Result.extend (th) - - create l_logo.make ("[ - - ]" - ) - create ti.make (form_username_or_email_name) - ti.set_label ("Username or email") - ti.set_is_required (True) - - create tp.make (form_password_name) - tp.set_label ("Password") - tp.set_is_required (True) - tp.set_description (link ("Reset password", "/user/password", Void)) - - create ts.make ("op") - ts.set_default_value ("Log in") - - create d.make_with_item (ti) - d.add_css_class ("input") - d.extend (tp) - Result.extend (l_logo) - Result.extend (d) - Result.extend (ts) - - Result.extend_text ("
    Need an account?
    " + link ("Sign up now!", "/user/register", Void) + "
    ") - end - - form_username_or_email_name: STRING = "name" - form_password_name: STRING = "password" - -end diff --git a/draft/application/cms/src/modules/user/user_edit_cms_execution.e b/draft/application/cms/src/modules/user/user_edit_cms_execution.e deleted file mode 100644 index bc076fb6..00000000 --- a/draft/application/cms/src/modules/user/user_edit_cms_execution.e +++ /dev/null @@ -1,215 +0,0 @@ -note - description: "[ - ]" - -class - USER_EDIT_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - fd: detachable WSF_FORM_DATA - u: detachable CMS_USER - l_is_editing_current_user: BOOLEAN - do - if attached {WSF_STRING} request.path_parameter ("uid") as p_uid and then p_uid.is_integer then - u := service.storage.user_by_id (p_uid.integer_value) - if has_permission ("view users") then - else - if u /= Void and then u.same_as (user) then - else - u := Void - end - end - else - u := user - end - if attached user as l_active_user then - l_is_editing_current_user := l_active_user.same_as (u) - end - create b.make_empty - initialize_primary_tabs (u) - if u = Void then - b.append ("Access denied") - set_redirection (url ("/user/register", Void)) - else - service.storage.fill_user_profile (u) - f := edit_form (u, url (request.path_info, Void), "user-edit") - - if request.is_post_request_method then - f.validation_actions.extend (agent edit_form_validate (?, u)) - f.submit_actions.extend (agent edit_form_submit (?, u, l_is_editing_current_user, b)) - f.process (Current) - fd := f.last_data - else - f.prepare (Current) - end - - f.append_to_html (theme, b) - - end - set_main_content (b) - end - - edit_form_validate (fd: WSF_FORM_DATA; u: CMS_USER) - local - fu: detachable CMS_USER - do - if attached {WSF_STRING} fd.item ("username") as s_username then - fu := service.storage.user_by_name (s_username.value) - if fu = Void then - fd.report_invalid_field ("username", "User does not exist!") - end - end - if attached {WSF_STRING} fd.item ("email") as s_email then - fu := service.storage.user_by_email (s_email.value) - if fu /= Void and then fu.id /= u.id then - fd.report_invalid_field ("email", "Email is already used by another user!") - end - end - end - - edit_form_submit (fd: WSF_FORM_DATA; u: CMS_USER; a_is_editing_current_user: BOOLEAN; b: STRING) - local - up: detachable CMS_USER_PROFILE - l_roles: like {CMS_USER}.roles - do - debug - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - end - - if attached {WSF_STRING} fd.item ("password") as s_password and then not s_password.is_empty then - u.set_password (s_password.value) - end - if attached {WSF_STRING} fd.item ("email") as s_email then - u.set_email (s_email.value) - end - - if attached {WSF_STRING} fd.item ("note") as s_note then - up := u.profile - if up = Void then - create up.make - end - up.force (s_note.value, "note") - u.set_profile (up) - end - if has_permission ("administer users") then - l_roles := u.roles - u.clear_roles - if attached fd.table_item ("roles") as f_roles and then not f_roles.is_empty then - create {ARRAYED_LIST [INTEGER]} l_roles.make (f_roles.count) - across - f_roles as r - loop - if attached {WSF_STRING} r.item as s and then attached s.is_integer then - u.add_role_by_id (s.integer_value) - end - end - end - end - - service.storage.save_user (u) - if a_is_editing_current_user and u /= user then - set_user (u) - end - set_redirection (user_url (u)) - end - - edit_form (u: CMS_USER; a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM - local - f: CMS_FORM - ti: WSF_FORM_TEXT_INPUT - tp: WSF_FORM_PASSWORD_INPUT - ta: WSF_FORM_TEXTAREA - ts: WSF_FORM_SUBMIT_INPUT - tset: WSF_FORM_FIELD_SET - cb: WSF_FORM_CHECKBOX_INPUT - do - create f.make (a_url, a_name) - - create ti.make ("username") - ti.set_label ("Username") - ti.set_default_value (u.name) - ti.set_is_required (False) - ti.set_is_readonly (True) - f.extend (ti) - - f.extend_text ("
    ") - - create tp.make ("password") - tp.set_label ("Password") - tp.set_is_required (False) - f.extend (tp) - - f.extend_text ("
    ") - - create ti.make ("email") - ti.set_label ("Valid email address") - if attached u.email as l_email then - ti.set_default_value (l_email) - end - ti.set_is_required (True) - f.extend (ti) - - f.extend_text ("
    ") - - create ta.make ("note") - ta.set_label ("Additional note about you") - ta.set_description ("You can use this input to tell us more about you") - if attached u.profile as p and then attached p.item ("note") as l_note then - ta.set_default_value (l_note) - end - ta.set_is_required (False) - f.extend (ta) - - if has_permission ("administer users") then - create tset.make - tset.set_legend ("User roles") - tset.set_collapsible (True) - f.extend (tset) - across - service.storage.user_roles as r - loop - if - r.item ~ service.storage.anonymous_user_role or - r.item ~ service.storage.authenticated_user_role - then - -- Skip - else - create cb.make_with_value ("roles[]", r.item.id.out) - cb.set_title (r.item.name) - cb.set_checked (u /= Void and then u.has_role (r.item)) - tset.extend (cb) - end - end - end - f.extend_text ("
    ") - - create ts.make ("op") - ts.set_default_value ("Save") - f.extend (ts) - - Result := f - end - -end diff --git a/draft/application/cms/src/modules/user/user_logout_cms_execution.e b/draft/application/cms/src/modules/user/user_logout_cms_execution.e deleted file mode 100644 index 8fa1221d..00000000 --- a/draft/application/cms/src/modules/user/user_logout_cms_execution.e +++ /dev/null @@ -1,39 +0,0 @@ -note - description: "[ - ]" - -class - USER_LOGOUT_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local --- l_url: READABLE_STRING_8 - b: STRING_8 - do - logout (request) - - if - attached {WSF_STRING} request.item ("destination") as s_dest - then - set_redirection (request.script_url (s_dest.value)) - else - set_redirection (request.script_url ("/")) - end - - set_title ("Logout") - create b.make_empty - set_main_content (b) --- l_url := request.script_url ("/info/") --- res.redirect_now_with_content (l_url, "Redirection to " + l_url, "text/html") - end - -end diff --git a/draft/application/cms/src/modules/user/user_module.e b/draft/application/cms/src/modules/user/user_module.e deleted file mode 100644 index 248c8e2b..00000000 --- a/draft/application/cms/src/modules/user/user_module.e +++ /dev/null @@ -1,152 +0,0 @@ -note - description: "Summary description for {USER_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - USER_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_BLOCK - -create - make - -feature {NONE} -- Initialization - - make - do - name := "user" - version := "1.0" - description := "Users management" - package := "core" - - enable - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - local - h: CMS_HANDLER - do - service := a_service - - a_service.map_uri ("/user/logout", agent handle_logout (a_service, ?, ?)) - a_service.map_uri ("/user/register", agent handle_register (a_service, ?, ?)) - a_service.map_uri ("/user/password", agent handle_request_new_password (a_service, ?, ?)) - - create {CMS_HANDLER} h.make (agent handle_user (a_service, ?, ?)) - a_service.router.map (create {WSF_URI_TEMPLATE_MAPPING}.make ("/user/{uid}", h)) - a_service.router.map (create {WSF_URI_MAPPING}.make_trailing_slash_ignored ("/user", h)) - a_service.map_uri_template ("/user/{uid}/edit", agent handle_edit (a_service, ?, ?)) - a_service.map_uri_template ("/user/reset/{uid}/{last-signed}/{extra}", agent handle_reset_password (a_service, ?, ?)) - - a_service.add_menu_alter_hook (Current) - a_service.add_block_hook (Current) - end - -feature -- Hooks - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - Result.extend ("register account") - Result.extend ("change username") - end - - block_list: ITERABLE [like {CMS_BLOCK}.name] - do - Result := <<"user-info">> - end - - get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) - local - b: CMS_CONTENT_BLOCK - do - if - a_execution.is_front and then - attached a_execution.user as u - then - create b.make ("user-info", "User", "Welcome " + a_execution.html_encoded (u.name), a_execution.formats.plain_text) - a_execution.add_block (b, Void) - end - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - opts: CMS_API_OPTIONS - do - if attached a_execution.user as u then - create lnk.make ("Logout", "/user/logout") - a_execution.add_to_main_menu (lnk) - else - create lnk.make ("Login", "/user") - create opts.make_from_manifest (<<["query", <<["destination", a_execution.request.path_info]>> ]>>) - lnk.set_options (opts) - a_execution.add_to_main_menu (lnk) - - create lnk.make ("Sign up", "/user/register") - lnk.set_options (opts) - a_execution.add_to_main_menu (lnk) - end - if a_execution.authenticated then - if attached a_execution.user as u then - create lnk.make ("My Account (" + u.name + ")", "/user") - else - create lnk.make ("My Account", "/user") - end - a_menu_system.user_menu.extend (lnk) - create lnk.make ("Logout", "/user/logout") - a_menu_system.user_menu.extend (lnk) - else - create lnk.make ("Login", "/user") - a_menu_system.user_menu.extend (lnk) - end - end - -feature -- Handlers - - handle_logout (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_LOGOUT_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_user (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_edit (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_EDIT_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_register (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_REGISTER_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_request_new_password (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_NEW_PASSWORD_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_reset_password (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_RESET_PASSWORD_CMS_EXECUTION}.make (req, res, cms)).execute - end - - -end diff --git a/draft/application/cms/src/modules/user/user_module_lib.e b/draft/application/cms/src/modules/user/user_module_lib.e deleted file mode 100644 index e1da1d1d..00000000 --- a/draft/application/cms/src/modules/user/user_module_lib.e +++ /dev/null @@ -1,29 +0,0 @@ -note - description: "Summary description for {USER_MODULE_LIB}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - USER_MODULE_LIB - -inherit - CMS_COMMON_API - - CMS_EXECUTION - -feature -- Initialization - - initialize_primary_tabs (u: detachable CMS_USER) - do - if u /= Void then - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("View", "/user/" + u.id.out)) - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Edit", "/user/" + u.id.out + "/edit")) - else - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Create new account", "/user/register")) - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Log in", "/user")) - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Request new password", "/user/password")) - end - end - -end diff --git a/draft/application/cms/src/modules/user/user_new_password_cms_execution.e b/draft/application/cms/src/modules/user/user_new_password_cms_execution.e deleted file mode 100644 index 70b60710..00000000 --- a/draft/application/cms/src/modules/user/user_new_password_cms_execution.e +++ /dev/null @@ -1,171 +0,0 @@ -note - description: "[ - ]" - -class - USER_NEW_PASSWORD_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - u: detachable CMS_USER - fd: detachable WSF_FORM_DATA - do - set_title ("Request new password") - create b.make_empty - if not request.is_post_request_method and authenticated then - u := user - initialize_primary_tabs (u) - if u /= Void then - if attached u.email as l_email then - f := new_password_form (url (request.path_info, Void), "new-password") - b.append ("Password reset instructions will be mailed to " + l_email + ". You must " + link ("log out", "/user/logout", Void) + " to use the password reset link in the e-mail.") - f.append_to_html (theme, b) - else - b.append ("Your account does not have any email address set!") - set_redirection (url ("/user/"+ u.id.out +"/edit", Void)) - end - else - b.append ("Unexpected issue") - end - else - f := new_password_form (url (request.path_info, Void), "new-password") - if request.is_post_request_method then - f.validation_actions.extend (agent password_form_validate) - f.submit_actions.extend (agent password_form_submit (?, b)) - f.process (Current) - fd := f.last_data - else - initialize_primary_tabs (Void) - end - - f.append_to_html (theme, b) - end - set_main_content (b) - end - - password_form_validate (fd: WSF_FORM_DATA) - local - u: detachable CMS_USER - do - if attached {WSF_STRING} fd.item ("name") as s_name then - u := service.storage.user_by_name (s_name.value) - if u = Void then - u := service.storage.user_by_email (s_name.value) - if u = Void then - fd.report_invalid_field ("name", "Sorry, " + html_encoded (s_name.value)+ " is not recognized as a user name or an e-mail address.") - end - end - end - fd.add_cached_value ("user", u) - initialize_primary_tabs (u) - end - - password_form_submit (fd: WSF_FORM_DATA; b: STRING) - local - e: detachable CMS_EMAIL - l_uuid: UUID - do - debug - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - end - if attached {CMS_USER} fd.cached_value ("user") as u then - if attached u.email as l_mail_address then - l_uuid := (create {UUID_GENERATOR}).generate_uuid - e := new_password_email (u, l_mail_address, l_uuid.out) - u.set_data_item ("new_password_extra", l_uuid.out) - service.storage.save_user (u) - service.mailer.safe_process_email (e) - add_success_message ("Further instructions have been sent to your e-mail address.") - set_redirection (url ("/user", Void)) - else - add_error_message ("No email is associated with the requested account. Please contact the webmaster for help.") - set_redirection (url ("/user", Void)) - end - else - add_error_message ("User not defined!") - end - end - - new_password_form (a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM - require - attached user as l_auth_user implies l_auth_user.has_email - local - u: like user - f: CMS_FORM - ti: WSF_FORM_TEXT_INPUT - th: WSF_FORM_HIDDEN_INPUT - ts: WSF_FORM_SUBMIT_INPUT - err: BOOLEAN - do - create f.make (a_url, a_name) - u := user - if u = Void then - create ti.make ("name") - ti.set_label ("Username or e-mail address") - ti.set_is_required (True) - f.extend (ti) - elseif attached u.email as l_mail then - create th.make ("name") - th.set_default_value (l_mail) - th.set_is_required (True) - f.extend (th) - else - f.extend_text ("The associated account has no e-mail address.") - err := True - end - - if not err then - create ts.make ("op") - ts.set_default_value ("E-mail new password") - f.extend (ts) - end - - Result := f - end - - new_password_email (u: CMS_USER; a_mail_address: STRING; a_extra: READABLE_STRING_8): CMS_EMAIL - local - b: STRING - opts: CMS_URL_API_OPTIONS - dt: detachable DATE_TIME - do - create b.make_empty - create opts.make_absolute - - b.append ("A request to reset the password for your account has been made at " + service.site_name + ".%N") - b.append ("You may now log in by clicking this link or copying and pasting it to your browser:%N%N") - dt := u.last_login_date - if dt = Void then - dt := u.creation_date - end - b.append (url ("/user/reset/" + u.id.out + "/" + unix_timestamp (dt).out + "/" + a_extra, opts)) - b.append ("%N") - b.append ("%N") - b.append ("This link can only be used once to log in and will lead you to a page where you can set your password. It expires after one day and nothing will happen if it's not used.%N") - b.append ("%N%N-- The %"" + service.site_name + "%" team") - - create Result.make (service.site_email, a_mail_address, "Account details for " + u.name + " at " + service.site_name, b) - end - -end diff --git a/draft/application/cms/src/modules/user/user_register_cms_execution.e b/draft/application/cms/src/modules/user/user_register_cms_execution.e deleted file mode 100644 index 95369dc9..00000000 --- a/draft/application/cms/src/modules/user/user_register_cms_execution.e +++ /dev/null @@ -1,217 +0,0 @@ -note - description: "[ - ]" - -class - USER_REGISTER_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - fd: detachable WSF_FORM_DATA - do - set_title ("Create new account") - create b.make_empty - if authenticated then - initialize_primary_tabs (user) - b.append ("You are already " + link ("signed in", "/user", Void) + ", please " + link ("signout", "/user/logout", Void) + " before trying to " + link ("register a new account", "/account/register", Void) + ".") - set_redirection (url ("/user", Void)) - else - f := registration_form (url (request.path_info, Void), "user-register") - - if request.is_post_request_method then - f.validation_actions.extend (agent registration_form_validate) - f.submit_actions.extend (agent registration_form_submitted (?, b)) - - f.process (Current) - fd := f.last_data - else - f.prepare (Current) - end - if fd /= Void and then fd.is_valid then - set_main_content (b) - else - initialize_primary_tabs (user) - f.append_to_html (theme, b) - end - end - set_main_content (b) - end - - registration_form_validate (fd: WSF_FORM_DATA) - local - u: detachable CMS_USER - do - if attached {WSF_STRING} fd.item ("username") as s_username then - u := service.storage.user_by_name (s_username.value) - if u /= Void then - fd.report_invalid_field ("username", "User already exists!") - end - end - if attached {WSF_STRING} fd.item ("email") as s_email then - u := service.storage.user_by_email (s_email.value) - if u /= Void then - fd.report_invalid_field ("email", "Email is already used!") - end - end - end - - registration_form_submitted (fd: WSF_FORM_DATA; buf: STRING) - local - b: STRING - u: detachable CMS_USER - up: detachable CMS_USER_PROFILE - e: detachable CMS_EMAIL - l_pass: detachable READABLE_STRING_32 - l_uuid: UUID - do - b := buf - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - if attached {WSF_STRING} fd.item ("username") as s_username then - u := service.storage.user_by_name (s_username.value) - - create u.make_new (s_username.value) - if attached {WSF_STRING} fd.item ("password") as s_password then - u.set_password (s_password.value) - l_pass := u.password - end - if attached {WSF_STRING} fd.item ("email") as s_email then - u.set_email (s_email.value) - end - - if attached {WSF_STRING} fd.item ("note") as s_note then - create up.make - up.force (s_note.value, "note") - u.set_profile (up) - end - - l_uuid := (create {UUID_GENERATOR}).generate_uuid - u.set_data_item ("new_password_extra", l_uuid.out) - - service.storage.save_user (u) - if attached u.email as l_mail_address then - e := new_registration_email (l_mail_address, u, l_pass, l_uuid.out) - service.mailer.safe_process_email (e) - end - e := new_user_account_email (service.site_email, u) - service.mailer.safe_process_email (e) - - login (u, request) - set_redirection (url ("/user", Void)) - end - end - - registration_form (a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM - local - f: CMS_FORM - ti: WSF_FORM_TEXT_INPUT - tp: WSF_FORM_PASSWORD_INPUT - ta: WSF_FORM_TEXTAREA - ts: WSF_FORM_SUBMIT_INPUT - do - create f.make (a_url, a_name) - - create ti.make ("username") - ti.set_label ("Username") - ti.set_is_required (True) - ti.set_validation_action (agent (fd: WSF_FORM_DATA) - do - if attached {WSF_STRING} fd.item ("username") as f_username and then f_username.value.count >= 5 then - else - fd.report_invalid_field ("username", "Username should contain at least 5 characters!") - end - end) - f.extend (ti) - - f.extend_text ("
    ") - - create tp.make ("password") - tp.set_label ("Password") - tp.set_is_required (True) - f.extend (tp) - - f.extend_text ("
    ") - - create ti.make ("email") - ti.set_label ("Valid email address") - ti.set_is_required (True) - f.extend (ti) - - f.extend_text ("
    ") - - create ta.make ("note") - ta.set_label ("Additional note about you") - ta.set_description ("You can use this input to tell us more about you") - ta.set_is_required (False) - f.extend (ta) - - f.extend_text ("
    ") - - create ts.make ("Register") - ts.set_default_value ("Register") - f.extend (ts) - - Result := f - end - - new_registration_email (a_mail_address: STRING; u: CMS_USER; a_password: detachable like {CMS_USER}.password; a_extra: READABLE_STRING_8): CMS_EMAIL - require - has_clear_password: u.password /= Void or else a_password /= Void - local - p: detachable like {CMS_USER}.password - b: STRING - opts: CMS_URL_API_OPTIONS - do - p := a_password - if p = Void then - p := u.password - end - - create b.make_from_string (u.name + "%N" + "Thank you for registering at " + service.site_name + ". ") - create opts.make_absolute --- if p /= Void then - b.append ("You may now log in to " + url ("/user", opts) + " using your username %""+ u.name +"%" and password%N") --- b.append ("%Nusername: " + u.name + "%Npassword: " + p + "%N%N") --- end - b.append ("You may also log in by clicking on this link or copying and pasting it in your browser:%N%N") - b.append (url ("/user/reset/" + u.id.out + "/" + unix_timestamp (u.creation_date).out + "/" + a_extra, opts)) --- b.append (url ("/user/reset/" + u.id.out + "/" + unix_timestamp (u.creation_date).out + "/", opts)) - b.append ("%N%NThis is a one-time login, so it can be used only once.%N%NAfter logging in, you will be redirected to " + url ("/user/" + u.id.out + "/edit", opts) + " so you can change your password.%N") - b.append ("%N%N-- The %"" + service.site_name + "%" team") - - create Result.make (service.site_email, a_mail_address, "Account details for " + u.name + " at " + service.site_name, b) - end - - new_user_account_email (a_mail_address: STRING; u: CMS_USER): CMS_EMAIL - local - b: STRING - opts: CMS_URL_API_OPTIONS - do - create b.make_from_string ("New user account %"" + u.name + "%" at " + service.site_name + ". ") - create opts.make_absolute - b.append ("See user account: " + user_url (u) + "%N") - b.append ("%N%N-- The %"" + service.site_name + "%" team") - create Result.make (service.site_email, a_mail_address, "New User Account %"" + u.name + "%" at " + service.site_name, b) - end - -end diff --git a/draft/application/cms/src/modules/user/user_reset_password_cms_execution.e b/draft/application/cms/src/modules/user/user_reset_password_cms_execution.e deleted file mode 100644 index dcf7042d..00000000 --- a/draft/application/cms/src/modules/user/user_reset_password_cms_execution.e +++ /dev/null @@ -1,86 +0,0 @@ -note - description: "[ - ]" - -class - USER_RESET_PASSWORD_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - u: detachable CMS_USER - err: BOOLEAN - t: INTEGER_64 - l_extra: detachable READABLE_STRING_8 - do - create b.make_empty - u := user - if u /= Void then - add_success_message ("You are logged in as " + u.name + ". " + link ("Change your password", "/user/" + u.id.out + "/edit", Void)) - set_redirection (front_page_url) - else - if attached {WSF_STRING} request.path_parameter ("uid") as p_uid and then p_uid.is_integer then - u := service.storage.user_by_id (p_uid.integer_value) - end - if u /= Void then - if attached non_empty_string_path_parameter ("last-signed") as p_last_signed then - if p_last_signed.is_integer_64 then - t := p_last_signed.to_integer_64 - else - err := True - end - if t > 0 then - if attached u.last_login_date as l_last then - if t /= unix_timestamp (l_last) then - err := True - end - else - if t /= unix_timestamp (u.creation_date) then - err := True - end - end - end - else - err := True - end - if attached non_empty_string_path_parameter ("extra") as s_extra then - l_extra := s_extra - if l_extra /= Void then - if attached {READABLE_STRING_8} u.data_item ("new_password_extra") as u_extra and then u_extra.same_string (l_extra) then - else - err := True - end - else - err := True - end - else - err := True - end - if not err then - login (u, request) - u.remove_data_item ("new_password_extra") - service.storage.save_user (u) - set_redirection (url ("/user/" + u.id.out + "/edit", Void)) - set_main_content (b) - end - else - err := True - end - if err then - add_warning_message ("The one-time login link you clicked is invalid.") - set_redirection (front_page_url) - end - end - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/notification/cms_mailer.e b/draft/application/cms/src/notification/cms_mailer.e deleted file mode 100644 index fe98a701..00000000 --- a/draft/application/cms/src/notification/cms_mailer.e +++ /dev/null @@ -1,48 +0,0 @@ -note - description : "[ - Component responsible to send email - ]" - author : "$Author$" - date : "$Date$" - revision : "$Revision$" - -deferred class - CMS_MAILER - -feature -- Status - - is_available: BOOLEAN - -- Is mailer available to use? - deferred - end - -feature -- Basic operation - - process_emails (lst: ITERABLE [CMS_EMAIL]) - -- Process set of emails `lst' - require - is_available - do - across - lst as c - loop - process_email (c.item) - end - end - - safe_process_email (a_email: CMS_EMAIL) - -- Same as `process_email', but include the check of `is_available' - do - if is_available then - process_email (a_email) - end - end - - process_email (a_email: CMS_EMAIL) - -- Process the sending of `a_email' - require - is_available - deferred - end - -end diff --git a/draft/application/cms/src/notification/cms_sendmail_mailer.e b/draft/application/cms/src/notification/cms_sendmail_mailer.e deleted file mode 100644 index 264b7e1c..00000000 --- a/draft/application/cms/src/notification/cms_sendmail_mailer.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description : "[ - CMS_MAILER using sendmail as mailtool - ]" - author : "$Author$" - date : "$Date$" - revision : "$Revision$" - -class - CMS_SENDMAIL_MAILER - -inherit - CMS_EXTERNAL_MAILER - redefine - default_create - end - -create - default_create - -feature {NONE} -- Initialization - - default_create - do - Precursor - make ("/usr/sbin/sendmail", <<"-t">>) - if not is_available then - make ("/usr/bin/sendmail", <<"-t">>) - end - set_stdin_mode (True, "%N.%N%N") - end - - -end diff --git a/draft/application/cms/src/notification/cms_storage_mailer.e b/draft/application/cms/src/notification/cms_storage_mailer.e deleted file mode 100644 index c57e8b58..00000000 --- a/draft/application/cms/src/notification/cms_storage_mailer.e +++ /dev/null @@ -1,38 +0,0 @@ -note - description: "Summary description for {CMS_CHAIN_MAILER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_STORAGE_MAILER - -inherit - CMS_MAILER - -create - make - -feature {NONE} -- Initialization - - make (a_storage: like storage) - do - storage := a_storage - end - -feature -- Access - - storage: CMS_STORAGE - -feature -- Status - - is_available: BOOLEAN = True - -feature -- Basic operation - - process_email (a_email: CMS_EMAIL) - do - storage.save_email (a_email) - end - -end diff --git a/draft/application/cms/src/storage/cms_sed_storage.e b/draft/application/cms/src/storage/cms_sed_storage.e deleted file mode 100644 index f8e2e881..00000000 --- a/draft/application/cms/src/storage/cms_sed_storage.e +++ /dev/null @@ -1,635 +0,0 @@ -note - description : "[ - CMS Storage implemented using SED - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_SED_STORAGE - -inherit - CMS_STORAGE - -create - make - -feature {NONE} -- Initialization - - make (dn: STRING) - -- Initialize `Current'. - do - directory_name := dn - ensure_directory_exists (dn) - create sed - initialize - end - - directory_name: STRING - - sed: SED_STORABLE_FACILITIES - - sed_file_retrieved (f: FILE): detachable ANY - local - r: SED_MEDIUM_READER_WRITER - do - create r.make (f) - r.set_for_reading - Result := sed.retrieved (r, True) - end - - sed_file_store (obj: ANY; f: FILE) - local - w: SED_MEDIUM_READER_WRITER - do - create w.make (f) - w.set_for_writing - sed.store (obj, w) - end - - save_object_with_id (obj: ANY; a_id: INTEGER; a_type: STRING) - local - dn: STRING - fn: FILE_NAME - f: RAW_FILE - do - create fn.make_from_string (directory_name) - fn.extend (a_type) - dn := fn.string - ensure_directory_exists (dn) - create fn.make_from_string (dn) - fn.set_file_name (a_id.out) --- fn.add_extension ("txt") - create f.make (fn.string) --- check not f.exists end - f.create_read_write - sed_file_store (obj, f) - f.close - end - - object_with_id (a_id: INTEGER; a_type: STRING): detachable ANY - local - dn: STRING - fn: FILE_NAME - f: RAW_FILE - do - create fn.make_from_string (directory_name) - fn.extend (a_type) - dn := fn.string - ensure_directory_exists (dn) - create fn.make_from_string (dn) - fn.set_file_name (a_id.out) --- fn.add_extension ("txt") - create f.make (fn.string) - if f.exists and f.is_readable then - f.open_read - Result := sed_file_retrieved (f) - f.close - end - end - -feature -- Access: user - - has_user: BOOLEAN - -- Has any user? - do - Result := users_count > 0 - end - - users_count: INTEGER - do - Result := last_sequence ("user") - end - - fill_user_profile (a_user: CMS_USER) - do - if a_user.profile = Void then - if attached user_profile (a_user) as p then - a_user.set_profile (p) - end - end - end - - all_users: LIST [CMS_USER] - local - res: ARRAYED_LIST [like all_users.item] - i, n: like last_sequence - do - n := last_sequence ("user") - create res.make (n) - from - i := 1 - until - i > n - loop - if attached user_by_id (i) as u then - res.force (u) - end - i := i + 1 - end - Result := res - end - - user_by_id (a_id: like {CMS_USER}.id): detachable CMS_USER - do - if attached {like user_by_id} object_with_id (a_id, "user") as u then - Result := u - end - end - - user_by_name (a_name: like {CMS_USER}.name): detachable CMS_USER - local - uid: INTEGER - do - if attached users_index as t then - uid := t.by_name.item (a_name) - if uid > 0 then - Result := user_by_id (uid) - end - end - end - - user_by_email (a_email: like {CMS_USER}.email): detachable CMS_USER - local - uid: INTEGER - do - if attached users_index as t then - uid := t.by_email.item (a_email) - if uid > 0 then - Result := user_by_id (uid) - end - end - end - - is_valid_credential (u, p: READABLE_STRING_32): BOOLEAN - do - if attached user_by_name (u) as l_user then - Result := attached l_user.encoded_password as l_pass and then l_pass.same_string (encoded_password (p)) - end - end - - encoded_password (a_raw_password: STRING_32): attached like {CMS_USER}.encoded_password - do - Result := a_raw_password.as_string_8 + "!123!" - end - -feature -- Change: user - - save_user (a_user: CMS_USER) - local - uid: INTEGER - prof: like {CMS_USER}.profile - l_has_new_name: BOOLEAN - l_has_new_email: BOOLEAN - l_stored_user: like user_by_id - do - if a_user.has_id then - uid := a_user.id - l_stored_user := user_by_id (uid) - if l_stored_user /= Void then - l_has_new_name := not l_stored_user.name.same_string (a_user.name) - l_has_new_email := not (l_stored_user.email ~ a_user.email) - end - else - l_has_new_name := True - l_has_new_email := True - uid := next_sequence ("user") - a_user.set_id (uid) - end - if attached a_user.password as p then - a_user.set_encoded_password (encoded_password (p)) - a_user.set_password (Void) - end - - prof := a_user.profile - a_user.set_profile (Void) - if prof /= Void then - save_user_profile (a_user, prof) - end - save_object_with_id (a_user, uid, "user") - if l_has_new_name or l_has_new_email then - if attached users_index as l_index then - l_index.by_name.force (uid, a_user.name) - l_index.by_email.force (uid, a_user.email) - store_users_index (l_index) - end - end - a_user.set_profile (prof) - end - -feature -- Access: user_role - - user_role_by_id (a_id: INTEGER): detachable CMS_USER_ROLE - do - if attached {like user_role_by_id} object_with_id (a_id, "user_roles") as ur then - Result := ur - end - end - - user_roles: LIST [CMS_USER_ROLE] - local - i: INTEGER - n: like last_sequence - do - n := last_sequence ("user_roles") - create {ARRAYED_LIST [CMS_USER_ROLE]} Result.make (n) - if n > 0 then - from - i := 1 - until - i > n - loop - if attached user_role_by_id (i) as ur then - Result.force (ur) - end - i := i + 1 - end - end - end - -feature -- Change: user_role - - save_user_role (a_role: CMS_USER_ROLE) - do - if not a_role.has_id then - a_role.set_id (next_sequence ("user_roles")) - end - save_object_with_id (a_role, a_role.id, "user_roles") - end - -feature -- Email - - save_email (a_email: CMS_EMAIL) - local - dn: STRING - fn: FILE_NAME - f: RAW_FILE - ts: INTEGER_64 - i: INTEGER - do - create fn.make_from_string (directory_name) - fn.extend ("emails") - dn := fn.string - ensure_directory_exists (dn) - ts := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp (a_email.date) - from - create fn.make_from_string (dn) - fn.set_file_name (ts.out) - fn.add_extension ("txt") - create f.make (fn.string) - until - not f.exists - loop - i := i + 1 - create fn.make_from_string (dn) - fn.set_file_name (ts.out + "-" + i.out) - fn.add_extension ("txt") - f.make (fn.string) - end - f.create_read_write - f.put_string (a_email.message) - f.close - end - -feature -- Log - - log (a_id: like {CMS_LOG}.id): detachable CMS_LOG - do - if attached {CMS_LOG} object_with_id (a_id, "log") as l then - Result := l - end - end - - recent_logs (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_LOG] - local - n: Like last_sequence - i, p1, nb: INTEGER - do - n := last_sequence ("log") - p1 := n - a_lower + 1 - - if p1 > 0 then - create {ARRAYED_LIST [CMS_LOG]} Result.make (a_count) - from - i := p1 - until - i < 1 or nb = a_count - loop - if attached log (i) as obj then - Result.force (obj) - nb := nb + 1 - end - i := i - 1 - end - else - create {ARRAYED_LIST [CMS_LOG]} Result.make (0) - end - end - - - save_log (a_log: CMS_LOG) - do - if not a_log.has_id then - a_log.set_id (next_sequence ("log")) - end - save_object_with_id (a_log, a_log.id, "log") - end - -feature -- Node - - recent_nodes (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_NODE] - local - n: Like last_sequence - i, p1, nb: INTEGER - do - n := last_sequence ("node") - p1 := n - a_lower + 1 - - if p1 > 0 then - create {ARRAYED_LIST [CMS_NODE]} Result.make (a_count) - from - i := p1 - until - i < 1 or nb = a_count - loop - if attached node (i) as l_node then - Result.force (l_node) - nb := nb + 1 - end - i := i - 1 - end - else - create {ARRAYED_LIST [CMS_NODE]} Result.make (0) - end - end - - node (a_id: INTEGER): detachable CMS_NODE - do - if attached {like node} object_with_id (a_id, "node") as obj then - Result := obj - end - end - - save_node (a_node: CMS_NODE) - local - nid: INTEGER - do - if a_node.has_id then - nid := a_node.id - else - nid := next_sequence ("node") - a_node.set_id (nid) - end - - save_object_with_id (a_node, nid, "node") - end - -feature {NONE} -- Implementation - - last_sequence (a_type: STRING): INTEGER - local - fn: FILE_NAME - f: RAW_FILE - do - create fn.make_from_string (directory_name) - fn.set_file_name (a_type) - fn.add_extension ("last_id") - create f.make (fn.string) - if f.exists and then f.is_readable then - f.open_read - f.read_line - if f.last_string.is_integer then - Result := f.last_string.to_integer - else - check is_integer: False end - end - f.close - end - end - - next_sequence (a_type: STRING): INTEGER - local - fn: FILE_NAME - f: RAW_FILE - do - create fn.make_from_string (directory_name) - fn.set_file_name (a_type) - fn.add_extension ("last_id") - create f.make (fn.string) - if f.exists and then f.is_readable then - f.open_read - f.read_line - if f.last_string.is_integer then - Result := f.last_string.to_integer - else - check is_integer: False end - end - f.close - end - Result := Result + 1 - f.open_write - f.put_string (Result.out) - f.put_new_line - f.close - end - - users_index: TUPLE [ - by_name: HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.name]; - by_email: HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.email] - ] - local - f: RAW_FILE - fn: FILE_NAME - res: detachable like users_index - retried: INTEGER - do - create fn.make_from_string (directory_name) - fn.set_file_name ("users.db") - create f.make (fn.string) - if retried = 0 then - if f.exists and then f.is_readable then - f.open_read - if attached {like users_index} sed_file_retrieved (f) as r then - res := r - end - f.close - else - end - end - if res = Void then - res := [ create {HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.name]}.make (1), - create {HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.email]}.make (1) ] - end - Result := res - rescue - retried := retried + 1 - retry - end - - store_users_index (a_users_index: like users_index) - local - f: RAW_FILE - fn: FILE_NAME - do - create fn.make_from_string (directory_name) - fn.set_file_name ("users.db") - create f.make (fn.string) - if not f.exists or else f.is_writable then - f.open_write - sed_file_store (a_users_index, f) - f.close - end - end - - user_profile (a_user: CMS_USER): detachable CMS_USER_PROFILE - do - if attached {like user_profile} object_with_id (a_user.id, "user_profile") as obj then - Result := obj - end - end - - save_user_profile (a_user: CMS_USER; a_prof: CMS_USER_PROFILE) - local - l_id: INTEGER - do - if a_user.has_id then - l_id := a_user.id - end - - save_object_with_id (a_prof, l_id, "user_profile") - end - -feature -- Misc - - custom_type (a_type: READABLE_STRING_8): STRING - do - Result := "custom__" + a_type - end - - custom_value_id (a_name: READABLE_STRING_8; a_type: READABLE_STRING_8): INTEGER - -- Storage `id' for custom value named `a_name' if any. - -- If no such data exists, return 0 - local - i, - l_id, l_last_id: INTEGER - t: STRING - do - t := custom_type (a_type) - l_last_id := last_sequence (t) - from - i := 1 - until - i > l_last_id or l_id > 0 - loop - if - attached {TUPLE [name: READABLE_STRING_8; value: attached like custom_value]} object_with_id (i, t) as obj and then - obj.name.same_string (a_name) - then - l_id := i - end - i := i + 1 - end - end - - set_custom_value (a_name: READABLE_STRING_8; a_value: attached like custom_value ; a_type: READABLE_STRING_8) - -- Save data `a_name:a_value' for type `a_type' - local - t: STRING - l_id: INTEGER - do - t := custom_type (a_type) - l_id := custom_value_id (a_name, a_type) - if l_id = 0 then - l_id := next_sequence (t) - end - save_object_with_id ([a_name, a_value], l_id, t) - end - - custom_value (a_name: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable TABLE_ITERABLE [READABLE_STRING_8, STRING_8] - -- Data for name `a_name' and type `a_type'. - local - i, - l_id, l_last_id: INTEGER - t: STRING - do - t := custom_type (a_type) - l_last_id := last_sequence (t) - from - i := 1 - until - i > l_last_id or l_id > 0 - loop - if - attached {TUPLE [name: READABLE_STRING_8; value: attached like custom_value]} object_with_id (i, t) as obj and then - obj.name.same_string (a_name) - then - l_id := i - Result := obj.value - end - i := i + 1 - end - end - - custom_value_names_where (a_where_key, a_where_value: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable LIST [READABLE_STRING_8] - -- Name where custom value has item `a_where_key' same as `a_where_value' for type `a_type'. - local - i, l_last_id: INTEGER - t: STRING - l_key_found: BOOLEAN - res: ARRAYED_LIST [READABLE_STRING_8] - do - create res.make (0) - t := custom_type (a_type) - l_last_id := last_sequence (t) - from - i := 1 - until - i > l_last_id - loop - if - attached {TUPLE [name: READABLE_STRING_8; value: attached like custom_value]} object_with_id (i, t) as d - then - l_key_found := False - across - d.value as c - until - l_key_found or Result /= Void - loop - if c.key.same_string (a_where_key) then - l_key_found := True - if c.item.same_string (a_where_value) then - res.force (d.name) - end - end - end - end - i := i + 1 - end - if not res.is_empty then - Result := res - end - end - -feature {NONE} -- Implementation - - ensure_directory_exists (dn: STRING) - local - d: DIRECTORY - do - d := tmp_dir - d.make (dn) - if not d.exists then - d.recursive_create_dir - end - end - -feature {NONE} -- Implementation - - tmp_dir: DIRECTORY - once - create Result.make (directory_name) - end - -invariant - -end diff --git a/draft/application/cms/src/storage/cms_storage.e b/draft/application/cms/src/storage/cms_storage.e deleted file mode 100644 index bfe592be..00000000 --- a/draft/application/cms/src/storage/cms_storage.e +++ /dev/null @@ -1,186 +0,0 @@ -note - description : "[ - CMS interface to storage - ]" - date : "$Date$" - revision : "$Revision$" - -deferred class - CMS_STORAGE - -feature {NONE} -- Initialization - - initialize - do - end - -feature -- Access: user - - has_user: BOOLEAN - -- Has any user? - deferred - end - - fill_user_profile (a_user: CMS_USER) - deferred - end - - all_users: LIST [CMS_USER] - deferred - end - - user_by_id (a_id: like {CMS_USER}.id): detachable CMS_USER - require - a_id > 0 - deferred - ensure - same_id: Result /= Void implies Result.id = a_id - no_password: Result /= Void implies Result.password = Void - end - - user_by_name (a_name: like {CMS_USER}.name): detachable CMS_USER - require - a_name /= Void and then not a_name.is_empty - deferred - ensure - no_password: Result /= Void implies Result.password = Void - end - - user_by_email (a_email: like {CMS_USER}.email): detachable CMS_USER - deferred - ensure - no_password: Result /= Void implies Result.password = Void - end - - is_valid_credential (u, p: READABLE_STRING_32): BOOLEAN - deferred - end - -feature -- Change: user - - save_user (a_user: CMS_USER) - deferred - ensure - a_user_password_is_encoded: a_user.password = Void - a_user.has_id - end - -feature -- Access: roles and permissions - - user_has_permission (u: detachable CMS_USER; s: detachable READABLE_STRING_8): BOOLEAN - -- Anonymous or user `u' has permission for `s' ? - --| `s' could be "create page", - do - if s = Void then - Result := True - elseif u = Void then - Result := user_role_has_permission (anonymous_user_role, s) - else - Result := user_role_has_permission (authenticated_user_role, s) - if not Result and attached u.roles as l_roles then - across - l_roles as r - until - Result - loop - if attached user_role_by_id (r.item) as ur then - Result := user_role_has_permission (ur, s) - end - end - end - end - end - - anonymous_user_role: CMS_USER_ROLE - do - if attached user_role_by_id (1) as l_anonymous then - Result := l_anonymous - else - create Result.make ("anonymous") - end - end - - authenticated_user_role: CMS_USER_ROLE - do - if attached user_role_by_id (2) as l_authenticated then - Result := l_authenticated - else - create Result.make ("authenticated") - end - end - - user_role_has_permission (a_role: CMS_USER_ROLE; s: READABLE_STRING_8): BOOLEAN - do - Result := a_role.has_permission (s) - end - - user_role_by_id (a_id: like {CMS_USER_ROLE}.id): detachable CMS_USER_ROLE - deferred - end - - user_roles: LIST [CMS_USER_ROLE] - deferred - end - -feature -- Change: roles and permissions - - save_user_role (a_user_role: CMS_USER_ROLE) - deferred - end - -feature -- Email - - save_email (a_email: CMS_EMAIL) - deferred - end - -feature -- Log - - recent_logs (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_LOG] - deferred - end - - log (a_id: like {CMS_LOG}.id): detachable CMS_LOG - require - a_id > 0 - deferred - end - - save_log (a_log: CMS_LOG) - deferred - end - -feature -- Node - - recent_nodes (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_NODE] - deferred - end - - node (a_id: INTEGER): detachable CMS_NODE - require - a_id > 0 - deferred - end - - save_node (a_node: CMS_NODE) - deferred - end - -feature -- Misc - - set_custom_value (a_name: READABLE_STRING_8; a_value: attached like custom_value; a_type: READABLE_STRING_8) - -- Save data `a_name:a_value' for type `a_type' - deferred - end - - custom_value (a_name: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable TABLE_ITERABLE [READABLE_STRING_8, STRING_8] - -- Data for name `a_name' and type `a_type'. - deferred - end - - custom_value_names_where (a_where_key, a_where_value: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable LIST [READABLE_STRING_8] - -- Names where custom value has item `a_where_key' same as `a_where_value' for type `a_type'. - deferred - end - -end diff --git a/draft/application/cms/src/theme/cms_html_template.e b/draft/application/cms/src/theme/cms_html_template.e deleted file mode 100644 index 86a93f50..00000000 --- a/draft/application/cms/src/theme/cms_html_template.e +++ /dev/null @@ -1,13 +0,0 @@ -note - description: "Summary description for {WSF_CMS_HTML_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HTML_TEMPLATE - -inherit - CMS_TEMPLATE - -end diff --git a/draft/application/cms/src/theme/cms_page_template.e b/draft/application/cms/src/theme/cms_page_template.e deleted file mode 100644 index 74c36646..00000000 --- a/draft/application/cms/src/theme/cms_page_template.e +++ /dev/null @@ -1,12 +0,0 @@ -note - description: "Summary description for {CMS_PAGE_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_PAGE_TEMPLATE - -inherit - CMS_TEMPLATE -end diff --git a/draft/application/cms/src/theme/cms_template.e b/draft/application/cms/src/theme/cms_template.e deleted file mode 100644 index 791844c9..00000000 --- a/draft/application/cms/src/theme/cms_template.e +++ /dev/null @@ -1,81 +0,0 @@ -note - description: "Summary description for {WSF_CMS_PAGE_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_TEMPLATE - -feature -- Access - - theme: CMS_THEME - deferred - end - - variables: HASH_TABLE [detachable ANY, STRING] - deferred - end - - prepare (page: CMS_HTML_PAGE) - deferred - end - - to_html (page: CMS_HTML_PAGE): STRING - deferred - end - -feature {NONE} -- Implementation - - apply_template_engine (s: STRING_8) - local - p,n: INTEGER - k: STRING - sv: detachable STRING - do - from - n := s.count - p := 1 - until - p = 0 - loop - p := s.index_of ('$', p) - if p > 0 then - k := next_identifier (s, p + 1) - s.remove_substring (p, p + k.count) - sv := Void - if attached variables.item (k) as l_value then - - if attached {STRING_8} l_value as s8 then - sv := s8 - elseif attached {STRING_32} l_value as s32 then - sv := s32.as_string_8 -- FIXME: use html encoder - else - sv := l_value.out - end - s.insert_string (sv, p) - p := p + sv.count - else - debug - s.insert_string ("$" + k, p) - end - end - end - end - end - - next_identifier (s: STRING; a_index: INTEGER): STRING - local - i: INTEGER - do - from - i := a_index - until - not (s[i].is_alpha_numeric or s[i] = '_' or s[i] = '.') - loop - i := i + 1 - end - Result := s.substring (a_index, i - 1) - end - -end diff --git a/draft/application/cms/src/theme/cms_theme.e b/draft/application/cms/src/theme/cms_theme.e deleted file mode 100644 index bec379ae..00000000 --- a/draft/application/cms/src/theme/cms_theme.e +++ /dev/null @@ -1,101 +0,0 @@ -note - description: "Summary description for {WSF_CMS_THEME}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_THEME - -inherit - WSF_THEME - undefine - url_encoded, - html_encoded - end - - CMS_COMMON_API - -feature {NONE} -- Access - - service: CMS_SERVICE - deferred - end - -feature -- Access - - name: STRING - deferred - end - - regions: ARRAY [STRING] - deferred --- Result := <<"header", "content", "footer">> - end - - page_template: CMS_TEMPLATE - deferred - end - -feature -- Conversion - - menu_html (a_menu: CMS_MENU; is_horizontal: BOOLEAN): STRING_8 - do - create Result.make_from_string ("
    ") - if is_horizontal then - Result.append ("
      %N") - else - Result.append ("
        %N") - end - across - a_menu as c - loop - append_cms_link_to (c.item, Result) - end - Result.append ("
      %N") - Result.append ("
    ") - end - - page_html (page: CMS_HTML_PAGE): STRING_8 - deferred - end - -feature {NONE} -- Implementation - - append_cms_link_to (lnk: CMS_LINK; s: STRING_8) - local - cl: STRING - do - create cl.make_empty - if lnk.is_active then - cl.append ("active ") - end - if lnk.is_expandable then - cl.append ("expandable ") - end - if lnk.is_expanded then - cl.append ("expanded ") - end - if cl.is_empty then - s.append ("
  • ") - else - s.append ("
  • ") - end - s.append ("" + html_encoded (lnk.title) + "") - if - lnk.is_expanded and then - attached lnk.children as l_children - then - s.append ("
      %N") - across - l_children as c - loop - append_cms_link_to (c.item, s) - end - s.append ("
    ") - end - s.append ("
  • ") - end - - -end diff --git a/draft/application/cms/www/themes/default/res/ewfcms.js b/draft/application/cms/www/themes/default/res/ewfcms.js deleted file mode 100644 index d4ebbef7..00000000 --- a/draft/application/cms/www/themes/default/res/ewfcms.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * EWF CMS javascript based on JQuery - */ - -/** - * Override jQuery.fn.init to guard against XSS attacks. - * - * See http://bugs.jquery.com/ticket/9521 - */ - -(function () { - var jquery_init = jQuery.fn.init; - jQuery.fn.init = function (selector, context, rootjQuery) { - // If the string contains a "#" before a "<", treat it as invalid HTML. - if (selector && typeof selector === 'string') { - var hash_position = selector.indexOf('#'); - if (hash_position >= 0) { - var bracket_position = selector.indexOf('<'); - if (bracket_position > hash_position) { - throw 'Syntax error, unrecognized expression: ' + selector; - } - } - } - return jquery_init.call(this, selector, context, rootjQuery); - }; - jQuery.fn.init.prototype = jquery_init.prototype; -})(); - - -var EWFCMS = EWFCMS || { }; - -EWFCMS.toggleFieldset = function(fieldset) { - if ($(fieldset).is('.collapsed')) { - var content = $('> div:not(.action)', fieldset); - $(fieldset).removeClass('collapsed'); - content.hide(); - content.slideDown( { - duration: 'fast', - easing: 'linear', - complete: function() { - //Drupal.collapseScrollIntoView(this.parentNode); - this.parentNode.animating = false; - $('div.action', fieldset).show(); - }, - step: function() { - // Scroll the fieldset into view - //Drupal.collapseScrollIntoView(this.parentNode); - } - }); - } else { - var content = $('> div:not(.action)', fieldset).slideUp('fast', function() { - $(this.parentNode).addClass('collapsed'); - this.parentNode.animating = false; - }); - } - }; - -jQuery(document).ready(function(){ - //$('.collapsed').hide(); - $('fieldset.collapsible > legend').each(function() { - var fieldset = $(this.parentNode); - // turn legen into clickable link and wrap contents - var text = this.innerHTML; - $(this).empty() - .append($(''+ text + '').click(function() { - var fieldset = $(this).parents('fieldset:first')[0]; - if (!fieldset.animating) { - fieldset.animating = true; - EWFCMS.toggleFieldset(fieldset); - } - return false; - } - )) - .after($('
    ') - .append(fieldset.children(':not(legend):not(.action)'))) - .addClass('collapse-processed'); - }); - $('fieldset.collapsed').each(function() { - $(this).removeClass('collapsed'); - EWFCMS.toggleFieldset(this); - }); -}); - -jQuery(document).ready(function(){ - $('#tabs').tabs(); -}); - -//jQuery(document).ready(function(){ - //$('#second_sidebar').hide(); -//}); - diff --git a/draft/application/cms/www/themes/default/res/favicon.ico b/draft/application/cms/www/themes/default/res/favicon.ico deleted file mode 100644 index 343067f9..00000000 Binary files a/draft/application/cms/www/themes/default/res/favicon.ico and /dev/null differ diff --git a/draft/application/cms/www/themes/default/res/logo.png b/draft/application/cms/www/themes/default/res/logo.png deleted file mode 100644 index d7973764..00000000 Binary files a/draft/application/cms/www/themes/default/res/logo.png and /dev/null differ diff --git a/draft/application/cms/www/themes/default/res/menu-collapsed.png b/draft/application/cms/www/themes/default/res/menu-collapsed.png deleted file mode 100644 index 95a214a6..00000000 Binary files a/draft/application/cms/www/themes/default/res/menu-collapsed.png and /dev/null differ diff --git a/draft/application/cms/www/themes/default/res/menu-expanded.png b/draft/application/cms/www/themes/default/res/menu-expanded.png deleted file mode 100644 index 46f39ecb..00000000 Binary files a/draft/application/cms/www/themes/default/res/menu-expanded.png and /dev/null differ diff --git a/draft/application/cms/www/themes/default/res/style.css b/draft/application/cms/www/themes/default/res/style.css deleted file mode 100644 index b0615aed..00000000 --- a/draft/application/cms/www/themes/default/res/style.css +++ /dev/null @@ -1,251 +0,0 @@ -body { margin: 0; background-color: #eeeeff;} -div#header { background-color: #003; color: #fff; border: solid 1px #003; padding: 0px; margin: 0px;} -div#header img#logo { float: left; margin: 5px 15px 5px 10px; } -div#header div#title {font-size: 180%; font-weight: bold; margin-top: 10px; } -ul.horizontal { - list-style-type: none; -} -ul.horizontal li { - display: inline; - padding: 0 5px 0 5px; -} - -div#menu-bar li.active { - border: solid 1px #ff0; - color: #ff0; -} -div#menu-bar li:hover { - background-color: #fff; - color: #00f; -} -div#menu-bar li a { - text-decoration: none; - color: #fff; -} -div#menu-bar li:hover a { - color: #00f; - font-style: bold; -} - - -div#primary-tabs li { - color: #00f; - padding: 2px 5px 2px 5px; - background-color: #eee; - border: solid 1px #ccf; -} -div#primary-tabs li.active { - padding: 2px 7px 1px 7px; - border-top: solid 2px #99f; - border-left: solid 1px #99f; - border-right: solid 1px #99f; - border-bottom: 0; - background-color: #fff; - color: #00f; -} -div#primary-tabs li:hover { - background-color: #fff; - color: #00f; -} -div#primary-tabs li a { - text-decoration: none; - color: #00f; -} -div#primary-tabs li:hover a { - color: #00f; - font-style: bold; -} - - - -div#menu-first { margin-left: 20%; color: #ccf; background-color: #003; } -div#menu-first a { color: #ccf; } -div#menu-second { color: #99f; background-color: #333; } -div#menu-second a { color: #99f; } - -div#main-wrapper { - clear: both; - display: block; - height: 0; -} -div#main { margin: 0; padding: 0; clear: both; height:0; display: block; } - -div#content { - padding: 5px 3px 5px 20px; - margin-top: 10px; - min-width: 60%; - display: inline; - float: left; - position: relative; - background-color: #ffffff; - padding-bottom: 30px; -} - -div#first_sidebar { - width: 20%; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; -} -div#second_sidebar { - width: 20%; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; - background-color: #eee; -} -div.sidebar div.block { - margin-bottom: 5px; - padding: 0; - border: dotted 1px #999; - background-color: #fff; -} -div.sidebar div.block div.title { - padding: 3px 3px 3px 3px; - font-weight: bold; - background-color: #dedede; - border-bottom: dotted 1px #999; -} -div.sidebar div.block div.inside { - margin: 3px; -} -div#footer { margin: 10px 0 10px 0; clear: both; display: block; text-align: center; padding: 10px; border-top: solid 1px #00f; color: #fff; background-color: #333;} -div#footer a { color: #ff0; } - -form div.error { - border-top: dotted 1px #f00; - border-bottom: dotted 1px #f00; - border-left: solid 3px #f00; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; -} -div.description { - font-style: italic; - font-color: #999; -} - -div.node-wrapper { - margin: 5px 2px 5px 2px; - border: dotted 1px #dddddd; - padding: 5px 3px 5px 3px; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; - float: left; -} -div.node div.description { - text-align: right; -} -div.node div.inner { - padding: 5px 5px 5px 10px; - border-top: dotted 1px #dddddd; -} - -form#user-login { - border: dotted 1px #099; - display: inline-block; - padding: 10px; - margin: 10px; -} - -form#user-login>div { - margin-bottom: 10px; -} -form#user-login .input { - float: left; -} -form#user-login img.logo { -} - -div#message { - border: solid 1px #fc0; - background-color: #fed; - color: #000; - padding: 5px; - margin: 5px; -} - -div#message li { - padding-left: 5px; - margin-left: 3px; -} -div#message li.success { - color: #003300; - background-color: #ccffcc; -} - -div#message li.error { - color: #330000; - background-color: #ff9494; -} -div#message li.warning { - color: #aa2200; - background-color: #ffcc99; -} - -div.columns { - margin-top: 10px; - display: inline-block; - clear: both; -} - -div.columns>* { - padding-left: 10px; - padding-top: 5px; - border-top: dotted 1px #999; - border-left: dotted 1px #999; - margin-left: 1px; - margin-right: 10px; - float: left; -} - -/* Link */ - -a { - text-decoration: none; -} -a:hover { - text-decoration: underline; -} - -div.menu ul.vertical { - margin: 0; - padding-left: 10px; - list-style-type: none; -} - -div.menu ul.vertical ul { - border-left: solid 3px #eee; - list-style-type: none; - margin: 0; - padding-left: 5px; - margin-left: 5px; - margin-bottom: 5px; -} - -/* Fieldset and collapsible */ - -fieldset.collapsible legend a { - padding-left: 15px; - background: url(menu-expanded.png) 5px 75% no-repeat; -} - -fieldset.collapsed legend a { - padding-left: 15px; - background: url(menu-collapsed.png) 5px 50% no-repeat; -} - -fieldset.collapsed { - border: none; - border-top: dotted 1px #000; -} - diff --git a/draft/application/cms/www/themes/test/res/favicon.ico b/draft/application/cms/www/themes/test/res/favicon.ico deleted file mode 100644 index 343067f9..00000000 Binary files a/draft/application/cms/www/themes/test/res/favicon.ico and /dev/null differ diff --git a/draft/application/cms/www/themes/test/res/logo.png b/draft/application/cms/www/themes/test/res/logo.png deleted file mode 100644 index d7973764..00000000 Binary files a/draft/application/cms/www/themes/test/res/logo.png and /dev/null differ diff --git a/draft/application/cms/www/themes/test/res/style.css b/draft/application/cms/www/themes/test/res/style.css deleted file mode 100644 index 6ce3435a..00000000 --- a/draft/application/cms/www/themes/test/res/style.css +++ /dev/null @@ -1,182 +0,0 @@ -body { margin: 0; background-color: #eeeeff;} -div#header { background-color: #300; color: #fff; border: solid 1px #003; padding: 0px; margin: 0px;} -div#header img#logo { float: left; margin: 5px 15px 5px 10px; } -div#header div#title {font-size: 180%; font-weight: bold; margin-top: 10px; } -ul.horizontal { - list-style-type: none; -} -ul.horizontal li { - display: inline; - padding: 0 5px 0 5px; -} - -div#menu-bar li.active { - border: solid 1px #ff0; - color: #ff0; -} -div#menu-bar li:hover { - background-color: #fff; - color: #00f; -} -div#menu-bar li a { - text-decoration: none; - color: #fff; -} -div#menu-bar li:hover a { - color: #00f; - font-style: bold; -} - - -div#primary-tabs li { - color: #00f; - padding: 2px 5px 2px 5px; - background-color: #eee; - border: solid 1px #ccf; -} -div#primary-tabs li.active { - padding: 2px 7px 1px 7px; - border-top: solid 2px #99f; - border-left: solid 1px #99f; - border-right: solid 1px #99f; - border-bottom: 0; - background-color: #fff; - color: #00f; -} -div#primary-tabs li:hover { - background-color: #fff; - color: #00f; -} -div#primary-tabs li a { - text-decoration: none; - color: #00f; -} -div#primary-tabs li:hover a { - color: #00f; - font-style: bold; -} - - - -div#menu-first { margin-left: 20%; color: #ccf; background-color: #003; } -div#menu-first a { color: #ccf; } -div#menu-second { color: #99f; background-color: #333; } -div#menu-second a { color: #99f; } - -div#main-wrapper { - clear: both; - display: block; - height: 0; -} -div#main { margin: 0; padding: 0; clear: both; height:0; display: block; } - -div#first_sidebar { - width: 20%; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; -} -div#second_sidebar { - width: 20%; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; -} -div.sidebar div.block { - margin-bottom: 5px; - padding: 0; - border: dotted 1px #999; - background-color: #fff; -} -div.sidebar div.block div.title { - padding: 3px 3px 3px 3px; - font-weight: bold; - background-color: #dedede; - border-bottom: dotted 1px #999; -} -div.sidebar div.block div.inside { - margin: 3px; -} - -div#content { padding: 5px 3px 5px 20px; - margin-top: 10px; - width: 50%; - display: inline; - float: left; - position: relative; - background-color: #ffffff; - padding-bottom: 30px; -} -div#footer { margin: 10px 0 10px 0; clear: both; display: block; text-align: center; padding: 10px; border-top: solid 1px #00f; color: #fff; background-color: #333;} -div#footer a { color: #ff0; } - -form div.error { - border-top: dotted 1px #f00; - border-bottom: dotted 1px #f00; - border-left: solid 3px #f00; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; -} -div.description { - font-style: italic; - font-color: #999; -} - -div.node-wrapper { - margin: 5px 2px 5px 2px; - border: dotted 1px #dddddd; - padding: 5px 3px 5px 3px; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; - float: left; -} -div.node div.description { - text-align: right; -} -div.node div.inner { - padding: 5px 5px 5px 10px; - border-top: dotted 1px #dddddd; -} - -form#login-form { - border: dotted 1px #099; - display: inline-block; - padding: 10px; - margin: 10px; -} - -div#message { - border: solid 1px #fc0; - background-color: #fed; - color: #000; - padding: 5px; - margin: 5px; -} - -div#message li { - padding-left: 5px; - margin-left: 3px; -} -div#message li.success { - color: #003300; - background-color: #ccffcc; -} - -div#message li.error { - color: #330000; - background-color: #ff9494; -} -div#message li.warning { - color: #aa2200; - background-color: #ffcc99; -} diff --git a/draft/library/security/oauth/oauth-safe.ecf b/draft/library/security/oauth/oauth-safe.ecf index 62e5bc4f..ab8706f5 100644 --- a/draft/library/security/oauth/oauth-safe.ecf +++ b/draft/library/security/oauth/oauth-safe.ecf @@ -1,5 +1,5 @@ - + @@ -9,7 +9,7 @@ - - + + diff --git a/draft/src/gewf/README.md b/draft/src/gewf/README.md new file mode 100644 index 00000000..a5cfd020 --- /dev/null +++ b/draft/src/gewf/README.md @@ -0,0 +1,3 @@ +The gewf tool, is an experimentation to generate EWF project from template. + +status: experimental, POC, in-progress, draft diff --git a/draft/src/gewf/gewf.ecf b/draft/src/gewf/gewf.ecf new file mode 100644 index 00000000..140da892 --- /dev/null +++ b/draft/src/gewf/gewf.ecf @@ -0,0 +1,21 @@ + + + + Generator for EWF project + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + + + + + + diff --git a/draft/src/gewf/license.lic b/draft/src/gewf/license.lic new file mode 100644 index 00000000..27384d13 --- /dev/null +++ b/draft/src/gewf/license.lic @@ -0,0 +1,10 @@ +${NOTE_KEYWORD} + copyright: "2011-${YEAR}, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" diff --git a/draft/src/gewf/src/gewf.e b/draft/src/gewf/src/gewf.e new file mode 100644 index 00000000..41f04891 --- /dev/null +++ b/draft/src/gewf/src/gewf.e @@ -0,0 +1,169 @@ +note + description : "Objects that ..." + author : "$Author$" + date : "$Date$" + revision : "$Revision$" + +class + GEWF + +create + make + +feature {NONE} -- Initialization + + make + -- Initialize `Current'. + local + args: ARGUMENTS_32 + cfg: detachable READABLE_STRING_32 + do + create args + if args.argument_count > 0 then + cfg := args.argument (1) + end + if cfg /= Void then + load_configuration (cfg) + end + execute + end + +feature -- Status + +feature -- Access + + config (k: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + local + l_keys: LIST [READABLE_STRING_GENERAL] + do + if attached {JSON_STRING} json_item (json, k) as js then + Result := js.unescaped_string_32 + end + end + + json_item (j: detachable JSON_VALUE; k: READABLE_STRING_GENERAL): detachable JSON_VALUE + local + l_keys: LIST [READABLE_STRING_GENERAL] + v: detachable JSON_VALUE + s: STRING_32 + js: JSON_STRING + do + if attached {JSON_OBJECT} j as jo then + l_keys := k.split ('.') + l_keys.start + create js.make_json_from_string_32 (l_keys.item.as_readable_string_32) + v := jo.item (js) + l_keys.remove + if l_keys.count > 0 then + if v /= Void then + create s.make (k.count) + across + l_keys as c + loop + s.append_string_general (c.item) + s.append_character ('.') + end + s.remove_tail (1) + Result := json_item (v, s) + end + else + Result := v + end + end + end + + load_configuration (fn: READABLE_STRING_GENERAL) + local + p: JSON_PARSER + f: PLAIN_TEXT_FILE + s: STRING + do + create s.make (1_024) + + create f.make_with_name (fn) + if f.exists and then f.is_access_readable then + f.open_read + from + until + f.exhausted + loop + f.read_stream_thread_aware (1_024) + s.append (f.last_string) + end + f.close + end + + create p.make_parser (s) + json := p.parse + end + + json: detachable JSON_VALUE + +feature -- Execution + + execute + local + tpl_name: READABLE_STRING_32 + vals: STRING_TABLE [READABLE_STRING_8] + uuid_gen: UUID_GENERATOR + do + if attached config ("template") as s32 then + create vals.make (5) + + tpl_name := s32 + create uuid_gen + vals.force (uuid_gen.generate_uuid.out, "UUID") + + if + attached config ("application.name") as appname + then + vals.force (appname.to_string_8, "APPNAME") + else + vals.force ("application", "APPNAME") + end + + if + attached config ("application.root_class") as approot + then + vals.force (approot.to_string_8, "APP_ROOT") + else + vals.force ("APPLICATION", "APP_ROOT") + end + generate (tpl_name, vals) + else + io.error.put_string ("Error no template value! %N") + end + end + + generate (tpl: READABLE_STRING_32; vals: STRING_TABLE [READABLE_STRING_8]) + local + gen: GEWF_GENERATOR + p: PATH + appname: detachable READABLE_STRING_GENERAL + do + create p.make_from_string ("template") + p := p.extended (tpl) + appname := vals.item ("APPNAME") + if appname = Void then + appname := "_generated" + end + create gen.make (p, create {PATH}.make_from_string (appname)) + gen.execute (vals) + end + +feature {NONE} -- Implementation + +invariant +-- invariant_clause: True + +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end diff --git a/draft/src/gewf/src/gewf_generator.e b/draft/src/gewf/src/gewf_generator.e new file mode 100644 index 00000000..389c606e --- /dev/null +++ b/draft/src/gewf/src/gewf_generator.e @@ -0,0 +1,132 @@ +note + description: "Summary description for {GEWF_GENERATOR}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + GEWF_GENERATOR + +inherit + DIRECTORY_ITERATOR + redefine + process_directory, + process_file + end + +create + make + +feature {NONE} -- Initialization + + make (tpl: PATH; tgt: PATH) + do + template_folder := tpl + target_folder := tgt + end + +feature -- Execution + + execute (vals: STRING_TABLE [READABLE_STRING_8]) + do + values := vals + process_directory (template_folder) + values := Void + end + +feature -- Operation + + process_file (fn: PATH) + -- + local + s: STRING_32 + line: STRING + src,tgt: RAW_FILE + do + create s.make_from_string (fn.name) + s := s.substring (template_folder.name.count + 2, s.count) + if attached fn.extension as ext and then ext.is_case_insensitive_equal ("tpl") then + s.remove_tail (4) -- ".tpl" + end + + evaluate_string_32 (s) + s.to_lower + create src.make_with_path (fn) + create tgt.make_with_path (target_folder.extended (s)) + tgt.create_read_write + src.open_read + from + until + src.exhausted + loop + src.read_line_thread_aware + line := src.last_string + evaluate_string_8 (line) + tgt.put_string (line) + tgt.put_new_line + end + src.close + tgt.close + +-- Precursor (fn) + end + + process_directory (dn: PATH) + -- + local + s: STRING_32 + p: PATH + dir: DIRECTORY + do + create s.make_from_string (dn.name) + s := s.substring (template_folder.name.count + 1, s.count) + evaluate_string_32 (s) + p := target_folder.extended (s) + create dir.make_with_path (p) + dir.recursive_create_dir + Precursor (dn) + end + +feature -- Access + + values: detachable STRING_TABLE [READABLE_STRING_8] + + template_folder: PATH + target_folder: PATH + +feature -- Implementation + + evaluate_string_8 (s: STRING_8) + do + if attached values as l_values then + across + l_values as c + loop + s.replace_substring_all ({STRING_8} "${" + c.key.as_string_8 + "}", c.item) + end + end + end + + evaluate_string_32 (s: STRING_32) + do + if attached values as l_values then + across + l_values as c + loop + s.replace_substring_all ({STRING_32} "${" + c.key.as_string_32 + "}", c.item) + end + end + end + + +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end diff --git a/draft/src/gewf/template/basic/${APPNAME}.ecf.tpl b/draft/src/gewf/template/basic/${APPNAME}.ecf.tpl new file mode 100644 index 00000000..d293c122 --- /dev/null +++ b/draft/src/gewf/template/basic/${APPNAME}.ecf.tpl @@ -0,0 +1,45 @@ + + + + + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/draft/src/gewf/template/basic/ecf-target-any_connector.tpl b/draft/src/gewf/template/basic/ecf-target-any_connector.tpl new file mode 100644 index 00000000..eb7f6c90 --- /dev/null +++ b/draft/src/gewf/template/basic/ecf-target-any_connector.tpl @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/draft/src/gewf/template/basic/ecf-target-connector.tpl b/draft/src/gewf/template/basic/ecf-target-connector.tpl new file mode 100644 index 00000000..d4a6fd75 --- /dev/null +++ b/draft/src/gewf/template/basic/ecf-target-connector.tpl @@ -0,0 +1,6 @@ + + + + + + diff --git a/draft/src/gewf/template/basic/launcher/any/application_launcher.e b/draft/src/gewf/template/basic/launcher/any/application_launcher.e new file mode 100644 index 00000000..7182d350 --- /dev/null +++ b/draft/src/gewf/template/basic/launcher/any/application_launcher.e @@ -0,0 +1,85 @@ +note + description: "Summary description for {APPLICATION_LAUNCHER}." + author: "" + date: "$Date: 2013-06-12 13:55:42 +0200 (mer., 12 juin 2013) $" + revision: "$Revision: 36 $" + +deferred class + APPLICATION_LAUNCHER + +feature {NONE} -- Initialization + + launcher_nature: detachable READABLE_STRING_8 + -- Initialize the launcher nature + -- either cgi, libfcgi, or nino. + --| We could extend with more connector if needed. + --| and we could use WSF_DEFAULT_SERVICE_LAUNCHER to configure this at compilation time. + local + p: PATH + l_entry_name: READABLE_STRING_32 + ext: detachable READABLE_STRING_32 + do + create p.make_from_string (execution_environment.arguments.command_name) + if attached p.entry as l_entry then + ext := l_entry.extension + end + if ext /= Void then + if ext.same_string (nature_nino) then + Result := nature_nino + end + if ext.same_string (nature_cgi) then + Result := nature_cgi + end + if ext.same_string (nature_libfcgi) or else ext.same_string ("fcgi") then + Result := nature_libfcgi + end + end + end + +feature {NONE} -- nino + + nature_nino: STRING = "nino" + + launch_nino (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_NINO_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- cgi + + nature_cgi: STRING = "cgi" + + launch_cgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_CGI_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- libfcgi + + nature_libfcgi: STRING = "libfcgi" + + launch_libfcgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_LIBFCGI_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- Launcher + + launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + local + nature: like launcher_nature + do + nature := launcher_nature + if nature = Void or else nature = nature_nino then + launch_nino (a_service, opts) + elseif nature = nature_cgi then + launch_cgi (a_service, opts) + elseif nature = nature_libfcgi then + launch_libfcgi (a_service, opts) + else + -- bye bye + (create {EXCEPTIONS}).die (-1) + end + end + +end diff --git a/draft/src/gewf/template/basic/launcher/default/application_launcher.e b/draft/src/gewf/template/basic/launcher/default/application_launcher.e new file mode 100644 index 00000000..e20b06ac --- /dev/null +++ b/draft/src/gewf/template/basic/launcher/default/application_launcher.e @@ -0,0 +1,19 @@ +note + description: "Summary description for {APPLICATION}." + author: "" + date: "$Date: 2013-06-12 13:55:42 +0200 (mer., 12 juin 2013) $" + revision: "$Revision: 36 $" + +deferred class + APPLICATION_LAUNCHER + +feature {NONE} -- Launcher + + launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + local + launcher: WSF_SERVICE_LAUNCHER + do + create {WSF_DEFAULT_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +end diff --git a/draft/src/gewf/template/basic/src/${APP_ROOT}.e.tpl b/draft/src/gewf/template/basic/src/${APP_ROOT}.e.tpl new file mode 100644 index 00000000..d93b9ef5 --- /dev/null +++ b/draft/src/gewf/template/basic/src/${APP_ROOT}.e.tpl @@ -0,0 +1,45 @@ +note + description: "[ + application service + ]" + date: "$Date$" + revision: "$Revision$" + +class + ${APP_ROOT} + +inherit + WSF_LAUNCHABLE_SERVICE + redefine + initialize + end + + WSF_ROUTED_SERVICE + + APPLICATION_LAUNCHER + +create + make_and_launch + +feature {NONE} -- Initialization + + initialize + -- Initialize current service. + do + Precursor + set_service_option ("port", 9090) + initialize_router + end + + setup_router + -- Setup `router' + local + fhdl: WSF_FILE_SYSTEM_HANDLER + do + router.handle_with_request_methods ("/doc", create {WSF_ROUTER_SELF_DOCUMENTATION_HANDLER}.make (router), router.methods_GET) + create fhdl.make_hidden (".") + fhdl.set_directory_index (<<"index.html">>) + router.handle_with_request_methods ("", fhdl, router.methods_GET) + end + +end diff --git a/draft/src/gewf/testing/README.txt b/draft/src/gewf/testing/README.txt new file mode 100644 index 00000000..1d7b2986 --- /dev/null +++ b/draft/src/gewf/testing/README.txt @@ -0,0 +1,9 @@ +To generate "demo" + + +gewf demo.cfg + + +It will generate the project under demo\demo.ecf + +note for now, the "template" folder should be in the current folder. diff --git a/draft/src/gewf/testing/demo.cfg b/draft/src/gewf/testing/demo.cfg new file mode 100644 index 00000000..545f164c --- /dev/null +++ b/draft/src/gewf/testing/demo.cfg @@ -0,0 +1,4 @@ +{ +"template": "basic", +"application": {"name" : "demo", "root_class": "EWF_DEMO" } +} diff --git a/examples/restbucksCRUD/restbucks-safe.ecf b/examples/restbucksCRUD/restbucks-safe.ecf index 26e51b11..86dcda7f 100644 --- a/examples/restbucksCRUD/restbucks-safe.ecf +++ b/examples/restbucksCRUD/restbucks-safe.ecf @@ -19,8 +19,8 @@ - + diff --git a/examples/simple/application.e b/examples/simple/application.e index 532ddbfd..159f0cf4 100644 --- a/examples/simple/application.e +++ b/examples/simple/application.e @@ -8,12 +8,23 @@ class inherit WSF_DEFAULT_SERVICE + redefine + initialize + end create make_and_launch feature {NONE} -- Initialization + initialize + -- Initialize current service. + do + set_service_option ("port", 9090) + end + +feature -- Basic operations + execute (req: WSF_REQUEST; res: WSF_RESPONSE) do -- To send a response we need to setup, the status code and diff --git a/examples/tutorial/step_4/hello/hello.ecf b/examples/tutorial/step_4/hello/hello.ecf index 2a1a12d3..37cfd5d0 100644 --- a/examples/tutorial/step_4/hello/hello.ecf +++ b/examples/tutorial/step_4/hello/hello.ecf @@ -11,7 +11,6 @@ - diff --git a/examples/tutorial/step_4/hello/src/user_message_handler.e b/examples/tutorial/step_4/hello/src/user_message_handler.e index 12a6a0e8..5e1b3f5e 100644 --- a/examples/tutorial/step_4/hello/src/user_message_handler.e +++ b/examples/tutorial/step_4/hello/src/user_message_handler.e @@ -10,6 +10,10 @@ class inherit WSF_URI_TEMPLATE_RESPONSE_HANDLER + SHARED_WSF_PERCENT_ENCODER + rename + percent_encoder as url_encoder + end feature -- Access @@ -75,7 +79,8 @@ feature -- Access url_encoded_string (s: READABLE_STRING_32): STRING_8 do - Result := (create {UTF8_URL_ENCODER}).encoded_string (s) + create Result.make (s.count) + url_encoder.append_percent_encoded_string_to (s, Result) end html_decoded_string (v: READABLE_STRING_32): READABLE_STRING_32 diff --git a/library/network/http_client/http_client-safe.ecf b/library/network/http_client/http_client-safe.ecf index 34db8bfd..c9c641e3 100644 --- a/library/network/http_client/http_client-safe.ecf +++ b/library/network/http_client/http_client-safe.ecf @@ -1,5 +1,5 @@ - + @@ -10,7 +10,6 @@ - @@ -22,6 +21,7 @@ + diff --git a/library/network/http_client/src/http_client_request_context.e b/library/network/http_client/src/http_client_request_context.e index 663c6a57..78819831 100644 --- a/library/network/http_client/src/http_client_request_context.e +++ b/library/network/http_client/src/http_client_request_context.e @@ -69,7 +69,7 @@ feature -- Access -- Upload data --| Note: make sure to precise the Content-Type header - upload_filename: detachable READABLE_STRING_8 + upload_filename: detachable IMMUTABLE_STRING_32 -- Upload data read from `upload_filename' --| Note: make sure to precise the Content-Type header @@ -124,8 +124,6 @@ feature -- Element change end add_header_lines (lst: ITERABLE [READABLE_STRING_8]) - local - i: INTEGER do across lst as c @@ -151,16 +149,20 @@ feature -- Element change set_upload_data (a_data: like upload_data) require - has_no_upload_data: not has_upload_data + has_no_upload_data: a_data /= Void implies not has_upload_data do upload_data := a_data end - set_upload_filename (a_fn: like upload_filename) + set_upload_filename (a_fn: detachable READABLE_STRING_GENERAL) require - has_no_upload_filename: not has_upload_filename + has_no_upload_filename: a_fn /= Void implies not has_upload_filename do - upload_filename := a_fn + if a_fn = Void then + upload_filename := Void + else + create upload_filename.make_from_string_general (a_fn) + end end set_write_agent (agt: like write_agent) @@ -233,7 +235,7 @@ feature {NONE} -- Implementation end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e b/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e index 87d3d4ee..083ca687 100644 --- a/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e +++ b/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e @@ -61,7 +61,7 @@ feature -- Execution retried: BOOLEAN l_form_data: detachable HASH_TABLE [READABLE_STRING_32, READABLE_STRING_32] l_upload_data: detachable READABLE_STRING_8 - l_upload_filename: detachable READABLE_STRING_8 + l_upload_filename: detachable READABLE_STRING_GENERAL l_headers: like headers do if not retried then @@ -172,7 +172,7 @@ feature -- Execution or request_method.is_case_insensitive_equal ("PUT") end - create l_upload_file.make (l_upload_filename) + create l_upload_file.make_with_name (l_upload_filename) if l_upload_file.exists and then l_upload_file.is_readable then curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_upload, 1) @@ -388,7 +388,7 @@ feature {NONE} -- Implementation end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e b/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e index e54dd360..d68eb98b 100644 --- a/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e +++ b/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e @@ -63,7 +63,6 @@ feature -- Basic operation put (a_path: READABLE_STRING_8; a_ctx: detachable HTTP_CLIENT_REQUEST_CONTEXT; data: detachable READABLE_STRING_8): HTTP_CLIENT_RESPONSE local - req: HTTP_CLIENT_REQUEST ctx: detachable HTTP_CLIENT_REQUEST_CONTEXT f: detachable RAW_FILE l_data: detachable READABLE_STRING_8 @@ -86,7 +85,7 @@ feature -- Basic operation f.close check ctx /= Void then ctx.set_upload_data (Void) - ctx.set_upload_filename (f.name) + ctx.set_upload_filename (f.path.name) end end Result := custom ("PUT", a_path, ctx) @@ -152,7 +151,7 @@ feature {LIBCURL_HTTP_CLIENT_REQUEST} -- Curl implementation ;note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/network/protocol/CONNEG/conneg-safe.ecf b/library/network/protocol/CONNEG/conneg-safe.ecf index 3be360c7..42207d69 100644 --- a/library/network/protocol/CONNEG/conneg-safe.ecf +++ b/library/network/protocol/CONNEG/conneg-safe.ecf @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - - + + diff --git a/library/network/protocol/http/http-safe.ecf b/library/network/protocol/http/http-safe.ecf index 93ad8e1a..024bdb8c 100644 --- a/library/network/protocol/http/http-safe.ecf +++ b/library/network/protocol/http/http-safe.ecf @@ -1,5 +1,5 @@ - + diff --git a/library/network/protocol/http/src/http_date.e b/library/network/protocol/http/src/http_date.e index 18d1a5a5..70e489a4 100644 --- a/library/network/protocol/http/src/http_date.e +++ b/library/network/protocol/http/src/http_date.e @@ -39,6 +39,7 @@ inherit DEBUG_OUTPUT create + make_now_utc, make_from_timestamp, make_from_string, make_from_date_time @@ -76,6 +77,12 @@ feature {NONE} -- Initialization date_time := dt end + make_now_utc + -- Build from current utc date time. + do + create date_time.make_now_utc + end + feature -- Access has_error: BOOLEAN @@ -151,60 +158,128 @@ feature -- Conversion to string append_date_time_to_ansi_c_string (date_time, Result) end +feature -- Conversion into string + + append_to_yyyy_mmm_dd_string (s: STRING_GENERAL) + local + dt: DATE_TIME + do + dt := date_time + append_integer_to (dt.year, s) -- yyyy + s.append_code (32) -- 32 ' ' -- SPace + append_month_mmm_to (dt.month, s) -- mmm + s.append_code (32) -- 32 ' ' -- SPace + append_2_digits_integer_to (dt.day, s) -- dd + end + + append_to_rfc1123_string (s: STRING_GENERAL) + local + dt: DATE_TIME + do + dt := date_time + append_day_ddd_to (dt.date.day_of_the_week, s) -- ddd + s.append_code (44) -- 44 ',' -- ',' + s.append_code (32) -- 32 ' ' -- SPace + append_2_digits_integer_to (dt.day, s) -- dd + s.append_code (32) -- 32 ' ' -- SPace + append_month_mmm_to (dt.month, s) -- mmm + s.append_code (32) -- 32 ' ' -- SPace + append_integer_to (dt.year, s) -- YYYY + s.append_code (32) -- 32 ' ' -- SPace + append_2_digits_time_to (dt.time, s) -- hh:mi:ss + s.append (" GMT") -- SPace + GMT + end + + append_rfc850_string (s: STRING_GENERAL) + local + dt: DATE_TIME + do + dt := date_time + append_day_name_to (dt.date.day_of_the_week, s) -- mmm + s.append_code (44) -- 44 ',' -- ',' + s.append_code (32) -- 32 ' ' -- SPace + append_2_digits_integer_to (dt.day, s) -- dd + s.append_code (45) -- 45 '-' -- '-' + append_month_mmm_to (dt.month, s) -- mmm + s.append_code (45) -- 45 '-' -- '-' + append_integer_to (dt.year \\ 100, s) -- yy + s.append_code (32) -- 32 ' ' -- SPace + append_2_digits_time_to (dt.time, s) -- hh:mi:ss + s.append (" GMT") -- SPace + GMT + end + + append_to_ansi_c_string (s: STRING_GENERAL) + --| Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format + local + dt: DATE_TIME + do + dt := date_time + append_day_ddd_to (dt.date.day_of_the_week, s) -- ddd + s.append_code (32) -- 32 ' ' -- SPace + append_month_mmm_to (dt.month, s) -- mmm + s.append_code (32) -- 32 ' ' -- SPace + s.append_code (32) -- 32 ' ' -- SPace + append_integer_to (dt.day, s) -- d + s.append_code (32) -- 32 ' ' -- SPace + append_2_digits_time_to (dt.time, s) -- hh:mi:ss + s.append_code (32) -- 32 ' ' -- SPace + append_integer_to (dt.year, s) -- yyyy + end + feature -- Conversion into string - append_date_time_to_yyyy_mmm_dd_string (dt: DATE_TIME; s: STRING) + append_date_time_to_yyyy_mmm_dd_string (dt: DATE_TIME; s: STRING_GENERAL) do - s.append_integer (dt.year) -- yyyy - s.append_character (' ') -- ' ' + append_integer_to (dt.year, s) -- yyyy + s.append_code (32) -- 32 ' ' -- SPace append_month_mmm_to (dt.month, s) -- mmm - s.append_character (' ') -- ' ' + s.append_code (32) -- 32 ' ' -- SPace append_2_digits_integer_to (dt.day, s) -- dd end - append_date_time_to_rfc1123_string (dt: DATE_TIME; s: STRING) + append_date_time_to_rfc1123_string (dt: DATE_TIME; s: STRING_GENERAL) do append_day_ddd_to (dt.date.day_of_the_week, s) -- ddd - s.append_character (',') -- ',' - s.append_character (' ') -- SPace + s.append_code (44) -- 44 ',' -- ',' + s.append_code (32) -- 32 ' ' -- SPace append_2_digits_integer_to (dt.day, s) -- dd - s.append_character (' ') -- SPace + s.append_code (32) -- 32 ' ' -- SPace append_month_mmm_to (dt.month, s) -- mmm - s.append_character (' ') -- SPace - s.append_integer (dt.year) -- yyyy - s.append_character (' ') -- SPace + s.append_code (32) -- 32 ' ' -- SPace + append_integer_to (dt.year, s) -- yyyy + s.append_code (32) -- 32 ' ' -- SPace append_2_digits_time_to (dt.time, s) -- hh:mi:ss s.append (" GMT") -- SPace + GMT end - append_date_time_to_rfc850_string (dt: DATE_TIME; s: STRING) + append_date_time_to_rfc850_string (dt: DATE_TIME; s: STRING_GENERAL) do append_day_name_to (dt.date.day_of_the_week, s) -- mmm - s.append_character (',') -- , - s.append_character (' ') -- SPace + s.append_code (44) -- 44 ',' -- ',' + s.append_code (32) -- 32 ' ' -- SPace append_2_digits_integer_to (dt.day, s) -- dd - s.append_character ('-') -- '-' + s.append_code (45) -- 45 '-' -- '-' append_month_mmm_to (dt.month, s) -- mmm - s.append_character ('-') -- '-' - s.append_integer (dt.year \\ 100) -- yy - s.append_character (' ') -- SPace + s.append_code (45) -- 45 '-' -- '-' + append_integer_to (dt.year \\ 100, s) -- yy + s.append_code (32) -- 32 ' ' -- SPace append_2_digits_time_to (dt.time, s) -- hh:mi:ss s.append (" GMT") -- SPace + GMT end - append_date_time_to_ansi_c_string (dt: DATE_TIME; s: STRING) + append_date_time_to_ansi_c_string (dt: DATE_TIME; s: STRING_GENERAL) --| Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format do append_day_ddd_to (dt.date.day_of_the_week, s) -- ddd - s.append_character (' ') -- SP + s.append_code (32) -- 32 ' ' -- SPace append_month_mmm_to (dt.month, s) -- mmm - s.append_character (' ') -- SPace - s.append_character (' ') -- SPace - s.append_integer (dt.day) -- d - s.append_character (' ') -- SPace + s.append_code (32) -- 32 ' ' -- SPace + s.append_code (32) -- 32 ' ' -- SPace + append_integer_to (dt.day, s) -- d + s.append_code (32) -- 32 ' ' -- SPace append_2_digits_time_to (dt.time, s) -- hh:mi:ss - s.append_character (' ') -- SPace - s.append_integer (dt.year) -- yyyy + s.append_code (32) -- 32 ' ' -- SPace + append_integer_to (dt.year, s) -- yyyy end feature -- Status report @@ -221,26 +296,26 @@ feature -- Status report feature {NONE} -- Implementation - append_2_digits_integer_to (i: INTEGER; s: STRING) + append_2_digits_integer_to (i: INTEGER; s: STRING_GENERAL) require is_not_negative: i >= 0 do if i <= 9 then - s.append_character ('0') + s.append_code (48) -- 48 '0' end - s.append_integer (i) + append_integer_to (i, s) end - append_2_digits_time_to (t: TIME; s: STRING) + append_2_digits_time_to (t: TIME; s: STRING_GENERAL) do append_2_digits_integer_to (t.hour, s) -- hh - s.append_character (':') -- : + s.append_code (58) -- 58 ':' -- : append_2_digits_integer_to (t.minute, s) -- mi - s.append_character (':') -- : + s.append_code (58) -- 58 ':' -- : append_2_digits_integer_to (t.second, s) -- ss end - append_day_ddd_to (d: INTEGER; s: STRING) + append_day_ddd_to (d: INTEGER; s: STRING_GENERAL) require 1 <= d and d <= 7 do @@ -257,7 +332,7 @@ feature {NONE} -- Implementation end end - append_day_name_to (d: INTEGER; s: STRING) + append_day_name_to (d: INTEGER; s: STRING_GENERAL) require 1 <= d and d <= 7 do @@ -274,7 +349,7 @@ feature {NONE} -- Implementation end end - append_month_mmm_to (m: INTEGER; s: STRING) + append_month_mmm_to (m: INTEGER; s: STRING_GENERAL) require 1 <= m and m <= 12 do @@ -296,6 +371,17 @@ feature {NONE} -- Implementation end end + append_integer_to (i: INTEGER; s: STRING_GENERAL) + do + if attached {STRING_32} s as s32 then + s32.append_integer (i) + elseif attached {STRING_8} s as s8 then + s8.append_integer (i) + else + s.append (i.out) + end + end + feature {NONE} -- Implementation string_to_date_time (s: READABLE_STRING_8): detachable DATE_TIME diff --git a/library/network/protocol/http/src/http_file_extension_mime_mapping.e b/library/network/protocol/http/src/http_file_extension_mime_mapping.e index 387e8ed4..043e0fc1 100644 --- a/library/network/protocol/http/src/http_file_extension_mime_mapping.e +++ b/library/network/protocol/http/src/http_file_extension_mime_mapping.e @@ -33,8 +33,7 @@ feature {NONE} -- Initialization -- Create with no mapping -- but one can use `map' to add new mapping do - create mapping.make (n) - mapping.compare_objects + create mapping.make_caseless (n) end make_default @@ -43,9 +42,8 @@ feature {NONE} -- Initialization local m: like mapping do - create m.make (40) + create m.make_caseless (40) mapping := m - m.compare_objects m.force (text_css, "css") m.force (text_html, "html") m.force (text_xml, "xml") @@ -74,13 +72,13 @@ feature {NONE} -- Initialization m.force (text_plain, "txt") end - make_from_file (fn: READABLE_STRING_8) + make_from_file (fn: READABLE_STRING_GENERAL) -- Create with mime.types file -- One can use `map' to add new mapping local f: RAW_FILE do - create f.make (fn) + create f.make_with_name (fn) if f.exists and then f.is_readable then make_empty (50) f.open_read @@ -128,7 +126,7 @@ feature {NONE} -- Initialization feature -- Access - mime_type (ext: READABLE_STRING_8): detachable READABLE_STRING_8 + mime_type (ext: READABLE_STRING_GENERAL): detachable READABLE_STRING_8 -- Mime type for extension `ext' do Result := mapping.item (ext.as_lower) @@ -136,7 +134,7 @@ feature -- Access feature -- Element change - map (e: READABLE_STRING_8; t: READABLE_STRING_8) + map (e: READABLE_STRING_GENERAL; t: READABLE_STRING_8) -- Add mapping extension `e' to mime type `t' do mapping.force (t, e.as_lower) @@ -220,13 +218,13 @@ feature {NONE} -- Implementation feature {NONE} -- Extension MIME mapping - mapping: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8] + mapping: STRING_TABLE [READABLE_STRING_8] invariant mapping_keys_are_lowercase: across mapping as c all c.key.same_string (c.key.as_lower) end note - copyright: "2011-2011, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/network/protocol/http/tests/tests.ecf b/library/network/protocol/http/tests/tests.ecf index d3f421e2..24346a73 100644 --- a/library/network/protocol/http/tests/tests.ecf +++ b/library/network/protocol/http/tests/tests.ecf @@ -1,7 +1,7 @@ - + /.git$ /EIFGENs$ diff --git a/library/runtime/process/notification_email/license.lic b/library/runtime/process/notification_email/license.lic new file mode 100644 index 00000000..27384d13 --- /dev/null +++ b/library/runtime/process/notification_email/license.lic @@ -0,0 +1,10 @@ +${NOTE_KEYWORD} + copyright: "2011-${YEAR}, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" diff --git a/draft/application/cms/src/notification/cms_chain_mailer.e b/library/runtime/process/notification_email/notification_chain_mailer.e similarity index 52% rename from draft/application/cms/src/notification/cms_chain_mailer.e rename to library/runtime/process/notification_email/notification_chain_mailer.e index f9f50cad..7c400683 100644 --- a/draft/application/cms/src/notification/cms_chain_mailer.e +++ b/library/runtime/process/notification_email/notification_chain_mailer.e @@ -1,14 +1,14 @@ note - description: "Summary description for {CMS_CHAIN_MAILER}." + description: "Summary description for {NOTIFICATION_CHAIN_MAILER}." author: "" date: "$Date$" revision: "$Revision$" class - CMS_CHAIN_MAILER + NOTIFICATION_CHAIN_MAILER inherit - CMS_MAILER + NOTIFICATION_MAILER create make @@ -22,9 +22,9 @@ feature {NONE} -- Initialization feature -- Access - active: CMS_MAILER + active: NOTIFICATION_MAILER - next: detachable CMS_MAILER + next: detachable NOTIFICATION_MAILER feature -- Status @@ -45,7 +45,7 @@ feature -- Change feature -- Basic operation - process_email (a_email: CMS_EMAIL) + process_email (a_email: NOTIFICATION_EMAIL) do if active.is_available then active.process_email (a_email) @@ -55,4 +55,14 @@ feature -- Basic operation end end +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/library/runtime/process/notification_email/notification_email-safe.ecf b/library/runtime/process/notification_email/notification_email-safe.ecf new file mode 100644 index 00000000..8bf4ed88 --- /dev/null +++ b/library/runtime/process/notification_email/notification_email-safe.ecf @@ -0,0 +1,18 @@ + + + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + + + + diff --git a/draft/application/cms/src/notification/cms_email.e b/library/runtime/process/notification_email/notification_email.e similarity index 58% rename from draft/application/cms/src/notification/cms_email.e rename to library/runtime/process/notification_email/notification_email.e index 13cfe771..4ca33864 100644 --- a/draft/application/cms/src/notification/cms_email.e +++ b/library/runtime/process/notification_email/notification_email.e @@ -7,7 +7,7 @@ note revision : "$Revision$" class - CMS_EMAIL + NOTIFICATION_EMAIL create make @@ -55,17 +55,24 @@ feature -- Conversion message: STRING_8 do Result := header - Result.append ("%N") + Result.append_character ('%N') Result.append (body) - Result.append ("%N") - Result.append ("%N") + Result.append_character ('%N') + Result.append_character ('%N') end header: STRING_8 + local + hdate: HTTP_DATE do create Result.make (20) - Result.append ("From: " + from_address + "%N") - Result.append ("Date: " + date_to_rfc1123_http_date_format (date) + " GMT%N") + Result.append ("From: ") + Result.append (from_address) + Result.append_character ('%N') + Result.append ("Date: ") + create hdate.make_from_date_time (date) + hdate.append_to_rfc1123_string (Result) + Result.append (" GMT%N") Result.append ("To: ") across to_addresses as c @@ -74,24 +81,24 @@ feature -- Conversion Result.append_character (';') end Result.append_character ('%N') - Result.append ("Subject: " + subject + "%N") + Result.append ("Subject: ") + Result.append (subject) + Result.append_character ('%N') ensure Result.ends_with ("%N") end - -feature {NONE} -- Implementation - - date_to_rfc1123_http_date_format (dt: DATE_TIME): STRING_8 - -- String representation of `dt' using the RFC 1123 - local - d: HTTP_DATE - do - create d.make_from_date_time (dt) - Result := d.rfc1123_string - end - invariant -- invariant_clause: True +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/contrib/ise_library/text/uri/uri.ecf b/library/runtime/process/notification_email/notification_email.ecf similarity index 53% rename from contrib/ise_library/text/uri/uri.ecf rename to library/runtime/process/notification_email/notification_email.ecf index c92ba12d..80db0f22 100644 --- a/contrib/ise_library/text/uri/uri.ecf +++ b/library/runtime/process/notification_email/notification_email.ecf @@ -1,6 +1,6 @@ - - + + /.git$ @@ -9,9 +9,10 @@ - - - + + + + + diff --git a/draft/application/cms/src/notification/cms_external_mailer.e b/library/runtime/process/notification_email/notification_external_mailer.e similarity index 66% rename from draft/application/cms/src/notification/cms_external_mailer.e rename to library/runtime/process/notification_email/notification_external_mailer.e index 6a79cafa..41f106f1 100644 --- a/draft/application/cms/src/notification/cms_external_mailer.e +++ b/library/runtime/process/notification_email/notification_external_mailer.e @@ -1,36 +1,42 @@ note - description : "Objects that ..." - author : "$Author$" - date : "$Date$" - revision : "$Revision$" + description: "[ + Component responsible to send email using an external mailer + i.e: an external tool such as sendmail or a script, ... + ]" + author: "$Author$" + date: "$Date$" + revision: "$Revision$" class - CMS_EXTERNAL_MAILER + NOTIFICATION_EXTERNAL_MAILER inherit - CMS_MAILER + NOTIFICATION_MAILER --- SHARED_EXECUTION_ENVIRONMENT + SHARED_EXECUTION_ENVIRONMENT + export + {NONE} all + end create make feature {NONE} -- Initialization - make (a_exe: like executable_path; args: detachable ITERABLE [READABLE_STRING_8]) + make (a_exe: READABLE_STRING_GENERAL; args: detachable ITERABLE [READABLE_STRING_GENERAL]) -- Initialize `Current'. do set_parameters (a_exe, args) end - executable_path: READABLE_STRING_8 + executable_path: PATH - arguments: detachable ARRAYED_LIST [STRING_8] + arguments: detachable ARRAYED_LIST [READABLE_STRING_GENERAL] stdin_mode_set: BOOLEAN -- Use `stdin' to pass email message, rather than using local file? - stdin_termination_sequence: detachable STRING + stdin_termination_sequence: detachable READABLE_STRING_8 -- Termination sequence for the stdin mode --| If any, this tells the executable all the data has been provided --| For instance, using sendmail, you should have "%N.%N%N" @@ -41,18 +47,18 @@ feature -- Status local f: RAW_FILE do - create f.make (executable_path) + create f.make_with_path (executable_path) Result := f.exists end feature -- Change - set_parameters (cmd: like executable_path; args: detachable ITERABLE [READABLE_STRING_8]) + set_parameters (cmd: READABLE_STRING_GENERAL; args: detachable ITERABLE [READABLE_STRING_GENERAL]) -- Set parameters `executable_path' and associated `arguments' local l_args: like arguments do - executable_path := cmd + create executable_path.make_from_string (cmd) if args = Void then arguments := Void else @@ -76,7 +82,7 @@ feature -- Change feature -- Basic operation - process_email (a_email: CMS_EMAIL) + process_email (a_email: NOTIFICATION_EMAIL) local l_factory: PROCESS_FACTORY args: like arguments @@ -86,7 +92,7 @@ feature -- Basic operation if retried = 0 then create l_factory if stdin_mode_set then - p := l_factory.process_launcher (executable_path, arguments, Void) + p := l_factory.process_launcher (executable_path.name, arguments, Void) p.set_hidden (True) p.set_separate_console (False) @@ -107,10 +113,10 @@ feature -- Basic operation f.put_string (a_email.message) f.close create args.make (1) - args.force (f.name) + args.force (f.path.name) end end - p := l_factory.process_launcher (executable_path, args, Void) + p := l_factory.process_launcher (executable_path.name, args, Void) p.set_hidden (True) p.set_separate_console (False) @@ -140,34 +146,36 @@ feature -- Basic operation feature {NONE} -- Implementation - new_temporary_file (a_extension: detachable STRING_8): RAW_FILE + new_temporary_file (a_extension: detachable READABLE_STRING_8): RAW_FILE -- Create file with temporary name. -- With concurrent execution, noting ensures that {FILE_NAME}.make_temporary_name is unique -- So using `a_extension' may help local - fn: FILE_NAME - s: like {FILE_NAME}.string + bn: STRING_32 + fn: PATH + s: STRING_32 f: detachable like new_temporary_file i: INTEGER do -- With concurrent execution, nothing ensures that {FILE_NAME}.make_temporary_name is unique -- So let's try to find from + create bn.make_from_string_general ((create {FILE_NAME}.make_temporary_name).string) + create s.make_empty until f /= Void or i > 1000 loop - create fn.make_temporary_name - s := fn.string + create fn.make_from_string (bn) + s.make_empty if i > 0 then s.append_character ('-') s.append_integer (i) - create fn.make_from_string (s) + fn := fn.appended (s) end if a_extension /= Void then - fn.add_extension (a_extension) + fn := fn.appended_with_extension (a_extension) end - s := fn.string - create f.make (fn.string) + create f.make_with_path (fn) if f.exists then i := i + 1 f := Void @@ -185,13 +193,16 @@ feature {NONE} -- Implementation result_creatable: Result.is_creatable end -feature {NONE} -- Environment - - Execution_environment: EXECUTION_ENVIRONMENT - once - create Result - end - invariant +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/library/runtime/process/notification_email/notification_mailer.e b/library/runtime/process/notification_email/notification_mailer.e new file mode 100644 index 00000000..01a16b2e --- /dev/null +++ b/library/runtime/process/notification_email/notification_mailer.e @@ -0,0 +1,58 @@ +note + description: "[ + Component responsible to send email + ]" + author: "$Author$" + date: "$Date$" + revision: "$Revision$" + +deferred class + NOTIFICATION_MAILER + +feature -- Status + + is_available: BOOLEAN + -- Is mailer available to use? + deferred + end + +feature -- Basic operation + + process_emails (lst: ITERABLE [NOTIFICATION_EMAIL]) + -- Process set of emails `lst' + require + is_available + do + across + lst as c + loop + process_email (c.item) + end + end + + safe_process_email (a_email: NOTIFICATION_EMAIL) + -- Same as `process_email', but include the check of `is_available' + do + if is_available then + process_email (a_email) + end + end + + process_email (a_email: NOTIFICATION_EMAIL) + -- Process the sending of `a_email' + require + is_available + deferred + end + +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end diff --git a/library/runtime/process/notification_email/notification_sendmail_mailer.e b/library/runtime/process/notification_email/notification_sendmail_mailer.e new file mode 100644 index 00000000..2ea09397 --- /dev/null +++ b/library/runtime/process/notification_email/notification_sendmail_mailer.e @@ -0,0 +1,44 @@ +note + description : "[ + NOTIFICATION_MAILER using sendmail as mailtool + ]" + author: "$Author$" + date: "$Date$" + revision: "$Revision$" + +class + NOTIFICATION_SENDMAIL_MAILER + +inherit + NOTIFICATION_EXTERNAL_MAILER + redefine + default_create + end + +create + default_create + +feature {NONE} -- Initialization + + default_create + do + Precursor + make ("/usr/sbin/sendmail", <<"-t">>) + if not is_available then + make ("/usr/bin/sendmail", <<"-t">>) + end + set_stdin_mode (True, "%N.%N%N") + end + + +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end diff --git a/library/security/openid/consumer/demo/application.e b/library/security/openid/consumer/demo/application.e index c92a7146..b74ef494 100644 --- a/library/security/openid/consumer/demo/application.e +++ b/library/security/openid/consumer/demo/application.e @@ -12,13 +12,18 @@ inherit undefine requires_proxy end - + WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE WSF_SERVICE WSF_NO_PROXY_POLICY + SHARED_EXECUTION_ENVIRONMENT + export + {NONE} all + end + create make_and_launch @@ -42,14 +47,20 @@ feature {NONE} -- Initialization on_launched (conn: WGI_CONNECTOR) local e: EXECUTION_ENVIRONMENT + cmd: STRING_32 do if attached {WGI_NINO_CONNECTOR} conn as nino then - create e - if attached e.get ("COMSPEC") as l_comspec then - e.launch (l_comspec + " /C start " + "http://localhost:" + nino.port.out + "/") - else - e.launch ("http://localhost:" + nino.port.out + "/") + e := execution_environment + create cmd.make (32) + if attached e.item ("COMSPEC") as l_comspec then + cmd.append (l_comspec) + cmd.append ({STRING_32} " /C start ") end + cmd.append ("http://localhost:") + cmd.append_integer (nino.port) + cmd.append_character ({CHARACTER_32} '/') + + e.launch (cmd) end end diff --git a/library/security/openid/consumer/openid-safe.ecf b/library/security/openid/consumer/openid-safe.ecf index b68c1f4a..059358e4 100644 --- a/library/security/openid/consumer/openid-safe.ecf +++ b/library/security/openid/consumer/openid-safe.ecf @@ -1,5 +1,5 @@ - + @@ -9,12 +9,12 @@ - + - + + - - + diff --git a/library/security/openid/consumer/openid.ecf b/library/security/openid/consumer/openid.ecf index 822d2df7..d9d3b72f 100644 --- a/library/security/openid/consumer/openid.ecf +++ b/library/security/openid/consumer/openid.ecf @@ -11,7 +11,7 @@ - + diff --git a/library/security/openid/consumer/src/openid_consumer.e b/library/security/openid/consumer/src/openid_consumer.e index 2dcc090c..68b73a5c 100644 --- a/library/security/openid/consumer/src/openid_consumer.e +++ b/library/security/openid/consumer/src/openid_consumer.e @@ -137,7 +137,7 @@ feature {OPENID_CONSUMER_VALIDATION} -- Implementation sess: HTTP_CLIENT_SESSION ctx: detachable HTTP_CLIENT_REQUEST_CONTEXT xrds_location: detachable READABLE_STRING_8 - xml: XML_LITE_PARSER + xml: XML_STANDARD_PARSER tree: XML_CALLBACKS_DOCUMENT xelt: detachable XML_ELEMENT s: READABLE_STRING_32 diff --git a/library/server/authentication/http_authorization/http_authorization-safe.ecf b/library/server/authentication/http_authorization/http_authorization-safe.ecf index 247bb953..e5282ae4 100644 --- a/library/server/authentication/http_authorization/http_authorization-safe.ecf +++ b/library/server/authentication/http_authorization/http_authorization-safe.ecf @@ -1,5 +1,5 @@ - + @@ -9,8 +9,8 @@ - + - + diff --git a/library/server/ewf_support/ewf_support-safe.ecf b/library/server/ewf_support/ewf_support-safe.ecf deleted file mode 100644 index dfe77fe2..00000000 --- a/library/server/ewf_support/ewf_support-safe.ecf +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - - - - - - - - - - - - diff --git a/library/server/ewf_support/ewf_support.ecf b/library/server/ewf_support/ewf_support.ecf deleted file mode 100644 index e95a3590..00000000 --- a/library/server/ewf_support/ewf_support.ecf +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - - - - - - - - - - - - diff --git a/library/server/ewf_support/src/before_72/shared_execution_environment.e b/library/server/ewf_support/src/before_72/shared_execution_environment.e deleted file mode 100644 index 9c40c09d..00000000 --- a/library/server/ewf_support/src/before_72/shared_execution_environment.e +++ /dev/null @@ -1,49 +0,0 @@ -note - description: "Shared instance of execution environment." - legal: "See notice at end of class." - status: "See notice at end of class." - date: "$Date$" - revision: "$Revision$" -class - SHARED_EXECUTION_ENVIRONMENT - -feature {NONE} - - Execution_environment: EXECUTION_ENVIRONMENT - once - create Result - end - -note - copyright: "Copyright (c) 2012, Eiffel Software" - license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" - licensing_options: "http://www.eiffel.com/licensing" - copying: "[ - This file is part of Eiffel Software's Eiffel Development Environment. - - Eiffel Software's Eiffel Development Environment is free - software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published - by the Free Software Foundation, version 2 of the License - (available at the URL listed under "license" above). - - Eiffel Software's Eiffel Development Environment is - distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with Eiffel Software's Eiffel Development - Environment; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - ]" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end diff --git a/library/server/ewf_support/src/before_72/wsf_support.e b/library/server/ewf_support/src/before_72/wsf_support.e deleted file mode 100644 index 8800bd7c..00000000 --- a/library/server/ewf_support/src/before_72/wsf_support.e +++ /dev/null @@ -1,36 +0,0 @@ -note - description: "[ - The WSF_SUPPORT class is meant to handle incompatibilities between version of libraries - And still allow to benefit from most recent improvements. - - Unicode is an example - ]" - date: "$Date$" - revision: "$Revision$" - -class - WSF_SUPPORT - -inherit - ANY - - SHARED_EXECUTION_ENVIRONMENT - export - {NONE} all - end - -feature -- Access: environment - - starting_environment: HASH_TABLE [READABLE_STRING_GENERAL, READABLE_STRING_GENERAL] - do - Result := execution_environment.starting_environment_variables - end - - environment_item (a_name: READABLE_STRING_GENERAL): detachable STRING_32 - do - if attached execution_environment.get (a_name.to_string_8) as v then - Result := v.to_string_32 - end - end - -end diff --git a/library/server/ewf_support/src/greater_or_72/wsf_support.e b/library/server/ewf_support/src/greater_or_72/wsf_support.e deleted file mode 100644 index 559333dd..00000000 --- a/library/server/ewf_support/src/greater_or_72/wsf_support.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description: "[ - The WSF_SUPPORT class is meant to handle incompatibilities between version of libraries - And still allow to benefit from most recent improvements. - - Unicode is an example - ]" - date: "$Date$" - revision: "$Revision$" - -class - WSF_SUPPORT - -inherit - ANY - - SHARED_EXECUTION_ENVIRONMENT - export - {NONE} all - end - -feature -- Access: environment - - starting_environment: HASH_TABLE [READABLE_STRING_GENERAL, READABLE_STRING_GENERAL] - do - Result := execution_environment.starting_environment - end - - environment_item (a_name: READABLE_STRING_GENERAL): detachable STRING_32 - do - Result := execution_environment.item (a_name) - end - -end diff --git a/library/server/ewsgi/connectors/cgi/cgi-safe.ecf b/library/server/ewsgi/connectors/cgi/cgi-safe.ecf index 9ad9cd54..ef1e2700 100644 --- a/library/server/ewsgi/connectors/cgi/cgi-safe.ecf +++ b/library/server/ewsgi/connectors/cgi/cgi-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,11 +7,11 @@ /\.git$ /\.svn$ - - + diff --git a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e index 56718745..809e4da1 100644 --- a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e +++ b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e @@ -52,19 +52,23 @@ feature -- Execution res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void) end if res.message_writable then - res.put_string ("
    " + l_trace + "
    ") + res.put_string ("
    ")
    +							res.put_string (l_trace)
    +							res.put_string ("
    ") end res.push end end end rescue - rescued := True - retry + if not rescued then + rescued := True + retry + end end note - copyright: "2011-2012, Eiffel Software and others" + copyright: "2011-2013, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf b/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf index 48582c1c..689dcbf5 100644 --- a/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf +++ b/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,12 +7,12 @@ /\.git$ /\.svn$ - + - diff --git a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e index 32f54566..b223538a 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e +++ b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e @@ -55,7 +55,7 @@ feature -- Server feature -- Execution - process_fcgi_request (vars: HASH_TABLE [STRING, STRING]; a_input: like input; a_output: like output) + process_fcgi_request (vars: STRING_TABLE [READABLE_STRING_8]; a_input: like input; a_output: like output) local req: WGI_REQUEST_FROM_TABLE res: detachable WGI_RESPONSE_STREAM @@ -73,15 +73,19 @@ feature -- Execution res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void) end if res.message_writable then - res.put_string ("
    " + l_trace + "
    ") + res.put_string ("
    ")
    +							res.put_string (l_trace)
    +							res.put_string ("
    ") end res.push end end end rescue - rescued := True - retry + if not rescued then + rescued := True + retry + end end feature -- Input/Output @@ -100,7 +104,7 @@ invariant fcgi_attached: fcgi /= Void note - copyright: "2011-2011, Eiffel Software and others" + copyright: "2011-2013, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e index 45f0a401..431001af 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e @@ -127,20 +127,28 @@ feature -- Server server.setup (l_http_handler) end - process_request (env: HASH_TABLE [STRING, STRING]; a_headers_text: STRING; a_socket: TCP_STREAM_SOCKET) + process_request (env: STRING_TABLE [READABLE_STRING_8]; a_headers_text: STRING; a_socket: TCP_STREAM_SOCKET) local req: WGI_REQUEST_FROM_TABLE res: detachable WGI_NINO_RESPONSE_STREAM + retried: BOOLEAN do - create req.make (env, create {WGI_NINO_INPUT_STREAM}.make (a_socket), Current) - create res.make (create {WGI_NINO_OUTPUT_STREAM}.make (a_socket), create {WGI_NINO_ERROR_STREAM}.make_stderr (a_socket.descriptor.out)) - req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text) - service.execute (req, res) - res.push + if not retried then + create req.make (env, create {WGI_NINO_INPUT_STREAM}.make (a_socket), Current) + create res.make (create {WGI_NINO_OUTPUT_STREAM}.make (a_socket), create {WGI_NINO_ERROR_STREAM}.make_stderr (a_socket.descriptor.out)) + req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text) + service.execute (req, res) + res.push + end + rescue + if not retried then + retried := True + retry + end end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e index b1602527..c9890a27 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e @@ -61,24 +61,24 @@ feature -- Request processing process_request (a_handler: HTTP_CONNECTION_HANDLER; a_socket: TCP_STREAM_SOCKET) -- Process request ... local - env: HASH_TABLE [STRING, STRING] + env: STRING_TABLE [READABLE_STRING_8] p: INTEGER l_request_uri, l_script_name, l_query_string, l_path_info: STRING l_server_name, l_server_port: detachable STRING - a_headers_map: HASH_TABLE [STRING, STRING] + l_headers_map: HASH_TABLE [STRING, STRING] vn: STRING e: EXECUTION_ENVIRONMENT do l_request_uri := a_handler.uri - a_headers_map := a_handler.request_header_map + l_headers_map := a_handler.request_header_map create e if attached e.starting_environment_variables as vars then - create env.make (vars.count) + create env.make_equal (vars.count) across vars as c loop - env.force (c.item.to_string_8, c.key.to_string_8) + env.force (c.item.to_string_8, c.key) end else create env.make (0) @@ -86,11 +86,11 @@ feature -- Request processing --| for Any Abc-Def-Ghi add (or replace) the HTTP_ABC_DEF_GHI variable to `env' from - a_headers_map.start + l_headers_map.start until - a_headers_map.after + l_headers_map.after loop - create vn.make_from_string (a_headers_map.key_for_iteration.as_upper) + create vn.make_from_string (l_headers_map.key_for_iteration.as_upper) vn.replace_substring_all ("-", "_") if vn.starts_with ("CONTENT_") and then @@ -100,8 +100,8 @@ feature -- Request processing else vn.prepend ("HTTP_") end - add_environment_variable (a_headers_map.item_for_iteration, vn, env) - a_headers_map.forth + add_environment_variable (l_headers_map.item_for_iteration, vn, env) + l_headers_map.forth end --| Specific cases @@ -114,7 +114,7 @@ feature -- Request processing l_script_name := l_request_uri.string l_query_string := "" end - if attached a_headers_map.item ("Host") as l_host then + if attached l_headers_map.item ("Host") as l_host then check has_host: env.has ("HTTP_HOST") end -- set_environment_variable (l_host, "HTTP_HOST", env) p := l_host.index_of (':', 1) @@ -129,7 +129,7 @@ feature -- Request processing check host_available: False end end - if attached a_headers_map.item ("Authorization") as l_authorization then + if attached l_headers_map.item ("Authorization") as l_authorization then check has_authorization: env.has ("HTTP_AUTHORIZATION") end -- set_environment_variable (l_authorization, "HTTP_AUTHORIZATION", env) p := l_authorization.index_of (' ', 1) @@ -174,7 +174,7 @@ feature -- Request processing callback.process_request (env, a_handler.request_header, a_socket) end - add_environment_variable (a_value: detachable STRING; a_var_name: STRING; env: HASH_TABLE [STRING, STRING]) + add_environment_variable (a_value: detachable STRING; a_var_name: READABLE_STRING_GENERAL; env: STRING_TABLE [READABLE_STRING_8]) -- Add variable `a_var_name => a_value' to `env' do if a_value /= Void then @@ -188,7 +188,7 @@ feature -- Request processing end end - set_environment_variable (a_value: detachable STRING; a_var_name: STRING; env: HASH_TABLE [STRING, STRING]) + set_environment_variable (a_value: detachable STRING; a_var_name: READABLE_STRING_GENERAL; env: STRING_TABLE [READABLE_STRING_8]) -- Add variable `a_var_name => a_value' to `env' do if a_value /= Void then @@ -197,7 +197,7 @@ feature -- Request processing end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/connectors/null/null-safe.ecf b/library/server/ewsgi/connectors/null/null-safe.ecf index 5039c428..0f7da040 100644 --- a/library/server/ewsgi/connectors/null/null-safe.ecf +++ b/library/server/ewsgi/connectors/null/null-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,11 +7,11 @@ /\.git$ /\.svn$ - - + diff --git a/library/server/ewsgi/ewsgi-safe.ecf b/library/server/ewsgi/ewsgi-safe.ecf index dbf0c5d8..e2979ff7 100644 --- a/library/server/ewsgi/ewsgi-safe.ecf +++ b/library/server/ewsgi/ewsgi-safe.ecf @@ -1,5 +1,5 @@ - + @@ -10,15 +10,15 @@ - - - + + + - - - - - + + + + + diff --git a/library/server/ewsgi/ewsgi_spec-safe.ecf b/library/server/ewsgi/ewsgi_spec-safe.ecf index 695a3356..32ac76f1 100644 --- a/library/server/ewsgi/ewsgi_spec-safe.ecf +++ b/library/server/ewsgi/ewsgi_spec-safe.ecf @@ -1,5 +1,5 @@ - + diff --git a/library/server/ewsgi/specification/request/wgi_request.e b/library/server/ewsgi/specification/request/wgi_request.e index d860b4e8..697e0ba2 100644 --- a/library/server/ewsgi/specification/request/wgi_request.e +++ b/library/server/ewsgi/specification/request/wgi_request.e @@ -88,14 +88,14 @@ feature -- Access: Input feature -- Access: CGI meta variables - meta_variable (a_name: READABLE_STRING_8): detachable READABLE_STRING_8 + meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_8 -- Environment variable related to `a_name' require a_name_valid: a_name /= Void and then not a_name.is_empty deferred end - meta_string_variable (a_name: READABLE_STRING_8): detachable READABLE_STRING_8 + meta_string_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_8 -- Environment variable related to `a_name' require a_name_valid: a_name /= Void and then not a_name.is_empty @@ -105,7 +105,7 @@ feature -- Access: CGI meta variables end end - meta_variables: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8] + meta_variables: STRING_TABLE [READABLE_STRING_8] -- These variables are specific to requests made with HTTP. -- Interpretation of these variables may depend on the value of -- SERVER_PROTOCOL. @@ -665,7 +665,7 @@ invariant path_info_identical: path_info ~ meta_string_variable ({WGI_META_NAMES}.path_info) note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/specification/response/wgi_logger_response.e b/library/server/ewsgi/specification/response/wgi_logger_response.e index cee92fab..39f6195a 100644 --- a/library/server/ewsgi/specification/response/wgi_logger_response.e +++ b/library/server/ewsgi/specification/response/wgi_logger_response.e @@ -25,9 +25,9 @@ feature {NONE} -- Initialization make_with_response_and_output (res: WGI_RESPONSE; a_out: FILE; a_err: FILE) do - make_with_response (res) output := a_out error := a_err + make_with_response (res) end output: FILE @@ -104,7 +104,7 @@ feature -- Error reporting end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/specification/stream/wgi_input_stream.e b/library/server/ewsgi/specification/stream/wgi_input_stream.e index d5c6b4dc..63f1cb66 100644 --- a/library/server/ewsgi/specification/stream/wgi_input_stream.e +++ b/library/server/ewsgi/specification/stream/wgi_input_stream.e @@ -123,6 +123,52 @@ feature -- Input character_read: not end_of_input implies last_appended_count > 0 end + append_to_file (a_file: FILE; nb: INTEGER) + -- Append at most `nb' characters read from input stream + -- to `a_file' + -- Set `last_appended_count' to the number of characters actually read. + -- (Note that even if at least `nb' characters are available + -- in the input stream, there is no guarantee that they + -- will all be read.) + require + is_open_read: is_open_read + not_end_of_input: not end_of_input + a_file_attached: a_file /= Void + a_file_is_open_write: a_file.is_open_write + nb_large_enough: nb > 0 + local + s: like last_string + n: INTEGER + l_remaining: INTEGER + do + from + n := nb.min (2_048) + l_remaining := nb - n + until + l_remaining = 0 or n = 0 + loop + read_string (n) + s := last_string + a_file.put_string (s) + if end_of_input or s.count < n then + n := s.count + -- no more data + l_remaining := l_remaining - n + n := 0 + else + n := s.count + l_remaining := l_remaining - n + end + end + last_appended_count := nb - l_remaining + -- Clean `last_string' + last_string.wipe_out + ensure + nb_char_read_large_enough: last_appended_count >= 0 + nb_char_read_small_enough: last_appended_count <= nb + character_read: not end_of_input implies last_appended_count > 0 + end + feature -- Access last_string: STRING_8 @@ -166,7 +212,7 @@ feature -- Status report end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/src/implementation/wgi_request_from_table.e b/library/server/ewsgi/src/implementation/wgi_request_from_table.e index 934f5e10..4368bb33 100644 --- a/library/server/ewsgi/src/implementation/wgi_request_from_table.e +++ b/library/server/ewsgi/src/implementation/wgi_request_from_table.e @@ -61,16 +61,16 @@ feature -- EWSGI access feature -- Access: CGI meta parameters - meta_variables: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8] + meta_variables: STRING_TABLE [READABLE_STRING_8] -- CGI Environment parameters - meta_variable (a_name: READABLE_STRING_8): detachable READABLE_STRING_8 + meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_8 -- CGI meta variable related to `a_name' do Result := meta_variables.item (a_name) end - meta_string_variable_or_default (a_name: READABLE_STRING_8; a_default: READABLE_STRING_8; use_default_when_empty: BOOLEAN): READABLE_STRING_8 + meta_string_variable_or_default (a_name: READABLE_STRING_GENERAL; a_default: READABLE_STRING_8; use_default_when_empty: BOOLEAN): READABLE_STRING_8 -- Value for meta parameter `a_name' -- If not found, return `a_default' require @@ -86,14 +86,14 @@ feature -- Access: CGI meta parameters end end - set_meta_string_variable (a_name: READABLE_STRING_8; a_value: READABLE_STRING_8) + set_meta_string_variable (a_name: READABLE_STRING_GENERAL; a_value: READABLE_STRING_8) do meta_variables.force (a_value, a_name) ensure param_set: attached meta_variable (a_name) as val and then val ~ a_value end - unset_meta_variable (a_name: READABLE_STRING_8) + unset_meta_variable (a_name: READABLE_STRING_GENERAL) do meta_variables.remove (a_name) ensure @@ -304,7 +304,7 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO -- Fill with variable from `a_vars' local s: like meta_string_variable - table: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8] + table: STRING_TABLE [READABLE_STRING_8] l_query_string: like query_string l_request_uri: detachable STRING_32 l_empty_string: like empty_string @@ -312,15 +312,14 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO create {STRING_8} l_empty_string.make_empty empty_string := l_empty_string - create table.make (a_vars.count) - table.compare_objects + create table.make_equal (a_vars.count) meta_variables := table from a_vars.start until a_vars.after loop - table.force (a_vars.item_for_iteration.to_string_8, a_vars.key_for_iteration.to_string_8) + table.force (a_vars.item_for_iteration.to_string_8, a_vars.key_for_iteration) a_vars.forth end @@ -482,7 +481,7 @@ invariant empty_string_unchanged: empty_string.is_empty note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/libfcgi/interface/fcgi_i.e b/library/server/libfcgi/interface/fcgi_i.e index b568f197..08ec4242 100644 --- a/library/server/libfcgi/interface/fcgi_i.e +++ b/library/server/libfcgi/interface/fcgi_i.e @@ -19,21 +19,21 @@ feature {NONE} -- Initialization feature -- Access - updated_environ_variables: HASH_TABLE [STRING, STRING] + updated_environ_variables: STRING_TABLE [READABLE_STRING_8] local i: INTEGER p, v, null: POINTER do p := fcgi_environ - create Result.make (50) + create Result.make_equal (50) if p /= null then from i := 0 - v := fcgi_i_th_environ (i,p) + v := fcgi_i_th_environ (i, p) until v = null loop - if attached separated_variables (create {STRING}.make_from_c (v)) as t then + if attached separated_variables (create {STRING_8}.make_from_c (v)) as t then Result.force (t.value, t.key) end i := i + 1 @@ -196,7 +196,7 @@ feature {NONE} -- Implementation: Environment "return ((char **)$p)[$i];" end - separated_variables (a_var: STRING): detachable TUPLE [value: STRING; key: STRING] + separated_variables (a_var: READABLE_STRING_8): detachable TUPLE [value: READABLE_STRING_8; key: READABLE_STRING_8] -- Given an environment variable `a_var' in form of "key=value", -- return separated key and value. -- Return Void if `a_var' is in incorrect format. @@ -224,7 +224,7 @@ feature {NONE} -- Implementation: Environment end note - copyright: "Copyright (c) 1984-2011, Eiffel Software and others" + copyright: "Copyright (c) 1984-2013, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/libfcgi/libfcgi-safe.ecf b/library/server/libfcgi/libfcgi-safe.ecf index 22641f08..fe797bfe 100644 --- a/library/server/libfcgi/libfcgi-safe.ecf +++ b/library/server/libfcgi/libfcgi-safe.ecf @@ -1,14 +1,13 @@ - + - /\.svn$ - /\.git$ /EIFGENs$ + /\.git$ + /\.svn$ - - @@ -31,8 +30,7 @@ - - + /linux$ /fake$ @@ -41,12 +39,13 @@ - /windows$ /fake$ + /windows$ + diff --git a/library/server/wsf/connector/cgi-safe.ecf b/library/server/wsf/connector/cgi-safe.ecf index 9f70e84a..bd1d9f5f 100644 --- a/library/server/wsf/connector/cgi-safe.ecf +++ b/library/server/wsf/connector/cgi-safe.ecf @@ -1,5 +1,5 @@ - + @@ -10,13 +10,13 @@ - - - - - - + - + + + + + + diff --git a/library/server/wsf/connector/libfcgi-safe.ecf b/library/server/wsf/connector/libfcgi-safe.ecf index 7228eaa5..63bbc68b 100644 --- a/library/server/wsf/connector/libfcgi-safe.ecf +++ b/library/server/wsf/connector/libfcgi-safe.ecf @@ -1,5 +1,5 @@ - + @@ -10,13 +10,13 @@ - - - - - - + - + + + + + + diff --git a/library/server/wsf/connector/nino-safe.ecf b/library/server/wsf/connector/nino-safe.ecf index a81f2fb7..c7a77a3a 100644 --- a/library/server/wsf/connector/nino-safe.ecf +++ b/library/server/wsf/connector/nino-safe.ecf @@ -1,5 +1,5 @@ - + @@ -10,17 +10,16 @@ - - - - + + + + + - - - - - + + + diff --git a/library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e b/library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e index cd5ffbc4..5e262ae9 100644 --- a/library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e +++ b/library/server/wsf/connector/openshift/wsf_openshift_service_launcher.e @@ -24,6 +24,11 @@ inherit initialize end + SHARED_EXECUTION_ENVIRONMENT + export + {NONE} all + end + create make, make_and_launch, @@ -37,15 +42,19 @@ feature {NONE} -- Initialization l_env: EXECUTION_ENVIRONMENT do Precursor - create l_env + l_env := execution_environment - if attached l_env.get (Openshift_ip) as l_ip then - server_name := l_ip.to_string_8 + if attached l_env.item (Openshift_ip) as l_ip then + if l_ip.is_valid_as_string_8 then + server_name := l_ip.to_string_8 + else + die ("could not parse " + Openshift_ip) + end else die (Openshift_ip + " is not defined") end - if attached l_env.get (Openshift_port) as l_port then + if attached l_env.item (Openshift_port) as l_port then if l_port.is_integer then port_number := l_port.to_integer else @@ -77,7 +86,7 @@ feature {NONE} -- Implementation ;note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/wsf/default/cgi-safe.ecf b/library/server/wsf/default/cgi-safe.ecf index ed590547..6034e626 100644 --- a/library/server/wsf/default/cgi-safe.ecf +++ b/library/server/wsf/default/cgi-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,10 +7,11 @@ /\.git$ /\.svn$ - - - - + + + diff --git a/library/server/wsf/default/libfcgi-safe.ecf b/library/server/wsf/default/libfcgi-safe.ecf index 4b6a9804..24a3a7fe 100644 --- a/library/server/wsf/default/libfcgi-safe.ecf +++ b/library/server/wsf/default/libfcgi-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,10 +7,11 @@ /\.git$ /\.svn$ - - - - + + + diff --git a/library/server/wsf/default/nino-safe.ecf b/library/server/wsf/default/nino-safe.ecf index 8befe07f..1aafe224 100644 --- a/library/server/wsf/default/nino-safe.ecf +++ b/library/server/wsf/default/nino-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,10 +7,11 @@ /\.git$ /\.svn$ - - - - + + + diff --git a/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e b/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e index 21d4bfc4..acd21662 100644 --- a/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e +++ b/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e @@ -137,7 +137,7 @@ feature {WSF_RESPONSE} -- Output debug l_description.append ("

    Meta Information

      ") - l_description.append ("
    • PATH_INFO=" + request.path_info + "
    • ") + l_description.append ("
    • PATH_INFO=" + request.percent_encoded_path_info + "
    • ") l_description.append ("
    • QUERY_STRING=" + request.query_string + "
    • ") l_description.append ("
    • REQUEST_URI=" + request.request_uri + "
    • ") l_description.append ("
    • SCRIPT_NAME=" + request.script_name + "
    • ") diff --git a/library/server/wsf/router/filter/wsf_maintenance_filter.e b/library/server/wsf/router/filter/wsf_maintenance_filter.e index c25c77ae..00c63937 100644 --- a/library/server/wsf/router/filter/wsf_maintenance_filter.e +++ b/library/server/wsf/router/filter/wsf_maintenance_filter.e @@ -68,10 +68,6 @@ feature -- Basic operations end end -feature -- Constants - - Date_time_format: STRING = "[0]dd/[0]mm/yyyy [0]hh:[0]mi:[0]ss" - note copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/server/wsf/router/support/starts_with/wsf_starts_with_handler.e b/library/server/wsf/router/support/starts_with/wsf_starts_with_handler.e index b1d6d422..b3863683 100644 --- a/library/server/wsf/router/support/starts_with/wsf_starts_with_handler.e +++ b/library/server/wsf/router/support/starts_with/wsf_starts_with_handler.e @@ -20,7 +20,7 @@ feature -- Execution a_start_path_attached: a_start_path /= Void req_attached: req /= Void res_attached: res /= Void - path_start_with_a_start_path: req.path_info.starts_with (a_start_path) + path_start_with_a_start_path: req.percent_encoded_path_info.starts_with (a_start_path) deferred end @@ -33,7 +33,7 @@ feature {WSF_ROUTER} -- Mapping end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e b/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e index ac09d22c..1a1a8435 100644 --- a/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e +++ b/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e @@ -83,7 +83,7 @@ feature {NONE} -- Execution a_start_path_attached: a_start_path /= Void req_attached: req /= Void res_attached: res /= Void - path_start_with_a_start_path: req.path_info.starts_with (a_start_path) + path_start_with_a_start_path: req.percent_encoded_path_info.starts_with (a_start_path) deferred end diff --git a/library/server/wsf/router/support/uri_template/wsf_uri_template_mapping_i.e b/library/server/wsf/router/support/uri_template/wsf_uri_template_mapping_i.e index f1430fa0..786d2af6 100644 --- a/library/server/wsf/router/support/uri_template/wsf_uri_template_mapping_i.e +++ b/library/server/wsf/router/support/uri_template/wsf_uri_template_mapping_i.e @@ -61,7 +61,7 @@ feature -- Status -- local tpl: URI_TEMPLATE - p: READABLE_STRING_32 + p: READABLE_STRING_8 do p := path_from_request (req) tpl := based_uri_template (template, a_router) @@ -72,7 +72,7 @@ feature -- Status -- local tpl: URI_TEMPLATE - p: READABLE_STRING_32 + p: READABLE_STRING_8 new_src: detachable WSF_REQUEST_PATH_PARAMETERS_PROVIDER do p := path_from_request (req) diff --git a/library/server/wsf/router/wsf_file_system_handler.e b/library/server/wsf/router/wsf_file_system_handler.e index 9e54a43e..a3a4b57e 100644 --- a/library/server/wsf/router/wsf_file_system_handler.e +++ b/library/server/wsf/router/wsf_file_system_handler.e @@ -15,31 +15,53 @@ inherit WSF_SELF_DOCUMENTED_HANDLER + SHARED_HTML_ENCODER + + SHARED_WSF_PERCENT_ENCODER + rename + percent_encoder as url_encoder + export + {NONE} all + end + + SHARED_EXECUTION_ENVIRONMENT + export + {NONE} all + end + create + make_with_path, + make_hidden_with_path, make, make_hidden feature {NONE} -- Initialization - make (d: like document_root) - require - valid_d: (d /= Void and then not d.is_empty) implies not d.ends_with (operating_environment.directory_separator.out) - local - e: EXECUTION_ENVIRONMENT + make_with_path (d: like document_root) do if d.is_empty then - create e - document_root := e.current_working_directory + document_root := execution_environment.current_working_path else document_root := d end ensure - not document_root.is_empty and then not document_root.ends_with (operating_environment.directory_separator.out) + not document_root.is_empty end - make_hidden (d: like document_root) - require - valid_d: (d /= Void and then not d.is_empty) implies not d.ends_with (operating_environment.directory_separator.out) + make_hidden_with_path (d: like document_root) + do + make_with_path (d) + is_hidden := True + ensure + hidden: is_hidden + end + + make (d: READABLE_STRING_GENERAL) + do + make_with_path (create {PATH}.make_from_string (d)) + end + + make_hidden (d: READABLE_STRING_GENERAL) do make (d) is_hidden := True @@ -60,16 +82,21 @@ feature -- Documentation Result.add_description ("File service") end -feature -- Access +feature -- Access + + document_root: PATH - document_root: STRING max_age: INTEGER index_disabled: BOOLEAN -- Index disabled? + index_ignores_function: detachable FUNCTION [ANY, TUPLE [PATH], BOOLEAN] + -- Function to evaluate if a path is ignored or not during autoindex. + -- If `index_ignores' is Void and `index_ignores_function' is Void, use default ignore rules. + directory_index: detachable ARRAY [READABLE_STRING_8] - -- File serve if a directory index is requested + -- File serve if a directory index is requested. not_found_handler: detachable PROCEDURE [ANY, TUPLE [uri: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE]] @@ -114,14 +141,52 @@ feature -- Element change access_denied_handler := h end + set_default_index_ignores + -- Use default auto index ignores behavior. + do + index_ignores_function := Void + end + + set_index_ignores_function (fct: attached like index_ignores_function) + -- Use `fct' to compute auto index ignores behavior. + do + index_ignores_function := fct + end + +feature -- Status report + + ignoring_index_entry (p: PATH): BOOLEAN + -- Ignoring path `p' for auto index? + local + e: detachable PATH + n: READABLE_STRING_32 + do + if attached index_ignores_function as fct then + Result := fct.item ([p]) + else + -- default + e := p.entry + if e = Void then + e := p + end + if e.is_parent_symbol then + else + n := e.name + Result := n.starts_with ({STRING_32} ".") + or n.ends_with ({STRING_32} "~") + or n.ends_with ({STRING_32} ".swp") + end + end + end + feature -- Execution execute (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) local - p: STRING + p: STRING_32 do - p := req.path_info - if p.starts_with (a_start_path) then + create p.make_from_string (req.path_info) + if p.starts_with_general (a_start_path) then p.remove_head (a_start_path.count) else check starts_with_base: False end @@ -131,16 +196,16 @@ feature -- Execution execute_starts_with (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) do - execute (a_start_path,req, res) + execute (a_start_path, req, res) end - process_uri (uri: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) + process_uri (uri: READABLE_STRING_32; req: WSF_REQUEST; res: WSF_RESPONSE) local f: RAW_FILE - fn: READABLE_STRING_8 + fn: like resource_filename do fn := resource_filename (uri) - create f.make (fn) + create f.make_with_path (fn) if f.exists then if f.is_readable then if f.is_directory then @@ -160,14 +225,20 @@ feature -- Execution end end - process_index (a_uri: READABLE_STRING_8; dn: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) + process_index (a_uri: READABLE_STRING_8; dn: PATH; req: WSF_REQUEST; res: WSF_RESPONSE) local h: HTTP_HEADER uri, s: STRING_8 d: DIRECTORY - l_files: LIST [STRING_8] + l_files: LIST [PATH] + p: PATH + n: READABLE_STRING_32 + httpdate: HTTP_DATE + pf: RAW_FILE + l_is_dir: BOOLEAN do - create d.make_open_read (dn) + create d.make_with_path (dn) + d.open_read if attached directory_index_file (d) as f then process_file (f, req, res) else @@ -178,25 +249,73 @@ feature -- Execution s := "[ - Index for folder: $URI + Index of $URI + -

      Index for $URI

      -
        +

        Index of $URI

        + + + ]" s.replace_substring_all ("$URI", uri) from - l_files := d.linear_representation + l_files := d.entries l_files.start until l_files.after loop - s.append ("
      • " + l_files.item_for_iteration + "
      • %N") + p := l_files.item + if ignoring_index_entry (p) then + + else + n := p.name + create pf.make_with_path (p) + if pf.is_directory then + l_is_dir := True + else + l_is_dir := False + end + + s.append ("") + s.append ("") + s.append ("") + s.append ("") + s.append ("") + end l_files.forth end s.append ("[ - + +
        NameLast modifiedSize

        ") + if l_is_dir then + s.append ("[dir]") + else + s.append (" ") + end + s.append ("") + if p.is_parent_symbol then + s.append ("[Parent Directory] ..") + else + s.append (html_encoder.encoded_string (n)) + end + if l_is_dir then + s.append ("/") + end + + s.append ("") + create httpdate.make_from_date_time (file_date (pf)) + httpdate.append_to_rfc1123_string (s) + s.append ("") + if not l_is_dir then + s.append_integer (file_size (pf)) + end + s.append ("

        ]" @@ -217,12 +336,12 @@ feature -- Execution process_file (f: FILE; req: WSF_REQUEST; res: WSF_RESPONSE) local - ext: READABLE_STRING_8 + ext: READABLE_STRING_32 ct: detachable READABLE_STRING_8 fres: WSF_FILE_RESPONSE dt: DATE_TIME do - ext := extension (f.name) + ext := extension (f.path.name) ct := extension_mime_mapping.mime_type (ext) if ct = Void then ct := {HTTP_MIME_TYPES}.application_force_download @@ -235,7 +354,7 @@ feature -- Execution then process_not_modified (f_date, req, res) else - create fres.make_with_content_type (ct, f.name) + create fres.make_with_content_type (ct, f.path.name) fres.set_status_code ({HTTP_STATUS_CODE}.ok) -- cache control @@ -341,7 +460,7 @@ feature {NONE} -- Implementation directory_index_file (d: DIRECTORY): detachable FILE local f: detachable RAW_FILE - fn: FILE_NAME + fn: PATH do if attached directory_index as default_index then across @@ -350,12 +469,11 @@ feature {NONE} -- Implementation Result /= Void loop if d.has_entry (c.item) then - create fn.make_from_string (d.name) - fn.set_file_name (c.item) + fn := d.path.extended (c.item) if f = Void then - create f.make (fn.string) + create f.make_with_path (fn) else - f.make (fn.string) + f.make_with_path (fn) end if f.exists and then f.is_readable then Result := f @@ -365,28 +483,34 @@ feature {NONE} -- Implementation end end - resource_filename (uri: READABLE_STRING_8): READABLE_STRING_8 - do - Result := real_filename (document_root + operating_environment.directory_separator.out + real_filename (uri)) - end - - dirname (uri: READABLE_STRING_8): READABLE_STRING_8 + resource_filename (uri: READABLE_STRING_32): PATH local - p: INTEGER + s: like uri_path_to_filename do - p := uri.last_index_of ('/', uri.count) - if p > 0 then - Result := uri.substring (1, p - 1) - else - create {STRING_8} Result.make_empty + Result := document_root + s := uri_path_to_filename (uri) + if not s.is_empty then + Result := Result.extended (s) end end - filename (uri: READABLE_STRING_8): READABLE_STRING_8 + dirname (uri: READABLE_STRING_32): READABLE_STRING_32 local p: INTEGER do - p := uri.last_index_of ('/', uri.count) + p := uri.last_index_of ({CHARACTER_32} '/', uri.count) + if p > 0 then + Result := uri.substring (1, p - 1) + else + create {STRING_32} Result.make_empty + end + end + + filename (uri: READABLE_STRING_32): READABLE_STRING_32 + local + p: INTEGER + do + p := uri.last_index_of ({CHARACTER_32} '/', uri.count) if p > 0 then Result := uri.substring (p + 1, uri.count) else @@ -394,58 +518,52 @@ feature {NONE} -- Implementation end end - extension (uri: READABLE_STRING_8): READABLE_STRING_8 + extension (uri: READABLE_STRING_32): READABLE_STRING_32 local p: INTEGER do - p := uri.last_index_of ('.', uri.count) + p := uri.last_index_of ({CHARACTER_32} '.', uri.count) if p > 0 then Result := uri.substring (p + 1, uri.count) else - create {STRING_8} Result.make_empty + create {STRING_32} Result.make_empty end end - real_filename (fn: STRING): STRING + uri_path_to_filename (fn: READABLE_STRING_32): STRING_32 -- Real filename from url-path `fn' --| Find a better design for this piece of code --| Eventually in a spec/$ISE_PLATFORM/ specific cluster + local + n: INTEGER do - if fn.is_empty then - Result := fn - else + n := fn.count + create Result.make_from_string (fn) + if n > 0 and then Result.item (Result.count) = {CHARACTER_32} '/' then + Result.remove_tail (1) + n := n - 1 + end + if n > 0 and then Result.item (1) = {CHARACTER_32} '/' then + Result.remove_head (1) + n := n - 1 + end + + if n > 0 then if {PLATFORM}.is_windows then - create Result.make_from_string (fn) - Result.replace_substring_all ("/", "\") - if Result [Result.count] = '\' then - Result.remove_tail (1) - end - else - Result := fn - if Result [Result.count] = '/' then - Result.remove_tail (1) - end + Result.replace_substring_all ({STRING_32} "/", {STRING_32} "\") end end end feature {NONE} -- Implementation - node_exists (p: READABLE_STRING_8): BOOLEAN - local - f: RAW_FILE - do - create f.make (p) - Result := f.exists - end - extension_mime_mapping: HTTP_FILE_EXTENSION_MIME_MAPPING local f: RAW_FILE once - create f.make ("mime.types") + create f.make_with_name ("mime.types") if f.exists and then f.is_readable then - create Result.make_from_file (f.name) + create Result.make_from_file (f.path.name) else create Result.make_default end @@ -453,6 +571,11 @@ feature {NONE} -- Implementation feature {NONE} -- implementation: date time + file_size (f: FILE): INTEGER + do + Result := f.count + end + file_date (f: FILE): DATE_TIME do Result := timestamp_to_date (f.date) diff --git a/library/server/wsf/router/wsf_routed_skeleton_service.e b/library/server/wsf/router/wsf_routed_skeleton_service.e index 48284652..45fd8975 100644 --- a/library/server/wsf/router/wsf_routed_skeleton_service.e +++ b/library/server/wsf/router/wsf_routed_skeleton_service.e @@ -30,10 +30,15 @@ feature -- Execution handle_unavailable (res) elseif requires_proxy (req) then handle_use_proxy (req, res) - elseif maximum_uri_length > 0 and then req.request_uri.count.to_natural_32 > maximum_uri_length then + elseif + maximum_uri_length > 0 and then + req.request_uri.count.to_natural_32 > maximum_uri_length + then handle_request_uri_too_long (res) - elseif req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) and then - req.request_uri.same_string ("*") then + elseif + req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) and then + req.request_uri.same_string ("*") + then handle_server_options (req, res) else create l_sess diff --git a/library/server/wsf/router/wsf_router_mapping.e b/library/server/wsf/router/wsf_router_mapping.e index 475818ca..873a25cb 100644 --- a/library/server/wsf/router/wsf_router_mapping.e +++ b/library/server/wsf/router/wsf_router_mapping.e @@ -77,12 +77,12 @@ feature -- Status feature -- Helper - path_from_request (req: WSF_REQUEST): READABLE_STRING_32 + path_from_request (req: WSF_REQUEST): READABLE_STRING_8 -- Path used by `Current' to check that mapping matches request `req' require req_attached: req /= Void do - Result := req.path_info + Result := req.percent_encoded_path_info ensure path_from_request_attached: Result /= Void end diff --git a/library/server/wsf/session/wsf_cookie_session.e b/library/server/wsf/session/wsf_cookie_session.e index 7c8d1425..0e499f6d 100644 --- a/library/server/wsf/session/wsf_cookie_session.e +++ b/library/server/wsf/session/wsf_cookie_session.e @@ -10,6 +10,11 @@ class inherit WSF_SESSION + SHARED_EXECUTION_ENVIRONMENT + export + {NONE} all + end + create make, make_new @@ -128,15 +133,6 @@ feature {NONE} -- Storage data.compare_objects end - sessions_folder_name: READABLE_STRING_8 - local - dn: DIRECTORY_NAME - once - create dn.make_from_string ((create {EXECUTION_ENVIRONMENT}).current_working_directory) - dn.extend ("_sessions_") - Result := dn.string - end - load do if manager.session_exists (uuid) then @@ -181,7 +177,7 @@ feature {NONE} -- Implementation end note - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/wsf/session/wsf_fs_session_manager.e b/library/server/wsf/session/wsf_fs_session_manager.e index 260607a1..81187b6f 100644 --- a/library/server/wsf/session/wsf_fs_session_manager.e +++ b/library/server/wsf/session/wsf_fs_session_manager.e @@ -21,12 +21,12 @@ feature {NONE} -- Initialization make_with_folder ("_WSF_SESSIONS_") end - make_with_folder (a_folder: like sessions_folder_name) + make_with_folder (a_folder: READABLE_STRING_GENERAL) do - sessions_folder_name := a_folder + create sessions_folder_name.make_from_string (a_folder) end - sessions_folder_name: STRING_8 + sessions_folder_name: PATH feature -- Access @@ -34,7 +34,7 @@ feature -- Access local f: RAW_FILE do - create f.make (file_name (a_session_uuid)) + create f.make_with_path (file_name (a_session_uuid)) Result := f.exists and then f.is_readable end @@ -42,7 +42,7 @@ feature -- Access local f: RAW_FILE do - create f.make (file_name (a_session_uuid)) + create f.make_with_path (file_name (a_session_uuid)) if f.exists and then f.is_readable then f.open_read if attached data_from_file (f) as d then @@ -68,7 +68,7 @@ feature -- Persistence delete_session (a_session) else ensure_session_folder_exists - create f.make (file_name (a_session.uuid)) + create f.make_with_path (file_name (a_session.uuid)) if not f.exists or else f.is_writable then f.create_read_write a_session.data.set_expiration (a_session.expiration) @@ -91,7 +91,7 @@ feature -- Persistence rescued: BOOLEAN do if not rescued then - create f.make (file_name (a_session.uuid)) + create f.make_with_path (file_name (a_session.uuid)) if f.exists then f.delete end @@ -131,7 +131,7 @@ feature {NONE} -- Implementation local d: DIRECTORY once - create d.make (sessions_folder_name) + create d.make_with_path (sessions_folder_name) if not d.exists then d.recursive_create_dir end @@ -143,18 +143,13 @@ feature {NONE} -- Implementation local d: DIRECTORY do - create d.make (sessions_folder_name) + create d.make_with_path (sessions_folder_name) Result := d.exists and then d.is_writable end - file_name (a_uuid: like {WSF_SESSION}.uuid): READABLE_STRING_8 - local - fn: FILE_NAME + file_name (a_uuid: like {WSF_SESSION}.uuid): PATH do - create fn.make_from_string (sessions_folder_name) - fn.set_file_name (a_uuid.out) - fn.add_extension ("session") - Result := fn.string + Result := sessions_folder_name.extended (a_uuid.out).appended_with_extension ("session") end note diff --git a/library/server/wsf/src/implementation/shared_wsf_percent_encoder.e b/library/server/wsf/src/implementation/shared_wsf_percent_encoder.e new file mode 100644 index 00000000..9d00bd44 --- /dev/null +++ b/library/server/wsf/src/implementation/shared_wsf_percent_encoder.e @@ -0,0 +1,28 @@ +note + description: "Objects to access the shared once WSF_PERCENT_ENCODER ..." + date: "$Date$" + revision: "$Revision$" + +class + SHARED_WSF_PERCENT_ENCODER + +feature -- Encoder + + percent_encoder: WSF_PERCENT_ENCODER + -- Shared Percent encoding engine. + once + create Result + end + +note + copyright: "2011-2013, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" + +end diff --git a/contrib/ise_library/text/uri/src/implementation/percent_encoder.e b/library/server/wsf/src/implementation/wsf_percent_encoder.e similarity index 95% rename from contrib/ise_library/text/uri/src/implementation/percent_encoder.e rename to library/server/wsf/src/implementation/wsf_percent_encoder.e index 72b7b894..8d60b89a 100644 --- a/contrib/ise_library/text/uri/src/implementation/percent_encoder.e +++ b/library/server/wsf/src/implementation/wsf_percent_encoder.e @@ -2,15 +2,22 @@ note description: "[ Component to handle percent encoding ]" - date: "$Date: 2013-01-26 01:40:46 +0100 (sam., 26 janv. 2013) $" - revision: "$Revision: 90880 $" + date: "$Date: 2013-05-21 01:15:17 +0200 (mar., 21 mai 2013) $" + revision: "$Revision: 92557 $" EIS: "name=Percent-encoding", "protocol=URI", "src=http://en.wikipedia.org/wiki/Percent-encoding" class - PERCENT_ENCODER + WSF_PERCENT_ENCODER feature -- Percent encoding + percent_encoded_string (v: READABLE_STRING_GENERAL): STRING_8 + -- Return `a_string' percent-encoded + do + create Result.make (v.count) + append_percent_encoded_string_to (v, Result) + end + append_percent_encoded_string_to (s: READABLE_STRING_GENERAL; a_result: STRING_GENERAL) -- Append `a_string' as percent-encoded value to `a_result' local @@ -126,6 +133,14 @@ feature {NONE} -- Implementation: character encoding feature -- Percent decoding + percent_decoded_string (v: READABLE_STRING_GENERAL): STRING_32 + -- Return the percent decoded string equivalent to the percent-encoded string `v' + --| Note that is `a_result' is a STRING_8, any Unicode character will be kept as UTF-8 + do + create Result.make (v.count) + append_percent_decoded_string_to (v, Result) + end + append_percent_decoded_string_to (v: READABLE_STRING_GENERAL; a_result: STRING_GENERAL) -- Append to `a_result' a string equivalent to the percent-encoded string `v' --| Note that is `a_result' is a STRING_8, any Unicode character will be kept as UTF-8 @@ -496,7 +511,7 @@ feature {NONE} -- Implementation end note - copyright: "Copyright (c) 1984-2013, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/wsf/src/request/value/wsf_multiple_string.e b/library/server/wsf/src/request/value/wsf_multiple_string.e index c4d6ab08..69cf8ebe 100644 --- a/library/server/wsf/src/request/value/wsf_multiple_string.e +++ b/library/server/wsf/src/request/value/wsf_multiple_string.e @@ -62,7 +62,7 @@ feature -- Access url_encoded_name: READABLE_STRING_8 -- URL encoded string of `name'. do - Result := url_encoder.encoded_string (name) + Result := url_encoded_string (name) end values: LIST [WSF_STRING] diff --git a/library/server/wsf/src/request/value/wsf_string.e b/library/server/wsf/src/request/value/wsf_string.e index c51c3583..0da28891 100644 --- a/library/server/wsf/src/request/value/wsf_string.e +++ b/library/server/wsf/src/request/value/wsf_string.e @@ -50,20 +50,6 @@ feature -- Access url_encoded_value: READABLE_STRING_8 -- URL encoded string of `value'. - frozen string: like value - obsolete - "Use value [2012-May-31]" - do - Result := value - end - - frozen url_encoded_string: like url_encoded_value - obsolete - "Use url_encoded_value [2012-May-31]" - do - Result := url_encoded_value - end - feature -- Conversion integer_value: INTEGER @@ -137,7 +123,7 @@ feature -- Visitor end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/wsf/src/request/value/wsf_uploaded_file.e b/library/server/wsf/src/request/value/wsf_uploaded_file.e index f6c5e7c3..b194f9b0 100644 --- a/library/server/wsf/src/request/value/wsf_uploaded_file.e +++ b/library/server/wsf/src/request/value/wsf_uploaded_file.e @@ -36,17 +36,17 @@ feature -- Access feature -- Status report - debug_output: STRING + debug_output: STRING_32 -- String that should be displayed in debugger to represent `Current'. do Result := Precursor if exists and then - attached tmp_name as n + attached tmp_path as p then Result.append_character (' ') Result.append_character ('%"') - Result.append (n) + Result.append (p.name) Result.append_character ('%"') end Result.append (" filename=%"") @@ -108,14 +108,56 @@ feature -- Access: Uploaded File size: INTEGER -- Size of uploaded file - tmp_name: detachable STRING + tmp_path: detachable PATH -- Filename of tmp file + tmp_name: detachable READABLE_STRING_GENERAL + do + if attached tmp_path as p then + Result := p.name + end + end + tmp_basename: detachable STRING -- Basename of tmp file feature -- Conversion + append_content_to_string (a_target: STRING) + -- Append the content of the uploaded file to `a_target'. + local + f: RAW_FILE + s: STRING + done: BOOLEAN + retried: BOOLEAN + do + if not retried and attached tmp_name as fn then + create f.make_with_name (fn) + if f.exists then + f.open_read + from + until + done + loop + f.read_stream_thread_aware (1_024) + s := f.last_string + if s.is_empty then + done := True + else + a_target.append (s) + done := f.exhausted or f.end_of_file + end + end + f.close + end + end + rescue + retried := True + retry + end + +feature -- Implementation + safe_filename: STRING local fn: like filename @@ -202,7 +244,7 @@ feature -- Conversion feature -- Basic operation - move_to (a_destination: STRING): BOOLEAN + move_to (a_destination: READABLE_STRING_GENERAL): BOOLEAN -- Move current uploaded file to `a_destination' --| Violates CQS principle. require @@ -211,10 +253,10 @@ feature -- Basic operation local f: RAW_FILE do - if attached tmp_name as n then - create f.make (n) + if attached tmp_path as p then + create f.make_with_path (p) if f.exists then - f.change_name (a_destination) + f.rename_file (a_destination) Result := True end end @@ -239,8 +281,8 @@ feature -- Status local f: PLAIN_TEXT_FILE do - if attached tmp_name as n then - create f.make (n) + if attached tmp_path as p then + create f.make_with_path (p) Result := f.exists end end @@ -253,10 +295,19 @@ feature -- Element change error := e end + set_tmp_path (p: like tmp_path) + do + tmp_path := p + end + set_tmp_name (n: like tmp_name) -- Set `tmp_name' to `n' do - tmp_name := n + if n /= Void then + set_tmp_path (create {PATH}.make_from_string (n)) + else + set_tmp_path (Void) + end end set_tmp_basename (n: like tmp_basename) diff --git a/library/server/wsf/src/request/wsf_value.e b/library/server/wsf/src/request/wsf_value.e index 5c42e804..6a1577e9 100644 --- a/library/server/wsf/src/request/wsf_value.e +++ b/library/server/wsf/src/request/wsf_value.e @@ -9,6 +9,13 @@ deferred class inherit DEBUG_OUTPUT + SHARED_WSF_PERCENT_ENCODER + rename + percent_encoder as url_encoder + export + {NONE} all + end + feature -- Access name: READABLE_STRING_32 @@ -91,23 +98,26 @@ feature -- Helper feature -- Status report - debug_output: STRING + debug_output: STRING_32 -- String that should be displayed in debugger to represent `Current'. do - create Result.make_from_string (url_encoder.encoded_string (name) + "=" + url_encoder.encoded_string (string_representation)) + create Result.make_from_string (name + {STRING_32} "=" + string_representation) end feature {NONE} -- Implementation - url_decoded_string (s: READABLE_STRING_8): READABLE_STRING_32 + url_encoded_string (s: READABLE_STRING_GENERAL): STRING_8 -- Decoded url-encoded string `s' do - Result := url_encoder.decoded_string (s) + create Result.make (s.count) + url_encoder.append_percent_encoded_string_to (s, Result) end - url_encoder: URL_ENCODER - once - create {UTF8_URL_ENCODER} Result --| Chrome is UTF-8 encoding the non ascii in query + url_decoded_string (s: READABLE_STRING_GENERAL): STRING_32 + -- Decoded url-encoded string `s' + do + create Result.make (s.count) + url_encoder.append_percent_decoded_string_to (s, Result) end feature -- Visitor @@ -117,7 +127,7 @@ feature -- Visitor end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/wsf/src/response/wsf_default_router_response.e b/library/server/wsf/src/response/wsf_default_router_response.e index 23b7ef99..327f97e4 100644 --- a/library/server/wsf/src/response/wsf_default_router_response.e +++ b/library/server/wsf/src/response/wsf_default_router_response.e @@ -24,6 +24,7 @@ feature {NONE} -- Initialization do router := a_router make (req) + set_suggestion_only_method (True) end feature -- Access @@ -36,6 +37,9 @@ feature -- Settings documentation_included: BOOLEAN -- Include self-documentation from `router' in the response? + suggestion_only_method: BOOLEAN + -- Display only suggestion for `req' method ? + feature -- Change set_documentation_included (b: BOOLEAN) @@ -43,6 +47,14 @@ feature -- Change documentation_included := b end + set_suggestion_only_method (b: BOOLEAN) + -- Set `suggestion_only_method' to `b' + do + suggestion_only_method := b + ensure + suggestion_only_method_set: suggestion_only_method = b + end + feature {WSF_RESPONSE} -- Output send_to (res: WSF_RESPONSE) @@ -138,10 +150,14 @@ feature {NONE} -- Implementation not_found_message (req: WSF_REQUEST): WSF_NOT_FOUND_RESPONSE local vis: WSF_ROUTER_AGENT_ITERATOR + l_method: detachable READABLE_STRING_8 do Result := Precursor (req) if documentation_included then create vis + if suggestion_only_method then + l_method := req.request_method + end vis.on_item_actions.extend (agent (i: WSF_ROUTER_ITEM; r: WSF_NOT_FOUND_RESPONSE; m: detachable READABLE_STRING_8) local l_is_hidden: BOOLEAN @@ -174,7 +190,7 @@ feature {NONE} -- Implementation r.add_suggested_text (s, Void) end end - end (?, Result, req.request_method)) + end (?, Result, l_method)) vis.process_router (router) end end diff --git a/library/server/wsf/src/response/wsf_download_response.e b/library/server/wsf/src/response/wsf_download_response.e index cedc8a2a..2fbdc65d 100644 --- a/library/server/wsf/src/response/wsf_download_response.e +++ b/library/server/wsf/src/response/wsf_download_response.e @@ -10,6 +10,8 @@ class inherit WSF_RESPONSE_MESSAGE + SHARED_UTF8_URL_ENCODER + create make, make_with_content_type, @@ -17,26 +19,26 @@ create feature {NONE} -- Initialization - make (a_file_name: READABLE_STRING_8) + make (a_file_name: READABLE_STRING_GENERAL) do set_status_code ({HTTP_STATUS_CODE}.ok) - file_name := a_file_name - base_name := basename (a_file_name) + create file_path.make_from_string (a_file_name) + base_name := basename (file_path) get_content_type initialize end - make_with_content_type (a_content_type: READABLE_STRING_8; a_filename: READABLE_STRING_8) + make_with_content_type (a_content_type: READABLE_STRING_8; a_filename: READABLE_STRING_GENERAL) -- Initialize `Current'. do set_status_code ({HTTP_STATUS_CODE}.ok) - file_name := a_filename - base_name := basename (a_filename) + create file_path.make_from_string (a_filename) + base_name := basename (file_path) content_type := a_content_type initialize end - make_html (a_filename: READABLE_STRING_8) + make_html (a_filename: READABLE_STRING_GENERAL) -- Initialize `Current'. do make_with_content_type ({HTTP_MIME_TYPES}.text_html, a_filename) @@ -45,15 +47,14 @@ feature {NONE} -- Initialization initialize local h: like header - d: HTTP_DATE do create h.make header := h h.put_content_type (content_type) h.put_transfer_encoding_binary - h.put_content_length (filesize (file_name)) + h.put_content_length (filesize (file_path)) h.put_content_disposition ("attachment", "filename=%""+ base_name +"%"") - if attached filedate (file_name) as dt then + if attached filedate (file_path) as dt then h.put_last_modified (dt) end end @@ -89,7 +90,14 @@ feature -- Access status_code: INTEGER assign set_status_code + file_path: PATH + file_name: READABLE_STRING_8 + obsolete + "Use `file_path.name' for unicode support [2013-may]" + do + Result := file_path.utf_8_name + end base_name: READABLE_STRING_8 @@ -125,73 +133,57 @@ feature {WSF_RESPONSE} -- Output res.set_status_code (status_code) res.put_header_text (header.string) if not answer_head_request_method then - send_file_content_to (file_name, res) + send_file_content_to (file_path, res) end end feature {NONE} -- Implementation: file system helper - filesize (fn: STRING): INTEGER + filesize (fn: PATH): INTEGER -- Size of the file `fn'. local f: RAW_FILE do - create f.make (fn) + create f.make_with_path (fn) if f.exists then Result := f.count end end - filedate (fn: STRING): detachable DATE_TIME + filedate (fn: PATH): detachable DATE_TIME -- Size of the file `fn'. local f: RAW_FILE d: HTTP_DATE do - create f.make (fn) + create f.make_with_path (fn) if f.exists then create d.make_from_timestamp (f.date) Result := d.date_time end end - file_extension (fn: STRING): STRING + file_extension (fn: PATH): STRING_32 -- Extension of file `fn'. - local - p: INTEGER do - p := fn.last_index_of ('.', fn.count) - if p > 0 then - Result := fn.substring (p + 1, fn.count) + if attached fn.extension as ext then + Result := ext else create Result.make_empty end end - basename (fn: STRING): STRING + basename (fn: PATH): STRING -- Basename of `fn'. local - p: INTEGER + s: READABLE_STRING_32 do - p := fn.last_index_of ((create {OPERATING_ENVIRONMENT}).Directory_separator, fn.count) - if p > 0 then - Result := fn.substring (p + 1, fn.count) + if attached fn.entry as p then + s := p.name else - Result := fn - end - end - - dirname (fn: STRING): STRING - -- Dirname of `fn'. - local - p: INTEGER - do - p := fn.last_index_of ((create {OPERATING_ENVIRONMENT}).Directory_separator, fn.count) - if p > 0 then - Result := fn.substring (1, p - 1) - else - create Result.make_empty + s := fn.name end + Result := url_encoder.encoded_string (s) end feature -- Content-type related @@ -203,7 +195,7 @@ feature -- Content-type related m: detachable READABLE_STRING_8 do create m_map.make_default - m := m_map.mime_type (file_extension (file_name).as_lower) + m := m_map.mime_type (file_extension (file_path).as_lower) if m = Void then m := {HTTP_MIME_TYPES}.application_force_download end @@ -212,15 +204,15 @@ feature -- Content-type related feature -- Implementation: output - send_file_content_to (fn: READABLE_STRING_8; res: WSF_RESPONSE) + send_file_content_to (fn: PATH; res: WSF_RESPONSE) -- Send the content of file `fn' require string_not_empty: not fn.is_empty - is_readable: (create {RAW_FILE}.make (fn)).is_readable + is_readable: (create {RAW_FILE}.make_with_path (fn)).is_readable local f: RAW_FILE do - create f.make (fn) + create f.make_with_path (fn) check f.exists and then f.is_readable end f.open_read diff --git a/library/server/wsf/src/response/wsf_file_response.e b/library/server/wsf/src/response/wsf_file_response.e index 8d00455b..28b21ff2 100644 --- a/library/server/wsf/src/response/wsf_file_response.e +++ b/library/server/wsf/src/response/wsf_file_response.e @@ -11,30 +11,49 @@ inherit WSF_RESPONSE_MESSAGE create + make_with_path, + make_with_content_type_and_path, + make_html_with_path, make, make_with_content_type, make_html feature {NONE} -- Initialization - make (a_file_name: READABLE_STRING_8) + make_with_path (a_path: PATH) do set_status_code ({HTTP_STATUS_CODE}.ok) - file_name := a_file_name + file_path := a_path get_content_type initialize end - make_with_content_type (a_content_type: READABLE_STRING_8; a_filename: READABLE_STRING_8) - -- Initialize `Current'. + make_with_content_type_and_path (a_content_type: READABLE_STRING_8; a_path: PATH) do set_status_code ({HTTP_STATUS_CODE}.ok) - file_name := a_filename + file_path := a_path content_type := a_content_type initialize end - make_html (a_filename: READABLE_STRING_8) + make_html_with_path (a_path: PATH) + -- Initialize `Current'. + do + make_with_content_type_and_path ({HTTP_MIME_TYPES}.text_html, a_path) + end + + make (a_file_name: READABLE_STRING_GENERAL) + do + make_with_path (create {PATH}.make_from_string (a_file_name)) + end + + make_with_content_type (a_content_type: READABLE_STRING_8; a_file_name: READABLE_STRING_GENERAL) + -- Initialize `Current'. + do + make_with_content_type_and_path (a_content_type, create {PATH}.make_from_string (a_file_name)) + end + + make_html (a_filename: READABLE_STRING_GENERAL) -- Initialize `Current'. do make_with_content_type ({HTTP_MIME_TYPES}.text_html, a_filename) @@ -118,13 +137,21 @@ feature -- Access content_type: READABLE_STRING_8 -- Content-Type of the response + file_path: path + -- File path + file_name: READABLE_STRING_8 + obsolete + "Use `file_path.name' for unicode support [2013-may]" + do + Result := file_path.utf_8_name + end file_exists: BOOLEAN -- File exists? file_size: INTEGER - -- Size of file named `file_name' + -- Size of file `file_path' head, bottom: detachable READABLE_STRING_8 -- Eventual head and bottom part @@ -184,7 +211,7 @@ feature {WSF_RESPONSE} -- Output res.put_string (s) end if not answer_head_request_method then - send_file_content_to (file_name, res) + send_file_content_to (file_path, res) end s := bottom if s /= Void then @@ -200,40 +227,37 @@ feature {NONE} -- Implementation: file system helper local f: RAW_FILE do - create f.make (file_name) + create f.make_with_path (file_path) file_exists := f.exists end get_file_size - -- Get `file_size' from file named `file_name' + -- Get `file_size' from file named `file_path' require file_exists: file_exists local f: RAW_FILE do - create f.make (file_name) + create f.make_with_path (file_path) file_size := f.count end file_last_modified: detachable DATE_TIME - -- Get `file_size' from file named `file_name' + -- Get `file_size' from file named `file_path' require file_exists: file_exists local f: RAW_FILE do - create f.make (file_name) + create f.make_with_path (file_path) create Result.make_from_epoch (f.change_date) end - file_extension (fn: STRING): STRING + file_extension (fn: PATH): STRING_32 -- Extension of file `fn'. - local - p: INTEGER do - p := fn.last_index_of ('.', fn.count) - if p > 0 then - Result := fn.substring (p + 1, fn.count) + if attached fn.extension as ext then + Result := ext else create Result.make_empty end @@ -242,13 +266,13 @@ feature {NONE} -- Implementation: file system helper feature -- Content-type related get_content_type - -- Content type associated with `file_name' + -- Content type associated with `file_path' local m_map: HTTP_FILE_EXTENSION_MIME_MAPPING m: detachable READABLE_STRING_8 do create m_map.make_default - m := m_map.mime_type (file_extension (file_name).as_lower) + m := m_map.mime_type (file_extension (file_path).as_lower) if m = Void then m := {HTTP_MIME_TYPES}.application_force_download end @@ -257,16 +281,16 @@ feature -- Content-type related feature {NONE} -- Implementation: output - send_file_content_to (fn: READABLE_STRING_8; res: WSF_RESPONSE) + send_file_content_to (fn: PATH; res: WSF_RESPONSE) -- Send the content of file `fn' require string_not_empty: not fn.is_empty - is_readable: (create {RAW_FILE}.make (fn)).is_readable + is_readable: (create {RAW_FILE}.make_with_path (fn)).is_readable file_exists: file_exists local f: RAW_FILE do - create f.make (fn) + create f.make_with_path (fn) check f.is_readable end f.open_read diff --git a/library/server/wsf/src/response/wsf_method_not_allowed_response.e b/library/server/wsf/src/response/wsf_method_not_allowed_response.e index ea1e0d70..4b33868a 100644 --- a/library/server/wsf/src/response/wsf_method_not_allowed_response.e +++ b/library/server/wsf/src/response/wsf_method_not_allowed_response.e @@ -136,11 +136,11 @@ feature {WSF_RESPONSE} -- Output s.append ( "[