Code Monkey home page Code Monkey logo

e-spirit / fsdevtools Goto Github PK

View Code? Open in Web Editor NEW
28.0 36.0 20.0 12.08 MB

Project to support developer experience (DX) with FirstSpirit template development by offering a connection between a VCS like Git and FirstSpirit.

License: Apache License 2.0

Java 97.86% Batchfile 0.04% Shell 0.04% HTML 0.08% JavaScript 0.09% CSS 0.16% Vue 1.27% SCSS 0.12% TypeScript 0.21% Kotlin 0.13%
firstspirit e-spirit cli-app import export command-line vcs

fsdevtools's Introduction

FSDevTools - User Guide

Welcome to the FSDevTools User Documentation, a project dedicated to enhancing the developer experience (DX) with FirstSpirit.

Minimal FirstSpirit version & Prerequisites

Since version 4.5.0, FSDevTools requires at least the FirstSpirit version 2023-11-05.

Before using FSDevTools, several prerequisites must be met. Detailed instructions can be found in the zip or tar.gz file of the binary distribution. Below is a summary of the key requirements.

Additionally, ensure that the JAVA_HOME environment variable is correctly set to a Java 17+ installation.

Upon initialization, the following configurations are sourced from your system environment using specific keys:

  • fshost: FirstSpirit host address.
  • fsport: FirstSpirit port number.
  • fsmode: FirstSpirit connection mode (HTTP, HTTPS, or SOCKET).
  • fsuser: FirstSpirit user account for authentication.
  • fspwd: Password for the FirstSpirit user.
  • fsservletzone: FirstSpirit servlet zone.
  • fsproject: Name of the FirstSpirit project.

Among these properties, only the project property lacks a default value. It must be configured to avoid exceptions in project-specific operations. Default values are utilized for other properties when neither an environment variable nor an option is provided.

All default values can be overridden by supplying command line options during execution.

Versioning Scheme

Starting from version 3.0.0, the FSDevTools follows the semantic versioning 2.0.0 (MAJOR.MINOR.PATCH) format for version numbering. This enables users to quickly determine whether there are any breaking changes compared to the previous release, simply by examining the version number.

Here's what each part of the version number signifies:

  • MAJOR: Includes incompatible changes. This version also indicates if the minimum required FirstSpirit version has been modified. Please exercise caution while updating and refer to the RELEASE NOTES for details.
  • MINOR: Adds new features in a backward-compatible manner.
  • PATCH: Contains backward-compatible bug fixes.

For a comprehensive list of changes within each version, please consult the RELEASE NOTES.

Additional Documentation

For information on using FSDevTools in conjunction with Git, refer to the FirstSpirit online documentation.

Usage

Most of the information required to utilize the command line tool can be accessed through the integrated fs-cli help command.

For detailed insights and examples, visit the command line interface usage page.

Logging

By default, no log files are generated. Instead, each command displays varying levels of detail in the command line output. To configure finer logging levels and enable log file creation, refer to the Log4J logging properties file located at /conf/log4j2.xml.

For more comprehensive error logging, the global option -e can be used. This provides additional exception stack traces in specific cases.

For detailed guidance on Log4J configuration, consult the Log4J manual.

External script engines

FSDevTools, by default, supports executing beanshell scripts in "script" commands. You can extend support for other script engines by copying external script engine JAR files into the "plugins" directory.

For now, the FSDevTools bundle comes with additional support for Groovy and Javascript scripts. Simply download the jar files and copy them into the "plugins" directory.

To use the script commands, use the following syntax.

  • fs-cli [-project ...] script parse [--scriptEngine|-se <NAME>] --scriptFile|-sf <PATH>
  • fs-cli [-project ...] script run [--scriptEngine|-se <NAME>] --scriptFile|-sf <PATH>

The currently supported script engines are:

Developing your own script engines

You can build your own script engine in just a few steps:

  • create a clean and new project
  • add the fs-cli.jar as a compile only dependency
  • add the dependencies as implementation dependencies that are needed for your script engine
  • implement the following interfaces:
  • create a fat jar that contains your implementations and the dependencies that are needed at runtime
    • you can use the ShadowJAR plugin for gradle to do this easily
  • copy the created fat jar to the $fs-cli$/plugins directory

Take a closer look at our external script engines, they were implemented in the described way.

Classloading for external script engines

The CLI uses a parent-first classloader to load each external script engine jar from the plugins directory. This means that each jar has its own classpath but all classes that are bundled with the CLI will be loaded from the classpath of the CLI - not the jar file itself. This allows developers to bundle external jars with their own libraries without polluting the classpath of the CLI. However, one big disadvantage is that you cannot override any classes that come with the CLI or the fs-isolated-runtime.jar.

This is especially the case for the following classes/libraries:

Legal Notices

FSDevTools is a product of Crownpeak Technology GmbH, based in Dortmund, Germany.

Usage of FSDevTools requires a valid license agreement with Crownpeak Technology GmbH.

