软件著作权-代码

软件著作权-代码
软件著作权-代码

Option.java

package https://www.360docs.net/doc/2a10773508.html,mon;

public class Option {

private String name;

private String id;

private String description;

private OptionGroup group;

public Option(String id, String name, String description,OptionGroup group) { this.id = id;

https://www.360docs.net/doc/2a10773508.html, = name;

this.description = description;

this.group = group;

}

public String getName() {

return name;

}

public String getId() {

return id;

}

public String getDescription() {

return description.replaceAll("\\t", "").trim();

}

public OptionGroup getGroup(){

return this.group;

}

}

OptionGroup.java

package https://www.360docs.net/doc/2a10773508.html,mon;

import java.util.ArrayList;

import java.util.List;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.XmlParser;

/**

* 选项组

* @author Administrator

*

*/

public class OptionGroup {

private String id;

private String name;

private List

public OptionGroup(String id, String name){

this.id = id;

https://www.360docs.net/doc/2a10773508.html, = name;

this.optionList = new ArrayList

}

public void addOption(Option o){

if(optionList!=null)

optionList.add(o);

}

public String getGroupPlaceHolder(){

return XmlParser.getInstance().getGroupPlaceholder(id);

}

public String getName(){

return https://www.360docs.net/doc/2a10773508.html,;

}

public List

return this.optionList;

}

}

ProjectType.java

package https://www.360docs.net/doc/2a10773508.html,mon;

/**

* 工程类型枚举

* @author Administrator

*

*/

public enum ProjectType {

/**

* 普通工程

*/

COMMOMAPPLICATION("commonApplication"),

/**

* 解决方案

*/

SOLUTION("solution"),

/**

* 模块程序

*/

MODULE("module"),

/**

* 原子库

*/

A TOM("atom");

private String name;

ProjectType(String name){

https://www.360docs.net/doc/2a10773508.html, = name;

}

public String getName(){

return https://www.360docs.net/doc/2a10773508.html,;

}

}

Activator.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui;

import org.eclipse.ui.plugin.AbstractUIPlugin;

import org.osgi.framework.BundleContext;

/**

* The activator class controls the plug-in life cycle

*/

public class Activator extends AbstractUIPlugin {

// The plug-in ID

public static final String PLUGIN_ID = "https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui";

// The shared instance

private static Activator plugin;

/**

* The constructor

*/

public Activator() {

}

/*

* (non-Javadoc)

* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) */

public void start(BundleContext context) throws Exception {

super.start(context);

plugin = this;

}

/*

* (non-Javadoc)

* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) */

public void stop(BundleContext context) throws Exception {

plugin = null;

super.stop(context);

}

/**

* Returns the shared instance

*

* @return the shared instance

*/

public static Activator getDefault() {

return plugin;

}

}

ClientSocket.java

package https://www.360docs.net/doc/2a10773508.html,working;

import java.io.BufferedInputStream;

import java.io.BufferedOutputStream;

import java.io.IOException;

import java.io.ObjectInputStream;

import java.io.ObjectOutputStream;

import https://www.360docs.net/doc/2a10773508.html,.Socket;

import https://www.360docs.net/doc/2a10773508.html,.SocketTimeoutException;

import https://www.360docs.net/doc/2a10773508.html,.UnknownHostException;

import org.apache.log4j.Logger;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.MessageConfig;

class ClientSocket {

private Logger logger = Logger.getLogger(MessageConfig.LOGGER_NAME);

private String ip;

private int port;

private Socket socket;

private ObjectOutputStream outputStream;

private ObjectInputStream inputStream;

public ClientSocket(String ip, int port) {

this.ip = ip;

this.port = port;

}

/**

* 连接服务器

* @return 连接成功返回true 否则返回false

* @throws IOException

* @throws UnknownHostException

*/

public boolean connect() throws UnknownHostException, IOException {

try {

boolean success = false;

socket = new Socket(ip, port);

//设置read超时

socket.setSoTimeout(NetworkingConfig.TIME_OUT);

success = true;

return success;

} catch(IOException e){

throw new IOException("无法连接服务器,请检查端口和服务器地址");

}

}

/**

* 发送消息到服务器

* @param message

* @return 发送成功返回true 否则返回false

*/

public void sendMessage(Message message)throws IOException{

try {

outputStream = new ObjectOutputStream(new BufferedOutputStream(socket.getOutputStream()));

outputStream.writeObject(message);

outputStream.flush();

}catch (IOException e) {

if(outputStream != null)

try {

outputStream.close();

} catch (IOException ioe) {

logger.error("关闭输出流失败");

}

throw new IOException("发送消息:"+message+" 失败");

}

}

/**

* 从服务器接受消息

* @return 成功接受返回接受到的消息,否则返回null

* @throws SocketTimeoutException

*/

public Message receiveMessage() throws SocketTimeoutException{

Message receiveMessage = null;

try {

inputStream = new ObjectInputStream(new BufferedInputStream(socket.getInputStream()));

receiveMessage = (Message)inputStream.readObject();

} catch(SocketTimeoutException e){

throw new SocketTimeoutException("读取数据超时");

} catch (ClassCastException e) {

logger.error("ClassCastException从服务器读取的数据不能转换为Message");

} catch (IOException ioe){

logger.error(ioe.getMessage());

} catch (ClassNotFoundException e){

logger.error(e.getMessage());

}

return receiveMessage;

}

/**

* 关闭连接

* @throws IOException

*/

public void shutdownConnection() throws IOException {

if (outputStream != null)

outputStream.close();

if (inputStream != null)

inputStream.close();

if (socket != null)

socket.close();

}

}

Downloader.java

package https://www.360docs.net/doc/2a10773508.html,working;

import java.io.File;

import java.io.IOException;

import https://www.360docs.net/doc/2a10773508.html,.SocketException;

import https://www.360docs.net/doc/2a10773508.html,.SocketTimeoutException;

import https://www.360docs.net/doc/2a10773508.html,.UnknownHostException;

import java.util.List;

import org.apache.log4j.Logger;

import org.dom4j.DocumentException;

import org.eclipse.core.runtime.IProgressMonitor;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.MessageConfig;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.XmlParser;

/**

* 负责从服务器接受数据

* @author Administrator

*

*/

