Skip to content
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

Configurable namespace prefixes #22

Closed

Conversation

Projects
None yet
3 participants
@daniel-dgi
Copy link
Contributor

commented Jun 2, 2015

Addresses FCREPO-1553

@@ -0,0 +1,43 @@
/**
*
*/

This comment has been minimized.

Copy link
@mikedurbin

mikedurbin Jun 4, 2015

Contributor

Is this empty javadoc comment required by checkstyle or our javadoc compilation? If not, we might as well remove it.

@@ -156,6 +159,10 @@
<constructor-arg type="java.lang.String" value="index" />
</bean>

<bean id="namespaceFile" class="java.io.File">
<constructor-arg type="java.lang.String" value="src/test/resources/namespaces.properties"/>

This comment has been minimized.

Copy link
@mikedurbin

mikedurbin Jun 4, 2015

Contributor

Could migration-bean.xml and namespace.properties be in the same path (either "test" or "main" or something else) as they seem to serve the same purpose as example configurations.

This comment has been minimized.

Copy link
@awoods

awoods Jun 4, 2015

Member

We probably do not want test resources showing up in the production deployment.

This comment has been minimized.

Copy link
@daniel-dgi

daniel-dgi Jun 4, 2015

Author Contributor

So move migration-bean.xml to test since it's really an example, replacing it-setup.xml? Seems like the best course of action since the production instance's app context setup must be supplied on the command line.

This comment has been minimized.

Copy link
@awoods

awoods Jun 4, 2015

Member

Moving migration-bean.xml to test/resources seems reasonable (noting that this may need to change as well: https://github.com/fcrepo4-labs/migration-utils/blob/master/src/main/java/org/fcrepo/migration/Migrator.java#L126).

This comment has been minimized.

Copy link
@daniel-dgi

daniel-dgi Jun 5, 2015

Author Contributor

I moved those resources into test, and then updated the console output when a user doesn't provide an app context xml file to reference github. I can't pull it in and spit it out at the user since we're no longer on the classpath :(

*/
public class NamespacePrefixMapper {

Properties namespacePrefixes;

This comment has been minimized.

Copy link
@awoods

awoods Jun 4, 2015

Member

Make this private

@@ -60,4 +65,7 @@
<constructor-arg value="localhost:8080" />
</bean>

<bean id="namespaceFile" class="java.io.File">
<constructor-arg type="java.lang.String" value="src/test/resources/namespaces.properties"/>

This comment has been minimized.

Copy link
@awoods

awoods Jun 4, 2015

Member

Same note as above.

@@ -0,0 +1,4 @@
dcterms = http://purl.org/dc/terms/

This comment has been minimized.

Copy link
@mikedurbin

mikedurbin Jun 4, 2015

Contributor

There's a really strange behavior in fcrepo4 that I think we should talk about in the comments for this file. Could you add something like the following to the top of this file:

#The first time a property is added to the repository belonging to a particular namespace, that namespace
#prefix is registered and will be used from that point on (for all properties using that namespace). Setting values
#here before the first run will allow registration of preferred namespace prefixes, but will have no effect on
#subsequent runs.

daniel-dgi added some commits Jun 5, 2015

sb.append("\n");
sb.append("~~~~~~~~~~~~~~\n");

This comment has been minimized.

Copy link
@awoods

awoods Jun 5, 2015

Member

Ouch! I thought it was helpful to be able to see this in the console, no?

This comment has been minimized.

Copy link
@awoods

awoods Jun 5, 2015

Member

You should be able to copy the test resources into the jar artifact with something along the lines of:
https://maven.apache.org/plugins/maven-resources-plugin/plugin-info.html

Let me know if you need some help.

This comment has been minimized.

Copy link
@daniel-dgi

daniel-dgi Jun 5, 2015

Author Contributor

Moving them to test means they're no longer on the classpath. :( Open to suggestions. Maybe download the file off of github and print it out?

This comment has been minimized.

Copy link
@daniel-dgi

daniel-dgi Jun 5, 2015

Author Contributor

Our gihtub comments are crossing each other.

Sure, I'll try and ship it with the jar.

This comment has been minimized.

Copy link
@awoods

awoods Jun 5, 2015

Member

The simpler alternative could be to leave the migration-bean.xml where it was and bring the namespaces.properties into the src/main/resources directory.

This comment has been minimized.

Copy link
@daniel-dgi

daniel-dgi Jun 5, 2015

Author Contributor

+1 Even better.

@mikedurbin

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2015

Squashed and merged in.

@mikedurbin mikedurbin closed this Jun 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.