You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2019/01/04 18:57:57 UTC

[isis] 02/02: ISIS-1811: updates migration-notes for M2

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 6ef1d8f15624aa0f5ef840c9a1e2f48d90eeff7f
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 4 18:57:42 2019 +0000

    ISIS-1811: updates migration-notes for M2
    
    with TODOs of the stuff to be documented.
---
 .../guides/rgcfg/_rgcfg_deployment-types.adoc      |   2 +-
 migration-notes.adoc                               | 142 ++++++++++++++++++++-
 2 files changed, 142 insertions(+), 2 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/rgcfg/_rgcfg_deployment-types.adoc b/adocs/documentation/src/main/asciidoc/guides/rgcfg/_rgcfg_deployment-types.adoc
index 25b916d..bcbb88d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgcfg/_rgcfg_deployment-types.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgcfg/_rgcfg_deployment-types.adoc
@@ -9,7 +9,7 @@ TODO: v2: This is out of date.  Instead we set system property or environment va
 
 Apache Isis distinguishes between the application being run in development mode vs running in production mode.  The framework calls this the "deployment type" (corresponding internally to the `DeploymentType` class).
 
-(For mostly historical reasons) development mode is actually called `SERVER_PROTOTYPE`, while production mode is called just `SERVER`.  (There is also a deprecated mode called `SERVER_EXPLORATION`; for all intents and purposes this can considered as an alias of `SERVER_PROTOTYPE`).
+(For mostly historical reasons) development mode is actually called `SERVER_PROTOTYPE`, while production mode is called just `SERVER`.
 
 When running in development/prototyping mode, certain capabilities are enabled; most notably any actions restricted to prototyping mode (using xref:../rgant/rgant.adoc#_rgant-Action_restrictTo[`@Action#restrictTo()`]) will be available.
 
diff --git a/migration-notes.adoc b/migration-notes.adoc
index e3375e2..5780701 100644
--- a/migration-notes.adoc
+++ b/migration-notes.adoc
@@ -4,6 +4,140 @@ Search also for: "TODO: v2: " in the .adoc documentation.
 
 == Migration Notes 2.0.0-M1 to 2.0.0-M2
 
+=== Table Tree Viewer (ISIS-898)
+
+also: ISIS-1943,ISIS-1944,ISIS-1947
+
+needs documenting how to use.
+
+public API is:
+
+* `TreeAdapter`
+* `TreeNode` and `LazyTreeNode`
+* `TreePath`
+* `TreeNode`
+
+eg in `isis-2-demo`,
+
+
+implementation of `TreeAdapter`:
+
+[source,java]
+----
+public class FileSystemTreeAdapter implements TreeAdapter<FileNode> {
+
+	@Override
+	public Optional<FileNode> parentOf(FileNode value) {
+		if(value.getType()==FileNode.Type.FileSystemRoot) {
+			return Optional.empty();
+		}
+		val parentFolderIfAny = value.asFile().getParentFile();
+		if(parentFolderIfAny==null) {
+			return Optional.empty(); // unexpected code reach, but just in case
+		}
+		return Optional.ofNullable(parentFolderIfAny)
+				.map(FileNodeFactory::toFileNode);
+	}
+
+	@Override
+	public int childCountOf(FileNode value) {
+		return (int) streamChildFiles(value).count();
+	}
+
+	@Override
+	public Stream<FileNode> childrenOf(FileNode value) {
+		return streamChildFiles(value)
+				.map(FileNodeFactory::toFileNode);
+	}
+
+	// -- HELPER
+	private static Stream<File> streamChildFiles(FileNode value){
+		val file = value.asFile();
+		val childFiles = file.listFiles();
+		if(childFiles==null) {
+			return Stream.empty();
+		}
+		return Stream.of(childFiles)
+				.filter(f->!f.isHidden());
+	}
+}
+----
+
+where `FileNode` doesn't, actually, need to implement `TreeNode`, it's just a regular view model:
+
+[source,java]
+----
+@XmlRootElement(name="FileNode")
+@DomainObject(nature=Nature.VIEW_MODEL)
+@ToString
+public class FileNode {
+
+	public static enum Type {
+		FileSystemRoot,
+		Folder,
+		File
+	}
+
+	@Getter @Setter protected String path;
+	@Getter @Setter protected Type type;
+
+	public String title() {
+		if(path==null) {
+			return null;
+		}
+		val file = asFile();
+		return file.getName().length()!=0 ? file.getName() : file.toString();
+	}
+
+	public String iconName() {
+		return type!=null ? type.name() : "";
+	}
+
+	// -- BREADCRUMB SUPPORT
+
+	@PropertyLayout(navigable=Navigable.PARENT, hidden=Where.EVERYWHERE)
+	public FileNode getParent() {
+	    val parentFile = asFile().getParentFile();
+	    return parentFile!=null ? FileNodeFactory.toFileNode(parentFile) : null;
+	}
+
+	// -- INIT
+
+	void init(File file) {
+		this.path = file.getAbsolutePath();
+		if(file.isDirectory()) {
+			type = isRoot(file) ? Type.FileSystemRoot : Type.Folder;
+		} else {
+			type = Type.File;
+		}
+	}
+
+	// -- HELPER
+
+	File asFile() {
+		return new File(path);
+	}
+
+	private static boolean isRoot(File file) {
+		return file.getParent()==null;
+	}
+}
+----
+
+
+=== isis-core-wrapper removed (ISIS-1838/1839)
+
+
+=== guice removed from applib and core (ISIS-1892)
+
+
+=== web.xml now much simpler (ISIS-1895)
+
+
+
+
+
+
 === @MemberGroupLayout was removed
 
 === Axon Eventbus Plugin
@@ -103,7 +237,7 @@ ObjectAdapter is no longer holding a reference to an ObjectSpecification for the
 ServicesInjector was removed. New interface ServiceInjector and ServiceRegistry redefined.
 //TODO work in progress with ISIS-2033
 
-=== JAXB XmlAdapters
+=== JAXB XmlAdapters (ISIS-1972)
 
 We do now provide JAXB XmlAdapters for Java built-in temporal types in 'applib': org.apache.isis.applib.adapters.JaxbAdapters
  
@@ -313,6 +447,8 @@ _@PostConstuct_ methods declared with domain objects no longer get passed over t
 
 === Wicket-Viewer
 
+==== custom theme providers (ISIS-2047)
+
 Customize the ThemeChooser by providing your own implementation of IsisWicketThemeSupport
 
 [source,java]
@@ -328,6 +464,10 @@ to be configured using
 isis.viewer.wicket.themes.provider=org.my.IsisWicketThemeSupport
 ----
 
+=== Removed o.a.i.WebServer (ISIS-2067)
+
+might need to reinstate, or long-term will have SpringBoot etc do the bootstrapping.
+
 
 == Migration Notes 1.x to 2.0.0-M1