Add JavaScript Console in SDK 4.1

cancel
Showing results for 
Search instead for 
Did you mean: 
jigir_shah
Active Member

Add JavaScript Console in SDK 4.1

Hello All,

I want to have javascript console in my Admin tools for my Alfresco SDK 4.1 project. I'm following all the steps as defined in below links.

https://github.com/Alfresco/alfresco-sdk/blob/master/docs/advanced-topics/amps.md

I've added amp files to extensions folder in platfrom and share project. Then, added line in Dockerfile. Also, I've added dependencies in pom as well.

However, I'm getting below errors. Can anyone please help me here?

Step 5/8 : RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install $TOMCAT_DIR/amps_share $TOMCAT_DIR/webapps/share -directory -nobackup -force
---> Running in 6afd2d28c38d
java.io.FileNotFoundException: /usr/local/tomcat/amps_share/javascript-console-share-0.6.amp/module.properties

at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:108)

at de.schlichtherle.truezip.file.TFileInputStream.<init>(TFileInputStream.java:81)
at org.alfresco.repo.module.tool.ModuleDetailsHelper.createModuleDetailsFromPropertyLocation(ModuleDetailsHelper.java:105)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModule(ModuleManagementTool.java:229)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:172)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:155)
at org.alfresco.repo.module.tool.ModuleManagementTool.main(ModuleManagementTool.java:837)
Caused by: java.util.zip.ZipException: ZIP file spanning/splitting is not supported!

8 Replies
abhinavmishra14
Advanced

Re: Add JavaScript Console in SDK 4.1

Try adding the dependencies to *-platform-docker and *-share-docker project's pom files. You dont have to manually install amps.

<youProject>-platform-docker

<dependency>
	<groupId>de.fmaul</groupId>
	<artifactId>javascript-console-repo</artifactId>
	<type>amp</type>
	<version>0.6</version>
	<exclusions>
		<exclusion>
			<groupId>*</groupId>
			<artifactId>*</artifactId>
		</exclusion>
	</exclusions>
</dependency>

 

<youProject>-share-docker

<dependency>
	<groupId>de.fmaul</groupId>
	<artifactId>javascript-console-share</artifactId>
	<type>amp</type>
	<version>0.6</version>
	<exclusions>
		<exclusion>
			<groupId>*</groupId>
			<artifactId>*</artifactId>
		</exclusion>
	</exclusions>
</dependency>

Please note that javascript-console-xxx-0.6 version works until ACS6.x. The add-on is broken for ACS 7.x onwards. In order to use it, you can clone this git repo "https://github.com/AFaust/ootbee-support-tools.git"and checkout "feature/js-console-fork" branch, build the amps and deploy them manually. 

You can downlod the patched amps from here:

https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-repo-0.7.a...

https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-share-0.7....

 

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)
filipehtf
Member II

Re: Add JavaScript Console in SDK 4.1

Hello, the indicated solution worked.
But if I try to add any amp in the production environment by customizing an image with Docker-Compose, I get the same error.

What is the solution for this error?

Unfortunately not all addons I can include natively via project.

Thank you!

abhinavmishra14
Advanced

Re: Add JavaScript Console in SDK 4.1

@filipehtf Can you please provide the steps you followed ? what do you mean by customizing an image in terms of above solution? and how you added the amp in prod?

The above solution is for inclusion in sdk so when you are developing the amp would be included in your local dev images for acs and share.

Also share the error details.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)
filipehtf
Member II

Re: Add JavaScript Console in SDK 4.1


@abhinavmishra14 wrote:

@filipehtf Can you please provide the steps you followed ? what do you mean by customizing an image in terms of above solution? and how you added the amp in prod?

The above solution is for inclusion in sdk so when you are developing the amp would be included in your local dev images for acs and share.

Also share the error details.


Hi, thanks for replying. The error happens in Share and Repo image when I add any amp file such as Javascript-Console.

 

FROM alfresco/alfresco-share:7.1.0-M1
ARG TOMCAT_DIR=/usr/local/tomcat

