mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2026-09-16 18:12:54 +00:00
ACS-12413 : enable deferred pre-commit hooks and normalize repo (#1333)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
eeabc8b858
commit
5b03dc315e
@@ -45,8 +45,8 @@ src/main/java/org/alfresco/transformer/Application.java
|
||||
<tr><td><div style="text-align:right">abc:height</div></td><td><input type="text" name="height" value="" /></td></tr>
|
||||
<tr><td><div style="text-align:right">timeout</div></td><td><input type="text" name="timeout" value="" /></td></tr>
|
||||
<tr><td></td><td><input type="submit" value="Transform" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/log">Log entries</a>
|
||||
@@ -114,6 +114,7 @@ public class TransformerNameController extends TransformController
|
||||
|
||||
* *TransformerName*Executer.java - *JavaExecutor* and *CommandExecutor* sub classes need to extract values from
|
||||
*transformOptions* and use them in a call to an external process or as parameters to a library call.
|
||||
|
||||
~~~
|
||||
...
|
||||
public class TransformerNameExecutor extends AbstractCommandExecutor
|
||||
@@ -157,30 +158,32 @@ public class Application
|
||||
~~~
|
||||
|
||||
Transform requests are handled by the *TransformController*, but are either:
|
||||
* POST requests (a direct http request from a client) where the transform options are passed as parameters, the source is supplied as a multipart file and
|
||||
|
||||
* POST requests (a direct http request from a client) where the transform options are passed as parameters, the source is supplied as a multipart file and
|
||||
the response is a file download.
|
||||
* POST request (a request via a message queue) where the transform options are supplied as JSON and the response is also JSON.
|
||||
* POST request (a request via a message queue) where the transform options are supplied as JSON and the response is also JSON.
|
||||
The source and target content is read from a location accessible to both the client and the transfomer.
|
||||
|
||||
**Example JSON request body**
|
||||
|
||||
```javascript
|
||||
var transformRequest = {
|
||||
"requestId": "1",
|
||||
"sourceReference": "2f9ed237-c734-4366-8c8b-6001819169a4",
|
||||
"sourceMediaType": "application/pdf",
|
||||
"sourceSize": 123456,
|
||||
"sourceExtension": "pdf",
|
||||
"targetMediaType": "text/plain",
|
||||
"targetExtension": "txt",
|
||||
"clientType": "ACS",
|
||||
"clientData": "Yo No Soy Marinero, Soy Capitan, Soy Capitan!",
|
||||
"schema": 1,
|
||||
"transformRequestOptions": {
|
||||
"targetMimetype": "text/plain",
|
||||
"targetEncoding": "UTF-8",
|
||||
"abc:width": "120",
|
||||
"abc:height": "200"
|
||||
}
|
||||
"requestId": "1",
|
||||
"sourceReference": "2f9ed237-c734-4366-8c8b-6001819169a4",
|
||||
"sourceMediaType": "application/pdf",
|
||||
"sourceSize": 123456,
|
||||
"sourceExtension": "pdf",
|
||||
"targetMediaType": "text/plain",
|
||||
"targetExtension": "txt",
|
||||
"clientType": "ACS",
|
||||
"clientData": "Yo No Soy Marinero, Soy Capitan, Soy Capitan!",
|
||||
"schema": 1,
|
||||
"transformRequestOptions": {
|
||||
"targetMimetype": "text/plain",
|
||||
"targetEncoding": "UTF-8",
|
||||
"abc:width": "120",
|
||||
"abc:height": "200"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -237,4 +240,3 @@ The build plan is available in [GitHub Actions CI](https://github.com/Alfresco/a
|
||||
|
||||
Please use [this guide](https://github.com/Alfresco/alfresco-repository/blob/master/CONTRIBUTING.md)
|
||||
to make a contribution to the project.
|
||||
|
||||
|
||||
+7
-7
@@ -61,7 +61,7 @@ import org.slf4j.LoggerFactory;
|
||||
* Use the {@link #setProcessDirectory(String) processDirectory} property to change the default location from which the command executes. The process's environment can be configured using the {@link #setProcessProperties(Map) processProperties} property.
|
||||
* <p>
|
||||
* Commands may use placeholders, e.g.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* find
|
||||
@@ -69,27 +69,27 @@ import org.slf4j.LoggerFactory;
|
||||
* ${filename}
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* The <b>filename</b> property will be substituted for any supplied value prior to each execution of the command. Currently, no checks are made to get or check the properties contained within the command string. It is up to the client code to dynamically extract the properties required if the required properties are not known up front.
|
||||
* <p>
|
||||
* Sometimes, a variable may contain several arguments. . In this case, the arguments need to be tokenized using a standard <tt>StringTokenizer</tt>. To force tokenization of a value, use:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* SPLIT:${userArgs}
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* You should not use this just to split up arguments that are known to require tokenization up front. The <b>SPLIT:</b> directive works for the entire argument and will not do anything if it is not at the beginning of the argument. Do not use <b>SPLIT:</b> to break up arguments that are fixed, so avoid doing this:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* SPLIT:ls -lih
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* Instead, break the command up explicitly:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* ls
|
||||
|
||||
+3
-3
@@ -76,7 +76,7 @@ import org.slf4j.Logger;
|
||||
* If a transform specifies that it can convert from {@code "<MIMETYPE>"} to {@code "alfresco-metadata-embed"}, it is indicating that it can embed metadata in {@code <MIMETYPE>}.
|
||||
*
|
||||
* The transform results in a new version of supplied source file that contains the metadata supplied in the transform options.
|
||||
*
|
||||
*
|
||||
* @author Jesper Steen Møller
|
||||
* @author Derek Hulley
|
||||
* @author adavis
|
||||
@@ -197,7 +197,7 @@ public abstract class AbstractMetadataExtractor
|
||||
* Based on AbstractMappingMetadataExtracter#getDefaultMapping.
|
||||
*
|
||||
* This method provides a <i>mapping</i> of where to store the values extracted from the documents. The list of properties need <b>not</b> include all metadata values extracted from the document. This mapping should be defined in a file based on the class name: {@code "<classname>_metadata_extract.properties"}
|
||||
*
|
||||
*
|
||||
* @return Returns a static mapping. It may not be null.
|
||||
*/
|
||||
private Map<String, Set<String>> buildExtractMapping()
|
||||
@@ -250,7 +250,7 @@ public abstract class AbstractMetadataExtractor
|
||||
* This method provides a <i>mapping</i> of model properties that should be embedded in the content. The list of properties need <b>not</b> include all properties. This mapping should be defined in a file based on the class name: {@code "<classname>_metadata_embed.properties"}
|
||||
* <p>
|
||||
* If no {@code "<classname>_metadata_embed.properties"} file is found, a reverse of the {@code "<classname>_metadata_extract.properties"} will be assumed. A last win approach will be used for handling duplicates.
|
||||
*
|
||||
*
|
||||
* @return Returns a static mapping. It may not be null.
|
||||
*/
|
||||
private Map<String, Set<String>> buildEmbedMapping()
|
||||
|
||||
@@ -58,4 +58,3 @@ management:
|
||||
|
||||
container:
|
||||
name: ${HOSTNAME:t-engine}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{}
|
||||
{}
|
||||
|
||||
+5
-5
@@ -58,17 +58,17 @@ import org.springframework.http.ResponseEntity;
|
||||
* <li>Provide expected json files (<sourceFilename>"_metadata.json") as resources on the classpath.</li>
|
||||
* <li>Override the method {@code testTransformation(TestFileInfo testFileInfo)} such that it calls the super method as a {@code @ParameterizedTest} for example:</li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* @ParameterizedTest
|
||||
*
|
||||
*
|
||||
* @MethodSource("engineTransformations")
|
||||
*
|
||||
*
|
||||
* @Override
|
||||
|
||||
* public void testTransformation(TestFileInfo testFileInfo)
|
||||
*
|
||||
* {
|
||||
*
|
||||
* {
|
||||
* super.testTransformation(TestFileInfo testFileInfo)
|
||||
* }
|
||||
* </pre>
|
||||
|
||||
Reference in New Issue
Block a user