Changeset 1636


Ignore:
Timestamp:
May 3, 2012, 1:23:14 PM (11 years ago)
Author:
Nicklas Nordborg
Message:

Changes required for BASE 3.1 compatibility.

Location:
extensions/net.sf.basedb.torrent/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.torrent/trunk/.classpath

    r1255 r1636  
    44  <classpathentry kind="src" path="src/external/hpbtc"/>
    55  <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"/>
    86  <classpathentry kind="lib" path="lib/compile/slf4j-api-1.5.2.jar"/>
    97  <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"/>
    1010  <classpathentry kind="output" path="bin"/>
    1111</classpath>
  • extensions/net.sf.basedb.torrent/trunk/META-INF/MANIFEST.MF

    r1245 r1636  
    11Manifest-Version: 1.0
    2 Class-Path: lib/torrent/hpbtc.jar
    32 
  • extensions/net.sf.basedb.torrent/trunk/META-INF/extensions.xml

    r1304 r1636  
    3434      for downloading files from BASE.
    3535    </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>
    3740    <url>http://baseplugins.thep.lu.se/wiki/net.sf.basedb.torrent</url>
    3841  </about>
  • extensions/net.sf.basedb.torrent/trunk/README

    r1245 r1636  
    11== Requirements ==
    22
    3  1. BASE 2.16.0 or later.
     3 1. BASE 3.1.0 or later.
    44 
    55== Introduction ==
     
    1919 2. Unpack the downloaded file to a directory of your choice.
    2020 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 you
    24     have enabled automatic installation, just sit back and wait for it to find
    25     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.
    2727
    2828== Known issues ==
     
    4444 2. Type `ant download-lib` to automatically download the BASE core JAR file that
    4545    are neeed for compilation. You can also do this manually by copying the
    46     BASE2Core.jar and BASE2Webclient.jar from the BASE installation directory
     46    base-core-*.jar and base-webclient-*.jar from the BASE installation directory
    4747    (`<basedir>/www/WEB-INF/lib/`) to the `./lib/compile` directory.
    4848
  • extensions/net.sf.basedb.torrent/trunk/build.xml

    r1251 r1636  
    3333  <!-- variables used -->
    3434  <property name="name" value="base-torrent" />
    35   <property name="version" value="0.2pre" />
     35  <property name="version" value="0.2-dev" />
    3636  <property name="src" location="src" description="Location of source files" />
    3737  <property name="build" location="build" description="Location of compiled files" />
     
    4343    description="Full name of .tar.gz file for download." />
    4444  <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" />
    4747  <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  />
    4956
    5057  <!-- set up classpath for compiling -->
     
    93100 
    94101  <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
    95114    name="jar"
    96     depends="build,jar.external"
     115    depends="build"
    97116    description="Creates the extension JAR file"
    98117    >
     
    102121      >
    103122      <fileset dir="${build}/main" />
     123      <fileset dir="${build}//external/hpbtc" />
    104124      <fileset dir="." includes="META-INF/**" />
    105125      <fileset dir="." includes="resources/**" />
     
    107127  </target>
    108128 
    109   <target
    110     name="jar.external"
    111     >
    112     <jar
    113       jarfile="lib/torrent/hpbtc.jar"
    114       >
    115       <fileset dir="${build}/external/hpbtc" />
    116     </jar>
    117   </target>
    118  
    119129  <target
    120130    name="build"
    121131    depends="init,checkjar,build.external"
    122     description="Compiles the plugin and put in jar"
     132    description="Compiles the plugin"
    123133    >
    124134    <mkdir dir="${build}/main" />
     
    160170    >
    161171    <available classname="net.sf.basedb.core.Application"
    162       classpathref="classpath" property="base2core" />
     172      classpathref="classpath" property="base-core" />
    163173    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory"
    164       classpathref="classpath" property="base2web" />
    165     <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    166     <fail unless="base2web" 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>
    168178  </target>
    169179 
    170180  <target
    171181    name="download-lib"
    172     description="Download BASE2Core.jar and BASE2Webclient.jar."
     182    description="Download required BASE core jar files"
    173183    >
    174184    <echo>
     
    179189-------------------------------------------------------
    180190    </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" />
    183193  </target>
    184194 
     
    195205    </sequential>
    196206  </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="&lt;version&gt;.*&lt;/version&gt;"
     215      replace="&lt;version&gt;${version}&lt;/version&gt;"
     216      encoding="UTF-8"
     217    />
     218    <replaceregexp
     219      file="META-INF/extensions.xml"
     220      match="&lt;min-base-version&gt;.*&lt;/min-base-version&gt;"
     221      replace="&lt;min-base-version&gt;${depend.base-version}&lt;/min-base-version&gt;"
     222      encoding="UTF-8"
     223    />
     224
     225    <echo>Don't forget to commit the changes to the subversion repository!</echo>
     226  </target>
     227
     228 
    197229</project>
  • extensions/net.sf.basedb.torrent/trunk/lib/compile

    • Property svn:ignore
      •  

        old new  
        11BASE2*.jar
         2base-*.jar
  • extensions/net.sf.basedb.torrent/trunk/resources/upload_torrent.jsp

    r1304 r1636  
    6161  </base:head>
    6262  <base:body>
    63   <p>
     63
    6464  <div id="selectForm">
     65    <h1>Upload torrent</h1>
    6566    <form action="UploadTorrent.servlet?ID=<%=ID%>&directory_id=<%=directory.getId()%>"
    6667      method="post" name="file" enctype="multipart/form-data" onsubmit="return false;">
    6768
    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.
    8888        </div>
    89         </td>
    90       </tr>
    91       </table>
     89      </div>
    9290    </div>
     91    </form>
    9392
    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>
    10197 
    10298  </base:body>
  • extensions/net.sf.basedb.torrent/trunk/src/main/net/sf/basedb/clients/torrent/service/TorrentService.java

    r1304 r1636  
    172172        log.debug("Logging in to BASE as user '" + username + "'");
    173173        sc = Application.newSessionControl(null, "local-bittorrent", null);
    174         sc.login(username, password, "Bittorrent download service", false);
     174        sc.login(username, password, "Bittorrent download service");
    175175        pinger = Application.newPinger(sc);
    176176        log.debug("Login successful");
     
    181181        InetSocketAddress socketAddress = new InetSocketAddress(tmpAddress, port);
    182182        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());
    184186        listenAddress = tmpClient.startProtocol(socketAddress);
    185187        log.debug("Connected to: " + listenAddress);
Note: See TracChangeset for help on using the changeset viewer.