Is that possible to update the component during workflow process? - tridion

I want to update metadata of the component during the component is in workflow process using core service. Is that possible?
I understand that when the item is in workflow process, that item is locked.

When an item is in workflow, the an activity can be started by members of the group to which that activity belongs. Only the user to whom the item is assigned can then update the content. That implies that if your code is running as the user who started the activity, you can update the item from the code.
Edited to reflect Nuno's comment about only the assigned user being able to update content.

Related

Why firebase calls child_added event on loading?

Everytime I load my list of items I realized that the child_added event is called, but why? Wasn't this event supposed to be called only when a new child is added to the database?
From https://firebase.google.com/docs/database/admin/retrieve-data#child-added
child_added is triggered once for each existing child and then again every time a new child is added to the specified path.
To get around it, there are already several posts that answer that:
Firebase child_added only get child added
How to separate initial data load from incremental children with Firebase?
how to discard initial data in a Firebase DB
A child added listener will always be invoked for all existing children under a node when the listener is first added. Then as new children are added, the listener will continue to get invoked. This is the expected behavior. It allows your code to stay in sync with the entire contents of that node at all time.
If you want to listen to only children that are recently added, you will have to come up with a query that involves looking at a timestamp field in each child to figure out if it's of interest to your code.
Because (in my opinion) it is handy way of populating lists, you can use only add or delete events and stop using load as such.
Suppose you have list of something in ios or android. What you need is:
load it some time at the beginning - you can use add event, firebase will call it so many times as the number of items in node (list);
react on adding new items from another device - again, add event will be called and you will populate the new item into your list;
delete (same as add).

react todos tutorial props vs state

So I'm in the beginning stages of learning Meteor and React and I just completed the tutorial on making a Todos list.
In the implementation we have a checkbox at the top that allows us to toggle between completed tasks and all tasks. This is set as a state.
There are also check boxes next to each task that can display a task as complete or not complete.
My question is, both of these check-boxes change in real time, yet only the former is designated as a state variable? Why is the task checkbox a prop?
The global checkbox is just linked to the state of the App component.
It gets more complex with the local checkbox of each Task component. The problem is that theApp component needs a global knowledge of all Task objects, e.g. to hide completed tasks.
Task components could hold the checkbox state, but it is not the way React works. In React, a parent component usually does not read the state of its children, but instead holds the state itself and passes relevant information the its children so that they can render it.
When a child needs to update some state, it does at the global level (see toggleChecked and deleteThisTask in the tutorial), so that its parent gets notified and rerenders the child. See here for another example.
Good explanation here (full version)

Possible ways to refresh tableview in Javafx

The one in the picture is what i need , whenever I press sell button the quatity in the backgroud tableview column should change What makes tableview refreshed automatically detecting the change in database value without running the program from scratch.
you attached an observableList to the Tableview, so it inmediatly detects any change and update the view. So, the thing here is you have to maintain updated your observableList, you should find a way to detects change in you database. If you database is only modified for you application this should not be a hard task to complete, on the other hand, if it's modified for another system I suppossed you have to maintain the list consulting the database every often.

How can I publish a reactive boolean flag only?

My webapp allows its users to interact with items. These items can be put in the trash bin, and thus be removed from regular items. I have a dedicated sub-menu called "trash bin" where users can recycle or delete the items previously put in the trash bin.
I want to conditionally display the trash bin menu, only if there are items in the trash bin depending on the user rights.
However, I don't want to publish the items in the trash bin before the user goes to the trash bin sub-menu.
What I currently do is calling a method which returns a flag (is there or not items in the user trash bin?). But this is not reactive: if another user trash an item, the sub-menu will only appear once the page has been reloaded.
How can I publish a reactive boolean flag?
I considered using one cursor.Observe() per menu/user and notify the creation (via update) or deletion (via remove) of an item using a publication.changed() on a fake published collection with one item (with one boolean field) but it seems overkill considering the resources used for the task.
I also considered updating a dedicated field in every user profile when an item status change. Here again, this is too much operations for a simple feature: I would need to assess every user right for each operation involving an item status change, and each time a user rights change, re-assess his right to recycle every item.
The less consuming alternative would be to wrap my method call in the menu template.Autorun(). However, this is not a reactive solution since it triggers only when the menu is re-rendered.
Have you faced the same kind of issue? Do you have a possible alternative solution in mind (performance-wise)?
Create a new collection, ex: TrashBinState that contains a document with the (presumably shared) state of your trash bin
Update that document server-side whenever an item is trashed
Publish it
Have every client subscribe to that publication

Tridion 2011: How to sort user list on publishing queue?

On Tridion 2011 SP1 HR1 publishing queue, I see user list is not sorted.
Is there a way to sort the user list or should I raise a ticket for a hot-fix?
Update:
To be more clear.
On Filter Publishing Task options --> User Dropdown, currently sorting is done based on User Title by default.
As a user, it's not appearing as sorted.
So, I'm looking for sorting the User Dropdown based on User Description.
Please suggest How can I achieve this.
Sort users in User dropdown on Publishing Queue popup could be achieved by creating new custom extension.
You add new js file to Publishing Queue popup group where you can overwrite Tridion.Cme.Views.PublishQueue.USER_DROPDOWN_HEAD_PATH property. It should point to Dropdown xml definition file. You'll need to create your own Dropdown xml definition file (by copying existing WebUI/Editors/CME/Xml/ListDefinitions/PublishQueueUserDropdown-head.xml) and add new node /list:listDefinition/list:rows/list:defaultSortField with value #Description.
On 2011 SP1 the user dropdown in the Filter Publishing Tasks options is sorted alphabetically by the username (User Title). And if you select "all", then in the Publishing Tasks list you can sort the task by username by clicking on the column heading. There is also a little funnel icon where you can filter further.
I am pretty sure this is by-design, so there will most likely not be a hotfix for this. You can submit an idea to have this feature implemented in one of the next releases via the Ideas site on sdltridionworld, or build a custom gui extension to do specifically what you need.

Resources