MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

MonoX Knowledgebase/File Manager?  (Mono Support )

Viewed 46374 time(s), 17 post(s) 3/29/2012 1:27:24 PMby erin0201

Related topics

erin0201

erin0201

3/29/2012 1:27:24 PM
Hi!

I was wondering if anyone could point me in the right direction for developing a knowledgebase type of web part.
I would like to create basically something where you have on the left a tree type of link/list of files in a folder, you can click on one and it displays in the column on the right. The display gives you the options to edit the content without actually editing the web part itself. It would also allow you to add a new file/link to the list.

I've seen these types of things around. I have hosting at home through imhosted and this is what they have called their "file manager". There is a tree view of all of the files in a pane on the left which looks a lot like a Windows Explorer window and then when you click on something you can view the source or content in a pane on the right handside. If you click preview it takes you to another page to see the actual design. You can also add files, move files around, edit files in the browser etc.

Has anyone developed anything like this? I've played around with the news and discussion board web parts and also with the file management web part, but nothing really has all the features I'm looking for on their own. At least not at first glance. Maybe I'm just not sure how to customize it?

Thanks for your help!
Erin0201
This content has not been rated yet. 
453 Reputation 61 Total posts
shawndg

shawndg

3/29/2012 3:08:03 PM
Hi Erin,

I build something like this with native .net ..

And first let me say this..
If you trying to build a hierarchy..
http://www.dotnetperls.com/recursion

You will need that.. a function like that to build your folder list.

I connected myn to a database and had the ability to right click and add folders and objects..
But the core of the process was recursive function to load the folder hierarchy from the database.

Then as far as adding MonoX..
Your going to need to code a custom web part.. well dont tech need too but I would..
and then treeview .. i had some problems getting this to work originally with MonoX some time ago that since then I think was fixed if not im sure the post is somewhere on the forums to how to get it to work.

But use a Tree view to handle the folder display, will work nice and allow you to add your own objects under the folders.
You may want to even look into whats available in Jquery.

I also would use two asp.net update panels.
One to display the folders/objects, and one to display the content when clicking on the folders/objects.

Hope that helps point you in the right direction..