public class Downloader {

private Logger logger = Logger.getLogger(MessageConfig.LOGGER_NAME);

private ClientSocket clientSocket = null;

private FtpUtil ftpUtil;

/**

* 连接服务器

* @throws IOException

* @throws UnknownHostException

* @throws LoginException

*/

public void connect() throws UnknownHostException, IOException, LoginException{

clientSocket = new ClientSocket(NetworkingConfig.SERVER_IP, NetworkingConfig.SERVER_LISTENING_PORT);

clientSocket.connect();

ftpUtil = new FtpUtil();

ftpUtil.connectAndLogin(NetworkingConfig.SERVER_IP, NetworkingConfig.FTP_SERVER_PORT, NetworkingConfig.FTP_CLIENT_USERNAME, NetworkingConfig.FTP_CLIENT_PASSWORD);

}

/**

* 发送消息到服务器

* @param message

* @throws IOException

*/

private void sendMessage(Message message) throws IOException{

clientSocket.sendMessage(message);

}

/**

* 从服务器接受消息

* @return 成功接受返回接收到的消息Message,否则返回null

* @throws SocketTimeoutException

*/

private Message getMessageFromServer() throws SocketTimeoutException{

return clientSocket.receiveMessage();

}

/*

* 发送消息格式:

* Message

* MessageType: GET_MANIFEST

* data:从download文件夹下manifest.xml中读取versionID(若不存在则id号为-1)

* paths:空

*

* 接收消息格式:

* 1. 没有更新manifest.xml

* Message

* MessageType: GET_MANIFEST

* data: 服务器端manifest.xml版本号

* paths: 空

*

* 2.有更新manifest.xml

* Message

* MessageType: GET_MANIFEST

* data: manifest.xml在ftp服务器端的目录

* paths: 空

*/

/**

* 下载manifest.xml到本地目录savePath

* @param savePath 存储目录

* @return 下载成功返回true,否则返回false

* @throws IOException

* @throws LoginException 登录ftp异常,用户名密码错误

* @throws SocketException ftp连接异常

*/

public void downloadManifest(String savePath) throws SocketTimeoutException,IOException{

String manifestVersion = "";

try{

manifestVersion = XmlParser.getInstance().getVersion();

}catch(NullPointerException e){

manifestVersion = "-1";

}

sendMessage(new Message(MessageType.GET_MANIFEST , manifestVersion));

Message message = getMessageFromServer();

if(message != null){

String remoteVersion = message.getData();

if(remoteVersion.equals(manifestVersion)){

https://www.360docs.net/doc/2a10773508.html,("服务器端manifest.xml无更新版本,读取本地download文件夹下manifest.xml");

return;

}

String remotePath = message.getData();

if(ftpUtil.downloadFile(remotePath, savePath)){

https://www.360docs.net/doc/2a10773508.html,("成功下载manifest.xml,保存至"+savePath+File.separator+MessageConfig.MANIFEST_FILE_NAME);

try {

MessageConfig.setManifestPath(savePath+File.separator+MessageConfig.MANIFEST_FILE_NAME);

} catch (DocumentException e) {

//donothing,因为成功下载manifest,理论上该处不会抛出异常

}

}

}

}

/*

* 发送消息格式:

* Message

* MessageType: GET_TEMPLATE

* data: 要下载的template的ID

* paths:空

*

* 接收消息格式:

* Message

* MessageType: GET_TEMPLATE

* data: template文件夹在ftp服务器的目录e.g. /AA/BB/CC/Target

* paths: option文件在ftp服务器的路径/包含文件名(若有多个option,以";"分割)

*/

/**

* 下载template文件,保存至savePath

* @param templateId 请求下载的templateID

* @param savePath template文件夹保存目录

* @throws IOException

*/

public void downTemplate(String templateId, String savePath, IProgressMonitor monitor) throws SocketTimeoutException,IOException{

monitor.beginTask("下载模板文件", 70);

sendMessage(new Message(MessageType.GET_TEMPLATE,templateId));

monitor.worked(10);

Message message = getMessageFromServer();

if(message != null){

String data = message.getData();

if(data != null && !data.equals("")){

ftpUtil.downloadFolder(data, savePath);

monitor.worked(50);

}

List paths = message.getPaths();

if(paths!=null && paths.size()>0){

for(String optionPath : paths){

ftpUtil.downloadFile(optionPath, savePath);

}

}

monitor.worked(10);

}

monitor.done();

}

public void disconnect() throws IOException{

clientSocket.shutdownConnection();

ftpUtil.loginoutAndDisconnect();

}

}

FtpUtil.java

package https://www.360docs.net/doc/2a10773508.html,working;

import java.io.File;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.OutputStream;

import https://www.360docs.net/doc/2a10773508.html,.SocketException;

import https://www.360docs.net/doc/2a10773508.html,.ftp.FTPClient;

import https://www.360docs.net/doc/2a10773508.html,.ftp.FTPClientConfig;

import https://www.360docs.net/doc/2a10773508.html,.ftp.FTPFile;

import https://www.360docs.net/doc/2a10773508.html,.ftp.FTPReply;

import org.apache.log4j.Logger;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.MessageConfig;

public class FtpUtil {

private Logger logger = Logger.getLogger(MessageConfig.LOGGER_NAME);

private FTPClient ftpClient;

/**

* 连接到FTP服务器并登录

* @param ftpServerIp FTP服务器IP

* @param ftpServerPort FTP服务器端口

* @param user 用户名

* @param password 密码

* @throws SocketException

* @throws IOException

* @throws LoginException 用户名密码异常

*/

public void connectAndLogin(String ftpServerIp, int ftpServerPort, String user, String password) throws SocketException, IOException, LoginException{

ftpClient = new FTPClient();

ftpClient.setControlEncoding("GBK");

FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_NT);

conf.setServerLanguageCode("zh");

try {

ftpClient.connect( ftpServerIp, ftpServerPort);

} catch (IOException e) {

logger.error("尝试连接到FTP服务器失败,请检查端口和服务器地址");

throw new IOException("尝试连接到FTP服务器失败,请检查端口和服务器地址");

}

int reply = ftpClient.getReplyCode();

if (!FTPReply.isPositiveCompletion(reply)) {

ftpClient.disconnect();

logger.error("FTP 服务器拒绝连接");

}

if(!ftpClient.login(user, password)){

throw new LoginException("登录FTP服务器失败,用户名密码错误");

}

ftpClient.enterLocalPassiveMode(); //active connection server mode

}

/**

* 注销并关闭连接

* @throws IOException

*/

public void loginoutAndDisconnect() throws IOException{

ftpClient.logout();

if(ftpClient.isConnected())

ftpClient.disconnect();

}

/**

* 下载指定文件

* @param remoteFilePath 在ftp服务器上的路径,包含文件名 e.g./aa/bb/cc/dd.xml

* @param localFileDir 下载文件保存在本地的目录

* @throws IOException

*/

