Skip to content
Browse files

ROOFLEX-46 - Bring Roo Flex Addon compatibility up to Roo 1.1.4

  • Loading branch information...
1 parent 4e416dc commit 51482d521c72595cccd366d6bd7347b8f79b4b91 @mteodori committed Aug 9, 2011
View
2 org.springframework.flex.roo.addon/pom.xml
@@ -437,7 +437,7 @@
</build>
<properties>
- <roo.version>1.1.2.RELEASE</roo.version>
+ <roo.version>1.1.5.RELEASE</roo.version>
</properties>
</project>
View
17 ...k.flex.roo.addon/src/main/java/org/springframework/flex/roo/addon/FlexOperationsImpl.java
@@ -19,7 +19,6 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStreamWriter;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.ArrayList;
@@ -329,12 +328,10 @@ private void updateDependencies() {
// ultimately should be fixed in Roo itself
private void fixBrokenFlexDependency() {
String pomPath = getPathResolver().getIdentifier(Path.ROOT, "pom.xml");
- MutableFile pomMutableFile = null;
Document pomDoc;
try {
- pomMutableFile = this.fileManager.updateFile(pomPath);
- pomDoc = XmlUtils.getDocumentBuilder().parse(pomMutableFile.getInputStream());
+ pomDoc = XmlUtils.getDocumentBuilder().parse(this.fileManager.getInputStream(pomPath));
} catch (Exception e) {
throw new IllegalStateException(e);
}
@@ -346,10 +343,10 @@ private void fixBrokenFlexDependency() {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
XmlUtils.writeXml(XmlUtils.createIndentingTransformer(), byteArrayOutputStream, pomDoc);
- String mxmlContent = byteArrayOutputStream.toString();
+ String pomContent = byteArrayOutputStream.toString();
try {
- FileCopyUtils.copy(mxmlContent, new OutputStreamWriter(pomMutableFile.getOutputStream()));
+ this.fileManager.createOrUpdateTextFileIfRequired(pomPath, pomContent, false);
} catch (Exception e) {
throw new IllegalStateException(e);
}
@@ -361,12 +358,10 @@ private void fixBrokenFlexDependency() {
// itself
private void fixBrokenFlexPlugin() {
String pomPath = getPathResolver().getIdentifier(Path.ROOT, "pom.xml");
- MutableFile pomMutableFile = null;
Document pomDoc;
try {
- pomMutableFile = this.fileManager.updateFile(pomPath);
- pomDoc = XmlUtils.getDocumentBuilder().parse(pomMutableFile.getInputStream());
+ pomDoc = XmlUtils.getDocumentBuilder().parse(this.fileManager.getInputStream(pomPath));
} catch (Exception e) {
throw new IllegalStateException(e);
}
@@ -394,10 +389,10 @@ private void fixBrokenFlexPlugin() {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
XmlUtils.writeXml(XmlUtils.createIndentingTransformer(), byteArrayOutputStream, pomDoc);
- String mxmlContent = byteArrayOutputStream.toString();
+ String pomContent = byteArrayOutputStream.toString();
try {
- FileCopyUtils.copy(mxmlContent, new OutputStreamWriter(pomMutableFile.getOutputStream()));
+ this.fileManager.createOrUpdateTextFileIfRequired(pomPath, pomContent, false);
} catch (Exception e) {
throw new IllegalStateException(e);
}
View
7 ....addon/src/main/java/org/springframework/flex/roo/addon/FlexScaffoldMetadataProvider.java
@@ -17,10 +17,11 @@
package org.springframework.flex.roo.addon;
import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.osgi.service.component.ComponentContext;
import org.springframework.roo.addon.entity.EntityMetadata;
-import org.springframework.roo.addon.web.mvc.controller.details.WebMetadataUtils;
+import org.springframework.roo.addon.web.mvc.controller.details.WebMetadataService;
import org.springframework.roo.classpath.PhysicalTypeIdentifier;
import org.springframework.roo.classpath.PhysicalTypeMetadata;
import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails;
@@ -41,6 +42,8 @@
@Service
public class FlexScaffoldMetadataProvider extends AbstractItdMetadataProvider {
+ @Reference private WebMetadataService webMetadataService;
+
protected void activate(ComponentContext context) {
this.metadataDependencyRegistry.registerDependency(PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType());
addMetadataTrigger(new JavaType(RooFlexScaffold.class.getName()));
@@ -90,7 +93,7 @@ protected ItdTypeDetailsProvidingMetadataItem getMetadata(String metadataIdentif
MemberDetails entityMemberDetails = memberDetailsScanner.getMemberDetails(getClass().getName(), entityClassOrInterfaceDetails);
return new FlexScaffoldMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, annotationValues, entityMetadata,
- WebMetadataUtils.getDynamicFinderMethodsAndFields(entityType, entityMemberDetails, metadataService, metadataIdentificationString, metadataDependencyRegistry));
+ webMetadataService.getDynamicFinderMethodsAndFields(entityType, entityMemberDetails, metadataIdentificationString));
}
public String getItdUniquenessFilenameSuffix() {

0 comments on commit 51482d5

Please sign in to comment.
Something went wrong with that request. Please try again.