Skip to content

Commit

Permalink
Initialize Open catalog project
Browse files Browse the repository at this point in the history
  • Loading branch information
venkatramanm committed Feb 23, 2022
0 parents commit 7756b31
Show file tree
Hide file tree
Showing 40 changed files with 1,151 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/target/
/.settings/
.commit
/*/.idea/
**/.flattened-pom.xml
**/*.iml
*/_*/
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>opencatalog</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
32 changes: 32 additions & 0 deletions bin/callapi
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
toolpath=`dirname $0`
projpath=$toolpath/..
cd $projpath

source $HOME/.bash_aliases
source overrideProperties/config/envvars
user_password=$1
user=`echo ${user_password} |cut -f1 -d '/'`
password=`echo ${user_password} |cut -f2 -d '/'`
shift
api=$1
shift

if [ "${content_type}" = "" ]
then
content_type="application/xml"
fi

apiKey=`bin/getapikey $user $password`
echo "user=$user"
echo "api=$api"
echo "data=$data"
echo "apiKey=$apiKey"
if [ "${baseurl}" = "" ]
then
baseurl="http://localhost:${wport}"
fi


echo curl -L -v -H "ApiKey: $apiKey" -H "Content-Type: ${content_type}" ${baseurl}/$api $@
curl -L -s -H "ApiKey: $apiKey" -H "Content-Type: ${content_type}" -H "ApiProtocol: ${ApiProtocol}" ${baseurl}/$api "$@"
26 changes: 26 additions & 0 deletions bin/getapikey
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
source $HOME/.bash_aliases
source overrideProperties/config/envvars

toolpath=`dirname $0`
projpath=$toolpath/../
cd $projpath

if [ $# -eq 0 ]
then
user=root
password=root
else
user=$1
password=$2
fi
if [ "${baseurl}" = "" ]
then
baseurl="http://localhost:${wport}"
fi

curl -s -H "content-type: application/json" "${baseurl}/login" -d '{ "User" : { "Name":"'$user'" , "Password":"'$password'"} } ' |grep 'ApiKey' |cut -f2 -d ':' |sed -e 's/ //g' -e 's/"//g'




7 changes: 7 additions & 0 deletions bin/h2console
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source overrideProperties/config/envvars
source bin/initconnection $1
if [ -f ~/.inputrc ]
then
export INPUTRC=~/.inputrc
fi
henplus -J ''"${url}"'' -U''${user}'' -P''${password}''
19 changes: 19 additions & 0 deletions bin/initconnection
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
urlname=".$1."
if [ "$urlname" = ".." ]
then
urlname="."
fi
if [ "$url" = "" -a -f overrideProperties/config/swf.properties ]
then
url=`grep ^swf.jdbc${urlname}url= overrideProperties/config/swf.properties|cut -f2- -d '='`
user=`grep ^swf.jdbc${urlname}userid= overrideProperties/config/swf.properties|cut -f2- -d '='`
password=`grep ^swf.jdbc${urlname}password= overrideProperties/config/swf.properties|cut -f2- -d '='`
fi

if [ "$url" = "" ]
then
url=`grep ^swf.jdbc${urlname}url= src/main/resources/config/swf.properties|cut -f2- -d '='`
user=`grep ^swf.jdbc${urlname}userid= src/main/resources/config/swf.properties|cut -f2- -d '='`
password=`grep ^swf.jdbc${urlname}password= src/main/resources/config/swf.properties|cut -f2- -d '='`
fi

25 changes: 25 additions & 0 deletions bin/mkicons
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
if [ $# -eq 0 ]
then
echo "Usage : $0 image.svg"
exit
fi
which convert 2>&1 1>/dev/null

if [ $? -ne 0 ]
then
echo "Imagemagik needed to convert svg to required pngs"
fi

if [ "$?" = "0" ]
then
if [ "${1%%.svg}" != "$1" ]
then
echo "OK"
convert -resize 192x192 $1 -transparent white 192x192.png
convert -resize 294x294 $1 -transparent white 294x294.png
convert -resize 512x512 $1 -transparent white 512x512.png
convert -resize 64x64 $1 -transparent white favicon.ico
else
echo Please pass svg file as argument.
fi
fi
27 changes: 27 additions & 0 deletions bin/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[Unit]
Description=opencatalog server
After=network.target

[Service]
Type=forking
PidFile=/home/ubuntu/opencatalog-%i/tmp/pid

User=ubuntu
Group=ubuntu

ExecStart=/bin/bash -c /home/ubuntu/opencatalog-%i/bin/swfstart
SuccessExitStatus=SIGKILL

StartLimitBust=2
StartLimitIntervalSec=300


TimeoutSec=300

Restart=always

PrivateTmp=true

[Install]
WantedBy=multi-user.target

12 changes: 12 additions & 0 deletions bin/reset_router
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

toolpath=`dirname $0`
projpath=$toolpath/..
cd $projpath

source $HOME/.bash_aliases
source overrideProperties/config/envvars
apiKey=`bin/getapikey`

curl http://localhost:${wport}/reset_router -H "ApiKey: $apiKey" -H 'ApiProtocol: application/json'

57 changes: 57 additions & 0 deletions bin/swfstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
source ~/.bash_aliases
bindir=`dirname $0`
projpath=$bindir/..
cd $projpath
ApiKey=`bin/getapikey`

source overrideProperties/config/envvars

if [ "${swf_env}" = "" ]
then
export swf_env="development"
fi

mvn clean -DskipTests=true package
if [ "$debug" = "" ]
then
export debug=y
fi
if [ "$suspend" = "" ]
then
export suspend=n
fi
if [ "$debug" = "y" -o "$debug" = "Y" ]
then
export DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=${suspend},address=${dport}"
fi

pid=`ps -ef |grep java.*PORT=${wport}|grep -v grep |tr -s ' ' |cut -f2 -d ' '`
if [ "$pid" != "" ]
then
kill -9 $pid
rm -f $PWD/tmp/pid
sleep 5
fi

mkdir -p $PWD/tmp
rm ${PWD}/tmp/pid
touch ${PWD}/tmp/pid

unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) separator=":";;
Darwin*) separator=":";;
CYGWIN*) separator=";";;
MINGW*) separator=";";;
*) separator=":"
esac

