java

HqEclipse

You can install the plugin using the Eclipse Update Manager:

Help > Install new Software
Work with: http://hge.javaforge.com/hgeclipse
[ Add... ]
[ OK ]
check HqEclipse
[ Next > ]
[ Next > ]
check "I accept the terms of the license agreement"
[ Finish ]

confirm Security Warnings dialog with [ OK ]

Restart your Eclipse

https://j2m.googlecode.com/hg/
https://hgeclipse-demo.googlecode.com/hg/

http://code.google.com/p/hgeclipse-demo/

Install Eclipse

# install eclipse
apt-get install eclipse -y
 
Help > Install New Software
Work with: http://download.eclipse.org/releases/galileo
[ Add ]
 
# install eclipse gwt plugin
Help > Install New Software
Work with: http://dl.google.com/eclipse/plugin/3.5
[ Add ]
[ Next ]
 
 
# disable editor line break after 80 char
Project > Properties
Configure Worksapece Settings
[ Edit ]
Line Wraping
Maximum line widht: 240
 
# Links
http://code.google.com/intl/de/eclipse/docs/install-eclipse-3.5.html

Create Magento SOAP account

command line

wget http://www.panticz.de/sites/default/files/soap.txt -O /tmp/soap.sql
mysql -u magento -pmagento magento < /tmp/soap.sql

Create soap role
System > Web Services > Roles
[Add New Role]
Role name: API Full Access

Roles Resources
Resource Access: All

[Save Role]

Create soap user
System > Web Services > Users
[Add New User]
User Name: soap
First Name: soap
Last Name: soap
Email: soap@soap.com
Api Key: test123
Api Key Confirmation: test123
This account is: Active

User Role

Extend Magento Product Attribute Api

# patch on command line
wget http://www.panticz.de/sites/default/files/api.xml_.diff -O /tmp/api.xml.diff
patch -p2 /var/www/app/code/core/Mage/Catalog/etc/api.xml < /tmp/api.xml.diff
 
wget http://www.panticz.de/sites/default/files/Api.php_.diff -O /tmp/Api.php.diff
patch -p2 /var/www/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php < /tmp/Api.php.diff
 
 
1. go to magento installation folder, for example /var/www/magento
 
2.

Java exampels

// identificate filetyp in filestream
System.out.println(URLConnection.guessContentTypeFromStream(new URL("http://www.example.org/banner.jpg").openStream()));

MagentoConnector - Connecting to Magento API with Java using SOAP

Hello everybody!
 
I am currently writing a Magento Connector for Java. The goal is to create a free wrapper / library to manage 
Magento informations from a Java application. The latest version (source code) can be downloaded from 
http://code.google.com/p/magja/ If someone is interested in co-development, please contact my over my homepage,
http://www.panticz.de/contact 
 
Greeting
 
Pawel
 
 
How to start:
1. create Magento API role and user
http://www.panticz.de/Create-Magento-SOAP-account
 
2.

Java2Snom

