updated make process to copy over new web stuff and not old web stuff
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 20 Aug 2005 19:55:49 +0000 (19:55 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 20 Aug 2005 19:55:49 +0000 (19:55 +0000)
removed the old transport_socket stuff

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1682 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/Makefile
Open-ILS/src/Makefile
Open-ILS/src/apachemods/Makefile
OpenSRF/src/libtransport/transport_session.h
OpenSRF/src/libtransport/transport_socket.c [deleted file]
OpenSRF/src/libtransport/transport_socket.h [deleted file]
OpenSRF/src/router/Makefile
install.sh

index 49b2137..06c3773 100644 (file)
@@ -2,7 +2,6 @@
 # Evergreen makefile
 # ------------------------------------------------------------------------
 
-IMAGE=$(WEBDIR)/images
 NEW_OPAC_URL=myopac.domain
 NEW_XUL_PACKAGE_NAME=openils
 NEW_XUL_PACKAGE_LABEL=OpenILS
@@ -11,8 +10,7 @@ NEW_XUL_PACKAGE_LABEL=OpenILS
 
 all:   xul 
 
-
-install:       images-install circ-install
+install:       circ-install
 
 xul:
        cp -R staff_client local_staff_client
@@ -27,28 +25,6 @@ xul:
        find local_staff_client/ -type f -exec sed -i s/gapines.org/${NEW_OPAC_URL}/g {} \;
        make -C local_staff_client package
 
-images-install:
-       @echo "Installing images to $(IMAGE)";
-       mkdir -p $(WEBDIR)
-       cp -r images $(WEBDIR)
-       ln -sf $(IMAGE)/pics/map.jpg $(IMAGE)/cartographic.jpg
-       ln -sf $(IMAGE)/bigpinesLogo.jpg $(IMAGE)/main_logo.jpg
-       ln -sf $(IMAGE)/pics/open_book.gif $(IMAGE)/"mixed material.jpg"
-       ln -sf $(IMAGE)/pics/movie.jpg $(IMAGE)/"moving image.jpg"
-       ln -sf $(IMAGE)/pics/music_icon.jpg $(IMAGE)/"notated music.jpg"
-       ln -sf $(IMAGE)/smallpinesLogo.jpg $(IMAGE)/"small_logo.jpg"
-       ln -sf $(IMAGE)/pics/computer.jpg $(IMAGE)/"software, multimedia.jpg"
-       ln -sf $(IMAGE)/pics/speaker.gif $(IMAGE)/"sound recording-musical.jpg"
-       ln -sf $(IMAGE)/pics/speaker.gif $(IMAGE)/"sound recording-nonmusical.jpg"
-       ln -sf $(IMAGE)/pics/speaker.gif $(IMAGE)/"sound recording.jpg"
-       ln -sf $(IMAGE)/pics/camera.gif $(IMAGE)/"still images.jpg"
-       ln -sf $(IMAGE)/pics/open_book.gif $(IMAGE)/text.jpg
-       ln -sf $(IMAGE)/pics/book_icon.jpeg $(IMAGE)/"three dimensional object.jpg"
-
-css-install:
-       mkdir -p $(WEBDIR)/css
-       cp -r css/opac/* $(WEBDIR)/css
-
 circ-install:
        mkdir -p $(CIRCRULESDIR)
        cp circ_rules/*.rules $(CIRCRULESDIR)/
index d33cba3..53bd1bf 100644 (file)
@@ -8,19 +8,12 @@ all: mod_xmltools
 
 install:       perl-install web-install string-templates-install storage-bootstrap xsl-install
 
-web-install:   web-templates-install javascript-install autojs-install  mod_xmltools-install webxml-install
+web-install:   webcore-install autojs-install  mod_xmltools-install 
 
 
-JSDIR=$(WEBDIR)/js
-
-marcdumper:
-       echo $@
-       make -C extras/marcdumper
-
-marcdumper-install:
-       echo $@
-       make -C extras/marcdumper install
-
+# -----------------------------------------------------------------------------------
+# Web stuff
+# -----------------------------------------------------------------------------------
 mod_xmltools:
        echo $@
        make -C apachemods mod_xmltools.so
@@ -29,10 +22,26 @@ mod_xmltools-install:
        echo $@
        make -C apachemods mod_xmltools-install
 
-webxml-install:
-       echo $@
+webcore-install:
        mkdir -p $(WEBDIR)
-       cp -r webxml $(WEBDIR)
+       cp -r ../web/* $(WEBDIR)
+
+autojs-install:
+       echo $@
+       cp extras/fieldmapper.pl $(BINDIR)
+       cp extras/org_tree_js.pl $(BINDIR)
+       cp extras/autogen.sh $(BINDIR)
+# -----------------------------------------------------------------------------------
+
+marcdumper:
+       echo $@
+       make -C extras/marcdumper
+
+marcdumper-install:
+       echo $@
+       make -C extras/marcdumper install
+
+# -----------------------------------------------------------------------------------
 
 perl-install:
        echo $@
@@ -43,13 +52,7 @@ perl-install:
        mkdir -p $(TEMPLATEDIR)
        cp -r templates/marc $(TEMPLATEDIR)
 
-javascript-install:
-       echo $@
-       @echo "Installing javascript to $(JSDIR)"
-       mkdir -p $(JSDIR)
-       cp -r javascript/* $(JSDIR)
-       cp ../../$(OPENSRFDIR)/javascript/JSON.js $(JSDIR)/util/
-       cp ../../$(OPENSRFDIR)/javascript/md5.js $(JSDIR)/util/
+# -----------------------------------------------------------------------------------
 
 storage-bootstrap:
        echo $@
@@ -58,19 +61,8 @@ storage-bootstrap:
        cp -r cgi-bin/* $(CGIDIR)
        ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW)
 
+# -----------------------------------------------------------------------------------
 
-autojs-install:
-       echo $@
-       cp extras/fieldmapper.pl $(BINDIR)
-       cp extras/org_tree_js.pl $(BINDIR)
-       cp extras/autogen.sh $(BINDIR)
-
-web-templates-install:
-       echo $@
-       @echo "Installing web templates to $(TEMPLATEDIR)"
-       mkdir -p $(TEMPLATEDIR)
-       cp -r templates/opac $(TEMPLATEDIR)
-       cp -r templates/html $(TEMPLATEDIR)
 
 string-templates-install:
        echo $@
@@ -78,7 +70,6 @@ string-templates-install:
        mkdir -p $(TEMPLATEDIR)
        cp -r templates/strings $(TEMPLATEDIR)
 
-
 xsl-install:   
        echo $@
        @echo "Installing XSL files to $(XSLDIR)"
index acfcd39..45fad14 100644 (file)
@@ -22,7 +22,6 @@ xmltools.o:   xmltools.c xmltools.h
        echo $@
        $(CC) -c $(CC_OPTS) xmltools.c -o $@
 
-
 mod_xmltools-install:
        echo $@
        $(APXS2) -i -a -n mod_xmltools mod_xmltools.so
@@ -31,8 +30,11 @@ mod_xmltools-install:
                LoadModule mod_xmltools_module modules/mod_xmltools.so \n \
                to this: \n \
                LoadModule mod_xmltools    modules/mod_xmltools.so"
-       @echo "Also, you can add \nXMLToolsDefaultLocale <locale>\nand\n \
-                       XMLToolsLocaleDir  <web-locale-dir> to httpd.conf"
+       @echo -e "Supported configuration options:\
+                       \nXMLToolsDefaultLocale <locale>\
+                       \nXMLToolsLocaleDir  <web-locale-dir>\
+                       \nXMLToolsPreXSL <pre_xsl_file>\
+                       \nXMLToolsPostXSL <post_xsl_file>"
        @echo "-----------------------------------------------";
        @sleep 3;
 
index d5bfbe3..27199e8 100644 (file)
@@ -3,7 +3,6 @@
 // a SAX push parser as it arrives.  When key Jabber documetn elements are met, 
 // logic ensues.
 // ---------------------------------------------------------------------------------
-#include "transport_socket.h"
 #include "transport_message.h"
 
 #include "utils.h"
diff --git a/OpenSRF/src/libtransport/transport_socket.c b/OpenSRF/src/libtransport/transport_socket.c
deleted file mode 100644 (file)
index b9ea09f..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-#include "transport_socket.h"
-
-
-/*
-int main( char* argc, char** argv ) {
-
-       transport_socket sock_obj;
-       sock_obj.port = 5222;
-       sock_obj.server = "10.0.0.4";
-       sock_obj.data_received_callback = &print_stuff;
-
-       printf("connecting...\n");
-       if( (tcp_connect( &sock_obj )) < 0 ) {
-               printf( "error connecting" );
-       }
-
-       printf("sending...\n");
-       if( tcp_send( &sock_obj, "<stream>\n" ) < 0 ) {
-               printf( "error sending" );
-       }
-       
-       printf("waiting...\n");
-       if( tcp_wait( &sock_obj, 15 ) < 0 ) {
-               printf( "error receiving" );
-       }
-
-       printf("disconnecting...\n");
-       tcp_disconnect( &sock_obj );
-
-}
-*/
-
-
-// returns the socket fd, -1 on error
-int tcp_connect( transport_socket* sock_obj ){
-
-
-       if( sock_obj == NULL ) {
-               fatal_handler( "connect(): null sock_obj" );
-               return -1;
-       }
-
-       struct sockaddr_in remoteAddr, localAddr;
-       struct hostent *hptr;
-       int sock_fd;
-
-       // ------------------------------------------------------------------
-       // Create the socket
-       // ------------------------------------------------------------------
-       if( (sock_fd = socket( AF_INET, SOCK_STREAM, 0 )) < 0 ) {
-               fatal_handler( "tcp_connect(): Cannot create socket" );
-               return -1;
-       }
-
-       // ------------------------------------------------------------------
-       // Get the hostname
-       // ------------------------------------------------------------------
-       if( (hptr = gethostbyname( sock_obj->server ) ) == NULL ) {
-               fatal_handler( "tcp_connect(): Unknown Host => %s", sock_obj->server );
-               return -1;
-       }
-
-       // ------------------------------------------------------------------
-       // Construct server info struct
-       // ------------------------------------------------------------------
-       memset( &remoteAddr, 0, sizeof(remoteAddr));
-       remoteAddr.sin_family = AF_INET;
-       remoteAddr.sin_port = htons( sock_obj->port );
-       memcpy( (char*) &remoteAddr.sin_addr.s_addr,
-                       hptr->h_addr_list[0], hptr->h_length );
-
-       // ------------------------------------------------------------------
-       // Construct local info struct
-       // ------------------------------------------------------------------
-       memset( &localAddr, 0, sizeof( localAddr ) );
-       localAddr.sin_family = AF_INET;
-       localAddr.sin_addr.s_addr = htonl( INADDR_ANY );
-       localAddr.sin_port = htons(0);
-
-       // ------------------------------------------------------------------
-       // Bind to a local port
-       // ------------------------------------------------------------------
-       if( bind( sock_fd, (struct sockaddr *) &localAddr, sizeof( localAddr ) ) < 0 ) {
-               fatal_handler( "tcp_connect(): Cannot bind to local port" );
-               return -1;
-       }
-
-       // ------------------------------------------------------------------
-       // Connect to server
-       // ------------------------------------------------------------------
-       if( connect( sock_fd, (struct sockaddr*) &remoteAddr, sizeof( struct sockaddr_in ) ) < 0 ) {
-               fatal_handler( "tcp_connect(): Cannot connect to server %s", sock_obj->server );
-               return -1;
-       }
-
-       sock_obj->sock_fd = sock_fd;
-       sock_obj->connected = 1;
-       return sock_fd;
-
-}
-
-
-int tcp_send( transport_socket* sock_obj, const char* data ){
-
-       if( sock_obj == NULL ) {
-               fatal_handler( "tcp_send(): null sock_obj" );
-               return 0;
-       }
-
-       //fprintf( stderr, "TCP Sending: \n%s\n", data );
-
-       // ------------------------------------------------------------------
-       // Send the data down the TCP pipe
-       // ------------------------------------------------------------------
-       if( send( sock_obj->sock_fd, data, strlen(data), 0 ) < 0 ) {
-               fatal_handler( "tcp_send(): Error sending data" );
-               return 0;
-       }
-
-       debug_handler( "Sent Data %s At %f Seconds", data, get_timestamp_millis() );
-       return 1;
-}
-
-
-
-int tcp_disconnect( transport_socket* sock_obj ){
-
-       if( sock_obj == NULL ) {
-               fatal_handler( "tcp_disconnect(): null sock_obj" );
-               return -1;
-       }
-
-       if( close( sock_obj->sock_fd ) == -1 ) {
-
-               // ------------------------------------------------------------------
-               // Not really worth throwing an exception for... should be logged.
-               // ------------------------------------------------------------------
-               warning_handler( "tcp_disconnect(): Error closing socket" );
-               return -1;
-       } 
-
-       return 0;
-}
-
-// ------------------------------------------------------------------
-// And now for the gory C socket code.
-// Returns 0 on failure, 1 otherwise
-// ------------------------------------------------------------------
-int tcp_wait( transport_socket* sock_obj, int timeout ){
-
-       if( sock_obj == NULL ) {
-               fatal_handler( "tcp_wait(): null sock_obj" );
-               return 0;
-       }
-
-
-       int n = 0; 
-       int retval = 0;
-       char buf[BUFSIZE];
-       int sock_fd = sock_obj->sock_fd;
-
-       fd_set read_set;
-
-       FD_ZERO( &read_set );
-       FD_SET( sock_fd, &read_set );
-
-       // ------------------------------------------------------------------
-       // Build the timeval struct
-       // ------------------------------------------------------------------
-       struct timeval tv;
-       tv.tv_sec = timeout;
-       tv.tv_usec = 0;
-
-       if( timeout == -1 ) {  
-
-               // ------------------------------------------------------------------
-               // If timeout is -1, there is no timeout passed to the call to select
-               // ------------------------------------------------------------------
-               if( (retval = select( sock_fd + 1 , &read_set, NULL, NULL, NULL)) == -1 ) {
-                       warning_handler( "Call to select interrupted" );
-                       return 0;
-               }
-
-       } else if( timeout != 0 ) { /* timeout of 0 means don't block */
-
-               if( (retval = select( sock_fd + 1 , &read_set, NULL, NULL, &tv)) == -1 ) {
-                       warning_handler( "Call to select interrupted" );
-                       return 0;
-               }
-       }
-
-       memset( &buf, 0, BUFSIZE );
-
-       if( set_fl( sock_fd, O_NONBLOCK ) < 0 ) 
-               return 0;
-
-#ifdef _ROUTER // just read one buffer full of data
-
-       n = recv(sock_fd, buf, BUFSIZE-1, 0);
-       sock_obj->data_received_callback( sock_obj->user_data, buf );
-       if( n == 0 )
-               n = -1;
-
-#else // read everything we can
-
-       debug_handler( "Leaving Socket Select At %f Seconds", get_timestamp_millis() );
-       while( (n = recv(sock_fd, buf, BUFSIZE-1, 0) ) > 0 ) {
-               debug_handler("SOCKET Read:  \n%s\n", buf);
-               sock_obj->data_received_callback( sock_obj->user_data, buf );
-               memset( &buf, 0, BUFSIZE );
-       }
-
-#endif
-
-       if( clr_fl( sock_fd, O_NONBLOCK ) < 0 ) {
-               warning_handler("Unable to clear O_NONBLOCK flag on socket");
-               return 0;
-       }
-
-
-       if( n < 0 ) { 
-               if( errno != EAGAIN ) { 
-                       warning_handler( " * Error reading socket with errno %d", errno );
-                       return 0;
-               }
-       }
-
-#ifdef _ROUTER
-       return n;
-#else
-       return sock_fd;
-#endif
-
-}
-
-
-/*
-int tcp_connected( transport_socket* obj ) {
-
-       int ret;
-       if( ! obj->sock_fd ) { return 0; }
-
-       ret = read( obj->sock_fd  , NULL,0 );
-       if( ret <= 0 ) {
-               return 0;
-       }
-       return 1;
-}
-*/
-
diff --git a/OpenSRF/src/libtransport/transport_socket.h b/OpenSRF/src/libtransport/transport_socket.h
deleted file mode 100644 (file)
index dd1f146..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <errno.h>
-
-#include "utils.h"
-#include "logging.h"
-//---------------------------------------------------------------
-// WIN32
-//---------------------------------------------------------------
-#ifdef WIN32
-#include <Windows.h>
-#include <Winsock.h>
-#else
-
-//---------------------------------------------------------------
-// Unix headers
-//---------------------------------------------------------------
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#endif
-
-#ifndef TRANSPORT_SOCKET_H
-#define TRANSPORT_SOCKET_H
-
-/* how many characters we read from the socket at a time */
-#ifdef _ROUTER
-#define BUFSIZE 412
-#else
-#define BUFSIZE 4096
-#endif
-
-/* we maintain the socket information */
-struct transport_socket_struct {
-       /* for a client, sock_fd is THE socket connection.  For a server,
-               it's the socket we listen on */
-       int     sock_fd;
-       int     connected;
-       char* server; /* remote server name or ip */
-       int     port;
-       void* user_data;
-
-       /* user_data may be anything.  it's whatever you wish
-               to see showing up in the callback in addition to
-               the acutal character data*/
-       void (*data_received_callback) (void * user_data, char*);
-};
-typedef struct transport_socket_struct transport_socket;
-
-/* connects.  If is_server is true, we call tcp_server_connect */
-int tcp_connect( transport_socket* obj );
-
-int tcp_send( transport_socket* obj, const char* data );
-
-int tcp_disconnect( transport_socket* obj );
-
-/* does both client and server waiting. 
-       returns the socket_fd on success, 0 on error */
-int tcp_wait( transport_socket* obj, int timeout );
-
-int tcp_connected(transport_socket* obj);
-
-
-
-#endif
index ef877a6..fc7c4ee 100644 (file)
@@ -3,7 +3,7 @@
 
 LD_OPTS                += -lc_utils -lxml2 -lopensrf_stack -lobjson
 LP                             = ../libtransport
-LIB_SOURCES = $(LP)/transport_socket.c $(LP)/transport_session.c $(LP)/transport_message.c $(LP)/transport_client.c 
+LIB_SOURCES = $(LP)/transport_session.c $(LP)/transport_message.c $(LP)/transport_client.c 
 
 all: msg router 
 
index 3fe7f63..49ba355 100755 (executable)
@@ -203,9 +203,7 @@ function runInstall {
                        # Evergreen ---                         
 
                        "evergreen_core" )
-                               if installing;  then $MAKE -C "$EVERGREENDIR" "images-install"; fi;
                                if installing;  then $MAKE -C "$EVERGREENDIR" "circ-install"; fi;
-                               if installing;  then $MAKE -C "$EVERGREENDIR" "css-install"; fi;
                                ;;      
 
                        "evergreen_xul_client" )