if [ "${closeStdFd}" = "" ]
then
closeStdFd=true;
fi
nohup nice -19 java -ea:com.venky -Xmx4g -XX:+PrintGCDetails -Xloggc:$PWD/tmp/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/media/heaps/java.hprof -XX:-OmitStackTraceInFastThrow $DEBUG_OPTS -DPORT=${wport} -Dswf.env=${swf_env} -Dswf.pidfile=$PWD/tmp/pid -Dderby.locks.waitTimeout=10 -DSystem.out.close=${closeStdFd} -DSystem.err.close=${closeStdFd} -DSystem.in.close=${closeStdFd} -cp "overrideProperties/${separator}target/classes/${separator}target/dependency/*" com.venky.swf.JettyServer &


exit 0
18 changes: 18 additions & 0 deletions bin/trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
toolpath=`dirname $0`
projpath=$toolpath/../
cd $projpath
source overrideProperties/config/envvars

source $HOME/.bash_aliases
agent_name=$1
if [ "$2" = "" ]
then
action="fire"
else
action="$2";
fi
apiKey=`bin/getapikey`

curl http://localhost:${wport}/triggers/${action} -H "ApiKey: $apiKey" -H "ApiProtocol: application/json" -d '{"Trigger":{"AgentName":"'${agent_name}'"}}' ;

20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
57 changes: 57 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'Open Catalog'
copyright = '2022, Venky Mahadevan,Ravi Prakash,Supriyo Ghosh'
author = 'Venky Mahadevan,Ravi Prakash,Supriyo Ghosh'

# The full version, including alpha/beta/rc tags
release = '1.0'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'myst_parser',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
23 changes: 23 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. Open Catalog documentation master file, created by
sphinx-quickstart on Wed Feb 23 15:40:02 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Open Catalog's documentation!
========================================

.. toctree::
:maxdepth: 2
:caption: Contents:


src/concept
src/mapping
src/process

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading

0 comments on commit 7756b31

Please sign in to comment.