I just grabbed some old sample code i wrote to do the database functions..
only to be used as ref.. no way it will compile but it will point you in the right direction to how to store a hiarchy structure inside the database..

        public void GetCategory()
        {
            QueryTreeView.Nodes.Clear();
 
            DataSet PrSet = PDataset("SELECT Q_CATEGORY_ID, Q_PARENT_ID, Q_CATEGORY_NAME FROM Categories ORDER BY Q_PARENT_ID");
 
            foreach (DataRow dr in PrSet.Tables[0].Rows)
            {
 
                if ((int)dr["Q_PARENT_ID"] == 0)
                {
                    TreeNode tnParent = new TreeNode();
                    tnParent.Text = dr["Q_CATEGORY_NAME"].ToString();
                    tnParent.Name = dr["Q_CATEGORY_ID"].ToString();
 
                    //Cmd is asigned to the node tag.
                    tnParent.Tag = QuerysMenuCmd.CategorySelect;
 
                    tnParent.Collapse();
 
                    //GET ALL QUERYS
                    DataContext MyDataContext = new DataContext(GConnectionString);
                    DataTable MyDataTable = new DataTable();
                    MyDataTable = MyDataContext.GetCategoryQuery(dr["Q_CATEGORY_ID"]);
 
                    foreach (DataRow Item in MyDataTable.Rows)
                    {
                        TreeNode MyNode = new TreeNode();
                        MyNode.Name = Item["QUERY_ID"].ToString();
                        MyNode.Text = Item["QUERY_NAME"].ToString();
 
                        //Cmd is asigned to the node tag.
                        MyNode.Tag = QuerysMenuCmd.OpenQuery;
                        MyNode.StateImageIndex = 1;
 
                        tnParent.Nodes.Add(MyNode);
                    }
 
 
                    QueryTreeView.Nodes.Add(tnParent);
 
                    FillChild(tnParent, dr["Q_CATEGORY_ID"].ToString());
                }
            }
 
        }
 
        public void SelectCategory(int CategoryId)
        {
            QueryTreeView.SelectedNode = GetNode(CategoryId, QueryTreeView.Nodes);
            QueryTreeView.Select();
        }
 
 
        public int FillChild(TreeNode parent, string CategoryId)
        {
 
            DataSet ds = PDataset("SELECT Q_CATEGORY_ID, Q_PARENT_ID, Q_CATEGORY_NAME FROM  Categories WHERE Q_PARENT_ID =" + CategoryId);
 
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    TreeNode child = new TreeNode();
                    child.Text = dr["Q_CATEGORY_NAME"].ToString().Trim();
                    child.Name = dr["Q_CATEGORY_ID"].ToString().Trim();
 
                    //cmd is asigned to node tag
                    child.Tag = QuerysMenuCmd.CategorySelect;
                    child.Collapse();
 
                    //GET ALL QUERYS
                    DataContext MyDataContext = new DataContext(GConnectionString);
                    DataTable MyDataTable = new DataTable();
                    MyDataTable = MyDataContext.GetCategoryQuery(dr["Q_CATEGORY_ID"]);
 
                    foreach (DataRow Item in MyDataTable.Rows)
                    {
                        TreeNode MyNode = new TreeNode();
                        MyNode.Name = Item["QUERY_ID"].ToString();
                        MyNode.Text = Item["QUERY_NAME"].ToString();
                        //cmd is asigned to node tag
                        MyNode.Tag = QuerysMenuCmd.OpenQuery;
                        MyNode.StateImageIndex = 1;
 
                        child.Nodes.Add(MyNode);
                    }
 
 
                    parent.Nodes.Add(child);
                    FillChild(child, dr["Q_CATEGORY_ID"].ToString());
                }
                return 0;
            }
            else
            {
                return 0;
            }
 
        }
 
        private TreeNode GetNode(string MyName, TreeNodeCollection parentCollection)
{
 
    TreeNode ret = null;
    TreeNode child = default(TreeNode);
 
    //step through the parentcollection
    foreach ( child in parentCollection) {
        if (child.Name == MyName) {
            ret = child;
        // if there is child items then call this function recursively
        } else if (child.GetNodeCount(false) > 0) {
            ret = GetNode(MyName, child.Nodes);
        }
 
        if ((ret != null))
            break; // TODO: might not be correct. Was : Exit For
        //if something was found, exit out of the for loop
 
    }
 
    return ret;
 
}
This content has not been rated yet. 
1871 Reputation 252 Total posts
denis

denis

