Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Construction of sample extensions from their source files is only possible if the Maven 1.1 tool is installed in the system.

Po rozpakowaniu archiwum z kodem źródłowym, w katalogu The archive with the source code has to be unpacked. The dcore-app-extension-tests znajdują się katalogi projektów dla poszczególnych rozszerzeń, o nazwach zaczynających się od  directory will contain project directories for particular extensions, with names beginning with dcore-app-extension. Znajduje się tam też katalog -tests. The directory will also contain the maven-repo, który zawiera dodatkowe pliki jar potrzebne przy budowaniu.

Aby zbudować wybrane rozszerzenie, należy w konsoli wejść do powiązanego z nim katalogu i wywołać polecenie

maven clean install

directory with additional jar files needed for building.

In order to build the selected extension, the user should enter the directory related to it in the console and run the

maven clean install

One can also build all extensions at once. To do that, the user should run the Można również zbudować wszystkie rozszerzenia na raz. W tym celu w katalogu dcore-app-extension-tests należy wywołać polecenie

maven multiproject:clean multiproject:install command in the dcore-app-extension-tests directory.

Programmers working in the Eclipse environment may find the following command. which creates a ready-to-import Eclipse file in the plugin directory, usefulDla programistów pracujących w środowisku Eclipse, przydatne będzie polecenie, które tworzy w katalogu wtyczki projekt Eclipse gotowy do zaimportowania:

maven eclipse

Po zbudowaniu danego rozszerzenia w katalogu target zostaje umieszczony plik jar, który można zainstalować w dLibrze.

Instalacja rozszerzeń

Once the chosen extension has been built, a jar file is placed in the target directory; the file can be installed in the dLibra system.

Installing Sample Extensions

Sample extensions are not installed in the Editor and Administrator Application by default. In order to install such a plugin in the system, the user should copy the jar file of the plugin in the Przykładowe rozszerzenia nie są domyślnie zainstalowane w Aplikacji Redaktora i Administratora dLibry. Aby zainstalować wtyczkę w systemie, należy skopiować plik jar wtyczki do katalogu /WEB-INF/jnlp-jars aplikacji czytelnika i uruchomić w panelu administracyjnym proces uaktualnienia aplikacji redaktora/administratora. Więcej na temat panelu administracyjnego aplikacji czytelnika można dowiedzieć się tutaj.

Po ponownym uruchomieniu Aplikacji Redaktora wtyczki powinny być widoczne (można to sprawdzić w menu Pomoc -> O programie). Proces uaktualnienia w panelu administracyjnym musi zostać uruchomiony po każdej zmianie plików jar.

Konfiguracja rozszerzeń

directory of the reader application and run the Editor and Administrator Application update process in the administration panel. For more information about the administration panel, see here.

Once the Editor Application has been restarted, the plugins should be visible (which can be checked in the “About the program” item of the “Help” menu). The update process in the administration panel must be run after every change of jar files.

Configuring Sample Extensions

A sample extension will be displayed correctly in the Editor and Administrator Application if the Aby rozszerzenie było poprawnie widoczne w Aplikacji Redaktora i Administratora, odpowiednia konfiguracja musi znajdować się w pliku src/etc/plugin.xml. Budowa tego pliku wynika z wymagań biblioteki Java Plugin Framework. Poniżej znajduje się przykładowa zawartość tego pliku contains an appropriate configuration. The construction of that file results from the requirements of the Java Plugin Framework. The content of that file can look as follows:

Code Block
languagehtml/xml
titleplugin.xml
<?xml version="1.0" ?>
<!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 0.7" "http://jpf.sourceforge.net/plugin_0_7.dtd">
<plugin id="pl.psnc.dlibra.app.extension.op.test" version="${pom.currentVersion}">
<requires>
	<import plugin-id="pl.psnc.dlibra.app.extension"/>
</requires>
	<runtime>
#foreach($dep in ${pom.dependencies})
#if(${dep.type} == "jar" && !${dep.getProperty('dist.skip').equals("true")})
		<library id="${dep.artifact}" path="lib/${dep.artifact}" type="code" />
#end
#end
		<library id="pluginCode" path="${jarName}" type="code" />
	</runtime>
<extension plugin-id="pl.psnc.dlibra.app.extension"
	point-id="objectPanel" id="op-test">
	<doc>
		<doc-text>Polish interface language is provided by Poznan Supercomputing and Networking Center.</doc-text>
	</doc>
	<parameter id="class"
		value="pl.psnc.dlibra.app.extension.optest.DummyObjectPanel"/>
</extension>
</plugin>

W znaczniku <runtime> znajduje się makro Velocity, które automatycznie dołączy do dystrybucji wtyczki niezbędne pliki jar (wszystkie te, które są wymienione jako zależności w pliku project.xml i nie mają dopisanej właściwości The <runtimes> tag contains the Velocity macro which automatically adds all the necessary jar files (those which are listed as dependencies in the project.xml file and which do not have value <dist.skip>true</dist.skip> added) to the distribution.

Znacznik <extension> definiuje konkretne rozszerzenie. Atrybut pluginId musi mieć wartość The <extension> tag defines the given extension. The pluginId attribute must have value "pl.psnc.dlibra.app.extension". Atrybut point-id musi zawierać identyfikator punktu rozszerzeń, do którego ma być włączona wtyczka (zgodny z nazwami wymienionymi w dokumentacji), natomiast atrybut id musi być unikalnym identyfikatorem rozszerzenia. Wewnątrz znacznika <extension> można umieścić opcjonalny znacznik doc z tekstem, który ma być wyświetlony w oknie informacyjnym Aplikacji (Menu Pomoc -> O programie...), oraz znaczniki <parameter> definiujące parametry wymienione w opisie danego punktu rozszerzeń.

Uwaga: w przykładowych rozszerzeniach każda wtyczka korzysta z tylko jednego punktu rozszerzeń, ale nic nie stoi na przeszkodzie, aby jedna wtyczka była włączona do wielu punktów. W tym celu należy umieścić w pliku konfiguracyjnym więcej znaczników <extension>.

Lista przykładowych rozszerzeń

The point-id  attribute must contain the identifier of the extension point to which the plugin is to be connected (corresponding to the names mentioned in the documentation), and the id attribute must be the unique identifier of the extension. The <extension> tag may be expanded by the addition of an optional doc tag with the text to be displayed in the information window of the application (in the “About the program” item of the “Help” menu) and by adding <parameters> tags which define the parameters mentioned in the description of the extension point.

Note: Each sample extension only uses one extension point, but such a plugin can be connected to many points, by placing more <extension>tags in the configuration file.

The List of Sample Extensions

The extensions are listed and described in subchaptersRozszerzenia zostały wymienione i opisane w podrozdziałach:

Children Display
sorttitle