Disclaimer

This document serves informational purposes only. Crownpeak reserves the right to modify its contents without prior notice. This document is not guaranteed to be free from errors and is not subject to any other warranties or conditions, whether implied in law or expressed orally. Crownpeak disclaims any liability associated with this document, and no contractual obligations are established by it, either directly or indirectly. The technologies, functionality, services, and processes described here are subject to change without notice.

fsdevtools's People

Contributors

boesebeck-espirit avatar gockel-e-spirit avatar grossmueller-espirit avatar jonas-mzh avatar jptrn avatar kafmann-e-spirit avatar kohlbrecher-espirit avatar markuspriegl avatar mkobak-bit avatar nico-mcalley avatar pernpeintner-espirit avatar reinartz-e-spirit avatar sosswa avatar timpavone1990 avatar vlapl avatar wagner-e-spirit avatar windmueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fsdevtools's Issues

Project Name Parameter & Spaces CLI

Hi,

is there a Problem when using a project name with a space?

Example:

./fs-cli.sh -p 'Project Space' export -- root:templatestore

will lead to the following error:

com.espirit.moddev.cli.commands.help.UnknownCommandException: fs-cli Space export root:templatestore

Storing the name in an environment variable is working fine.

FastClasspathScanner is outdated -- consider porting to ClassGraph

Your project, e-Spirit/FSDevTools, depends on the outdated library FastClasspathScanner in the following source files:

FastClasspathScanner has been significantly reworked since the version your code depends upon:

  • a significant number of bugs have been fixed
  • some nontrivial API changes have been made to simplify and unify the API
  • FastClasspathScanner has been renamed to ClassGraph: https://github.com/classgraph/classgraph

ClassGraph is a significantly more robust library than FastClasspathScanner, and is more future-proof. All future development work will be focused on ClassGraph, and FastClasspathScanner will see no future development.

Please consider porting your code over to the new ClassGraph API, particularly if your project is in production or has downstream dependencies:

Feel free to close this bug report if this code is no longer in use. (You were sent this bug report because your project depends upon FastClasspathScanner, and has been starred by 18 users. Apologies if this bug report is not helpful.)

Enable (optional) proxy use for fs-cli tools

Hello everyone,

a lot of customers use VPN and proxy server to grant access to their systems for external service providers.
Since the fs-cli tools do not provide proxy use at the moment (see: Community post) they cannot be used in all project situations. Therefore it is necessary to provide optional proxy use for the fs-cli tools to be able to be productive in all project situations.

Thanks in advance
Sandro

WIP Proposal: Export the projects FSM dependencies

Work in Progress - this proposal is not yet completely defined, but you are very welcome to comment on it

Background of the proposal:
When importing a project that has e.g. a custom input-component within its templates, an import command is not working. So you need to lookup the dependencies manually and install them by the current existing module install command beforehand.
As I recognized, that when you execute the fs-cli command export root:templatestore projectproperty:ALL and your current project depends on in my case a webapp-module, then a jar-file e.g. under "Global/Modules/WebApps///Webedit/lib/.jar is being placed.

Proposal:
This brought up the question / idea, if there should be the possibility to export also complete FSMs.

Variant 1 "like install / uninstallation of modules, manual step for export one FSM":
Implement the possibility to export a module, so the .fsm file will be downloaded to the export directory.

_Variant 2 "optionally export used/required modules of the selected project"
Implement the possibility to export the module(s) that are required projects to do a sync / import command against an empty FirstSpirit server instance.

Pros and Cons:

Variant 1 "module export"-step:

  • (+) can be soley used, so you dont have to look on the server module directory and export the files via ssh..
  • (-) you need to list the modules manually

Variant "optionally export used/required modules of the selected project":

  • (+) minimizing effort on fs-cli users side (you dont have to look up the dependencies manually)
  • (+) errors when doing an import afterwards are minimized
  • (+) you always have the latest versions of the FSMs when exporting the template-project
  • (-) possible large files (FSMs) in the SCM (git, ..) repository --> e.g. use git-lfs for *.fsm to solve this

How about just a groovyScript that can be executed generically via the fs-cli ?

Some years ago I implemented an easy way to just execute a bunch of groovy script files. Give it a list of json parameters. Thats it.
With that solution we are able to run one or more scriptfunctionality without adapting the fs-cli for each functionality.
So it is perfect for the fast pace we need to adapt and change things in our daily business. Would also remove some effords on the e-Spirit side as well (codereview, adapting to newer fs-cli versions, ...).
We could additionally do a separate repository - for example via the ESUG github group for just sharing our "best-of-breed" scripts. So just some smaller scripts for basic tasks.

What do you think about it @kafmann-e-spirit , @boesebeck-espirit ?