public boolean downloadFile(String remoteFilePath,String localFileDir){

boolean result = false;

String fileName = remoteFilePath.substring(https://www.360docs.net/doc/2a10773508.html,stIndexOf("/")+1,remoteFilePath.length());

String dir = remoteFilePath.substring(0, https://www.360docs.net/doc/2a10773508.html,stIndexOf("/"));

try{

ftpClient.changeWorkingDirectory(dir);

FTPFile files[] = ftpClient.listFiles();

for(FTPFile f : files){

if(f.getName().equals(fileName)){

File localFile = new File(localFileDir+File.separator+fileName);

OutputStream os = new FileOutputStream(localFile);

ftpClient.retrieveFile(fileName, os);

os.close();

result = true;

}

}

}catch(Exception e){

System.out.println(e.getMessage());

}

return result;

}

/**

* 载指定文件夹

* @param remoteFolder FTP服务器文件夹/aa/bb/cc,目标文件夹

* @param localDir下载到本地目录localDir

* @throws IOException

*/

public void downloadFolder(String remoteFolder, String localDir) throws IOException{

//文件夹名称

String folderName = remoteFolder.substring(https://www.360docs.net/doc/2a10773508.html,stIndexOf("/")+1,remoteFolder.length());

File localFolder = new File(localDir+File.separator+folderName);//在本地以服务器端创建相应文件夹

if(!localFolder.exists())

localFolder.mkdirs();

ftpClient.changeWorkingDirectory(remoteFolder);

FTPFile[] files = ftpClient.listFiles();

for(FTPFile file : files){

if(!file.getName().equals(".") && !file.getName().equals("..")){

String remoteFilePath = remoteFolder+NetworkingConfig.FTP_FILE_SEPERATOR+file.getName();

if(file.isDirectory()){

downloadFolder(remoteFilePath, localFolder.getAbsolutePath());

}else{

if(file.isFile()){

downloadFile(remoteFilePath, localFolder.getAbsolutePath());

}

}

}

}

}

}

LoginException.java

package https://www.360docs.net/doc/2a10773508.html,working;

public class LoginException extends Exception {

private static final long serialVersionUID = -4615049932628592182L;

public LoginException(String message){

super(message);

}

}

Message.java

package https://www.360docs.net/doc/2a10773508.html,working;

import java.io.Serializable;

import java.util.ArrayList;

import java.util.List;

/**

* 消息结构,用于在客户端和服务器之间传递控制信息

* 实际的文件传输使用FTP

* @author Administrator

*

*/

public class Message implements Serializable{

private static final long serialVersionUID = 406680447556221555L;

private MessageType type;

private String data;

private List paths;//请求下载文件时,从服务器端返回的paths保存options在服务器ftp上的路径

public Message(){

}

public Message(MessageType type){

this.type = type;

this.data = "";

this.paths = new ArrayList();

}

public Message(MessageType type, String data){

this.type = type;

this.data = data;

this.paths = new ArrayList();

}

public MessageType getType() {

return type;

}

public void setType(MessageType type) {

this.type = type;

}

public String getData() {

return data;

}

public void setData(String data) {

this.data = data;

}

public List getPaths() {

return paths;

}

public void setPaths(List paths) {

this.paths = paths;

}

public String toString() {

return "消息类型: "+getType()+

" 消息内容: "+((getData().equals("")||getData()==null)?"空":getData())+

" 可选项: "+(paths.size()==0?"空":paths);

}

}

MessageType.java

package https://www.360docs.net/doc/2a10773508.html,working;

public enum MessageType {

/**

* 表示该消息类型为向服务器请求manifest.xml

*/

GET_MANIFEST,

/**

* 表示该消息类型为向服务器请求指定ID的模板文件

*/

GET_TEMPLATE;

}

NetworkingConfig.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui;

public class NetWorkingName {

public static final String SERVER_LISTENING_PORT = "SERVER_LISTENING_PORT";

public static final String SERVER_IP = "SERVER_IP";

// public static final String SERVER_IP = "192.168.1.160";

public static final String FTP_SERVER_PORT= "FTP_SERVER_PORT";

public static final String FTP_CLIENT_USERNAME= "FTP_CLIENT_USERNAME";

public static final String FTP_CLIENT_PASSWORD= "FTP_CLIENT_PASSWORD";

public static final String TIME_OUT = "TIME_OUT";

}

NetWorkingConfigs.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui;

import org.eclipse.jface.preference.FieldEditorPreferencePage;

import org.eclipse.jface.preference.IPreferenceStore;

import org.eclipse.jface.preference.IntegerFieldEditor;

import org.eclipse.jface.preference.StringFieldEditor;

import org.eclipse.swt.SWT;

import https://www.360docs.net/doc/2a10773508.html,yout.GridLayout;

import https://www.360docs.net/doc/2a10773508.html,posite;

import org.eclipse.swt.widgets.Text;

import org.eclipse.ui.IWorkbench;

import org.eclipse.ui.IWorkbenchPreferencePage;

import https://www.360docs.net/doc/2a10773508.html,workingConfig;

public class NetWorkingConfigs extends FieldEditorPreferencePage implements

IWorkbenchPreferencePage {

IPreferenceStore preferenceStore;

private IntegerFieldEditor containerText;

private IntegerFieldEditor ftpText;

private StringFieldEditor userText;

private StringFieldEditor pwdText;

private IntegerFieldEditor timeText;

private StringFieldEditor ipText;

public NetWorkingConfigs()

{

super(GRID);

setPreferenceStore(Activator.getDefault().getPreferenceStore());

setDescription("请修改远程应用仓库配置信息!");

//System.out.println(test);

}

@Override

protected void createFieldEditors() {

addField(ipText=new StringFieldEditor(NetWorkingName.SERVER_IP, "服务器IP", 18, getFieldEditorParent()));

addField(containerText=new IntegerFieldEditor(NetWorkingName.SERVER_LISTENING_PORT, "服务器端口", getFieldEditorParent(), 5));

addField(ftpText=new IntegerFieldEditor(NetWorkingName.FTP_SERVER_PORT, "服务器FTP端口", getFieldEditorParent(), 5));

addField(timeText=new IntegerFieldEditor(NetWorkingName.TIME_OUT, "超时时间/毫秒", getFieldEditorParent(), 6));

addField(userText=new StringFieldEditor(NetWorkingName.FTP_CLIENT_USERNAME, "用户名", 18, getFieldEditorParent()));

addField(pwdText=new StringFieldEditor(NetWorkingName.FTP_CLIENT_PASSWORD, "密码", 18, getFieldEditorParent()));

}

@Override

public void init(IWorkbench workbench) {

// TODO Auto-generated method stub

setPreferenceStore(Activator.getDefault().getPreferenceStore());

//System.out.println(test);

//preferenceStore.getDefaultString(NetWorkingName.SERVER_IP);

}

public void ConnectionAll(){

NetworkingConfig.setSERVER_IP(getPreferenceStore().getString(NetWorkingName.SERVER_IP));

NetworkingConfig.setSERVER_LISTENING_PORT(getPreferenceStore().getInt(NetWorkingName.SERVE R_LISTENING_PORT));

NetworkingConfig.setFTP_SERVER_PORT(getPreferenceStore().getInt(NetWorkingName.FTP_SERVER_ PORT));

NetworkingConfig.setTIME_OUT(getPreferenceStore().getInt(NetWorkingName.TIME_OUT));

NetworkingConfig.setFTP_CLIENT_USERNAME(getPreferenceStore().getString(NetWorkingName.FTP_ CLIENT_USERNAME));

NetworkingConfig.setFTP_CLIENT_PASSWORD(getPreferenceStore().getString(NetWorkingName.FTP_ CLIENT_PASSWORD));

}

@Override

public boolean performOk() {

// TODO Auto-generated method stub

//performApply();

return super.performOk();

}

@Override

protected void performApply() {

// TODO Auto-generated method stub

//preferenceStore.setValue(NetWorkingName.SERVER_IP, ""+ipText.getStringValue());

//preferenceStore.setDefault(name, value)

setValue();

super.performApply();

}

public void setValue()

{

NetworkingConfig.setSERVER_IP(ipText.getStringValue());

NetworkingConfig.setSERVER_LISTENING_PORT(containerText.getIntValue());

NetworkingConfig.setFTP_SERVER_PORT(ftpText.getIntValue());

NetworkingConfig.setTIME_OUT(timeText.getIntValue());

NetworkingConfig.setFTP_CLIENT_USERNAME(userText.getStringValue());

NetworkingConfig.setFTP_CLIENT_PASSWORD(pwdText.getStringValue());

}

@Override

protected void performDefaults() {

// TODO Auto-generated method stub

preferenceStore=getPreferenceStore();

super.performDefaults();

}

}

TemplateInfo.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template;

import java.util.ArrayList;

import java.util.HashMap;

import java.util.List;

import java.util.Map;

import org.apache.log4j.Logger;

import org.eclipse.cdt.core.model.CModelException;

import org.eclipse.cdt.core.model.CoreModel;

import org.eclipse.cdt.core.model.ICProject;

import org.eclipse.core.resources.IProject;

import org.eclipse.core.runtime.IProgressMonitor;

import https://www.360docs.net/doc/2a10773508.html,mon.Option;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry.AblatorFile;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry.AblatorFolder;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry.AblatorIncludePath;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry.AblatorSourceFolder;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry.Entry;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.MessageConfig;

/**

* 模板信息,类似于CDT Template中的template.xml

* 包含生成模板的所有信息

* @author Administrator

*

*/

public class TemplateInfo {

private Logger logger = Logger.getLogger(MessageConfig.LOGGER_NAME);

//对于有可选项的Info该属性表示可选项,对于无可项的Info该项optionList.size()==0 //文件的替换变量在manifest.xml中指出选

private List

//对应模板文件中的所有实体

private List entryList;

private String sourceFolderPath;

private Entry projectEntry;

//绝对路径前缀,即工程路径

private String absPathPrefix;

public String getAbsPathPrefix() {

return absPathPrefix;

}

public void setAbsPathPrefix(String absPathPrefix) {

this.absPathPrefix = absPathPrefix;

}

public TemplateInfo(){

entryList = new ArrayList();

optionList = new ArrayList

}

public List getEntryList(){

return this.entryList;

}

public String getSourceFolderPath(){

return this.sourceFolderPath;

}

public void setSourceFolderPath(String path){

this.sourceFolderPath = path;

}

public void addEntry(Entry entry){

entryList.add(entry);

}

public Entry getLast(){

if(entryList.size()>0)

return entryList.get(entryList.size()-1);

return null;

}

/**

* 根据TemplateInfo保存的信息创建完整的工程

* @param project

*/

public IProject createProject(IProject project,IProgressMonitor monitor){

IProject newProject = project;

ICProject cProject = CoreModel.getDefault().create(project);

int totalWork = entryList.size();

monitor.beginTask("TemplateInfo create", totalWork);

//remove the Project Entry

entryList.remove(projectEntry);

for(Entry entry : entryList){

//folder

if(entry.isCommonFolder){

//new AblatorFolder().createFolder(newProject, entry);

AblatorFolder.createFolder(newProject, entry);

//如果该实体是源文件夹,为工程添加该源文件夹

if(entry.isSourceFolder){

try {

//new AblatorSourceFolder().setSourceFolder(cProject, entry);

AblatorSourceFolder.setSourceFolder(cProject, entry);

} catch (CModelException e) {

logger.error(e);

}

}

}

//file

else{

if(this.optionList.size()>0)//if Options exist, need replace

AblatorFile.createFileWithReplacement(newProject,entry,getReplaceMap());

else

AblatorFile.createFile(newProject, entry);

}

}

try {

//append include paths

AblatorIncludePath.addIncludePath(cProject);

} catch (CModelException e) {

logger.error("CModelException: "+e);

}

monitor.worked(totalWork);

monitor.done();

return newProject;

}

/**

* 生成替换变量的map

* @return

*/

private Map getReplaceMap() {

Map map = new HashMap();

for(Option o:optionList)

map.put(o.getGroup().getGroupPlaceHolder(), o.getName());

return map;

}

/**

* 通过List Options,添加Entry 到TemplateInfo

* @param options

*/

public void addOptions(List

this.optionList = options;

projectEntry = entryList.get(entryList.size()-1);

Entry optionFolderEntry = new Entry("//"+MessageConfig.OPTION_FOLDER_NAME, MessageConfig.OPTION_FOLDER_NAME);

optionFolderEntry.setParent(projectEntry);

optionFolderEntry.isCommonFolder = true;

entryList.add(optionFolderEntry);

for(Option o : options){

Entry optionEntry = new Entry(MessageConfig.OPTION_FOLDER_NAME+"\\"+o.getName(), o.getName());

optionEntry.setParent(optionFolderEntry);

optionEntry.setTemplateFileAbsolutePath(absPathPrefix+"\\"+optionEntry.getPath());

entryList.add(optionEntry);

}

}

}

PerferenceInitializer.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui;

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;

import org.eclipse.jface.preference.IPreferenceStore;

public class PerferenceInitializer extends AbstractPreferenceInitializer {

@Override

public void initializeDefaultPreferences() {

// TODO Auto-generated method stub

IPreferenceStore store=Activator.getDefault().getPreferenceStore();

store.setDefault(NetWorkingName.SERVER_IP, "192.168.1.110");

store.setDefault(NetWorkingName.SERVER_LISTENING_PORT, 8821);

store.setDefault(NetWorkingName.FTP_SERVER_PORT, 21);

store.setDefault(NetWorkingName.TIME_OUT, 5000);

store.setDefault(NetWorkingName.FTP_CLIENT_USERNAME, "rtlab");

store.setDefault(NetWorkingName.FTP_CLIENT_PASSWORD, "rtlab");

}

}

TemplateInfoFactory.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template;

import java.io.File;

import org.eclipse.jface.dialogs.MessageDialog;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry.Entry;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.MessageConfig;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.XmlParser;

/**

* 根据id 生成TemplateInfo

*/

public class TemplateInfoFactory {

private TemplateInfo templateInfo;

private String templateId;

/**

* 通过id生成模板的TemplateInfo,不包括options目录及其子文件

* @param id

*/

public TemplateInfo createTemplateInfo(String id){

this.templateId = id;

XmlParser parser = XmlParser.getInstance();

File file = parser.findFileById(templateId);

if(!file.exists()){

MessageDialog.openError(null, "error", "文件"+file.getAbsolutePath()+"不存在");

return null;

}

createTargetTemplateInfo(file,null);

return this.templateInfo;

}

/**

* 创建TemplateInfo,其中entry保存源文件路径和目标文件路径,方便后期进行文件复制

* 同时保存源文件夹名e.g. /src

* @param inputFile

* @param parent

* @return

*/

private TemplateInfo createTargetTemplateInfo(File inputFile,Entry parent){

TemplateInfo templateInfo= createTemplate(inputFile,parent);

//递归栈

Entry projectEntry = templateInfo.getLast();

//绝对路径前缀

String projectPath = projectEntry.getPath();

// https://www.360docs.net/doc/2a10773508.html,("absolute path prefix: "+projectPath);

for(Entry ed :templateInfo.getEntryList()){

//保存模板文件的绝对路径,以便文件拷贝

ed.setTemplateFileAbsolutePath(ed.getPath());

String path = ed.getPath().substring(projectPath.length(), ed.getPath().length());

ed.setPath(path);

}

templateInfo.setSourceFolderPath(XmlParser.getInstance().getSingleSourcePath(templateId));

templateInfo.setAbsPathPrefix(projectPath);

return templateInfo;

}

/**

* 返回指定id的模板的TemplateInfo,其中Entry的Path为绝对路径

* @param inputFile

* @param parent

* @return

*/

private TemplateInfo createTemplate(File inputFile,Entry parent){

if(!inputFile.getName().equals(MessageConfig.OPTION_FOLDER_NAME)){

if(templateInfo==null)

templateInfo = new TemplateInfo();

String path = inputFile.getAbsolutePath();

Entry entry = new Entry(path, inputFile.getName());

entry.setParent(parent);

if(inputFile.isDirectory()){

entry.isCommonFolder = true;

//判断当前文件夹是否是源文件夹

if(inputFile.getName().equals(XmlParser.getInstance().getSingleSourcePath(templateId)))

entry.isSourceFolder = true;

File[] fileArray = inputFile.listFiles();

if(fileArray.length>0){

for(File file : fileArray){

createTemplate(file,entry);

}

}

}

templateInfo.addEntry(entry);

}

return templateInfo;

}

}

AblatorFile.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry;

import java.io.BufferedReader;

import java.io.ByteArrayInputStream;

import java.io.File;

import java.io.IOException;

import java.io.InputStream;

import java.io.InputStreamReader;

import https://www.360docs.net/doc/2a10773508.html,.URL;

import java.util.Map;

import java.util.Set;

import org.apache.log4j.Logger;

import org.eclipse.core.resources.IContainer;

import org.eclipse.core.resources.IFile;

import org.eclipse.core.resources.IFolder;

import org.eclipse.core.resources.IProject;

import org.eclipse.core.runtime.CoreException;

import org.eclipse.core.runtime.IStatus;

import org.eclipse.core.runtime.Status;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.MessageConfig;

public class AblatorFile {

private static Logger logger = Logger.getLogger(MessageConfig.LOGGER_NAME);

/**

* 添加文件到指定工程,文件不包含替换变量

* @param project

* @param entry

*/

public static void createFile(IProject project, Entry entry){

IFile file = project.getFile(entry.getPath());

IContainer parent = file.getParent();

if(parent instanceof IProject){

try {

try {

file.create(getContentsStream(entry), true, null);

} catch (IOException e) {

logger.error("IOException: "+e);

}

} catch (CoreException e) {

logger.error("CoreException: " + e);

}

}

else//文件位于工程内某一文件夹中

{

IFolder parentFolder = (IFolder) parent;

if(!parentFolder.exists())

//父问价家不存在,则创建

AblatorFolder.createFolder(project,entry);

try {

try {

file.create(getContentsStream(entry), true, null);

} catch (IOException e) {

logger.error("IOException: "+e);

}

} catch (CoreException e) {

logger.error("CoreException: " + e);

}

}

}

/**

* 添加文件到指定工程,文件包含替换变量

* @param project

* @param entry

* @param replaceMap 包含所有的替换信息{}

*/

public static void createFileWithReplacement(IProject project, Entry entry,Map replaceMap){

IFile file = project.getFile(entry.getPath());

IContainer parent = file.getParent();

/**

* options目录下的文件直接复制即可,无需考虑变量替换

*/

//不是options目录下的文件,可能需要变量替换

if(!parent.getName().equals(MessageConfig.OPTION_FOLDER_NAME)){

if(parent instanceof IProject){

try {

file.create(getContentStream(entry,replaceMap), true, null);

} catch (CoreException e) {

e.printStackTrace();

}

}

else

{

IFolder parentFolder = (IFolder) parent;

if(!parentFolder.exists())

//创建文件夹

AblatorFolder.createFolder(project, entry);

try {

file.create(getContentStream(entry,replaceMap), true, null);

} catch (CoreException e) {

e.printStackTrace();

}

}

}

//是options目录下文件,直接复制

else

createFile(project,entry);

}

/**

* 获得模板文件内容

* @return

* @throws IOException

*/

private static InputStream getContentsStream(Entry entry) throws IOException{

File file = new File(entry.getTemplateFileAbsolutePath());

URL url = file.toURI().toURL();

InputStream s = url.openStream();

return s;

}

/**

* 返回替换后的模板内容

* @param entry

* @param replaceMap

* @return

* @throws CoreException

*/

private static InputStream getContentStream( Entry entry, Map replaceMap) throws CoreException {

Set placeholderSet = replaceMap.keySet();

final String newline = "\n"; // System.getProperty("line.separator");

String line;

StringBuffer sb = new StringBuffer();

try {

File file = new File(entry.getTemplateFileAbsolutePath());

URL url = file.toURI().toURL();

InputStream input = url.openStream();

BufferedReader reader = new BufferedReader(new InputStreamReader(input));

try {

while ((line = reader.readLine()) != null) {

for(String placeholder : placeholderSet){

if(line.contains(placeholder))

line = line.replaceAll("\\$\\{"+placeholder+"\\}", replaceMap.get(placeholder));

}

sb.append(line);

sb.append(newline);

}

} finally {

reader.close();

}

} catch (IOException ioe) {

IStatus status = new Status(IStatus.ERROR, "ExampleWizard", IStatus.OK,

ioe.getLocalizedMessage(), null);

throw new CoreException(status);

}

return new ByteArrayInputStream(sb.toString().getBytes());

}

}

AblatorFolder.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry;

import org.apache.log4j.Logger;

import org.eclipse.core.resources.IFolder;

import org.eclipse.core.resources.IProject;

import org.eclipse.core.runtime.IPath;

import org.eclipse.core.runtime.Path;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.MessageConfig;

public class AblatorFolder {

private static Logger logger = Logger.getLogger(MessageConfig.LOGGER_NAME);

/**

* 递归创建文件夹及其父文件夹

* @param project

* @param entry

*/

public static void createFolder(IProject project, Entry entry){

IPath ipath = null;

//保证输入参数entry是Folder Entry

if(entry.isCommonFolder)

ipath = new Path(entry.getPath());

else

ipath = new Path(entry.getParent().getPath());

for (int i=1;i<=ipath.segmentCount();i++) {

IFolder subfolder = project.getFolder(ipath.uptoSegment(i));

if (!subfolder.exists()) {

try {

subfolder.create(true, true, null);

} catch (Exception e) {

logger.error(e);

}

}

}

}

}

AblatorIncludePath.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry;

import org.eclipse.cdt.core.model.CModelException;

import org.eclipse.cdt.core.model.CoreModel;

import org.eclipse.cdt.core.model.ICProject;

import org.eclipse.cdt.core.model.IPathEntry;

import org.eclipse.core.runtime.Path;

import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.EnvironmentVariable;

public class AblatorIncludePath {

/**

* 添加include路径

* @param cProject

* @throws CModelException

*/

public static void addIncludePath(ICProject cProject) throws CModelException{

String[] includePaths = EnvironmentVariable.getCIncludePath();

int len = includePaths.length;

IPathEntry[] oldEntry = cProject.getRawPathEntries();

IPathEntry[] newEntry = new IPathEntry[oldEntry.length+len];

System.arraycopy(oldEntry,0 , newEntry, 0, oldEntry.length);

/**

* 系统路径需将参数isSystemInclude)设置为true

* 解决了编辑器提示找不到#include

*/

for(int i=0;i

newEntry[oldEntry.length+i] =

CoreModel.newIncludeEntry(Path.EMPTY, Path.EMPTY,new Path(includePaths[i]),true);

}

CoreModel.setRawPathEntries(cProject, newEntry, null);

}

}

AblatorSourceFolder.java

package https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.template.entry;

import java.util.ArrayList;

import java.util.List;

import org.eclipse.cdt.core.model.CModelException;

import org.eclipse.cdt.core.model.CoreModel;

import org.eclipse.cdt.core.model.ICProject;

import org.eclipse.cdt.core.model.IPathEntry;

import org.eclipse.core.runtime.IPath;

import org.eclipse.core.runtime.IProgressMonitor;

public class AblatorSourceFolder {

public static void setSourceFolder(ICProject cProject, Entry entry) throws CModelException{ if(cProject!=null){

IPath projPath = cProject.getPath();

setSourceForProject(entry.getName(),null, projPath, cProject);

}

}

private static void setSourceForProject(String targetPath, IProgressMonitor monitor, IPath projPath, ICProject cProject) throws CModelException {

IPathEntry[] entries = cProject.getRawPathEntries();

List newEntries = new ArrayList(entries.length + 1);

int projectEntryIndex= -1;

IPath path = projPath.append(targetPath);

软件著作权转让合同标准范本(完整版)

金家律师修订 本协议或合同的条款设置建立在特定项目的基础上,仅供参考。实践中,需要根据双方实际的合作方式、项目内容、权利义务等,修改或重新拟定条款。本文为Word格式,可直接使用、编辑或修改 软件著作权转让合同 转让人(甲方):__________________________________________ 法定代表人:_____________________________________________ 受让人(乙方):__________________________________________ 法定代表人:_____________________________________________ 甲、乙双方本着平等自愿、真诚合作的原则,经双方友好协商,依据《中华人民共和国知识产权法》和《计算机软件保护条例》以及其他有关法律、法规的规定,就甲方向乙方转让软件著作权及源代码事宜达成如下协议,以期共同遵守。 第一条作品的名称 甲方将其拥有所有权的软件著作权(以下简称“本著作权”)及源代码之全部知识产权利转让给乙方。 第二条转让的权利种类、地域范围 1.甲方向乙方转让以下全部地域范围内的与本著作权相关的所有权利; 2.地域范围:。 第三条转让价金、交付转让价金的日期 1.乙方为此向甲方支付转让费用共计(大写)元人民币,(小写)元人民币。 2.付款进度 a.乙方于软件著作权交付日向甲方支付元; b.从合同签订之日起一个月内向甲方支付元; c.从合同签订之日起三个月内向甲方支付元。 第四条支付价金的方式 乙方按下述方式付款:

a □现金支付; b □银行转帐; c □支票支付。 第五条甲方权利与义务 1.甲方应按本合同约定向乙方转让_______________软件产品、软件开发平台及全部的源代码等,并保证代码的完整性,可直接编译为应用程序正常使用。 2.自本合同签订之日起,甲方不得将本合同标的(即转让软件及源代码)转让或许可第三人使用;自乙方付款完毕之日起,乙方享有该转让软件及源代码的一切知识产权,甲方不得以任何形式使用、转让、传播该软件或源代码。 3.甲方向乙方提供《软件系统设计及使用说明书》及全部的相关文档。 4.甲方在合同签字后负责为乙方现场安装、调试系统开发平台,讲解各个功能的实现原理及方法,并当面解答乙方提出的全部问题。 5.甲方在本合同生效三个月内,负责为乙方解答开发过程中遇到的问题,并讲解开发思想及方法。 第六条乙方权利与义务 1.乙方负责支付本著作权及源代码的转让费人民币元(人民币大写:),并按本合同约定付款进度向甲方付款。 2.乙方有权对此软件或源代码做出任意修改,并有权自由处置该软件或源代码。 第七条违约责任 1.如任何一方违反本合同约定给对方造成损失,守约方均可以要求对方赔偿际损失金额。 2.如甲方侵害他人知识产权或违背现行各项法律或国家政策时,由甲方自行承担赔偿责任,与乙方无关;转让软件或源代码因此被有关机关扣留、没收,或禁止发行、使用的,甲方应赔偿乙方遭受的全部损失,并由甲方负责解决所有纠纷承担相关费用。 第八条保证条款 1.甲方保证拥有本产品的知识产权且不存在任何权利瑕疵。并且此转让行为不侵犯任何第三方的合法权益。若甲方违反本条内容,则甲方构成违约,乙方有权解除合同,并有权要求甲方赔偿损失。

软件著作权源代码例子

1 2 #ifnfdgdfdef __CHEDGDFGCLID_A_ 3 #dedfgdffine __CHEGDFGCLID_A_ 4 5 /************************************************************************/ 6 /* 定义 */ 7 /************************************************************************/ 8 #defgdfgdfine FLADGDFGSH_SEDGDFGION 9 10 #defidgdne EDFGDFNS_ ADDGDFDESS_TEST #defidgdfne EDGDFGNS_ ADDEDGDGSS_TEST_3 11 12 13 #defdgdfine NDGDFGEED _CHECK 6 14 15 typdfgdfedef enum { 16 17 CA_ONEISDGDFGEMPTY, 18 CA_TWOISEDGDFGMPTY, 19 CA_TWOISFFDGDFGULL 20 }chedgdfckusdfdfm; 21 22 typedsfsdfef ssfsdftruct 23 { 24 TX_U8 desfdfsKey[9]; 25 TX_U8 desfsdfdsresult[9]; 26 TX_U64 crc64; 27 }DedgdfgsDatsfsdfdsa_f; 28 /************************************************************************/ 29 30 /* 函数声明 */ 31 /************************************************************************/ 32 TX_ ChesfsfckValid(checkenum checkcase); 33 TX_ ResfsdfadFlash(void); 34 TX_ ReadRanFromPanel(void); 35 TX_ ResfsdfadSerial(void); 36 TX_ ResfsdfadIPanel(void);

计算机软件著作权登记-源代码范本教学内容

计算机软件著作权登记-源代码范本 注意事项:常见的源代码包含:C语言,VB,C++,JAVA,.NET等。 提交的代码必须是源代码的开头载入程序,第30页必须断开,第60页是软 件的程序结尾,代码中不得出现与申请表内容不符合的日期,著作权人,软 件名字等,不能出现开源代码,不能出现任何版权纠纷。 格式要求:一、源代码应提交前、后各连续30页,不足60页的,应当全部提交。 二、源代码页眉应标注软件的名称和版本号,应当与申请表中名称完全一致,页 眉右上应标注页码,源代码每页不少于50行。 范例如下: #include #include #include #include #include #include #include #include #include #include #include

#include #include #include #include #include #include #include #include #define NS_MAIN 1 #include #endif #ifdef DLZ #include #endif static tybs_boolean_t want_stats = TYBS_FALSE; static char program_name[TYBS_DIR_NAMEMAX] = "named"; static char absolute_conffile[TYBS_DIR_PATHMAX]; static char saved_command_line[512]; static char version[512]; static unsigned int maxsocks = 0; void ns_main_earlywarning(const char *format, ...) { va_list args; va_start(args, format); if (ns_g_lctx != NULL) { tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_W ARNING, format, args); } else { fprintf(stderr, "%s: ", program_name); vfprintf(stderr, format, args); fprintf(stderr, "\n"); fflush(stderr); } va_end(args); } Void ns_main_earlyfatal(const char *format, ...) { va_list args; va_start(args, format); if (ns_g_lctx != NULL) { tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, format, args); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "exiting (due to early fatal error)"); } else { fprintf(stderr, "%s: ", program_name); vfprintf(stderr, format, args); fprintf(stderr, "\n"); fflush(stderr); }

软著授权软件著作权授权软著授权书模板

****软件着作权 授权书 甲方(授权人): 信用代码: 甲方(被授权人): 信用代码: 授权人特此授权被授权人,按照本授权书约定享有相关权益: 一授权内容 甲方是 *****软件登记号: (简称“”)的所有权人、着作权人,并且,依法享有转授权权利。甲方同意授予乙方以下第条所述权益。 委托乙方作为甲方的广告代理,有权以乙方自己的名义,通过各类媒体为甲方产品、服务、品牌以及相关活动等进行推广。 委托乙方作为甲方的运营代理,有权以乙方自己的名义或以甲方名义(包括但不限于提交甲方资料为甲方上架安卓应用市场平台,简称“平台”),通过各类媒体为甲方、产品、服务、品牌以及相关活动等进行推广。同时,有权对以甲方名义对产品进行上架应用市场、开通账户进行投放广告等。 乙方在为甲方产品、服务、品牌以及相关活动等进行运营时,有权

使用与甲方相关的广告素材(包括但不限于音视频、图片、文字等)、网站等信息。 授权乙方依法运营许可物,并有权通过各类媒体为许可物进行推广。 二、授权性质 授权性质为第项。 非独家授权,乙方不得转授权。 非独家授权,乙方可以转授权。 独家授权,乙方可以转授权。 三、授权期限及区域 自 2020 年 4 月 8 日至 2023 _年 4 月 7 日止。授权区域 为中国/全球范围。 四、其他 双方均承诺上述内容真实、合法、有效,并愿意承担与之相关的全部责任。 双方同意并确认,乙方应当自觉依照本授权书内容行使权益,包括但不限于在授权期限内、授权区域内行使权益。 若乙方存在违反本授权书约定的侵权或越权行为的,甲方应当直接追究乙方责任。 (正文完)

甲方(授权人): (盖章/签名) 时间:2020年4月15日 甲方(被授权人): (盖章/签名) 时间:2020年4月15日

软件著作权成功维权十大案例之一

软件著作权成功维权十 大案例之一 公司内部编号:(GOOD-TMMT-MMUT-UUPTY-UUYY-DTTI-

2015软件着作权成功维权十大案例之一 临危受命,严密证据链让被告无处可逃 导读:一场历时一年多的“图像预处理”软件着作权之争终于在2015年09月17日下午谢幕。在本案一审审理中,在极为不利的情况下,长昊律师事务所临危受命、不负重望,最终喜得佳绩。我所律师以当事人的合法利益最大化为目标,在案件亲办过程中,克服重重困难,终于让被告受到了法律的制裁。本所回顾此案办理历程并就案件核心予以展述,一起共勉。 软件被盗,果断维权 2012年7月20日,张XX、陈XX将其共同享有的《XXX软件》(以下简称涉案侵权软件)转让给XH公司,并签订了《计算机软件着作权转让协议》。2012年12月1日,国家版权局出具证书号为软着登字第XX 号的《计算机软件着作权登记证书》,证书记载:着作权人为XH公司,开发完成日期为2009年9月9日,权利取得方式为受让,权利范围为全部权利。 被告人李XX注册成立深圳市HCRZ科技有限公司(以下简称HCRZ公司),在宝安区西乡黄田草围第一工业区租赁厂地生产摄像头,并未经原告XH公司授权在其生产的摄像头上安装XH公司所有的涉案侵权软件。 2014年05月30日10时,XH公司代表张XX向公安机关举报被告人李XX所有的HCRZ公司生产的摄像头软件侵犯其公司研发的软件着作权,2014年8月13日,公安机关在位于深圳市宝安区西乡黄田草围第一工业区HCRZ公司查获各类型摄像头5000多个,其中安装了涉案侵权软件的的HD-500T摄像头477个,查获电脑、烧录器等工具,并将被告人

软件著作权转让协议同范本(完整版)

合同编号:YT-FS-1709-17 软件著作权转让协议同范 本(完整版) Clarify Each Clause Under The Cooperation Framework, And Formulate It According To The Agreement Reached By The Parties Through Consensus, Which Is Legally Binding On The Parties. 互惠互利共同繁荣 Mutual Benefit And Common Prosperity

软件著作权转让协议同范本(完整 版) 备注:该合同书文本主要阐明合作框架下每个条款,并根据当事人一致协商达成协议,同时也明确各方的权利和义务,对当事人具有法律约束力而制定。文档可根据实际情况进行修改和使用。 合同(或合约)(covenants),是双方当事人基于对立合致的意思表示而成立的法律行为,为私法自治的主要表现,意指盖印合约中所包含的合法有效承诺或保证。本文是关于软件著作权转让协议同范本,仅供大家参考。 甲方:____ 乙方:____ 经甲乙双方协商一致,就《____》之软件著作权转让事宜达成本协议。 1.软件概况 软件的名称及版本号:____ 软件全称:____

软件简称:____ 软件版本:____ 2.甲方的权利和责任 自签订本协议之日起,甲方不再拥有该软件的著作权; 甲方必须向乙方提供该软件的全部源代码及其他相关文档; 甲方有义务向乙方提供该软件相关的技术支持; 甲方不得以任何方式向第三方透露与该软件相关的技术细节。 3.乙方的权利和责任 自签订本协议之日起,乙方拥有该软件的著作权; 乙方有义务在该软件上投入人力和物力,不断完善、升级该产品。 4.共同条款 甲方同意将该软件的著作权的各项权利无偿并且无地域限制地转让给乙方; 违反本协议第二条第3款、第4款之约定,甲方

软件著作权-源代码范本

软件著作权-源代码范本 注意事项:常见的源代码包含:C语言,VB,C++,JAVA,.NET等。 提交的代码必须是源代码的开头载入程序,第30页必须断开,第60页是软 件的程序结尾,代码中不得出现与申请表内容不符合的日期,著作权人,软件名 字等,不能出现开源代码,不能出现任何版权纠纷。 格式要求:一、源代码应提交前、后各连续30页,不足60页的,应当全部提交。 、源代码页眉应标注软件的名称和版本号,应当与申请表中名称完全一致,页 眉右上应标注页码,源代码每页不少于50行。 范例如下: #i nclude #in elude #i nclude #in elude

#in elude #i nclude #i nclude #i nclude #i nclude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #defi ne NS_MAIN 1 #i nclude #en dif #ifdef DLZ #in clude #en dif static tybs_boolean_t wan t_stats = TYBS_FALSE; static char static char static char static char static un sig ned program_ name[TYBS_DIR_NAMEMAX] = "n amed"; absolute_co nffile[TYBS_DIR_PATHMAX]; saved_comma nd_li ne[512]; versio n[512]; maxsocks = 0; n s_ma in _earlywar nin g(c onst char *format, ...) { va_list args; va_start(args, format); if (ns_g」ctx != NULL) { tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_W ARNING, format, args); } else { fprin tf(stderr, "%s: ", program_ name); vfprin tf(stderr, format, args); fprin tf(stderr, "\n"); fflush(stderr); } va_e nd(args); } Void n s_ma in _earlyfatal(c onst char *format, ...) { va_list args; va_start(args, format); if (ns_g」ctx != NULL) { tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, format, args); tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "exit ing (due to early fatal error)"); } else { fprin tf(stderr, "%s: ", program, name); vfprin tf(stderr, format, args); fprin tf(stderr, "\n"); fflush(stderr); } va_e nd(args); exit(1); } static void assert ion _failed(c onst char *file, in t li ne, tybs_assert ion type_t type, const char *cond)

著作权案例分析

案例一:“脸谱”引发著作权纠纷 中国艺术研究院赔偿4万 案情介绍: 《中国戏曲脸谱》一书使用了京剧脸谱绘画大师汪鑫福所绘的177幅京剧脸谱,汪鑫福的外孙季成将中国艺术研究院、九州出版社、北京世纪高教书店诉至法院。 汪鑫福自上世纪20年代起至90年代去世时陆 续创作了大量京剧脸谱,相当部分都收藏在艺术研究院陈列室中。上世纪50年代时,汪鑫福曾在艺术研究院前身戏曲改进局工作。2000年1月,经北京森淼圆文化传播有限公司组织联系,由艺术研究院提供图片及文字,九州出版社提供书号出版了中国戏曲脸谱》一书,该书中使用了汪鑫福绘制并收藏在陈列室中的177幅京剧脸谱,但没有为汪鑫福署名。 季成作为汪鑫福的外孙,自其母亲去世后即为“脸谱”的继承人。季成于2010年初发现《中国戏曲脸谱》一书,并于2010年8月从北京世纪高教书店购买到该书,故起诉要求 三被告停止侵权、向其赔礼道歉、赔偿经济损失53.1万元、精神损害抚慰金1万元及合理费用3万余元等。 法院审理 诉讼中,双方争议焦点主要集中在涉案脸谱的性质上,季成表示涉案脸谱为汪鑫福个人作品,而艺术研究院坚持认为涉案脸谱完成于上世纪50年代,为著作权归属于该研究院的职务作品。法院经审理认为,双方均认可汪鑫福一生绘制了大量京剧脸谱,而涉案脸谱没有专门标识或特征体现出绘制时间,故无证据证明涉案脸谱的时间完成时间。不排除部分涉案脸谱完成时我国尚未颁布实施著作权法,但汪鑫福去世以及《中国戏曲脸谱》一书出版时,我国已于1991年6月1日起施行著作权法,那么在使用他人作品时,就应当尊重法律规定的赋予著作权人的权利,除非有合法理由排除或限制著作权人权利。 我国著作权法规定了两类职务作品,一类是著作权由作者享有,但单位有权在其业务范围内优先使用,另一类是作者享有署名权,著作权的其他权利由单位享有。艺术研究院既表示涉案脸谱属于第二类职务作品,又表示著作权应当全部归属于艺术研究院。法院根据本案证据体现出的情况,认为汪鑫福所绘制的京剧脸谱不属于艺术研究院主张的主要利用了单位的物质技术条件创作,并由单位承担责任的第二类职务作品。况且,艺术研究院曾书面承认其享有涉案脸谱的所有权,汪鑫福的家属享有著作权。涉案脸谱属于美术作品,原件所有权的转移不视为作品著作权的转移。艺术研究院的矛盾解释混淆了作品原件所有权人与著 作权人所享有权利的区别,美术作品原件所有权人在享有作品原件所有权的同时,享有该作品著作权中的展览权,但不享有该作品的其他著作权,也不得损害著作权人所享有的其他著作权。 法院判决 艺术研究院未经季成许可亦未支付报酬,将涉案脸谱收录入《中国戏曲脸谱》中,九州出版社未尽到著作权审查义务出版《中国戏曲脸谱》一书的行为侵犯了季成因继承而取得的涉案脸谱的复制权等著作财产权。北京世纪书店销售的《中国戏曲脸谱》一书有合法来源,应当承担停止销售的责任。最后,北京海淀法院判决三被告停止侵权、中国艺术研究院和九州出版社赔偿季成经济损失35400元及合理费用1万元。宣判后,双方当事人均未明确表示是

计算机软件著作权转让合同范本标准版本

The Legal Relationship Established By Parties To Resolve Disputes Ultimately Realizes Common Interests. The Document Has Legal Effect After Reaching An Agreement Through Consultation. 编订:XXXXXXXX 20XX年XX月XX日 计算机软件著作权转让合同范本标准版本

计算机软件著作权转让合同范本标 准版本 温馨提示:本合同文件应用在当事人双方(或多方)为解决或预防纠纷而确立的法律关系,最终实现共同的利益,文书经过协商而达成一致后,签署的文件具有法律效力。文档下载完成后可以直接编辑,请根据自己的需求进行套用。 甲方:_______________ 乙方:_______________ 经甲乙双方协商一致,就 《_______________》之软件著作权转让事宜达 成本协议。 1.软件概况 软件的名称及版本号:_______________ 软件全称:_______________ 软件简称:_______________ 软件版本:_______________ 2.甲方的权利和责任

自签订本协议之日起,甲方不再拥有该软件的著作权; 甲方必须向乙方提供该软件的全部源代码及其他相关文档; 甲方有义务向乙方提供该软件相关的技术支持; 甲方不得以任何方式向第三方透露与该软件相关的技术细节。 3.乙方的权利和责任 自签订本协议之日起,乙方拥有该软件的著作权; 乙方有义务在该软件上投入人力和物力,不断完善、升级该产品。 4.共同条款 甲方同意将该软件的著作权的各项权利无

软件著作权申请源程序

**汽车商城管理系统源程序 using System; using System.Collections.Generic; using System.Text; namespace Qing.Model { ///

/// 购物车实体类 /// [Serializable] public partial class cart_keys { public cart_keys() { } #region Model private int _article_id; private int _quantity = 0; /// /// 文章ID /// public int article_id { set { _article_id = value; } get { return _article_id; } } /// /// 购买数量 /// public int quantity { set { _quantity = value; } get { return _quantity; } } #endregion } /// /// 购物车列表 /// [Serializable] public partial class cart_items { public cart_items(){ }

#region Model private int _article_id; private string _goods_no = string.Empty; private string _title = string.Empty; private string _spec_text = string.Empty; private string _img_url = string.Empty; private decimal _sell_price = 0M; private decimal _user_price = 0M; private int _quantity = 1; private int _stock_quantity = 0; ///

/// 文章ID /// public int id { set { _article_id = value; } get { return _article_id; } } /// /// 商品货号 /// public string goods_no { set { _goods_no = value; } get { return _goods_no; } } /// /// 商品名称 /// public string title { set { _title = value; } get { return _title; } } /// /// 商品地址 /// public string linkurl { get; set; } /// /// 商品规格 /// public string spec_text { set { _spec_text = value; }

软件著作权-代码

Option.java package https://www.360docs.net/doc/2a10773508.html,mon; public class Option { private String name; private String id; private String description; private OptionGroup group; public Option(String id, String name, String description,OptionGroup group) { this.id = id; https://www.360docs.net/doc/2a10773508.html, = name; this.description = description; this.group = group; } public String getName() { return name; } public String getId() { return id; } public String getDescription() { return description.replaceAll("\\t", "").trim(); } public OptionGroup getGroup(){ return this.group; } } OptionGroup.java package https://www.360docs.net/doc/2a10773508.html,mon; import java.util.ArrayList; import java.util.List; import https://www.360docs.net/doc/2a10773508.html,.uestc.ablator.ui.util.XmlParser; /** * 选项组 * @author Administrator * */ public class OptionGroup { private String id; private String name; private List

软件著作权转让合同模版

软件著作权转让合同 转让人(甲方):公司 法定代表人: 受让人(乙方):公司 法定代表人: 甲、乙双方本着平等自愿、真诚合作的原则,经双方友好协商,依据《中华人民共和国知识产权法》和《计算机软件保护条例》以及其他有关法律、法规的规定,就甲方向乙方转让软件著作权及源代码事宜达成如下协议,以期共同遵守。 第一条作品的名称 甲方将其拥有所有权的软件著作权(以下简称“本著作权”)及源代码之全部知识产权利转让给乙方。 第二条转让的权利种类、地域范围 1.甲方向乙方转让以下全部地域范围内的与本著作权相关的所有权利; 2.地域范围:。 第三条转让价金、交付转让价金的日期 1.乙方为此向甲方支付转让费用共计(大写)元人民币,(小写)元人民币。 2.付款进度 a.乙方于软件著作权交付日向甲方支付元; b.从合同签订之日起一个月内向甲方支付元; c.从合同签订之日起三个月内向甲方支付元。

第四条支付价金的方式 乙方按下述方式付款: a□现金支付; b□银行转帐; c□支票支付。 第五条甲方权利与义务 1.甲方应按本合同约定向乙方转让_______________软件产品、软件开发平台及全部的源代码等,并保证代码的完整性,可直接编译为应用程序正常使用。 2.自本合同签订之日起,甲方不得将本合同标的(即转让软件及源代码)转让或许可第三人使用;自乙方付款完毕之日起,乙方享有该转让软件及源代码的一切知识产权,甲方不得以任何形式使用、转让、传播该软件或源代码。 3.甲方向乙方提供《软件系统设计及使用说明书》及全部的相关文档。 4.甲方在合同签字后负责为乙方现场安装、调试系统开发平台,讲解各个功能的实现原理及方法,并当面解答乙方提出的全部问题。 5.甲方在本合同生效三个月内,负责为乙方解答开发过程中遇到的问题,并讲解开发思想及方法。 第六条乙方权利与义务 1.乙方负责支付本著作权及源代码的转让费人民币元(人民币大写:),并按本合同约定付款进度向甲方付款。 2.乙方有权对此软件或源代码做出任意修改,并有权自由处置该软件或源代码。 第七条违约责任 1.如任何一方违反本合同约定给对方造成损失,守约方均可以要求对方赔偿际损失金额。 2.如甲方侵害他人知识产权或违背现行各项法律或国家政策时,由甲方自行承担赔偿责任,与乙方无关;转让软件或源代码因此被有关机关扣留、没收,或禁止发行、使用的,甲方应赔偿乙方遭受的全部损失,并由甲方负责解决所有纠纷承担相关费用。

软件著作权源代码

#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define NS_MAIN 1 #include #endif #ifdef DLZ #include #endif static tybs_boolean_t want_stats = TYBS_FALSE; static char program_name[TYBS_DIR_NAMEMAX] = "named"; static char absolute_conffile[TYBS_DIR_PATHMAX]; static char saved_command_line[512]; static char version[512]; static unsigned int maxsocks = 0; void ns_main_earlywarning(const char *format, ...) { va_list args; va_start(args, format); if (ns_g_lctx != NULL) { tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_W ARNING, format, args); } else { fprintf(stderr, "%s: ", program_name); vfprintf(stderr, format, args); fprintf(stderr, "\n"); fflush(stderr); } va_end(args); } Void ns_main_earlyfatal(const char *format, ...) { va_list args; va_start(args, format); if (ns_g_lctx != NULL) {

软件著作权通用代码范本

usingSystem; usingSystem.Collections; https://www.360docs.net/doc/2a10773508.html,ponentModel; usingSystem.Data; usingSystem.Drawing; usingSystem.Web; usingSystem.Web.SessionState; usingSystem.Web.UI; usingSystem.Web.UI.WebControls; usingSystem.Web.UI.HtmlControls; usingSystem.Data.SqlClient; usingSystem.Configuration; namespaceOfficeOnline { ///

/// Advice 的摘要说明。 /// public class Advice :System.Web.UI.Page { protectedSystem.Web.UI.WebControls.ImageButton ImageButton1; protectedSystem.Web.UI.WebControls.DataGrid dgdadvice; protectedSystem.Web.UI.WebControls.ImageButton ImageButton2; private void Page_Load(objectsender, System.EventArgs e) { if (!IsPostBack) { //创建数据库连接和命令对象 SqlConnection objconn = new SqlConnection(ConfigurationSettings.AppSettings["connstr"]); objconn.Open(); stringobjsql="Select * from Advice"; SqlDataAdapter da = new SqlDataAdapter(objsql,objconn); //创建并填充DataSet DataSet ds = newDataSet(); da.Fill(ds); dgdadvice.DataSource=ds; dgdadvice.DataBind(); objconn.Close(); } } #region Web 窗体设计器生成的代码 override protected voidOnInit(EventArgs e) { //

计算机软件著作权转让合同范本(完整版)

计算机软件著作权转让合同范本 计算机软件著作权转让合同范本 乙方: ______________________ 经甲乙双方协商一致,就《______________________》之软件著作权转让事宜达成本协议。 1.软件概况 软件的名称及版本号: ______________________ 软件全称: ______________________ 软件简称: ______________________ 软件版本: ______________________ 2.甲方的权利和责任 自签订本协议之日起,甲方不再拥有该软件的著作权; 甲方必须向乙方提供该软件的全部源代码及其他相关文档; 甲方有义务向乙方提供该软件相关的技术支持; 甲方不得以任何方式向第三方透露与该软件相关的技术细节。 3.乙方的权利和责任 自签订本协议之日起,乙方拥有该软件的著作权;

乙方有义务在该软件上投入人力和物力,不断完善、升级该产品。 4.共同条款 甲方同意将该软件的著作权的各项权利无偿并且无地域限制地转让给乙方; 违反本协议第二条第3款、第4款之约定,甲方必须向乙方赔偿乙方在该软件上的所有投入,且乙方有权解除本协议; 违反本协议第三条第2款之约定,甲方有权解除本协议,并向乙方无偿索回该软件的著作权。 5.其他 本合同以甲乙双方全部签字之日为开始生效之日期; 未尽事宜,双方应协商解决。不愿协商或协商不成的,按司法程序解决。 本协议共壹页;壹式肆份,双方各执两份。 甲方: _________________ 代表人: _______________ 签订日期: _____________ 乙方: _________________ 代表人: _______________

软件著作权源程序代码