-
Notifications
You must be signed in to change notification settings - Fork 158
Replace ROME Propono AtomPub server with self-contained StAX implementation #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
snoopdave
wants to merge
1
commit into
apache:master
Choose a base branch
from
snoopdave:replace-propono-atompub
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 0 additions & 83 deletions
83
app/src/main/java/org/apache/roller/weblogger/util/WSSEUtilities.java
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomCategories.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } |
53 changes: 53 additions & 0 deletions
53
app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomCategory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } |
60 changes: 60 additions & 0 deletions
60
app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomCollection.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } |
42 changes: 42 additions & 0 deletions
42
app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomConstants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"; | ||
|
|
||
| /** 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"; | ||
| } | ||
54 changes: 54 additions & 0 deletions
54
app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/AtomContent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.