./fs-cli-wrapper groovyscript run --scriptURI=file:///usr/local/customer/workdir/groovyscripts/dosomethingawesome.groovy --scriptParameters "$(./jq -c '.' < scriptparameters.json)"
@see code
I use the jq command to read the json in an acceptable escaped way for the json :D. This is not as easy as you first think. Maybe I will also implement a direct parameter to just give like the scriptURI another URI for the json parameters. Could also be yaml parameters as maybe some would like to just use yaml instead of json.

The groovyscript gets the 'fsConnection', 'fsContext' and 'scriptParameters' injected. Then you can start from there to use FirstSpiritAgents, Services and so on, just for perfectly customizable processes. We just used it for e.g. to load javascript/css/.. to the mediastore, release it recursively afterwards, manipulating maintenance tasks and executing them afterwards, etc. while skipping the "customize, build, release etc. stuff for the 'customized' fs-cli itself". Also if it would be a basic functionality we would not have to merge our custom fs-cli with the official one on a regular basis.

Thank you for your advice and time!

Here you can find the changes for the releases 4.0.0 and 2.6.10 to check it out: https://github.com/e-Spirit-Usergroup/FSDevTools/releases/

Some Issues when setting up FS-CLI

Hi there,

after setting up the fs-cli on redhat envrionment, I found the following issues:

  1. Javap is not present in JRE -> We are using the dev-tools to automate Import/Export of Projects and installation of FSM. MAybe there is another way to figure out if the additional VM_ARGS are neccessary?
  2. Regarding the presence of file fs-isolated-server-*.jar:

The CLI fails, if its not present, but its not printing a proper error message, if there is only 1 file in the lib dir.

Check

[root@XXXX devtools]# ls fs-cli/lib/
 fsdevtools-cli-4.5.0.jar
[root@XXXX devtools]# sudo -u fs5 ./fs-import-content-export.sh
+ export JAVA_HOME=/usr/java/latest
+ JAVA_HOME=/usr/java/latest
+ sh /opt/firstspirit5/devtools/fs-cli/bin/fs-cli.sh XXXXX
+ JAVACMD=/usr/java/latest/bin/java
++ pwd
+ FS_CLI_DIR=/opt/firstspirit5/devtools/fs-cli
+ VM_ARGS='--add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED'
+ /usr/java/latest/bin/java --add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED -Xmx512m -Dlog4j.configurationFile=/opt/firstspirit5/devtools/fs-cli/conf/log4j2.xml -cp '/opt/firstspirit5/devtools/fs-cli/lib/*' com.espirit.moddev.cli.Main XXXX
Exception in thread "main" java.lang.NoClassDefFoundError: de/espirit/firstspirit/access/project/ProjectScriptContext
	at com.espirit.moddev.cli.Main.main(Main.java:33)
Caused by: java.lang.ClassNotFoundException: de.espirit.firstspirit.access.project.ProjectScriptContext
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

vs.

[root@XXXX devtools]# ls fs-cli/lib/
fs-isolated-server-5.2.230909.jar.bkp  fsdevtools-cli-4.5.0.jar
[root@XXXX devtools]# sudo -u fs5 ./fs-import-content-export.sh
+ export JAVA_HOME=/usr/java/latest
+ JAVA_HOME=/usr/java/latest
+ sh /opt/firstspirit5/devtools/fs-cli/bin/fs-cli.sh XXXX
+ JAVACMD=/usr/java/latest/bin/java
++ pwd
+ FS_CLI_DIR=/opt/firstspirit5/devtools/fs-cli
+ VM_ARGS='--add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED'
+ /usr/java/latest/bin/java --add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED -Xmx512m -Dlog4j.configurationFile=/opt/firstspirit5/devtools/fs-cli/conf/log4j2.xml -cp '/opt/firstspirit5/devtools/fs-cli/lib/*' com.espirit.moddev.cli.Main XXXX
ERROR Couldn't find FirstSpirit classes - have you placed your FirstSpirit api jar (fs-isolated-runtime) into the fs-cli lib folder?

Because of bullet 1, we changed the wrapper so far:

#!/bin/sh

# WARNING: This file is managed by Ansible.
# DO NOT EDIT THIS FILE MANUALLY.
# Any changes made directly to this file may be overwritten by Ansible.

set -eux

JAVACMD="/usr/java/latest/bin/java";

# Tries to use readlink or realpath. If not installed, falls back to no conversion.
my_realpath() {
    readlink -f "$1" 2>/dev/null || realpath "$1" 2>/dev/null || echo "$1"
}

FS_CLI_DIR="$( pwd )/fs-cli"

VM_ARGS="--add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED"

$JAVACMD $VM_ARGS -Xmx512m -Dlog4j.configurationFile="${FS_CLI_DIR}/conf/log4j2.xml" -cp "${FS_CLI_DIR}/lib/*" com.espirit.moddev.cli.Main "$@";
RETVAL=$?;
exit ${RETVAL};

Quick-Fix:

Add an additional check in the fs-cli.sh:

if [ ! -f "${FS_CLI_DIR}/lib/fs-isolated-server-*.jar" ]; then
    echo "ERROR: fs-isolated-server-*.jar not found in lib directory."
    exit 1
fi

Clarify Import/Export

Hi,

as I stated out in my other issue I am currently automating the provisioning of FirstSpirit.

It is a bit unclear to me, how the import/export on the gui and the fs-cli tool is working and if they are doing the same.

As far as I understand, there are two options of export: Full Project Export (fs-cli project export and only the First Spirit content fs-cli export).

The first one on the GUI gives me a big tar.gz, the second a slim zip file.

However, how can I import the tar.gz file with the fs-cli? This is my approach so far:

#!/bin/bash

# WARNING: This file is managed by Ansible.
# DO NOT EDIT THIS FILE MANUALLY.
# Any changes made directly to this file may be overwritten by Ansible.

set -eux

export JAVA_HOME="/usr/java/latest/"

sh {{ fs_cli_path }} \
-e \
-port "{{ fs_tomcat_port }}" \
-p "{{ fs_project_name }}" \
-h "{{ fs_host_name }}" \
-u admin \
-pwd "{{ fs_admin_password }}" \
-sd "{{ fs_content_dir }}" \
import

I choose the tar.gz for fs_content_dir , but it expects a unpacked directory. Do I need to unpack this tar.gz first or is there also a option to add the tar.gz as parameter?

Thanks in advance :)

Problems building from source / FirstSpirit 5.2.190507

I'm trying to build FSDevTools using FirstSpirit artefacts from version 5.2.190507. Unfortunately, the build fails with a compilation error:

[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ fsdevtools-sharedutils ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to C:\ws\code\FSDevTools\fsdevtools-sharedutils\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/ws/code/FSDevTools/fsdevtools-sharedutils/src/main/java/com/espirit/moddev/shared/webapp/WebAppIdentifierParser.java:[5,25] cannot find symbol
  symbol:   class VisibleForTesting
  location: package de.espirit.common
[ERROR] /C:/ws/code/FSDevTools/fsdevtools-sharedutils/src/main/java/com/espirit/moddev/shared/webapp/WebAppIdentifierParser.java:[51,6] cannot find symbol
  symbol:   class VisibleForTesting
  location: class com.espirit.moddev.shared.webapp.WebAppIdentifierParser
[INFO] 2 errors
[INFO] -------------------------------------------------------------

If I replace all module dependencies on fs-isolated-runtime with fs-access that problem goes away and it instead fails with the following:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/ws/code/FSDevTools/fsdevtools-moduleservice/src/main/java/com/espirit/moddev/moduleinstaller/ModuleInstaller.java:[394,25] incompatible types: java.lang.String cannot be converted to org.slf4j.Marker
[INFO] 1 error
[INFO] -------------------------------------------------------------

This is for master/tag 2.3.743 and also tag 2.3.733.

The build successfully finished for tag 2.3.723 after working around stefanbirkner/system-rules#32

Is there something wrong in my build setup or how come no one else appears to run into these problem?

Import ignores new templates

Hi,

I'm trying to sync between 2 projects. The source projects has new page & link templates.
The import will ignore the new templates. I have to manually import them to FirstSpirit, is there any way to tell the Importer to create the new templates during an import?

Add command to activate/deactivate a project

For a project switch on command line, for example, to activate the sample project for a short time, it would be great if fs-cli could support the activation & deactivation of a project.

fs-cli help project mentions the commands delete, import and export only, whereas you can activate an inactive project with the --activateProjectIfDeactivated option in combination with anothre command. However, there seems to be no dedicated command for activation/deactivation.

Regards, Michael.

Dependency FSTestTools could not be resolved

Hi everyone,

I tried to build the FSDevTools to extend them. But a needed dependency, the "com.espirit.moddev.fstesttools", can not be resolved.
image

As mentioned in this community post the fstesttools should be available on GitHub, but the link points to a 404 error.
https://community.e-spirit.com/community/developer/blog/2017/06/26/release-fs-test-tools-are-available-on-github-now
https://github.com/e-Spirit/FSTestTools

Please provide all needed dependencies to build and extend the FSDevTools as soon as possible, because we need them for a customer project.

I again ask for an official e-Spirit Maven repository so the build process would be a lot easier when we could just download the needed dependencies instead of building and installing it on our own!

Thanks
Sandro

Enhancement/Proposal: Entities of all datasources within a project cannot be easily exported

Currently you need to repeat the command per one datasource, so you end like:

export entities:products entities:categories entities:... ...

There should be a more efficient and comfortable way to export all entities and transfer them with the complete content to another stage (e.g. export from PROD and import to DEV).

There are several possible ways we could achieve this:

  • use the syntax as it exists for other elements like
    export entities:ALL
    and extend the current existing export entities:<content2_id> logic.

  • implement a more general cmd function "execute_script" which executes a Script/Class that must exist inside the current server as FSM/project script and do a subprocess call for generating the cmd arguments of the "export" call automatically

  • or by a custom command like "export_all_entities"

  • the above logics could also use an e.g. configurable regular expression, so you can configure by the uid/uid-path of the content2-element if it should be exported or not.

Error: Could not find or load main class fs-cli\\lib\*

Hi,

Currently i am facing this issue in my local (windows 10) and FS version is 5_2_18_08. I have placed the fs-access.jar in the lib folder and currently using the fs-cli 2.1.669 version

Error: Could not find or load main class \fs-cli\lib*

Import Documentation

Hi,
thanks for this useful plugin.
I was able to export my project without problems.
After editing one file i was using the import statement without any flags.
The console gave me this info of updating 81 files:
INFO - updated elements: 81
Is it possible to only update the one edited file. and soime kind of watcher?
Otherwise the turnaround times for template editing are to long...

Extend schedule run command for CI Pipeline

Hey folks,

first of all thank for that implementation to run schedule entries.

But in the end that current feature set doesn't match my needs.
I want to run schedule entries with the fs-cli from inside a ci pipeline.
For that it is necessary to have control whether a schedule run was successfully or it failed.
And if it failed I need much more details on the kind of errors to decide if I have to exit the whole pipeline.

Currently there is only a short response that the run was successful and nothing else.

Are there plans on your side to implement such kind of extension or is the way to go to do it by my self and open a PullRequest which you can accept or not?

Kind Regards
Olli

Import "test mode"?

Hi,

I'd like to know what the import command would do, without actually importing. Something like a "test-mode", where I would get a list of would-be changes.

Just now, after deleting two table templates in the dev project and importing the changes in the QA project , fs-cli needlessly updated every single db template. The update was "empty" but still annoying. I wish, I'd have known before, I would have rather deleted the templates manually.

Regards,
Ana

Import fails due to (non existing) duplicate element

Summary

When importing content using the FSDevTools the import crashes due to duplicate elements. There is no duplicate element in existence though.

Error

ERROR Import operation not successful
de.espirit.firstspirit.store.access.nexport.exceptions.SyncOperationException: [ExternalSync - Import] failed: Duplicate element id 3998632959672668959 detected: SiteStore/a/b/c/d/pagefolder_name SiteStore/a/b/c/pagefolder_name
	at de.espirit.firstspirit.store.access.nexport.operations.ImportOperationImpl.perform(ImportOperationImpl.java:133)
	at com.espirit.moddev.cli.commands.ImportCommand.call(ImportCommand.java:113)
	at com.espirit.moddev.cli.commands.ImportCommand.call(ImportCommand.java:49)
	at com.espirit.moddev.cli.Cli.executeCommand(Cli.java:221)
	at com.espirit.moddev.cli.Cli.execute(Cli.java:132)
	at com.espirit.moddev.cli.Cli.main(Cli.java:105)
Caused by: java.lang.IllegalStateException: Duplicate element id 3998632959672668959 detected: SiteStore/a/b/c/pagefolder_name SiteStore/a/b/c/d/pagefolder_name
	at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1518)
	at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1531)
	at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1531)
	at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1531)
	at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1531)
	at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1531)
	at de.espirit.firstspirit.store.access.nexport.ElementFileSystemSync.refresh(ElementFileSystemSync.java:134)
	at de.espirit.firstspirit.store.access.nexport.ElementFileSystemSync.getRootImportElements(ElementFileSystemSync.java:170)
	at de.espirit.firstspirit.store.access.nexport.operations.ImportOperationImpl.perform(ImportOperationImpl.java:126)
	... 5 more

Conditions

Element names have been anonymized

The Pagefolder (1) SiteStore/a/b/c/d/pagefolder_name does exist in the source and in the target project.

The Pagefolder (2) SiteStore/a/b/c/pagefolder_name does not exist in the source nor in the target project.

The Pagefolder (1) was initially created as (2) but has been moved to (1) in 2017.

There is no deleted Element SiteStore/a/b/c/pagefolder_name in the source nor the target project.

Target project is an ~2 week old export of the source project.

Possible wrong packaging of the release downloads (zip, tar.gz) since version 2.5.0

Hi team.

Before version 2.5.0 you provided the Windows fs-cli.cmd file in the downloadable zip file, and the Linux/Mac fs-cli file in the downloadable tar.gz file.

Since version 2.5.0 both downloadable archives contain fs-cli.cmd and fs-cli.sh (with .sh extension), but the documentation still talks about fs-cli without e.g. .sh extension. Therefore, I assume that there is an issue with your packaging tool.

Furthermore, before version 2.5.0 the fs-cli script was provided with execute rights, since version 2.5.0 the fs-cli.sh has no execute rights anymore. Is a minor issue, but it would be nice if you could provide the scripts again with execute rights.

In addition, the end-of-line style of fs-cli.sh seems to be Windows style instead of Linux style, so I get the following error message while running sh fs-cli.sh:

$ sh ./fs-cli.sh
: not found: 2: ./fs-cli.sh: 
: not found: 3: ./fs-cli.sh: 

: not found: 7: ./fs-cli.sh: }
: not found: 8: ./fs-cli.sh: 
: not found: 5: ./fs-cli.sh: {
Fehler: Hauptklasse com.espirit.moddev.cli.Main konnte nicht gefunden oder geladen werden
Ursache: java.lang.ClassNotFoundException: com.espirit.moddev.cli.Main
: not found: 10: ./fs-cli.sh: 
: not found: 11: ./fs-cli.sh: 

After applying the execute right, I encounter this error message indicating that ^M is part of the line ending.

$ chmod +x fs-cli.sh
$ ./fs-cli.sh
bash: ./fs-cli.sh: /bin/sh^M: Defekter Interpreter: Datei oder Verzeichnis nicht gefunden

After running the following command, I can execute fs-cli.sh as usual:

sed -i 's/\r//' fs-cli.sh

Finally, I noticed that you changed the archive naming scheme (breaking my tools ;) ) - since version 2.5.0 the version is part of the archive names. Is this intentional?

Regards, Michael.

Using the CLI to track templates changes in git - problem with new templates

We use the CLI tool so that we can keep all the temples from a project in git.

For each feature we work in different branches in git and then use the CLI to import changes from master and export changes relevant for the branch. Each developer has a local server and needs to use the CLI to load the templates from different branches into their local dev project.

This works well until we have new objects (templates, media or similar) that come from another branch and need to be created in firstspirit.

We really require that we can import new objects too, is it possible to explain what the problems are with creating new objects?

We would happily invest some development time in adding the functionality to the CLI to do this if we could be guided a bit in where the changes need to be made.

Doesn't compile

Hi,

The last version I downloaded compiled and worked fine. I just downloaded a new version today and tried to compile but the build can't resolve the dependency for fs-license.jar. I don't have this and no idea how to get it. Can you provide some advice on how to resolve this. I have just upgraded to FirstSpirit 5.2.717 and I can't sync until I get this resolved.

Below is the output of the maven build following your instructions to compile the project.

[INFO] ------------------------------------------------------------------------
[INFO] Building FirstSpirit Development Tools Server Runner Module 1.0_DEV.123
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/de/espirit/firstspirit/wrapper/3.5.12/wrapper-3.5.12.pom
[WARNING] The POM for de.espirit.firstspirit:wrapper:jar:3.5.12 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Command Line Interface API ......................... SUCCESS [ 58.472 s]
[INFO] FirstSpirit Development Tools Core ................. SUCCESS [ 14.686 s]
[INFO] Command Line Interface ............................. SUCCESS [ 59.241 s]
[INFO] FirstSpirit Development Tools Server Runner Module . FAILURE [ 0.599 s]
[INFO] FirstSpirit Development Tools ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:13 min
[INFO] Finished at: 2017-04-07T16:39:26-04:00
[INFO] Final Memory: 62M/656M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project fsdevtools-serverrunner: Could not resolve dependencies for project com.espirit.moddev.fsdevtools:fsdevtools-serverrunner:jar:1.0_DEV.123: Failed to collect dependencies at de.espirit.firstspirit:fs-license:jar:[,5.2.717]: No versions available for de.espirit.firstspirit:fs-license:jar:[,5.2.717] within specified range -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :fsdevtools-serverrunner

Thanks,

FSDevTools requires Java 8 but FirstSpirit runs with Java 11

Hi.

In my local development environment, I run FirstSpirit with Java 11. I also use FSDevTools with the same Java version resulting in the following warnings. Do you plan to support Java 11 or newer for the FSDevTools in the near future?

 INFO fs-cli version 2.5.2 / git hash ea7eea2d178da11be820d4ca8d51add88daa184f
 INFO Build for FirstSpirit version 5.2.190710
 INFO Using FirstSpirit Access API version 5.2.190808.78484 (fs-isolated-runtime.jar)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.espirit.moddev.cli.reflection.ReflectionUtils (file:/home/michael/fs-cli/lib/fsdevtools-cli-2.5.2.jar) to field sun.reflect.annotation.AnnotationInvocationHandler.memberValues
WARNING: Please consider reporting this to the maintainers of com.espirit.moddev.cli.reflection.ReflectionUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Question regarding automation tasks via CLI

Hey @kafmann-e-spirit ,

last time your reply was a big help to me. So maybe you can give me a quick advice here too :)

  1. Is there any option changing the default Admin:Admin Passwort via some CLI/API (or even fs-cli?)
  2. After importing a project, the web componntent is not automatically installed as Preview. Is there any way to do this via fs-cli?
Screenshot 2024-02-29 at 10 13 17 copy

On my quick research I was not able to find anything related to this two issues, neither fs-cli nor JavaAPI.

Thanks in advance :)

Add command to run schedules

