Skip to content

Commit

Permalink
Xml config split to an extension, stage 04
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraZizka committed Jun 21, 2014
1 parent 9aa87a5 commit 68a3680
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jboss.windup.graph.dao;

import org.jboss.windup.graph.model.meta.xml.MavenFacetModel;
import org.jboss.windup.rules.apps.maven.model.MavenFacetModel;
import org.jboss.windup.graph.model.resource.XmlResourceModel;

public interface MavenFacetDao extends BaseDao<MavenFacetModel> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jboss.windup.graph.dao;

import org.jboss.windup.graph.model.meta.xml.WebConfigurationFacetModel;
import org.jboss.windup.rules.apps.web.model.WebConfigurationFacetModel;
import org.jboss.windup.graph.model.resource.XmlResourceModel;

public interface WebConfigurationDao extends BaseDao<WebConfigurationFacetModel> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.inject.Singleton;

import org.jboss.windup.graph.dao.MavenFacetDao;
import org.jboss.windup.graph.model.meta.xml.MavenFacetModel;
import org.jboss.windup.rules.apps.maven.model.MavenFacetModel;
import org.jboss.windup.graph.model.resource.XmlResourceModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.inject.Singleton;

import org.jboss.windup.graph.dao.WebConfigurationDao;
import org.jboss.windup.graph.model.meta.xml.WebConfigurationFacetModel;
import org.jboss.windup.rules.apps.web.model.WebConfigurationFacetModel;
import org.jboss.windup.graph.model.resource.XmlResourceModel;

import com.thinkaurelius.titan.core.attribute.Text;
Expand Down
6 changes: 5 additions & 1 deletion reporting/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-sail-api</artifactId>
<version>2.7.10</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints-graph-sail</artifactId>
<version>2.5.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.jboss.windup.reporting.renderer;

import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.oupls.sail.pg.PropertyGraphSail;
import info.aduna.iteration.CloseableIteration;

import java.io.File;
import java.io.FileOutputStream;

import javax.inject.Inject;

import org.jboss.windup.graph.GraphContext;
import org.jboss.windup.reporting.renderer.api.GraphRDFRenderer;
import org.openrdf.model.Namespace;
import org.openrdf.model.Statement;
import org.openrdf.rio.RDFFormat;
Expand All @@ -19,8 +19,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.oupls.sail.pg.PropertyGraphSail;

public class GraphRDFRendererImpl implements GraphRDFRenderer
{
Expand All @@ -43,52 +41,39 @@ public void renderRDF(File outputFile)
writer.startRDF();

SailConnection sc = null;
try
{
try {
sc = sail.getConnection();
CloseableIteration<? extends Namespace, SailException> n = sc.getNamespaces();
try
{
while (n.hasNext())
{
try {
while (n.hasNext()) {
Namespace ns = n.next();
writer.handleNamespace(ns.getPrefix(), ns.getName());
}
}
finally
{
finally {
n.close();
}

CloseableIteration<? extends Statement, SailException> i = sc.getStatements(null, null, null, false);
try
{
while (i.hasNext())
{
try {
while (i.hasNext()) {
Statement stmt = i.next();
if (stmt.getSubject() != null && stmt.getPredicate() != null && stmt.getObject() != null)
{
writer.handleStatement(stmt);
}
}
}
finally
{
finally {
i.close();
}
}
finally
{
finally {
if (sc != null)
{
sc.close();
}
}

writer.endRDF();
}
catch (Exception e)
{
catch (Exception e) {
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.jboss.windup.graph.model.meta.xml;
package org.jboss.windup.rules.apps.web.model;

import org.jboss.windup.reporting.renderer.api.Label;

import com.tinkerpop.frames.Property;
import com.tinkerpop.frames.modules.typedgraph.TypeValue;
import org.jboss.windup.graph.model.meta.xml.XmlMetaFacetModel;


@TypeValue("WebFacet")
public interface WebConfigurationFacetModel extends XmlMetaFacetModel
Expand Down
8 changes: 8 additions & 0 deletions rules/app/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.windup.reporting</groupId>
<artifactId>windup-reporting</artifactId>
<version>${project.version}</version>
<classifier>forge-addon</classifier>
<scope>provided</scope>
</dependency>



<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.jboss.windup.graph.model.meta.xml;

import org.jboss.windup.reporting.renderer.api.Label;
package org.jboss.windup.rules.apps.maven.model;

import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.frames.Adjacency;
import com.tinkerpop.frames.Property;
import com.tinkerpop.frames.modules.typedgraph.TypeValue;
import org.jboss.windup.graph.model.meta.xml.XmlMetaFacetModel;
import org.jboss.windup.reporting.renderer.api.Label;


@TypeValue("MavenFacet")
public interface MavenFacetModel extends XmlMetaFacetModel {
Expand Down
4 changes: 0 additions & 4 deletions rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
-->
</modules>

<dependencies>

</dependencies>

</project>

0 comments on commit 68a3680

Please sign in to comment.