Skip to content

Commit 8d6318c

Browse files
committed
Merge branch 'cups-binding' of https://github.com/peuter/openhab2 into peuter-cups-binding
Added missing imports for java.xml # Conflicts: # addons/binding/pom.xml Signed-off-by: Kai Kreuzer <[email protected]> (github: @kaikreuzer)
1 parent a6177bf commit 8d6318c

File tree

17 files changed

+667
-2
lines changed

17 files changed

+667
-2
lines changed

Diff for: addons/binding/org.openhab.binding.ipp/.classpath

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry exported="true" kind="lib" path="lib/cups4j-0.6.4.jar"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
5+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
6+
<classpathentry kind="src" path="src/main/java"/>
7+
<classpathentry kind="output" path="target/classes"/>
8+
</classpath>

Diff for: addons/binding/org.openhab.binding.ipp/.project

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.openhab.binding.ipp</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.ds.core.builder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.pde.PluginNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<binding:binding id="ipp"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
5+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">
6+
7+
<name>IPP Binding</name>
8+
<description>This is the binding for the Internet Printing Protocol (IPP). You can
9+
show how many jobs are done/waiting on an IPP/CUPS Printer</description>
10+
<author>Tobias Braeutigam</author>
11+
12+
</binding:binding>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<thing:thing-descriptions bindingId="ipp"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
5+
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
6+
<thing-type id="printer">
7+
<label>Printer</label>
8+
<description>A IPP Printer</description>
9+
10+
<channels>
11+
<channel id="jobs" typeId="jobs" />
12+
<channel id="waitingJobs" typeId="waitingJobs" />
13+
<channel id="doneJobs" typeId="doneJobs" />
14+
</channels>
15+
<config-description>
16+
<parameter name="name" type="text" required="true">
17+
<label>Name</label>
18+
<description>The name of the printer</description>
19+
</parameter>
20+
<parameter name="url" type="text" required="true">
21+
<label>URL</label>
22+
<description>The URL of the printer</description>
23+
</parameter>
24+
<parameter name="refresh" type="integer">
25+
<label>Refresh interval</label>
26+
<description>Specifies the refresh interval in seconds</description>
27+
<default>60</default>
28+
</parameter>
29+
</config-description>
30+
</thing-type>
31+
32+
<channel-type id="jobs" advanced="true">
33+
<item-type>Number</item-type>
34+
<label>total jobs</label>
35+
<description>Total number of print jobs on the printer</description>
36+
<state readOnly="true"></state>
37+
</channel-type>
38+
<channel-type id="waitingJobs">
39+
<item-type>Number</item-type>
40+
<label>waiting jobs</label>
41+
<description>Number of waiting print jobs on the printer</description>
42+
<state readOnly="true"></state>
43+
</channel-type>
44+
<channel-type id="doneJobs" advanced="true">
45+
<item-type>Number</item-type>
46+
<label>done jobs</label>
47+
<description>Number of completed print jobs on the printer</description>
48+
<state readOnly="true"></state>
49+
</channel-type>
50+
51+
</thing:thing-descriptions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: IPP Binding
4+
Bundle-SymbolicName: org.openhab.binding.ipp;singleton:=true
5+
Bundle-Vendor: openHAB
6+
Bundle-Version: 2.0.0.qualifier
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
8+
Bundle-ClassPath: .,
9+
lib/cups4j-0.6.4.jar
10+
Import-Package: com.google.common.collect,
11+
javax.jmdns,
12+
javax.xml,
13+
javax.xml.bind,
14+
org.apache.commons.codec,
15+
org.apache.commons.lang,
16+
org.apache.commons.logging,
17+
org.apache.commons.logging.impl,
18+
org.apache.http,
19+
org.apache.http.client,
20+
org.apache.http.client.cache,
21+
org.apache.http.client.methods,
22+
org.apache.http.conn,
23+
org.apache.http.entity,
24+
org.apache.http.entity.mime,
25+
org.apache.http.impl.client,
26+
org.apache.http.params,
27+
org.apache.http.util,
28+
org.eclipse.smarthome.config.core,
29+
org.eclipse.smarthome.config.discovery,
30+
org.eclipse.smarthome.core.library.types,
31+
org.eclipse.smarthome.core.thing,
32+
org.eclipse.smarthome.core.thing.binding,
33+
org.eclipse.smarthome.core.types,
34+
org.eclipse.smarthome.io.transport.mdns.discovery,
35+
org.openhab.core.library.types,
36+
org.osgi.framework,
37+
org.slf4j
38+
Service-Component: OSGI-INF/*.xml
39+
Export-Package: org.openhab.binding.ipp,
40+
org.openhab.binding.ipp.handler
41+
Require-Bundle: org.eclipse.osgi.services
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2014 openHAB UG (haftungsbeschraenkt) and others.
5+
All rights reserved. This program and the accompanying materials
6+
are made available under the terms of the Eclipse Public License v1.0
7+
which accompanies this distribution, and is available at
8+
http://www.eclipse.org/legal/epl-v10.html
9+
10+
-->
11+
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" configuration-policy="optional" immediate="true" name="org.openhab.binding.ipp">
12+
13+
<implementation class="org.openhab.binding.ipp.internal.IppHandlerFactory"/>
14+
<reference bind="setDiscoveryServiceRegistry" cardinality="1..1" interface="org.eclipse.smarthome.config.discovery.DiscoveryServiceRegistry" name="DiscoveryServiceRegistry" policy="static" unbind="unsetDiscoveryServiceRegistry"/>
15+
<service>
16+
<provide interface="org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory"/>
17+
</service>
18+
19+
</scr:component>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.
4+
All rights reserved. This program and the accompanying materials
5+
are made available under the terms of the Eclipse Public License v1.0
6+
which accompanies this distribution, and is available at
7+
http://www.eclipse.org/legal/epl-v10.html
8+
-->
9+
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.openhab.binding.ipp.internal.discovery">
10+
<implementation class="org.openhab.binding.ipp.internal.discovery.IppPrinterDiscoveryParticipant"/>
11+
<service>
12+
<provide interface="org.eclipse.smarthome.io.transport.mdns.discovery.MDNSDiscoveryParticipant"/>
13+
</service>
14+
</scr:component>

Diff for: addons/binding/org.openhab.binding.ipp/about.html

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml">
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
6+
<title>About</title>
7+
</head>
8+
<body lang="EN-US">
9+
<h2>About This Content</h2>
10+
11+
<p>April 11, 2015</p>
12+
<h3>License</h3>
13+
14+
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
15+
indicated below, the Content is provided to you under the terms and conditions of the
16+
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
17+
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
18+
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
19+
20+
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
21+
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
22+
apply to your use of any object code in the Content. Check the Redistributor's license that was
23+
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
24+
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
25+
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
26+
27+
28+
<h3>Third Party Content</h3>
29+
<p>The Content includes items that have been sourced from third parties as set out below. If you
30+
did not receive this Content directly from the Eclipse Foundation, the following is provided
31+
for informational purposes only, and you should look to the Redistributor's license for
32+
terms and conditions of use.</p>
33+
<p><em>
34+
<strong>CUPS4j 0.6.4</strong> <br/><br/>
35+
Cups4J is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by
36+
the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br />
37+
Cups4J is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
38+
See the GNU Lesser General Public License for more details.<br /> You should have received a copy of the GNU Lesser General Public License along with Cups4J. If not, see <a href="http://www.gnu.org/licenses" title="http://www.gnu.org/licenses">http://www.gnu.org/licenses</a>.<br /><br /></p>
39+
</em></p>
40+
41+
42+
</body>
43+
</html>
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source.. = src/main/java/
2+
output.. = target/classes
3+
bin.includes = META-INF/,\
4+
.,\
5+
OSGI-INF/,\
6+
ESH-INF/,\
7+
lib/cups4j-0.6.4.jar
8+
83.5 KB
Binary file not shown.

Diff for: addons/binding/org.openhab.binding.ipp/pom.xml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>org.openhab.binding</groupId>
8+
<artifactId>pom</artifactId>
9+
<version>2.0.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<properties>
13+
<bundle.symbolicName>org.openhab.binding.ipp</bundle.symbolicName>
14+
<bundle.namespace>org.openhab.binding.ipp</bundle.namespace>
15+
</properties>
16+
17+
<groupId>org.openhab.binding</groupId>
18+
<artifactId>org.openhab.binding.ipp</artifactId>
19+
<version>2.0.0-SNAPSHOT</version>
20+
21+
<name>IPP Binding</name>
22+
<packaging>eclipse-plugin</packaging>
23+
24+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright (c) 2014 openHAB UG (haftungsbeschraenkt) and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*/
8+
package org.openhab.binding.ipp;
9+
10+
import java.util.Collection;
11+
12+
import org.eclipse.smarthome.core.thing.ThingTypeUID;
13+
14+
import com.google.common.collect.Lists;
15+
16+
17+
/**
18+
* The {@link IppBindingConstants} class defines common constants, which are
19+
* used across the whole binding.
20+
*
21+
* @author Tobias Braeutigam - Initial contribution
22+
*/
23+
public class IppBindingConstants {
24+
25+
public static final String BINDING_ID = "ipp";
26+
27+
// List of all Thing Type UIDs
28+
public final static ThingTypeUID PRINTER_THING_TYPE = new ThingTypeUID(BINDING_ID, "printer");
29+
30+
// List of all Channel ids
31+
public final static String JOBS_CHANNEL = "jobs";
32+
public final static String WAITING_JOBS_CHANNEL = "waitingJobs";
33+
public final static String DONE_JOBS_CHANNEL = "doneJobs";
34+
35+
public final static String PRINTER_PARAMETER_URL = "url";
36+
public final static String PRINTER_PARAMETER_NAME = "name";
37+
public final static String PRINTER_PARAMETER_REFRESH_INTERVAL = "refresh";
38+
39+
public final static Collection<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Lists.newArrayList(IppBindingConstants.PRINTER_THING_TYPE);
40+
}

0 commit comments

Comments
 (0)