3/29/2012 8:01:41 PM
There are quite a few places in MonoX where such interface is used - backend file management, page management, news management. It would be a bit difficult to implement everything from scratch, but there are plenty of ready-to-use treeview ASP.NET controls (MonoX uses Telerik's TreeView in the backend). It is easy to bind hierarchical data structures to such controls. Everything else should be a relatively straightforward ASP.NET work.
This content has not been rated yet. 
7207 Reputation 956 Total posts
erin0201

erin0201

3/30/2012 2:10:30 PM
Is there a way that I can implement what is used for backend file management at a user level for a specifc folder and set of files? Maybe a tutorial on how to bind a treeview control to a certain folder hierarchy and how to get the options of upload/download/open on it? I've found a few solutions out there that allow you to use a file management tree view with folders and to edit text files within the browser, however I'm not sure how I would bind the user authentication control from MonoX to them.

If there was a way to use the backend file management type of solution already in MonoX to bind to a specific folder/file list and then a way to have an "edit file" feature where general text files could be opened inside of one of Monox's built in editors that would be perfect! I'm just not that sure how to start or if the editing on text files can even be done that way with what Monox currently has.

Thanks again for your suggestions!
This content has not been rated yet. 
453 Reputation 61 Total posts
denis

denis

3/30/2012 7:09:39 PM
There is no direct way to pass the specific folder to the file management tool, or to allow users to edit a selected file. I will talk with our developers to see if somebody could compile a small sample on how to implement your own page, since that particular page is not too complicated.
This content has not been rated yet. 
7207 Reputation 956 Total posts
erin0201

erin0201

3/30/2012 7:31:45 PM
That would be perfect!!

Thanks for your help Denis and have a great weekend!
Erin
This content has not been rated yet. 
453 Reputation 61 Total posts
erin0201

erin0201

4/3/2012 1:30:32 PM
I have found an ASP.NET file manager that I think I want to use. However, part of the installation asks you to create a virtual directory in IIS for the filemanager folder. I did that and I'm not getting a MonoX url rewriter error from Monox's config file.
Here is the file manager I'm using:
http://aspnetpower.com/filemanager/?module=installation

The FileManager folder is at root like they instruct. I created a virtual directory called fileman that points to that folder.
When I try to go to the link colintranetcms (which is my current monox link) and go to http://colintranetcms/fileman

I get the following ASP.NET error:

Server Error in '/fileman' Application.
Configuration Error

Description: An error occurred during the processing
of a configuration file required to service this request. Please review
the specific error details below and modify your configuration file
appropriately.

Parser Error Message: Could not load file or
assembly 'MonoSoftware.UrlRewriter' or one of its dependencies. The
system cannot find the file specified.
(D:\colintraCMS\Intranet\MonoXCMS\web.config line 459)


Source Error:

Line 457: <httpRuntime maxRequestLength="1550000" enableVersionHeader="false" />
Line 458: <httpModules>
Line 459: <add type="MonoSoftware.UrlRewriter.RewriterHttpModule, MonoSoftware.UrlRewriter" name="UrlRewriter" />
Line 460: <add name="CompressionModule" type="MonoSoftware.Web.WAO.HttpCompress.HttpCompressModule, MonoSoftware.Web.WAO" />
Line 461: <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />


Source File: D:\colintraCMS\Intranet\MonoXCMS\web.config Line: 459

Do I just need to register the file manager's default page in monox?
This content has not been rated yet. 
453 Reputation 61 Total posts
denis

denis

4/3/2012 2:24:55 PM
Hi Erin,
This is a standard ASP.NET scenario: if you have handlers or modules configured in the root web.config file, you either have to copy the assemblies (DLL files) they reference to the bin folder of your new sub-application, OR to remove such handlers/modules from the web.config of your sub-application (instead of add name... you would have to use remove name=...)
This content has not been rated yet. 
7207 Reputation 956 Total posts
erin0201

erin0201

4/4/2012 1:47:28 PM
Thanks Denis! That fixed it.

I have another question for you. I was playing with the web parts for a news menu and a customizable news section so that the menu would allow me to create categories and then I could narrow down which news articles or in my case support articles are viewable.

However, I created a user group for those allowed to view the parts and put some users into it and when the user logs in, they can see the page which works just fine, and they aren't allowed to edit the web parts on the page, BUT they still see the little "edit" thing pop up in the upper right of a part when they hover over in that area. They just can't click anything into it to be able to edit the part. The part titles are also showing. Is there anyway to hide the part titles and to hide the little "edit" part thing from popping up in the upper right when they mouseover the area?

I'm still experimenting as to whether the news web parts would be better for us to create a knowledgebase or if we just want to use a straight forward file management technique. The new module thing might work for the IT department's knowledgebase and the file manager for the users to keep SOPs and other technical documents. However, for the IT department, there are several that aren't web developers and I would rather they not see the web part titles or the web part "edit" thing pop up when they view the page.
This content has not been rated yet. 
453 Reputation 61 Total posts
erin0201

erin0201

4/4/2012 2:04:23 PM
I also can't seem to get it to display the document name instead of the thumbnail, or even underneath the thumbnail or something. In order to see the document name you have to hover over it. Is there any way to get it to display the files in a list with their names, or does it have to display it by thumbnails?
This content has not been rated yet. 
453 Reputation 61 Total posts
1 2