Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public class Node implements Externalizable {
private boolean propertiesPopulated;

private Object rawNodeData;

/**
* TODO
*/
public Node() {
super();
}

public Node(String nodeUri, String type) {
setNodeUri(nodeUri);
setType(type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*/
package org.flowerplatform.core.node.remote;

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;

import org.flowerplatform.core.CorePlugin;
import org.flowerplatform.core.RemoteMethodInvocationListener;
import org.flowerplatform.core.node.resource.ResourceService;
Expand All @@ -27,7 +31,7 @@
*/
public class ResourceServiceRemote {

public SubscriptionInfo subscribeToParentResource(String nodeUri) {
public SubscriptionInfo subscribeToParentResource(String nodeUri) {
String sessionId = CorePlugin.getInstance().getRequestThreadLocal().get().getSession().getId();
return CorePlugin.getInstance().getResourceService()
.subscribeToParentResource(sessionId, nodeUri, new ServiceContext<ResourceService>(CorePlugin.getInstance().getResourceService()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ public StylePropertyWrapper setIsDefaultAs(boolean isDefault) {
setIsDefault(isDefault);
return this;
}

public StylePropertyWrapper() {
super();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class SubscriptionInfo {

private String resourceSet;

public SubscriptionInfo() {
}

public SubscriptionInfo(Node rootNode) {
this(rootNode, null, null);
}
Expand Down
1 change: 0 additions & 1 deletion org.flowerplatform.flex_client.core/.flexLibProperties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<classEntry path="org.flowerplatform.flex_client.core.editor.action.UploadAction"/>
<classEntry path="org.flowerplatform.flex_client.core.editor.ui.UploadView"/>
<classEntry path="org.flowerplatform.flex_client.core.node.remote.ServiceContext"/>
<classEntry path="org.flowerplatform.flex_client.core.node.NodeRegistryManager"/>
<classEntry path="org.flowerplatform.flex_client.core.node_tree.NodeTree"/>
<classEntry path="org.flowerplatform.flex_client.core.node_tree.NodeTreeHierarchicalModelAdapter"/>
<classEntry path="org.flowerplatform.flex_client.core.node_tree.NodeTreeItemRenderer"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ package org.flowerplatform.flex_client.core {
import org.flowerplatform.flex_client.core.editor.remote.update.ChildrenUpdate;
import org.flowerplatform.flex_client.core.editor.remote.update.PropertyUpdate;
import org.flowerplatform.flex_client.core.editor.remote.update.Update;
import org.flowerplatform.flex_client.core.editor.resource.ResourceOperationsManager;
import org.flowerplatform.flex_client.core.editor.resource.ResourceOperationsHandler;
import org.flowerplatform.flex_client.core.editor.ui.AboutView;
import org.flowerplatform.flex_client.core.editor.ui.OpenNodeView;
import org.flowerplatform.flex_client.core.link.ILinkHandler;
import org.flowerplatform.flex_client.core.link.LinkView;
import org.flowerplatform.flex_client.core.node.IServiceInvocator;
import org.flowerplatform.flex_client.core.node.NodeRegistryManager;
import org.flowerplatform.flex_client.core.node.NodeExternalInvocator;
import org.flowerplatform.flex_client.core.node.controller.GenericValueProviderFromDescriptor;
import org.flowerplatform.flex_client.core.node.controller.ResourceDebugControllers;
import org.flowerplatform.flex_client.core.node.controller.TypeDescriptorRegistryDebugControllers;
Expand Down Expand Up @@ -118,8 +118,6 @@ package org.flowerplatform.flex_client.core {

public var globalMenuActionProvider:VectorActionProvider = new VectorActionProvider();

public var nodeRegistryManager:NodeRegistryManager;

public var lastUpdateTimestampOfServer:Number = -1;
public var lastUpdateTimestampOfClient:Number = -1;

Expand All @@ -140,8 +138,12 @@ package org.flowerplatform.flex_client.core {
return editorClassFactoryActionProvider;
}

public function get resourceNodesManager():ResourceOperationsManager {
return ResourceOperationsManager(nodeRegistryManager.resourceOperationsManager.resourceOperationsHandler);
public function get nodeRegistryManager():* {
return _nodeRegistryManager;
}

public function get resourceNodesManager():ResourceOperationsHandler {
return ResourceOperationsHandler(nodeRegistryManager.resourceOperationsManager.resourceOperationsHandler);
}

override public function preStart():void {
Expand All @@ -164,9 +166,9 @@ package org.flowerplatform.flex_client.core {
serviceLocator.addService("uploadService");
serviceLocator.addService("preferenceService");

var resourceOperationsHandler:ResourceOperationsManager = new ResourceOperationsManager();
nodeRegistryManager = new NodeRegistryManager(resourceOperationsHandler, IServiceInvocator(serviceLocator), resourceOperationsHandler);
var resourceOperationsHandler:ResourceOperationsHandler = new ResourceOperationsHandler();
_nodeRegistryManager = new NodeRegistryManager(resourceOperationsHandler, IServiceInvocator(serviceLocator), new NodeExternalInvocator());

updateTimer = new UpdateTimer(5000);

FlexUtilGlobals.getInstance().registerAction(RemoveNodeAction);
Expand Down Expand Up @@ -549,3 +551,7 @@ package org.flowerplatform.flex_client.core {

}
}

include "../../../../../../org.flowerplatform.js_client.core/WebContent/js/node_registry/ResourceOperationsManager.js";
include "../../../../../../org.flowerplatform.js_client.core/WebContent/js/node_registry/NodeRegistryManager.js";
include "../../../../../../org.flowerplatform.js_client.core/WebContent/js/node_registry/NodeRegistry.js";
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ package org.flowerplatform.flex_client.core.editor {
import spark.components.VGroup;

import org.flowerplatform.flex_client.core.CorePlugin;
import org.flowerplatform.flex_client.core.editor.action.NodeTypeActionProvider;
import org.flowerplatform.flex_client.core.editor.remote.Node;
import org.flowerplatform.flex_client.core.node.INodeRegistryManagerListener;
import org.flowerplatform.flex_client.core.node.NodeRegistry;
import org.flowerplatform.flexutil.FlexUtilGlobals;
import org.flowerplatform.flexutil.action.ComposedActionProvider;
import org.flowerplatform.flexutil.action.IAction;
Expand All @@ -49,7 +47,7 @@ package org.flowerplatform.flex_client.core.editor {

protected var _viewHost:IViewHost;

public var nodeRegistry:NodeRegistry;
public var nodeRegistry:*;

public function EditorFrontend() {
super();
Expand Down Expand Up @@ -120,14 +118,14 @@ package org.flowerplatform.flex_client.core.editor {
// nothing to do
}

public function nodeRegistryRemoved(nodeRegistry:NodeRegistry):void {
public function nodeRegistryRemoved(nodeRegistry:*):void {
if (this.nodeRegistry == nodeRegistry) {
var workbench:IWorkbench = FlexUtilGlobals.getInstance().workbench;
workbench.closeView(workbench.getViewComponentForEditor(this), true, false);
}
}

public function resourceNodeRemoved(resourceNodeUri:String, nodeRegistry:NodeRegistry):void {
public function resourceNodeRemoved(resourceNodeUri:String, nodeRegistry:*):void {
// do nothing
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.flowerplatform.flex_client.core.editor.remote.update {
import org.flowerplatform.flex_client.core.editor.remote.Node;
import org.flowerplatform.flex_client.core.node.NodeRegistry;

/**
* @author Cristina Constantinescu
Expand All @@ -29,7 +28,7 @@ package org.flowerplatform.flex_client.core.editor.remote.update {

public var timestamp:Number;

public function apply(nodeRegistry:NodeRegistry, node:Node):void {
public function apply(nodeRegistry:*, node:Node):void {
// do nothing
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@

protected function setAllSelected(value:Boolean):void {
for (var i:int = 0; i < resourceNodes.length; i++) {
var resourceNodeData:ResourceNode = ResourceNode(resourceNodes.getItemAt(i));
var resourceNodeData:Object = resourceNodes.getItemAt(i);
resourceNodeData.selected = value;
}
}

protected function yesButton_clickHandler(event:MouseEvent):void {
var invokedServerMethod:Boolean = false;
for (var i:int = 0; i < resourceNodes.length; i++) {
var resourceNodeData:ResourceNode = ResourceNode(resourceNodes.getItemAt(i));
var resourceNodeData:Object = resourceNodes.getItemAt(i);
if (resourceNodeData.selected) {
// invoke service method and wait for result to close the view
CorePlugin.getInstance().serviceLocator.invoke(serverMethodToInvokeForSelection, [resourceNodeData.resourceNodeId], function(data:Object):void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/* license-start
*
* Copyright (C) 2008 - 2013 Crispico Software, <http://www.crispico.com/>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details, at <http://www.gnu.org/licenses/>.
*
* license-end
*/
*
* Copyright (C) 2008 - 2013 Crispico Software, <http://www.crispico.com/>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details, at <http://www.gnu.org/licenses/>.
*
* license-end
*/
package org.flowerplatform.flex_client.core.editor.resource {
import mx.collections.ArrayList;
import mx.collections.IList;
Expand All @@ -23,35 +23,33 @@ package org.flowerplatform.flex_client.core.editor.resource {
import org.flowerplatform.flex_client.core.editor.action.ReloadAction;
import org.flowerplatform.flex_client.core.editor.action.SaveAction;
import org.flowerplatform.flex_client.core.editor.action.SaveAllAction;
import org.flowerplatform.flex_client.core.node.IExternalInvocator;
import org.flowerplatform.flex_client.core.node.IResourceOperationsHandler;
import org.flowerplatform.flex_client.resources.Resources;
import org.flowerplatform.flexutil.FlexUtilGlobals;
import org.flowerplatform.flexutil.layout.IWorkbench;
import org.flowerplatform.flexutil.layout.event.ActiveViewChangedEvent;
import org.flowerplatform.flexutil.layout.event.ViewsRemovedEvent;
import org.flowerplatform.flex_client.core.node.NodeRegistryManager;

/**
* @author Cristina Constantinescu
* @author Mariana Gheorghe
*/
public class ResourceOperationsManager implements IResourceOperationsHandler, IExternalInvocator {
public class ResourceOperationsHandler implements IResourceOperationsHandler {

public var saveAction:SaveAction = new SaveAction();
public var saveAllAction:SaveAllAction = new SaveAllAction();
public var reloadAction:ReloadAction = new ReloadAction();
private var _nodeRegistryManager:NodeRegistryManager;
public function get nodeRegistryManager():NodeRegistryManager {

private var _nodeRegistryManager:*;

public function get nodeRegistryManager():* {
return _nodeRegistryManager;
}

public function set nodeRegistryManager(value:NodeRegistryManager):void {
public function set nodeRegistryManager(value:*):void {
_nodeRegistryManager = value;
}

public function activeViewChangedHandler(evt:ActiveViewChangedEvent):void {
updateEditorFrontendActionsEnablement();
}
Expand Down Expand Up @@ -106,7 +104,7 @@ package org.flowerplatform.flex_client.core.editor.resource {
public function getResourceNodeLabel(resourceNodeId:String):String {
return resourceNodeId;
}

/**
* Don't remove editors immediately. If there are dirty editors, show save dialog.
*/
Expand All @@ -124,7 +122,7 @@ package org.flowerplatform.flex_client.core.editor.resource {
}
_nodeRegistryManager.resourceOperationsManager.showSaveDialog(nodeRegistries);
}


/**
* If at least one dirty resourceNode found, shows the save dialog, else closes the editors OR
Expand Down Expand Up @@ -156,7 +154,7 @@ package org.flowerplatform.flex_client.core.editor.resource {
public function showReloadDialog(nodeRegistries:Array = null, resourceSets:Array = null):void {
var resourceNodes:ArrayList = new ArrayList();
for each (var resourceSet:String in resourceSets) {
resourceNodes.addItem(new ResourceNode(resourceSet, true));
resourceNodes.addItem({resourceNodeId: resourceSet, selected:true});
}

var reloadView:ResourceNodesListView = new ResourceNodesListView();
Expand All @@ -178,22 +176,13 @@ package org.flowerplatform.flex_client.core.editor.resource {
.setHeight(small ? 150 : 300)
.show();
}

/**
* @return global dirty state for all open editors = saveAll action enablement.
*/
public function getGlobalDirtyState():Boolean {
return saveAllAction != null ? saveAllAction.enabled : false;
}

public function showMessageBox(text:String, title:String):void {
FlexUtilGlobals.getInstance().messageBoxFactory.createMessageBox()
.setText(text)
.setTitle(title)
.setWidth(300)
.setHeight(200)
.showMessageBox();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,17 @@

<fx:Script>
<![CDATA[
import mx.collections.IList;
import mx.core.UIComponent;
import mx.events.FlexEvent;

import org.flowerplatform.flex_client.core.CorePlugin;
import org.flowerplatform.flex_client.core.editor.EditorFrontend;
import org.flowerplatform.flex_client.core.editor.remote.Node;
import org.flowerplatform.flex_client.core.node.NodeRegistry;
import org.flowerplatform.flex_client.resources.Resources;
import org.flowerplatform.flexutil.FlexUtilAssets;
import org.flowerplatform.flexutil.FlexUtilGlobals;
import org.flowerplatform.flexutil.Utils;
import org.flowerplatform.flexutil.action.IAction;
import org.flowerplatform.flexutil.layout.IWorkbench;
import org.flowerplatform.flexutil.view_content_host.IViewHost;

private static const ZIP_EXTENSION:String = ".zip";

Expand Down Expand Up @@ -120,7 +116,7 @@
var activeComponent:UIComponent = workbench.getEditorFromViewComponent(workbench.getActiveView());

if (activeComponent is EditorFrontend) {
var nodeRegistry:NodeRegistry = EditorFrontend(activeComponent).nodeRegistry;
var nodeRegistry:* = EditorFrontend(activeComponent).nodeRegistry;
nodeRegistry.refresh(uploadLocationNode);
}

Expand Down
Loading