Hi. I did not find any command to run schedules from the command line. It would be great to have such a feature, which also shows the log output allowing a faster debugging in case of problems. Currently, I have to run a schedule, wait for its end, open the log, scroll up/down to find yellow/red marked lines, etc. Would be helpful to have it on the command line to use for example grep and other tools for faster analysis.

Any questions?

With FirstSpirit 2019-11, fs-cli shows a lot of "Unable to register 'com.github.jaiimageio.impl.plugins..." warnings

It seems to be no issue but is for your information... Release 2.5.5

 WARN Unable to register 'com.github.jaiimageio.impl.plugins.bmp.BMPImageReaderSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.bmp.BMPImageReaderSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.bmp.BMPImageWriterSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.bmp.BMPImageWriterSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.gif.GIFImageWriterSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.gif.GIFImageWriterSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.pcx.PCXImageReaderSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.pcx.PCXImageReaderSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.pcx.PCXImageWriterSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.pcx.PCXImageWriterSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.pnm.PNMImageReaderSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.pnm.PNMImageReaderSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.pnm.PNMImageWriterSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.pnm.PNMImageWriterSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.raw.RawImageReaderSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.raw.RawImageReaderSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.raw.RawImageWriterSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.raw.RawImageWriterSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.tiff.TIFFImageReaderSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.tiff.TIFFImageReaderSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.tiff.TIFFImageWriterSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.tiff.TIFFImageWriterSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.wbmp.WBMPImageReaderSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.wbmp.WBMPImageReaderSpi
 WARN Unable to register 'com.github.jaiimageio.impl.plugins.wbmp.WBMPImageWriterSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.plugins.wbmp.WBMPImageWriterSpi
 WARN Unable to register 'com.github.jaiimageio.impl.stream.ChannelImageInputStreamSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.stream.ChannelImageInputStreamSpi
 WARN Unable to register 'com.github.jaiimageio.impl.stream.ChannelImageOutputStreamSpi' - java.lang.ClassNotFoundException: com.github.jaiimageio.impl.stream.ChannelImageOutputStreamSpi
 WARN Unable to register 'com.luciad.imageio.webp.WebPImageReaderSpi' - java.lang.ClassNotFoundException: com.luciad.imageio.webp.WebPImageReaderSpi
 WARN Unable to register 'com.luciad.imageio.webp.WebPImageWriterSpi' - java.lang.ClassNotFoundException: com.luciad.imageio.webp.WebPImageWriterSpi
 INFO Image readers: [bmp, gif, jpeg, jpg, png, tif, tiff, wbmp], image writers: [bmp, gif, jpeg, jpg, png, tif, tiff, wbmp]
 INFO Export operation successful

ERROR Exception occurred during context initialization or command execution java.io.IOException: Underlying input stream returned zero bytes

Firstspirit Version 2020-10
FS-CLI Version: 2.6.2 / 2.6.10

We're seeing this error while importing/exporting templates.

Changing Path to /opt/fs-cli
 INFO fs-cli version 2.6.2 / git hash 360dcd5282cc7e4ff2af9a9c50cfcb7b0b8cd63b
 INFO Build for FirstSpirit version 5.2.200807
 INFO Using FirstSpirit Access API version 5.2.201107.79400 (fs-access.jar)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.espirit.moddev.cli.reflection.ReflectionUtils (file:/opt/fs-cli/lib/fsdevtools-cli-2.6.2.jar) to field sun.reflect.annotation.AnnotationInvocationHandler.memberValues
WARNING: Please consider reporting this to the maintainers of com.espirit.moddev.cli.reflection.ReflectionUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
 INFO Executing ImportCommand
 INFO Connected to FirstSpirit server at localhost:8080 of version 5.2.201107.79400 (ISOLATED)
 INFO project is 'xxx'
 INFO Importing...
 INFO importing from directory '/fs-cli-data'
 INFO using the following temporary directory: /tmp
 INFO PAGESTORE(false) loaded in 966ms
 INFO CONTENTSTORE(false) loaded in 70ms
 INFO MEDIASTORE(false) loaded in 26ms
 INFO SITESTORE(false) loaded in 107ms
 INFO TEMPLATESTORE(false) loaded in 500ms
 INFO GLOBALSTORE(false) loaded in 26ms
