Skip to content

Commit

Permalink
Set correct date format to parse timestamp fields in widget YAML code
Browse files Browse the repository at this point in the history
Change content types

Javadoc fixes

Implement getAddId(URL) for marketplace (unused)

Bump Maven version

Signed-off-by: Yannick Schaus <[email protected]>
  • Loading branch information
ghys committed Sep 9, 2021
1 parent d7a4c6c commit 53eb6d0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bundles/org.openhab.core.addon.marketplace/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.core.bundles</groupId>
<artifactId>org.openhab.core.reactor.bundles</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.2.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.core.addon.marketplace</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class CommunityBundleAddonHandler implements MarketplaceAddonHandler {
// add-on types supported by this handler
private static final List<String> SUPPORTED_EXT_TYPES = Arrays.asList("binding");

private static final String BUNDLE_CONTENTTYPE = "application/java-archive";
private static final String BUNDLE_CONTENTTYPE = "application/vnd.openhab.bundle";

private static final String JAR_DOWNLOAD_URL_PROPERTY = "jar_download_url";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ public void uninstall(String id) {

@Override
public String getAddonId(URI addonURI) {
// TODO Auto-generated method stub
if (addonURI.toString().startsWith(COMMUNITY_TOPIC_URL)) {
return addonURI.toString().substring(0, addonURI.toString().indexOf("/", COMMUNITY_BASE_URL.length()));
}
return "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.io.InputStream;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;

import org.eclipse.jdt.annotation.NonNull;
import org.openhab.core.addon.Addon;
Expand Down Expand Up @@ -56,6 +57,7 @@ public CommunityUIWidgetAddonHandler(final @Reference UIComponentRegistryFactory
this.widgetRegistry = uiComponentRegistryFactory.getRegistry("ui:widget");
this.yamlMapper = new ObjectMapper(new YAMLFactory());
yamlMapper.findAndRegisterModules();
this.yamlMapper.setDateFormat(new SimpleDateFormat("MMM d, yyyy, hh:mm:ss aa"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Date;

/**
* A DTO class mapped to the Discourse tagged topic list API.
* A DTO class mapped to the Discourse category topic list API.
*
* @author Yannick Schaus - Initial contribution
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
@Component(name = "org.openhab.core.karafaddons")
public class KarafAddonService implements AddonService {
private static final String ADDONS_CONTENTTYPE = "application/java-archive";
private static final String ADDONS_CONTENTTYPE = "application/vnd.openhab.feature;type=karaf";
private static final String ADDONS_AUTHOR = "openHAB";

private final Logger logger = LoggerFactory.getLogger(KarafAddonService.class);
Expand Down

0 comments on commit 53eb6d0

Please sign in to comment.