Changeset 1636
- Timestamp:
- May 3, 2012, 1:23:14 PM (11 years ago)
- Location:
- extensions/net.sf.basedb.torrent/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.torrent/trunk/.classpath
r1255 r1636 4 4 <classpathentry kind="src" path="src/external/hpbtc"/> 5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> 6 <classpathentry kind="lib" path="lib/compile/BASE2Core.jar"/>7 <classpathentry kind="lib" path="lib/compile/BASE2Webclient.jar"/>8 6 <classpathentry kind="lib" path="lib/compile/slf4j-api-1.5.2.jar"/> 9 7 <classpathentry kind="lib" path="lib/compile/servlet-api.jar"/> 8 <classpathentry kind="lib" path="lib/compile/base-core-3.1.0.jar"/> 9 <classpathentry kind="lib" path="lib/compile/base-webclient-3.1.0.jar"/> 10 10 <classpathentry kind="output" path="bin"/> 11 11 </classpath> -
extensions/net.sf.basedb.torrent/trunk/META-INF/MANIFEST.MF
r1245 r1636 1 1 Manifest-Version: 1.0 2 Class-Path: lib/torrent/hpbtc.jar3 2 -
extensions/net.sf.basedb.torrent/trunk/META-INF/extensions.xml
r1304 r1636 34 34 for downloading files from BASE. 35 35 </description> 36 <version>0.2pre</version> 36 <version>0.2-dev</version> 37 <min-base-version>3.1.0</min-base-version> 38 <copyright>BASE development team</copyright> 39 <email>basedb-users@lists.sourceforge.net</email> 37 40 <url>http://baseplugins.thep.lu.se/wiki/net.sf.basedb.torrent</url> 38 41 </about> -
extensions/net.sf.basedb.torrent/trunk/README
r1245 r1636 1 1 == Requirements == 2 2 3 1. BASE 2.16.0 or later.3 1. BASE 3.1.0 or later. 4 4 5 5 == Introduction == … … 19 19 2. Unpack the downloaded file to a directory of your choice. 20 20 3. Copy the `torrent.properties` file to `WEB-INF/classes` directory. 21 4. Copy the `base-torrent.jar` file and the `lib` directory, including sub-22 directories and files, to your BASE extensions directory, `WEB-INF/extensions`.23 5. Run the `Extensions -> Manual scan` command to install the extension. If you24 have enabled automatic installation, just sit back and wait for it to find25 the bittorrent service.26 6. Done.21 4. Copy the `base-torrent.jar` file to your BASE plug-ins directory. 22 Eg. the directory specified by the `plugins.dir` setting in `base.config`. 23 5. Log in to BASE as a user with Administrator priviliges. 24 6. Go to 'Administrate->Plug-ins & Extensions->Overview' page. 25 Run the installation wizard and select to install/update `base-torrent.jar`. 26 7. Done. 27 27 28 28 == Known issues == … … 44 44 2. Type `ant download-lib` to automatically download the BASE core JAR file that 45 45 are neeed for compilation. You can also do this manually by copying the 46 BASE2Core.jar and BASE2Webclient.jar from the BASE installation directory46 base-core-*.jar and base-webclient-*.jar from the BASE installation directory 47 47 (`<basedir>/www/WEB-INF/lib/`) to the `./lib/compile` directory. 48 48 -
extensions/net.sf.basedb.torrent/trunk/build.xml
r1251 r1636 33 33 <!-- variables used --> 34 34 <property name="name" value="base-torrent" /> 35 <property name="version" value="0.2 pre" />35 <property name="version" value="0.2-dev" /> 36 36 <property name="src" location="src" description="Location of source files" /> 37 37 <property name="build" location="build" description="Location of compiled files" /> … … 43 43 description="Full name of .tar.gz file for download." /> 44 44 <property name="javac.arg" value="-Xlint:unchecked" /> 45 <property name="javac.source" value="1. 5" />46 <property name="javac.target" value="1. 5" />45 <property name="javac.source" value="1.6" /> 46 <property name="javac.target" value="1.6" /> 47 47 <property name="javac.encoding" value="UTF-8" /> 48 <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.16.0" /> 48 <property name="depend.base-version" 49 value="3.1.0" 50 description="The BASE version that this project depends on." 51 /> 52 <property name="depend.jars" 53 value="http://base2.thep.lu.se/base/jars/${depend.base-version}" 54 description="The location of the BASE core JARs that this project depends on." 55 /> 49 56 50 57 <!-- set up classpath for compiling --> … … 93 100 94 101 <target 102 name="install" 103 depends="jar" 104 > 105 <fail unless="base.plugins" message="base.plugins is not set to the path of BASE plug-ins directory." /> 106 <copy todir="${base.plugins}"> 107 <fileset file="${jar.name}" /> 108 </copy> 109 <echo>Copied '${jar.name}' to '${base.plugins}'.</echo> 110 </target> 111 112 113 <target 95 114 name="jar" 96 depends="build ,jar.external"115 depends="build" 97 116 description="Creates the extension JAR file" 98 117 > … … 102 121 > 103 122 <fileset dir="${build}/main" /> 123 <fileset dir="${build}//external/hpbtc" /> 104 124 <fileset dir="." includes="META-INF/**" /> 105 125 <fileset dir="." includes="resources/**" /> … … 107 127 </target> 108 128 109 <target110 name="jar.external"111 >112 <jar113 jarfile="lib/torrent/hpbtc.jar"114 >115 <fileset dir="${build}/external/hpbtc" />116 </jar>117 </target>118 119 129 <target 120 130 name="build" 121 131 depends="init,checkjar,build.external" 122 description="Compiles the plugin and put in jar"132 description="Compiles the plugin" 123 133 > 124 134 <mkdir dir="${build}/main" /> … … 160 170 > 161 171 <available classname="net.sf.basedb.core.Application" 162 classpathref="classpath" property="base 2core" />172 classpathref="classpath" property="base-core" /> 163 173 <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" 164 classpathref="classpath" property="base 2web" />165 <fail unless="base 2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />166 <fail unless="base 2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />167 <echo>Found BASE2Core.jar and BASE2Webclient.jar.</echo>174 classpathref="classpath" property="base-web" /> 175 <fail unless="base-core" message="Can't find base-core-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> 176 <fail unless="base-web" message="Can't find base-webservices-client-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> 177 <echo>Found all requried BASE core JAR files.</echo> 168 178 </target> 169 179 170 180 <target 171 181 name="download-lib" 172 description="Download BASE2Core.jar and BASE2Webclient.jar."182 description="Download required BASE core jar files" 173 183 > 174 184 <echo> … … 179 189 ------------------------------------------------------- 180 190 </echo> 181 <download-lib file=" BASE2Core.jar" />182 <download-lib file=" BASE2Webclient.jar" />191 <download-lib file="base-core-${depend.base-version}.jar" /> 192 <download-lib file="base-webclient-${depend.base-version}.jar" /> 183 193 </target> 184 194 … … 195 205 </sequential> 196 206 </macrodef> 207 208 <target name="update-version"> 209 <echo>Setting version to: ${version}</echo> 210 211 <echo>extensions.xml</echo> 212 <replaceregexp 213 file="META-INF/extensions.xml" 214 match="<version>.*</version>" 215 replace="<version>${version}</version>" 216 encoding="UTF-8" 217 /> 218 <replaceregexp 219 file="META-INF/extensions.xml" 220 match="<min-base-version>.*</min-base-version>" 221 replace="<min-base-version>${depend.base-version}</min-base-version>" 222 encoding="UTF-8" 223 /> 224 225 <echo>Don't forget to commit the changes to the subversion repository!</echo> 226 </target> 227 228 197 229 </project> -
extensions/net.sf.basedb.torrent/trunk/lib/compile
- Property svn:ignore
-
old new 1 1 BASE2*.jar 2 base-*.jar
-
- Property svn:ignore
-
extensions/net.sf.basedb.torrent/trunk/resources/upload_torrent.jsp
r1304 r1636 61 61 </base:head> 62 62 <base:body> 63 <p> 63 64 64 <div id="selectForm"> 65 <h1>Upload torrent</h1> 65 66 <form action="UploadTorrent.servlet?ID=<%=ID%>&directory_id=<%=directory.getId()%>" 66 67 method="post" name="file" enctype="multipart/form-data" onsubmit="return false;"> 67 68 68 <h3 class="docked">Upload torrent</h3> 69 <div class="boxedbottom"> 70 <table class="form" cellspacing=0> 71 <tr> 72 <td class="prompt">Save in</td> 73 <td><%=HTML.encodeTags(directory.getPath().toString())%></td> 74 </tr> 75 <tr> 76 <td class="prompt">Torrent file</td> 77 <td> 78 <input <%=requiredClazz%> type="file" name="torrent" size="50"> 79 </td> 80 </tr> 81 <tr> 82 <td colspan="2"> 83 <div class="helpmessage"> 84 Select a torrent file on your local computer. The torrent file will 85 be submitted as a job to the torrent service on the BASE server. 86 When the service has downloaded all files they will be saved to 87 the current directory. 69 <div class="content filled"> 70 <div> 71 <table class="fullform input100 bottomborder"> 72 <tr> 73 <th>Save in</th> 74 <td><%=HTML.encodeTags(directory.getPath().toString())%></td> 75 </tr> 76 <tr> 77 <th>Torrent file</th> 78 <td> 79 <input <%=requiredClazz%> type="file" name="torrent" size="50"> 80 </td> 81 </tr> 82 </table> 83 <div class="padded"> 84 Select a torrent file on your local computer. The torrent file will 85 be submitted as a job to the torrent service on the BASE server. 86 When the service has downloaded all files they will be saved to 87 the current directory. 88 88 </div> 89 </td> 90 </tr> 91 </table> 89 </div> 92 90 </div> 91 </form> 93 92 94 <table align="center"> 95 <tr> 96 <td width="50%"><base:button image="upload.gif" onclick="doUpload()" title="Upload" /></td> 97 <td width="50%"><base:button onclick="top.window.close()" title="Cancel" /></td> 98 </tr> 99 </table> 100 </form> 93 <base:buttongroup subclass="dialogbuttons"> 94 <base:button image="upload.png" onclick="doUpload()" title="Upload" /> 95 <base:button onclick="top.window.close()" title="Cancel" /> 96 </base:buttongroup> 101 97 102 98 </base:body> -
extensions/net.sf.basedb.torrent/trunk/src/main/net/sf/basedb/clients/torrent/service/TorrentService.java
r1304 r1636 172 172 log.debug("Logging in to BASE as user '" + username + "'"); 173 173 sc = Application.newSessionControl(null, "local-bittorrent", null); 174 sc.login(username, password, "Bittorrent download service" , false);174 sc.login(username, password, "Bittorrent download service"); 175 175 pinger = Application.newPinger(sc); 176 176 log.debug("Login successful"); … … 181 181 InetSocketAddress socketAddress = new InetSocketAddress(tmpAddress, port); 182 182 log.debug("Creating bittorrent client on " + socketAddress); 183 tmpClient = new Client(); 183 String peerId = "BASE@" + Application.getHostName(); 184 if (peerId.length() > 20) peerId = peerId.substring(0, 20); 185 tmpClient = new Client(peerId.getBytes()); 184 186 listenAddress = tmpClient.startProtocol(socketAddress); 185 187 log.debug("Connected to: " + listenAddress);
Note: See TracChangeset
for help on using the changeset viewer.