ERROR Import operation not successful
java.io.IOException: Underlying input stream returned zero bytes
        at java.base/sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
        at java.base/sun.nio.cs.StreamDecoder.implRead(Unknown Source)
        at java.base/sun.nio.cs.StreamDecoder.read(Unknown Source)
        at java.base/java.io.InputStreamReader.read(Unknown Source)
        at java.base/java.io.BufferedReader.fill(Unknown Source)
        at java.base/java.io.BufferedReader.readLine(Unknown Source)
        at java.base/java.io.BufferedReader.readLine(Unknown Source)
        at de.espirit.firstspirit.store.access.nexport.importer.ReferencesImporter.addLines(ReferencesImporter.java:100)
        at de.espirit.firstspirit.store.access.nexport.importer.ReferencesImporter.sourceInit(ReferencesImporter.java:66)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1543)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ElementFileSystemSync.refresh(ElementFileSystemSync.java:134)
        at de.espirit.firstspirit.store.access.nexport.ElementFileSystemSync.getRootImportElements(ElementFileSystemSync.java:170)
        at de.espirit.firstspirit.store.access.nexport.operations.ImportOperationImpl.perform(ImportOperationImpl.java:127)
        at com.espirit.moddev.cli.commands.ImportCommand.call(ImportCommand.java:121)
        at com.espirit.moddev.cli.commands.ImportCommand.call(ImportCommand.java:47)
        at com.espirit.moddev.cli.Cli.executeCommand(Cli.java:206)
        at com.espirit.moddev.cli.Cli.execute(Cli.java:129)
        at com.espirit.moddev.cli.Cli.main(Cli.java:102)
        at com.espirit.moddev.cli.Main.main(Main.java:11)
ERROR Exception occurred during context initialization or command execution
java.io.IOException: Underlying input stream returned zero bytes
        at java.base/sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
        at java.base/sun.nio.cs.StreamDecoder.implRead(Unknown Source)
        at java.base/sun.nio.cs.StreamDecoder.read(Unknown Source)
        at java.base/java.io.InputStreamReader.read(Unknown Source)
        at java.base/java.io.BufferedReader.fill(Unknown Source)
        at java.base/java.io.BufferedReader.readLine(Unknown Source)
        at java.base/java.io.BufferedReader.readLine(Unknown Source)
        at de.espirit.firstspirit.store.access.nexport.importer.ReferencesImporter.addLines(ReferencesImporter.java:100)
        at de.espirit.firstspirit.store.access.nexport.importer.ReferencesImporter.sourceInit(ReferencesImporter.java:66)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1543)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ExportUtil.initImportElement(ExportUtil.java:1570)
        at de.espirit.firstspirit.store.access.nexport.ElementFileSystemSync.refresh(ElementFileSystemSync.java:134)
        at de.espirit.firstspirit.store.access.nexport.ElementFileSystemSync.getRootImportElements(ElementFileSystemSync.java:170)
        at de.espirit.firstspirit.store.access.nexport.operations.ImportOperationImpl.perform(ImportOperationImpl.java:127)
        at com.espirit.moddev.cli.commands.ImportCommand.call(ImportCommand.java:121)
        at com.espirit.moddev.cli.commands.ImportCommand.call(ImportCommand.java:47)
        at com.espirit.moddev.cli.Cli.executeCommand(Cli.java:206)
        at com.espirit.moddev.cli.Cli.execute(Cli.java:129)
        at com.espirit.moddev.cli.Cli.main(Cli.java:102)
        at com.espirit.moddev.cli.Main.main(Main.java:11)
 INFO Connection to FirstSpirit closed!
 INFO Execution time: 164.62s

I can't find any other logs to specify the error. Can you provide any info on this matter?

Update dependency com.github.rvesse.airline to latest version

Hi,

i am currently creating a new command for the FSDevTools, which will be added to the already available commands via a jar.
I want to use and overwrite a typeConverterProvider for easier reading via the Option Annotation.
Unfortunately the FSDevTools uses the version 2.1.1. of com.github.rvesse.airline and with this version i am not able to override the typedConverter.
When i am trying to create a custom converter and run the command, always the DefaultTypeConverter is used.
So could you please test if the version of com.github.rvesse.airline can be updated?

Thank you and best regards
Christian

Couldn't build project in local IDE

Hey folks,

I wanna build a new or improve existing commands but I'm not able to build the project on my local IDE (Intellij) with gradle.

The problem here are 2 things combined in 1 main reason:

  • Missing credentials for espirit artifactory -

Problems in Detail

  1. Missing dependency for fs-server.jar (I can fix this by maintain these files in my own nexus)
  2. Missing dependency for de.espirit.process

This second dependency is not hosted here on GitHub and not somewhere else. Where could I get it?
Is it possible to gain a community access to your artifactory? This request exists sind several years by the community and if you want to improve the so called DX you have to do this.

But for now, where could I get the de.espirit.process-dependency?

Kind Regards
Olli

Export workflow permissions

Using the basic workflows, we allowed "everybody" to use them by selecting "all" in the workflow permissions tab of the content (green) and structure (blue) roots.

After exporting the project and importing it again, the selected "all" is gone. As a result, for example, the delete workflow is not available anymore.

It would be great, if the workflow permissions would be exported and/or successfully imported.

export-workflow-permissions

Return Codes not valid - How to use in Jenkins?

The fs-cli tool writes an error code to standard out (e.g. "Major error (code 202): An authentication failure with FirstSpirit occurred"), but the return-code of the command is always 0.

How to use this tool in a Jenkins Pipeline?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.