Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ limitations under the License.
<maven-war.version>3.4.0</maven-war.version>
<maven-surefire.version>3.5.2</maven-surefire.version>
<maven-antrun.version>1.0b3</maven-antrun.version>
<rome.version>1.19.0</rome.version> <!-- locked in place since next version removes popono -->
<rome.version>1.19.0</rome.version> <!-- ROME core; used for feeds/planet (AtomPub no longer uses Propono) -->
<slf4j.version>2.0.16</slf4j.version>
<spring.version>5.3.39</spring.version>
<spring.security.version>5.8.14</spring.security.version>
Expand Down Expand Up @@ -522,11 +522,12 @@ limitations under the License.
</exclusions>
</dependency>

<!-- todo: remove/replace propono -->
<!-- Used by Trackback; previously reached the classpath transitively
via rome-propono, now declared explicitly since propono was removed. -->
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-propono</artifactId>
<version>${rome.version}</version>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -592,6 +593,15 @@ limitations under the License.
<scope>test</scope>
</dependency>

<!-- Jing: RELAX NG validator, used to check AtomWriter output against
the RFC 4287 / RFC 5023 schemas in AtomSchemaValidationTest. -->
<dependency>
<groupId>com.thaiopensource</groupId>
<artifactId>jing</artifactId>
<version>20091111</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.roller.weblogger.webservices.atomprotocol;

import java.util.ArrayList;
import java.util.List;

/**
* An APP categories element (app:categories) describing the categories a
* collection accepts. When {@code fixed} is true the listed categories are the
* only ones allowed.
*/
public class AtomCategories {

private boolean fixed;
private String scheme;
private final List<AtomCategory> categories = new ArrayList<>();

public boolean isFixed() {
return fixed;
}

public void setFixed(boolean fixed) {
this.fixed = fixed;
}

public String getScheme() {
return scheme;
}

public void setScheme(String scheme) {
this.scheme = scheme;
}

public List<AtomCategory> getCategories() {
return categories;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.roller.weblogger.webservices.atomprotocol;

/**
* An atom:category element. A null {@code scheme} signifies a free-form tag;
* a scheme that matches the weblog category scheme signifies a weblog category.
*/
public class AtomCategory {

private String term;
private String scheme;
private String label;

public String getTerm() {
return term;
}

public void setTerm(String term) {
this.term = term;
}

public String getScheme() {
return scheme;
}

public void setScheme(String scheme) {
this.scheme = scheme;
}

public String getLabel() {
return label;
}

public void setLabel(String label) {
this.label = label;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.roller.weblogger.webservices.atomprotocol;

import java.util.ArrayList;
import java.util.List;

/**
* An APP collection (app:collection) within a workspace.
*/
public class AtomCollection {

private String title;
private String href;
private List<String> accepts = new ArrayList<>();
private final List<AtomCategories> categories = new ArrayList<>();

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getHref() {
return href;
}

public void setHref(String href) {
this.href = href;
}

public List<String> getAccepts() {
return accepts;
}

public void setAccepts(List<String> accepts) {
this.accepts = accepts;
}

public List<AtomCategories> getCategories() {
return categories;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.roller.weblogger.webservices.atomprotocol;

/**
* Constants shared by the StAX-based AtomPub implementation.
*/
public final class AtomConstants {

private AtomConstants() {
}

/** Atom Syndication Format namespace (RFC 4287). */
public static final String ATOM_NS = "http://www.w3.org/2005/Atom";

/** Atom Publishing Protocol namespace (RFC 5023). */
public static final String APP_NS = "http://www.w3.org/2007/app";

/** Media type for an Atom entry. */
public static final String ENTRY_MEDIA_TYPE = "application/atom+xml;type=entry";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower confidence than the rest, but flagging: ENTRY_MEDIA_TYPE has no charset parameter while FEED_MEDIA_TYPE and SERVICE_MEDIA_TYPE both declare charset=utf-8, and Propono declared it on entry responses too. Clients that fall back to ISO-8859-1 when charset is absent will mojibake non-ASCII titles on GET entry and 201 responses.


/** Media type for an Atom feed/collection. */
public static final String FEED_MEDIA_TYPE = "application/atom+xml;type=feed;charset=utf-8";

/** Media type for an APP service document. */
public static final String SERVICE_MEDIA_TYPE = "application/atomsvc+xml;charset=utf-8";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.roller.weblogger.webservices.atomprotocol;

/**
* An Atom text/content construct (atom:content or atom:summary). For inline
* content {@code value} holds the text; for out-of-line media content
* {@code src} holds the source URI instead.
*/
public class AtomContent {

private String type;
private String value;
private String src;

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public String getSrc() {
return src;
}

public void setSrc(String src) {
this.src = src;
}
}
Loading
Loading