From bf38c8e9cc11caacae8ce541927a179bc189d254 Mon Sep 17 00:00:00 2001 From: Mediha Zukic Date: Tue, 20 Jun 2017 14:02:14 +0200 Subject: [PATCH] Readme file --- .DS_Store | Bin 6148 -> 6148 bytes README.md | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.DS_Store b/.DS_Store index 11ad1bb4badbc1140db69207d8dfaad84fc93a97..e918db18cdb9706d3ff47d889b6c6e9541422157 100644 GIT binary patch delta 123 zcmZoMXfc@J&&aVcU^g=($7DlRsmW?AM>!0Q4RjQY4J{`pusKdPVU6&VVF+SyWpHG0 zVekdgdJMS?DL}HAA&Ehk!4L?I8IpnQR0dNZt;>+kU;$($GFURWdgkOOC*|ZPF)%O) TFfcH-ZmwlDV%p5k@s}R}dJ`GV delta 52 zcmZoMXfc@J&&a+pU^g=(`(#5_smW?AM>&iwjdc_ZjVvecU~`;o!Wyyp39B;G#D<8? I>>Pjj0grAExc~qF diff --git a/README.md b/README.md index b3e57ea..42e8948 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,38 @@ -# medolinagwtreact -medolina gwt react +## Synopsis + +The project shows how to integrate React components into GWT application. GWT backend consists of Login service which allows users to create login sessions. + +## Adding React component + +EmbeddedReact.ReactComponentProps componentProps = new EmbeddedReact.ReactComponentProps(); +componentProps.onGoToGWTAppClicked = new MouseEventHandler() { + @Override + public void onMouseEvent(MouseEvent event) { + setReactComponentVisibility(false); + String sessionID = Cookies.getCookie("sid"); + if (sessionID == null) + setLoginFormVisibility(true); + else + checkWithServerIfSessionIdIsStillLegal(sessionID, false); + + } +}; +componentProps.currentLoggedUser = result.getUserName(); +ReactDOM.render(React.createElement(EmbeddedReact::loggedInComponent, componentProps), Document.get().getElementById("reactAppDiv")); + +## Build and run solution + +In Eclipse go to Build Path -> Configure Build Path, select Java Build Path on the right and Libraries in top panel. Select Add JARS and add + +- gwt-interop-utils-0.4.0.jar +- gwt-react-0.6.0.jar +- gwt-servlet.jar + +Libraries located in /GWTReactApp/war/WEB-INF/lib/ folder. + +Right click on project folder and select Run As -> Web Application (GWT Super Dev Mode) + +## Adding addition React modules + +1. Step 6 explained in details in in gwt-react library documentation file given at https://github.com/GWTReact/gwt-react/blob/master/DOCUMENTATION.md +2. Add updated .js file to the project (add it as static