Skip to content

Commit

Permalink
docs: README.md updated according to the latest changes (#84)
Browse files Browse the repository at this point in the history
Refs: #81
  • Loading branch information
grigoriev authored Jul 10, 2024
1 parent e78475b commit 09042ba
Showing 1 changed file with 75 additions and 66 deletions.
141 changes: 75 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,57 +23,67 @@ Maven's `pom.xml` should contain following content:

```xml
<parent>
<groupId>ch.sbb.polarion.extensions</groupId>
<artifactId>ch.sbb.polarion.extension.generic</artifactId>
<version>6.0.0</version>
<groupId>ch.sbb.polarion.extensions</groupId>
<artifactId>ch.sbb.polarion.extension.generic</artifactId>
<version>6.2.0</version>
</parent>
```

* Specify extension context, automatic module name and web application name in POM's properties:

```xml
<properties>
<maven-jar-plugin.Extension-Context>pdf-exporter</maven-jar-plugin.Extension-Context>
<maven-jar-plugin.Automatic-Module-Name>ch.sbb.polarion.extension.pdf_exporter</maven-jar-plugin.Automatic-Module-Name>
<web.app.name>${maven-jar-plugin.Extension-Context}</web.app.name>
<maven-jar-plugin.Extension-Context>pdf-exporter</maven-jar-plugin.Extension-Context>
<maven-jar-plugin.Automatic-Module-Name>ch.sbb.polarion.extension.pdf_exporter</maven-jar-plugin.Automatic-Module-Name>
<web.app.name>${maven-jar-plugin.Extension-Context}</web.app.name>
</properties>
```

* Reference or extend following build plugins:

```xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
</plugin>

<plugin>
<groupId>ch.sbb.maven.plugins</groupId>
<artifactId>markdown2html-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>
```

Expand Down Expand Up @@ -169,30 +179,29 @@ registering settings classes and extending classes of REST controller, web appli

```java
public class PdfExporterRestApplication extends GenericRestApplication {
private final Logger logger = Logger.getLogger(PdfExporterRestApplication.class);

public PdfExporterRestApplication() {
logger.debug("Creating PDF-Exporter REST Application...");

try {
NamedSettingsRegistry.INSTANCE.register(
Arrays.asList(
new StylePackageSettings(),
new HeaderFooterSettings(),
new CssSettings(),
new LocalizationSettings(),
new CoverPageSettings(),
new FileNameTemplateSettings()
)
);
} catch (Exception e) {
logger.error("Error during registration of named settings", e);
private final Logger logger = Logger.getLogger(PdfExporterRestApplication.class);

public PdfExporterRestApplication() {
logger.debug("Creating PDF-Exporter REST Application...");

try {
NamedSettingsRegistry.INSTANCE.register(
Arrays.asList(
new StylePackageSettings(),
new HeaderFooterSettings(),
new CssSettings(),
new LocalizationSettings(),
new CoverPageSettings(),
new FileNameTemplateSettings()
)
);
} catch (Exception e) {
logger.error("Error during registration of named settings", e);
}

logger.debug("PDF-Exporter REST Application has been created");
}

logger.debug("PDF-Exporter REST Application has been created");
}

...
...
}
```

Expand All @@ -204,12 +213,12 @@ simply specifying servlet name in constructor:
```java
public class PdfExporterAdminUiServlet extends GenericUiServlet {

@Serial
private static final long serialVersionUID = -6337912330074718317L;
@Serial
private static final long serialVersionUID = -6337912330074718317L;

public PdfExporterAdminUiServlet() {
super("pdf-exporter-admin");
CurrentExtensionConfiguration.getInstance().setExtensionConfiguration(PdfExporterExtensionConfiguration.getInstance());
}
public PdfExporterAdminUiServlet() {
super("pdf-exporter-admin");
CurrentExtensionConfiguration.getInstance().setExtensionConfiguration(PdfExporterExtensionConfiguration.getInstance());
}
}
```

0 comments on commit 09042ba

Please sign in to comment.