首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >datalist中的户外移动操作不起作用

datalist中的户外移动操作不起作用
EN

Stack Overflow用户
提问于 2015-04-11 21:19:20
回答 1查看 324关注 0票数 1

我需要通过添加一个移动操作来定制Alfresco datalist操作。我在下面的教程中重点介绍了这一点:https://github.com/share-extras/sdk-sample-datalist-action

步骤:

1-我通过向datagrid.get.config.xml文件添加以下行来覆盖该文件(位置: C:\Alfresco\tomcat\shared\classes\alfresco\web-extension\site-webscripts\org\alfresco\components\data-lists)

2-我将我的OnActionMoveTo实现添加到了位于C:\Alfresco\tomcat\webapps\share\components\data-lists中的actions.js和OnActionMoveTo -min.js文件中,下面是OnActionMoveTo的实现:

代码语言:javascript
复制
      /**
   * Move single document or folder.
   *
   * @method onActionMoveTo
   * @param p_items {object} Object literal representing the file or folder to be actioned
   */
  onActionMoveTo: function DataListActions_onActionMoveTo(pp_items)
  {
      var p_items = YAHOO.lang.isArray(pp_items) ? pp_items : [pp_items];

      console.log(p_items);
     this._copyMoveTo("move", p_items);
  },
  /**
   * Copy/Move To implementation.
   *
   * @method _copyMoveTo
   * @param mode {String} Operation mode: copy|move
   * @param p_items {object} Object literal representing the file or folder to be actioned
   * @private
   */
  _copyMoveTo: function DataListActions__copyMoveTo(mode, p_items)
  {
     // Check mode is an allowed one
     if (!mode in
        {
           copy: true,
           move: true
        })
     {
        throw new Error("'" + mode + "' is not a valid Copy/Move to mode.");
     }

     if (!this.modules.copyMoveTo)
     {
        this.modules.copyMoveTo = new Alfresco.module.DoclibCopyMoveTo(this.id + "-copyMoveTo");
     }

     var DLGF = Alfresco.module.DoclibGlobalFolder;

     var allowedViewModes =
     [
        DLGF.VIEW_MODE_RECENT_SITES,
        DLGF.VIEW_MODE_FAVOURITE_SITES,
        DLGF.VIEW_MODE_SITE,
        DLGF.VIEW_MODE_SHARED
     ];

     if (this.options.repositoryBrowsing === true)
     {
        //this block is not executed (verified by a console.log)
        allowedViewModes.push(DLGF.VIEW_MODE_REPOSITORY);
     }
     allowedViewModes.push(DLGF.VIEW_MODE_USERHOME)
     var zIndex = 0;
     if (this.fullscreen !== undefined && ( this.fullscreen.isWindowOnly || Dom.hasClass(this.id, 'alf-fullscreen')))
     {
        zIndex = 1000;
     }
     this.modules.copyMoveTo.setOptions(
     {
        allowedViewModes: allowedViewModes,
        mode: mode,
        siteId: this.options.siteId,
        containerId: this.options.containerId,
        path: this.currentPath, // this is printed as undefined in the console.log
        files: p_items,
        rootNode: this.options.rootNode, // this is printed as undefined in the console.log
        parentId: this.getParentNodeRef(p_items), // this is printed as undefined in the console.log
        zIndex: zIndex
     }).showDialog();
  },

当我单击datalist中的move链接时,将执行函数(OnActionMoveTo),但它没有显示用于移动项目的文件夹选取器。当我记录该函数时,我发现了以下内容:

代码语言:javascript
复制
path: this.currentPath, // this is printed as undefined in the console.log
files: p_items,
rootNode: this.options.rootNode, // this is printed as undefined in the console.log
parentId: this.getParentNodeRef(p_items), // this is printed as undefined in the console.log

有人能帮我解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2015-05-20 14:06:28

似乎还缺少几个组件。

如果您查看sample-action.js文件中的代码,您将注意到有一个对存储库webscript的调用,其中包含在repo端进行更改的实际逻辑,这在您的示例中是缺失的。检出此部件:

代码语言:javascript
复制
 webscript:
        {
           method: Alfresco.util.Ajax.POST,
           name: "duplicate/node/" + destinationNodeRef.uri
        },

用于在点击移动动作时显示弹出窗口的逻辑应该是客户端javascript的一部分。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29578330

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档