public String getSnomSetting(String phoneIp, String field) {
    String value = "";
 
    try {
        URL url = new URL("http://" + phoneIp + "/settings.htm");
        BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
 
        String inputLine;
        while ((inputLine = in.readLine()) != null) {
            if (inputLine.indexOf(field) == 0) {
                value = inputLine.substring(inputLine.indexOf(":") + 1).trim();
            }
        }
 
        in.close();
    } catch (Exception e) {
        System.out.println("[!] getSnomSetting:" + 

Enable UNO listener on Windows

wordpad "C:\Programme\OpenOffice.org 3\Basis\share\registry\data\org\openoffice\Setup.xcu"
 
search for <node oor:name="Office"> (by default line 3) and add
<prop oor:name="ooSetupConnectionURL" oor:type="xs:string">
   <value>socket,host=localhost,port=8100;urp;</value>
</prop>

Asterisk auto-dial out with Java (asterisk-java)

# configure manager
/etc/asterisk/manager.conf
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0 
 
[manager]
secret=pa55w0rd
permit=0.0.0.0/0.0.0.0
read=system,call,log,verbose,agent,command,user
write=system,call,log,verbose,agent,command,user
 
# create extension
/etc/asterisk/extensions.conf
[directdial]
exten => 1,1,Dial(CAPI/ISDN1/${customernum}/b)
 
# reload asterisk
/etc/init.d/asterisk restart
 
# download java class
wget http://maven.reucon.com/public-snapshot/org/asteriskjava/asterisk-java/1.0.0-SNAPSHOT/asterisk-java-1.0.0-20090303.204542-422.jar
 
# HelloMa

install Java database (JDBC) driver for MySQL

sudo apt-get install libmysql-java
 
# old, manuall installation
# wget http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-5.1.6.tar.gz -P /tmp
# tar xzf /tmp/mysql-connector-java-5.1.6.tar.gz -C /tmp
# cp /tmp/mysql-connector-java-5.1.6/mysql-connector-java-5.1.6-bin.jar /opt/gwt-linux/
 
# LINKS
http://packages.ubuntu.com/feisty/libs/libmysql-java

Create GWT MySQLConn project under Netbeans

# HowTo
1. install Netbeans: http://www.panticz.de/install_netbeans
1.1 install http://www.panticz.de/install-GWT4NB
2. install GWT: http://www.panticz.de/install_gwt
3. install MySQL driver: http://www.panticz.de/install_mysql_driver
4.

GWT + MySQL + Netbeans Demo

# INFO
url : jdbc:mysql://localhost:3306/Bible
user: gwt-examples
pass: password
 
# create database and user
mysql -u root -p
create database Bible;
CREATE USER 'gwt-examples' IDENTIFIED BY 'password';
grant all on Bible.* to 'gwt-examples'@'%' identified by "password";
#grant all on Bible.* to 'gwt-examples'@'192.168.1.10' identified by "password";
#grant all on Bible.* to 'gwt-examples'@'localhost' identified by "password";
commit;
quit;
 
# get gwt examples 
cd ${HOME}
svn checkout http://gwt-examples.googlecode.com/svn/trunk/ gwt-examples
 
# fill database
wget http://ken

NetBeans

Configure Oracle DB access
1. Services > Databases > Drivers > New Driver...
add
~/.netbeans/6.1/config/Databases/Driver/ojdbc14.jar
ok

2. Services > Databases > Drivers > Oracle > Connect using
Database URL: jdbc:oracle:thin:@192.168.0.1:1521:XE
Username: USER
Password: PASS

Copy config files
mkdir -p ~/.netbeans/6.1/config/Databases/Driver
cp ojdbc14.jar ~/.netbeans/6.1/config/Databases/Driver/
cp jdbc_oracle_thin__192_168_1_1_15.xml ~/.netbeans/6.1/config/Databases/Connections/jdbc_oracle_thin__192_168_1_1_15.xml

OpenOffice

install packages
sudo apt-get install -y openoffice.org-java-common openoffice.org-officebean openoffice.org-base patch

enable uno listener
#wget http://www.panticz.de/sites/default/files/Setup.xcu_.diff -P /tmp/
#patch -p2 /usr/lib/openoffice/share/registry/data/org/openoffice/Setup.xcu < /tmp/Setup.xcu_.diff

add path to java
wget http://www.panticz.de/sites/default/files/javasettingsunopkginstall.xml_.diff -P /tmp/

Tomcat

# start
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0
export JAVA_OPTS="$JAVA_OPTS -Xmx256m"
/usr/local/apache-tomcat-5.5.20/bin/startup.sh
 
# deploy
/opt/SDK2/bin/asadmin deploy /tmp/Intranet.war

installJavaJDK.sh

#!/bin/sh
 
sudo su
 
# install debconf-utils
apt-get install debconf-utils
 
# create answer file
debconf-set-selections <<\EOF
sun-java6-bin shared/accepted-sun-dlj-v1-1    boolean true
EOF
 
# java JDK 5
apt-get -y install sun-java5-jdk
 
# java JDK &
apt-get -y install sun-java6-jdk

Install NeatBeans

#!/bin/sh
 
URL=http://download.netbeans.org/netbeans/6.8/final/bundles/netbeans-6.8-ml-java-linux.sh
 
# fix ubuntu locale settings for german
#sed -i 's|en_US.UTF-8|de_DE.UTF-8|g' /etc/scim/global
 
# download and install
wget ${URL} -O /tmp/netbeans-linux.sh
sudo bash /tmp/netbeans-linux.sh --silent
 
 
# OPTIONAL
# install Java JDK
http://www.panticz.de/ubuntu_install_java_jdk
 
# disable compiz effects (Visual Effects (System > Preferences > Appearance > Visual Effects => none)
metacity --replace &
 
# MySQL driver
apt-get install libmysql-java
# old# sudo cp Desktop/netbean

Do you like this page? Then support it. Please click the AD below and visit the sponsor. Thank you!

Syndicate content