2012年6月30日星期六

adobe livecycle es3的PDF Generator

折腾了3天,写了个java通过ejb终于可以call到ES3上面的服务了,tmd,才发现ES3没有Acrobat 根本没法ps->pdf。而Acrobat只有windows和mac的版本,没有linux版本。白折腾了,太阳。
付上测试的java程序,算个终结。编译时,要用到很多jar,根据classnotfound,逐步排查添加。
我添加到jar主要在以下目录
/home/adobe/adobe_livecycle_es3/sdk/client-libs/common
/home/adobe/adobe_livecycle_es3/sdk/client-libs/jboss
/home/adobe/adobe_livecycle_es3/sdk/client-libs/thirdparty
/home/adobe/glassfish3/glassfish/modules目下的 javax.ejb.jar
/home/adobe/jboss-5.1.0.GA/client目录下的jbossall-client.jar

在线帮助文档
http://help.adobe.com/en_US/livecycle/10.0/documentation.html#task=0,1,2,3,4,5,6&module=-1
http://help.adobe.com/en_US/livecycle/10.0/ProgramLC/index.html
PDF Generator支持的文件格式
http://www.adobe.com/products/livecycle/pdfgenerator/formats.html
package testadobe;

import java.util.*;
import com.adobe.idp.Document;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.livecycle.generatepdf.client.*;
import java.io.File;
import java.io.FileInputStream;

/**
*
* @author Administrator
*/
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
            Properties ConnectionProps = new Properties();
            ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099"); 
            ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);           
            ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss"); 
            ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator"); 
            ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

            ServiceClientFactory factory = ServiceClientFactory.createInstance(ConnectionProps);

        try {
            String inputFilename = "/home/adobe/eps/A2_color/s.eps";
            FileInputStream fileInputStream = new FileInputStream(inputFilename);
            Document inDoc = new Document(fileInputStream);
            String adobePDFSettings = "Standard";
            String securitySettings = "No Security";
            String fileTypeSettings = "Standard_eps";

            CreatePDFResult result = new CreatePDFResult();
            result = new GeneratePdfServiceClient(factory).createPDF(inDoc, inputFilename, fileTypeSettings, adobePDFSettings, securitySettings, null, null);

            Document createdDocument = result.getCreatedDocument();
            createdDocument.copyToFile((new File("/home/adobe/eps/A2_color/s.pdf")));


        } catch (Exception e) {
           e.printStackTrace();
   
        }

    }
}

2012年6月29日星期五

Linux EL 6.2安装adobe livecycle es3

我整的是jboss的版本。挺折腾。
安装条件
1. jboss 5.1,别去整更高的版本。这es3再高版本的jboss上爬不起来。
2. MySQL Community Server(虽然我没打算将gds放数据,不过还是得装,要5.1的版本,5.5的会报错type=InnoDB不支持,因为已经换成了ENGINE=InnoDB),装好后,启动mysql,建立数据库名为adobe,建立用户adobe/adobe,付给权限。
create database adobe;
grant all privileges on adobe.* to adobe@localhost identified by 'adobe';
设置mysql的max_allowed_packet为16M。

3. jdk 1.6(要带j2ee的,因为最后编译client走ejb的话要用到javax.ejb.jar库)

安装步骤:
0,下载lces_server_10_0_2_jboss_all_unix.tar.gz,解压

1,安装jboss,安装完后,将LiveCycle_Server_install/third_party/db/mysql/mysql-connector-java-5.1.14-bin.jar放到jboss的lib目录,将LiveCycle_Server_install/third_party/jboss-4.2.1_jars/crypto下的jar放到jboss的lib目录,将LiveCycle_Server_install/third_party/additional/datasources/lc_mysql/deploy/adobe-ds.xml放到jboss的deploy目录。
设置jboss的jdk环境所需内存为1.5G以上,设置MaxPermSize为256M。
设置 ulimit -n的值大于等于8192
我用的虚拟机测试,给2G内存,玩不转,至少给3G给虚拟机。

2,运行LiveCycle_Server_install/server/Disk1/InstData/Linux/NoVM/install.bin安装,一路next。

3,不要安装Correspondence_Management_install

4,安装完后,运行安装目录里/configurationManager/bin/ConfigurationManager.sh,一路config,next。中途需要将export目录下的文件cp到jboss的server的deploy的目录下后启动jboss,我是用all,所以就nohup run.sh -c all &了。

Linux EL 6.2安装MySQL-server-5.5.24

EL6.2带的只是mysql client,版本是5.1.52。下载好MySQL-server-5.5.24-1.el6.x86_64.rpm,rpm安装是报和mysql-5.1.52-1.el6_0.1.x86_64冲突,
rpm -e mysql-5.1.52-1.el6_0.1.x86_64
说被mysql-devel-5.1.52-1.el6_0.1.x86_64使用
rpm -e mysql-devel-5.1.52-1.el6_0.1.x86_64
rpm -e mysql-5.1.52-1.el6_0.1.x86_64
再安装,还报冲突mysql-libs-5.1.52-1.el6_0.1.x86_64
rpm -e mysql-libs-5.1.52-1.el6_0.1.x86_64,不行,有libmysqlclient.so.16被postfix-2.6.6-2.2.el6_1.x86_64使用。总不能把postfix-2.6.6-2.2.el6_1.x86_64删了。
没法子了。

于是先安装 MySQL-shared-compat-5.5.24-1.el6.x86_64.rpm
 rpm -ivh MySQL-shared-compat-5.5.24-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.5.24-1.el6.x86_64.rpm
再删rpm -e  mysql-libs-5.1.52-1.el6_0.1.x86_64就没问题了,
最后
rpm -ivh MySQL-server-5.5.24-1.el6.x86_64.rpm没问题。到此6.2的mysql更新完毕。

启动停止重启
一、启动方式
1、使用 service 启动:service mysqld start
2、使用 mysqld 脚本启动:/etc/inint.d/mysqld start
3、使用 safe_mysqld 启动:safe_mysqld&
二、停止
1、使用 service 启动:service mysqld stop
2、使用 mysqld 脚本启动:/etc/inint.d/mysqld stop
3、mysqladmin shutdown
三、重启
1、使用 service 启动:service mysqld restart
2、使用 mysqld  脚本启动:/etc/inint.d/mysqld restart


2012年6月27日星期三

Linux EL 6.2打开xdmp

1. Open /etc/gdm/custom.conf and edit the security and xdmcp section like the followings:
[security]
DisallowTCP=false

[xdmcp]
Enable=true

2. Add UDP port 177 to the Allow list on firewall.
防火墙关闭的就不用修改
/etc/sysconfig/ipchains文件中加入以下语句:
-A input -p udp -s 0/0 -d 0/0 177 -j accept

3. As an admin, do 'init 3' and then, 'init 5' 
修改/etc/inittab,将
id:3:initdefault:
修改为:
id:5:initdefault:


----------------------追记
6.3里面就变了样子。
1。 yum install xdm。否则没有/etc/X11/xdm了
2。修改/etc/X11/xdm/xdm-config,注释掉
#DisplayManager.requestPort:    0
3。修改/etc/X11/xdm/Xaccess ,放开
*                                       #any host can get a login window
4。加上上面的修改才可以。