# Copy Dockerfile to avoid an error if no AMPs exist
COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps_share/
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
    $TOMCAT_DIR/amps_share $TOMCAT_DIR/webapps/share -directory -nobackup -force

 

I get the error when applying the amps, saying that I couldn't find the files because it's not a folder.

abhinavmishra14
Advanced

Re: Add JavaScript Console in SDK 4.1


@filipehtf wrote:

@abhinavmishra14 wrote:

@filipehtf Can you please provide the steps you followed ? what do you mean by customizing an image in terms of above solution? and how you added the amp in prod?

The above solution is for inclusion in sdk so when you are developing the amp would be included in your local dev images for acs and share.

Also share the error details.


Hi, thanks for replying. The error happens in Share and Repo image when I add any amp file such as Javascript-Console.

 

FROM alfresco/alfresco-share:7.1.0-M1
ARG TOMCAT_DIR=/usr/local/tomcat

# Copy Dockerfile to avoid an error if no AMPs exist
COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps_share/
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
    $TOMCAT_DIR/amps_share $TOMCAT_DIR/webapps/share -directory -nobackup -force

 

I get the error when applying the amps, saying that I couldn't find the files because it's not a folder.


This is what i wanted to see. For repo layer you need to run the command by switching the user to root. 

You can find a discussion here: https://hub.alfresco.com/t5/alfresco-content-services-forum/alfresco-sdk-4-issue-with-alfresco-platf...

For share layer your dockerfile commands looks correct, it should not be failing unless the amp is missing under extensions directory. 

Check the full list of instructions here: https://github.com/Alfresco/acs-community-deployment/issues/131#issuecomment-691300550

You can also take a reference from this dockerfile: https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/configs-to-override/share/...

 

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)
filipehtf
Member II

Re: Add JavaScript Console in SDK 4.1

@abhinavmishra14 

Thanks for your attention, but what happens is that I had already tried with the USER root command, and got no results.

The Share layer, presents the same error, follows below.

The file is present, if it repairs it finds the name of the .amp file.

Seems to be some problem with decompression.

I've tried several amps, which if put as a dependency on the pom works.

The case is that in installations it doesn't justify a complete maven project, when you have the option to create the local image, even more when dealing with addons outside the Mavem repository.

I appreciate the help.

Step 8/21 : COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps_share/
 ---> 2a5fdb95f15b
Step 9/21 : COPY Dockerfile *.amp $TOMCAT_DIR/amps_share/
 ---> 87e3dfc16208
Step 10/21 : RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install     $TOMCAT_DIR/amps_share $TOMCAT_DIR/webapps/share -directory -nobackup -force
 ---> Running in 955ba9bebdb1
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
java.io.FileNotFoundException: /usr/local/tomcat/amps_share/alfresco-governance-services-community-share-3.5.a.amp/module.properties
        at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:108)
        at de.schlichtherle.truezip.file.TFileInputStream.<init>(TFileInputStream.java:81)
        at org.alfresco.repo.module.tool.ModuleDetailsHelper.createModuleDetailsFromPropertyLocation(ModuleDetailsHelper.java:105)
        at org.alfresco.repo.module.tool.ModuleManagementTool.installModule(ModuleManagementTool.java:229)
        at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:172)
        at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:155)
        at org.alfresco.repo.module.tool.ModuleManagementTool.main(ModuleManagementTool.java:837)

 

abhinavmishra14
Advanced

Re: Add JavaScript Console in SDK 4.1

@filipehtf are you getting the below error for governance services amp or every amp?

java.io.FileNotFoundException: /usr/local/tomcat/amps_share/alfresco-governance-services-community-share-3.5.a.amp/module.properties
        at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:108)

Share you DockerFiles for repo and share, and docker-compose.yml, so we can look at it. The error seems strage.

For reference you can have a look at this project which builds custom image with some add-on amps which is installed.

https://github.com/abhinavmishra14/change-acs-share-port-demo

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)
abhinavmishra14
Advanced

Re: Add JavaScript Console in SDK 4.1

@Oberbrunner What are you trying to say exactly? You are mentioning something that is not related to jsconsole here.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)