I've been following the guide here where it gives an example of an editor using a ViewModel.
I'm looking to change this so that instead of a single editor that is rebound to each domain object for editing, instead each object will bring up its own separate editor.
I want to keep using the ViewModels as I like the separation they provide and the API they have (easy rollback / saving).
How should I handle opening an editor per domain object (especially in a TornadoFX way)?
The solution is to create a new scope for the new editor and inserting the relevant models into that new scope. If you're using the Workspace, this is done using built in functions like dockInNewScope:
workspace.dockInNewScope<MyEditor>(myModel1, myModel2, etc)
If you're not using Workspace, you can create a new scope manually, put models into it and lookup views in the new scope as well:
val newScope = Scope(myModel1, myModel2)
find<MyEditor>(newScope).openWindow()
MyEditor will in this instance see myModel and myModel2 in it's scope, so that it can inject them.
Related
I created a new extension "lecturers" with the TYPO3 Extension Builder (v.10.0.1).
As default actions, I added list, show and create. After creating the extension, I did not modify any of the files except the list template.
Usually, I add new data within the BE, as it can be seen in the image:
But when I open the list view, no data is shown. Also, the repository is empty (<f:debug>{lecturers}</f:debug>.
However, when I added a record within the create view, the repository as well as the list view includes that one record.
Does anyone know which lines of code I am missing, to include the BE records in my repository as well? Thank you for your help!
After removing the setting of persistence in the generated folder TypoScript/setup.typoscript it worked
I've been developing a new Vue project to control the connected devices from one point, I've been working on an admin template and it's all good but there is something that I want to learn and implement to this application.
Let's say I want to change the whole frontend template (the admin template that I'm using now) and use a new design, how can I implement the whole existing application to a new template? For example, when you start creating a Wordpress page, it gives you different templates and you choose some of them and start designing the website... Maybe after six months you want to change that design and you simply click and switch to a new template and all the existing content will be migrated to the new template. That is exactly what I want to do with Vuejs.
I have to do this project, which I prepared with the existing theme, dynamically, as if I will pass it to another theme in the future. When switching my existing project to a new theme, instead of copying all the components and their related scripts, I want to be able to switch just like in Wordpress by simply throwing the theme file into the project. How can I add this functionality to the project?
It is possible to define pagination on document library?
I have a document library with more that 10000 documents... when I open the library occurs an timeout.
Actually SenseNet already does this! They just don't deliver it in the standard list control. If you open up the PRC and navigate to /Root/IMS/BuiltIn/Portal you'll see a list control with paging. The code can be found at /Root/Global/renderers/UserExploreGrid.ascx as User Control portlet. You can copy the code and change it to meet your needs.
Our company prefers to create User Control portlets and use Datatables with calls to the SenseNet OData API using skip and top to deliver pages.
Finally, given that SenseNet Content is stored as a tree structure (in SQL!), you can move the Content after creation so that data is organized hierarchically. A common solution is to take the first letter of the DisplayName and create a sub-folder from that letter, thereby reducing the number of items at a single node.
Here's what the paging looks like:
The short answer is no. Right now there isn't a built in functionality for that.
The long answer is that you can make a pagination yourself. One of the core member of sensenet made a grid where you can use pagination. It won't work with the current free to use releases because they lack the js files she used. But the idea behind it, is using a custom view. Which you can achieve by adding a system folder named Views under a the Document library and adding your custom view there.
You can use this grid for Explore, just follow these steps:
Go to the Explore action page, and switch editor mode on the PRC.
Place a ClientContext portlet (this can find under the Portlets->Application section in the portlet picker dialog) to the Wide column. Set portlet (client context porlet) properties, Apparance to None. It is a technical portlet, which allow get the CurrentContext in javascript. This is a very important element to work with this grid. The Grid use the client context.
Place a UserControlPortlet (In the portlet picker, Portlets->Application section) to the Wide Column.
Set portlet properties:
4.1. Portlet title: <%$ Resources: PortletTitles, Items%>
4.2. User Control path: /Root/Global/renderers/UserExploreGrid.ascx
Checkin Page modification on the PRC.
Enjoy your pageable explore portlet.
Keep in mind that this grid is specifically designed for users, so they will miss actions in the top menu. These must be handwritten. Then I suggest you copy the UserControl ( /Root/Global/renderers/UserExploreGrid.ascx)
and then put the action list on it . You can read more info about action list here: http://wiki.sensenet.com/ActionList
Br,
maros
In IBM Content Navigator, The "Check In" dialogue contains a Properties Pane, that in turn contains a Class Selector drop down box.
ClassSelector image
I want to keep the check-in functionality, but would like to have that Class Selector box not appear (There is no use case where a user would need to change the document class).
What would be the proper way to achieve this?
Is there a way to extend the ecm/widget/CheckInDialogue.js file AND make the default checkIn action use my new js?
Do I need to create a brand new checkIn action that references a new js?
Do I just change the ICN shipped js/html?
Just to clarify, I do know how to create a plugin, and how to create a js extension to the checkinDialogue.js, and how to remove the classSelector; however I don't know how to make the checkin action use my new script, or the best way to accomplish this.
Thanks!
Before answering your question, I would like to say that I think there is other options to do this without customizing ICN. The two easiest I can see would be:
Use entry templates, that way class selector will be disable on check in by default
Remove the privChangeClass privilege, that should hide the Class Selector (might be difficult if you want to leave full priv.)
Now if you want to hide it without using entry templates or privileges.
Yes, extend the ecm.widget.layout.CommonActionHandler and overwrite the actionCheckIn function and use your CheckInDialog instead of the default one. Then use your CommonActionHandler instead of the default one in your desktop. I don't think there is a way to change the ActionHandler from the admin desktop UI yet (if I missed it please let me know), although it's loaded by the client on the _loadDesktop function and set by the appearance tab but the value is hard-coded, so you might have to inject it after the load of better, call ecm.model.desktop.setActionHander(actionhandler) where actionhandler is the instance, not the class name (string) in a plugin.
You can, this will make things easier to manage if you have several desktops and you want some to use your new Check In dialog and some not.
No, that's a terrible idea :) Future upgrade of ICN and your code will be a nightmare and the delivery process a lot more complex than a simple configuration trick or ICN plug-in, that's what plug-ins are for.
Also a not so clean but really simple solution would be to aspect after the CheckInDialog.prototype on the postCreate function and do a domStyle.set(this.addContentItemPropertiesPane._contentClassSelectorDiv, "display", "none"); to just hide it on all CheckInDialogs.
I have one doubt that where to write ViewModel class in MVC4. I could see that there is two folder called Models and ViewModel. In case of writing parentmodel and viewmodel class, under which folder i have to write it.
My suggestion is to create a ViewModels folder and keep all view-models in it by creating hierarchy same as your Views folder in it.
Like suppose you have Index.cshtml and About.cshtml in
View -> Home
folder, then put the view-models defined for Index and About in
ViewModels -> Home -> IndexViewModel.cs
and
ViewModels -> Home -> AboutViewModel.cs
This helps to keep code separation in development.
I hope you got an idea. Thank you.
Ultimately its up to preference. Im quite new to MVC but i like to keep my models and ViewModels in one place (if its not a huge project!) that way the file paths are similar and easier to keep a track of. If it's a view model i just like to put ViewModel at the end of the name. For e.g:
UserViewModel.cs / UserVM.cs (your view models)
User.cs(just a regular model)
If it's a big project where you have lots of both, it's quite acceptable to put them all in a different project all together, again keeping your file paths accessible.