Skip to content

Commit dfc1d77

Browse files
Merge pull request #26 from ali-salman/master
Added Aspose.Words Java for Eclipse Maven
2 parents 010c56d + bef6b18 commit dfc1d77

31 files changed

+3377
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin.includes = feature.xml
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<feature
3+
id="com.aspose.words.java.maven"
4+
label="Aspose.Words Java for Eclipse (Maven)"
5+
version="1.0.0.3"
6+
provider-name="http://www.aspose.com">
7+
8+
<description>
9+
Aspose.Words Maven Project wizard creates Maven Project for using Aspose.Words for Java API within Eclipse IDE.
10+
Aspose.Words for Java is an advanced class library for Java that enables you to perform a great range of document processing tasks directly within your Java applications.
11+
Aspose.Words for Java supports processing word (DOC, DOCX, OOXML, RTF) HTML, OpenDocument, PDF, EPUB, XPS, SWF and all image formats.
12+
With Aspose.Words you can generate, modify, and convert documents without using Microsoft Word.&quot;
13+
Aspose.Words Maven Project wizard fetch and configures the latest Maven dependency reference of Aspose.Words for Java from the Aspose Cloud Maven Repository.
14+
The wizard also gives you option to download the Code Examples to use Aspose.Words for Java API.
15+
Once you are finished with this wizard - created Maven project and downloaded Code Examples. Next you can insert those Code Examples to use Aspose.Words for Java API in your Project from File -&gt; New -&gt; Other -&gt; Aspose.Words Code Example
16+
The newly created project and the Code Examples you added is now ready to be enhanced, all required resources and references are also automatically added.
17+
</description>
18+
19+
<license url="">
20+
The MIT License (MIT)
21+
Copyright (c) 2001-2016 Aspose Pty Ltd
22+
23+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
24+
25+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
26+
27+
THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28+
</license>
29+
30+
<plugin
31+
id="com.aspose.words.java.maven.plugin"
32+
download-size="0"
33+
install-size="0"
34+
version="1.0.0.3"
35+
unpack="false"/>
36+
37+
</feature>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source.. = src/
2+
output.. = bin/
3+
bin.includes = META-INF/,\
4+
.,\
5+
plugin.xml,\
6+
resources/
7+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?eclipse version="3.4"?>
3+
<plugin>
4+
<extension
5+
point="org.eclipse.ui.newWizards">
6+
<wizard
7+
category="org.eclipse.m2e"
8+
class="com.aspose.words.maven.AsposeMavenProjectWizard"
9+
icon="resources/Aspose.png"
10+
id="asposeplugin.wizard.new.mavenprojectwizard"
11+
name="Aspose.Words Maven Project"
12+
project="true">
13+
</wizard>
14+
<wizard
15+
category="org.eclipse.jdt.ui.java"
16+
class="com.aspose.words.maven.examples.AsposeExampleWizard"
17+
icon="resources/Aspose.png"
18+
id="asposeplugin.wizard.new.mavenexamplewizard"
19+
name="Aspose.Words Code Example"
20+
project="false">
21+
</wizard>
22+
</extension>
23+
24+
</plugin>
Loading
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
</attributes>
29+
</classpathentry>
30+
<classpathentry kind="output" path="target/classes"/>
31+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
3+
org.eclipse.jdt.core.compiler.compliance=1.7
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.source=1.7
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.mycompany</groupId>
5+
<artifactId>mavenproject1</artifactId>
6+
<version>2</version>
7+
<packaging>jar</packaging>
8+
<repositories>
9+
<repository>
10+
<id>Aspose-Maven-Repository</id>
11+
<name>Aspose Maven Repository</name>
12+
<url>http://maven.aspose.com/artifactory/simple/ext-release-local/</url>
13+
</repository>
14+
</repositories>
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<maven.compiler.source>1.7</maven.compiler.source>
18+
<maven.compiler.target>1.7</maven.compiler.target>
19+
</properties>
20+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 1998-2015 Aspose Pty Ltd.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
*
8+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
*
10+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11+
*/
12+
package com.aspose.words;
13+
14+
import java.io.IOException;
15+
import java.net.URISyntaxException;
16+
import java.net.URL;
17+
import org.eclipse.core.runtime.FileLocator;
18+
import org.eclipse.ui.plugin.AbstractUIPlugin;
19+
import org.osgi.framework.BundleContext;
20+
21+
/**
22+
* The activator class controls the plug-in life cycle
23+
*/
24+
public class Activator extends AbstractUIPlugin {
25+
26+
// The plug-in ID
27+
public static final String PLUGIN_ID = "AsposeWordsEclipsePlugin";
28+
29+
// The shared instance
30+
private static Activator plugin;
31+
32+
/**
33+
* The constructor
34+
*/
35+
public Activator() {
36+
}
37+
38+
public static String getResourceFilePath(String resourceFileName) {
39+
String fileURL = null;
40+
try {
41+
URL url = getDefault().getBundle().getEntry("resources/" + resourceFileName);
42+
fileURL = FileLocator.toFileURL(url).toURI().normalize().getPath();
43+
} catch (IOException | URISyntaxException e) {
44+
e.printStackTrace();
45+
}
46+
return fileURL;
47+
}
48+
49+
/*
50+
* (non-Javadoc)
51+
*
52+
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
53+
* BundleContext)
54+
*/
55+
public void start(BundleContext context) throws Exception {
56+
super.start(context);
57+
plugin = this;
58+
}
59+
60+
/*
61+
* (non-Javadoc)
62+
*
63+
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
64+
* BundleContext)
65+
*/
66+
public void stop(BundleContext context) throws Exception {
67+
plugin = null;
68+
super.stop(context);
69+
}
70+
71+
/**
72+
* Returns the shared instance
73+
*
74+
* @return the shared instance
75+
*/
76+
public static Activator getDefault() {
77+
return plugin;
78+
}
79+
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 1998-2015 Aspose Pty Ltd.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
*
8+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
*
10+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11+
*/
12+
package com.aspose.words;
13+
14+
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
15+
import org.eclipse.core.runtime.preferences.InstanceScope;
16+
17+
/**
18+
*
19+
* @author Adeel
20+
*/
21+
public final class MavenSettings {
22+
23+
private static final String PROP_LAST_ARCHETYPE_GROUPID = "lastArchetypeGroupId";
24+
private static final String PROP_LAST_ARCHETYPE_VERSION = "lastArchetypeVersion";
25+
26+
private IEclipsePreferences getPreferences() {
27+
return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
28+
}
29+
30+
/**
31+
*
32+
* @return
33+
*/
34+
public String getLastArchetypeGroupId() {
35+
return getPreferences().get(PROP_LAST_ARCHETYPE_GROUPID, "com.mycompany");
36+
}
37+
38+
/**
39+
*
40+
* @return
41+
*/
42+
public String getLastArchetypeVersion() {
43+
return getPreferences().get(PROP_LAST_ARCHETYPE_VERSION, "1.0-SNAPSHOT");
44+
}
45+
46+
/**
47+
*
48+
* @param version
49+
*/
50+
public void setLastArchetypeVersion(String version) {
51+
putProperty(PROP_LAST_ARCHETYPE_VERSION, version);
52+
}
53+
54+
/**
55+
*
56+
* @param groupId
57+
*/
58+
public void setLastArchetypeGroupId(String groupId) {
59+
putProperty(PROP_LAST_ARCHETYPE_GROUPID, groupId);
60+
}
61+
62+
private String putProperty(String key, String value) {
63+
String retval = getProperty(key);
64+
if (value != null) {
65+
getPreferences().put(key, value);
66+
} else {
67+
getPreferences().remove(key);
68+
}
69+
return retval;
70+
}
71+
private static final MavenSettings INSTANCE = new MavenSettings();
72+
73+
/**
74+
*
75+
* @return
76+
*/
77+
public static MavenSettings getDefault() {
78+
return INSTANCE;
79+
}
80+
81+
private String getProperty(String key) {
82+
return getPreferences().get(key, null);
83+
}
84+
85+
}

0 commit comments

Comments
 (0)