Sitecore - how to preview an unpublishable item - sitecore

I have a simple requirement to be able to setup and preview pages in advance. The pages are for publication on a particular day and are one-off publications. They must not be visible prior to publication.
How can I preview the item prior to publication without making anything public?
If I restrict the version (i.e. version 1) from being published, I still get a published page showing standard values i.e. version 0 of the item.
If I restrict the item from being published, I can no longer preview it. It seems that the preview function has a dependancy on the item being publishable.
Am I missing a trick here?
Update : I'm particularly interested in why I can't preview the item when the item is restricted, as this is possibly the most intuitive restriction a user can use.

You can set a date restriction on the version or the item.
Then go to the preview mode and use the date selector to select a different date.
When you select a date that falls within the publication date range, your item will be visible in the preview.
Update:
As you're particularly interested in previewing restricted items; it can be done if you setup a new site and point it to the master database instead of the usual web database.
This is explained in a blogpost by Mark Ursino.

As Rudd mentioned, my blog post explains how to do this. However, you can also setup a new workflow provider by Alex Shyba that allows for semi-final workflow states and thus allows publishing to them: Publish to pre-production web database. Part 2.

Related

Older Power-BI pbix using a SharePoint-Online list that has had new fields added

I have a Power-BI dashboard that was created some time ago. It’s data source is a SharePoint-Online list. Since the Power-BI dashboard was created, several new fields have been added to the SharePoint list. Now I am being asked to add a new page to the dashboard that reports on those new fields. However, I have not found a way to get the existing Power-BI list/dataset to show the new fields.
Refreshing the data does refresh the values, but refresh does not add the new fields.
I’ve spend the last 4 hours looking on the internet for a solution. The only thing I have been able to do so far is to attach the list again with a different name- the new fields DO show up when I do this. (I can’t just replace the older Power-BI list/dataset because there have been several calculated columns and measures added.)
I can work with this and create the report, but is this the only way? It doesn’t seem like it should be.
Any help would be appreciated! Thank you!
(I'm using Power BI April 2021 and Sharepoint Online)
So, it looks like there's no good answer to this issue. I found that adding another instance of the reference Sharepoint list, that included the new columns, did work (however inelegant). That seems to be the best direct answer for times when the older pbix file must continue to be used.
What I ended up doing, though, was to create a new separate pbix file which included the latest version of the Sharepoint List. This was the best solution for my organization since it will allow us to be more focused on the specific manufacturing processes involved.
Thanks to #Jon and #Alejandro for their efforts to help!
If you have access to PowerAutomate you could refresh the dataset creating a flow so that given a certain time (say, once or twice a day) the dataset gets refreshed with the new created items.
Otherwise if you are working with the service version of Power BI you can program a refresh of the dataset directly from the workspace going to the settings of the dataset. You would have to have a gateway set for that which could be in personal mode or not.
Also if you want to update the data in the service version you could do it manually too in the workspace.

How to send report directly to the printer?

I am using Apex 18.2. and ORDS as a printing server.
I have a master-detail page for selling items with a form on a table as the master region and an IG as the detail, joined to each other through assigning the PK to the FK IG's column.
There is another page with a report that can be queried through number of page items to get the documents with items sold in the previously mentioned master-detail page.
Whenever a user creates a document and submit the page, I will need to send the data of that document directly to the printer.
I mentioned the report page because I thought redirecting to it and assigning the PK to the corresponding page item could be a suggestion. But I know that I can create a shared component> report query too. But I do not know how could I send the data directly to the printer in either way.
I do not know if the report type - IR, CR or IG would make a difference. That's why I just referred to "report". But I'd need to know how it could be done with all types of reports.
Here is how a real-world scenario would look like,
You enter a supermarket, buy some items, go to the cashier, pay for what you've bought and get a receipt. The receipt is printed when the cashier saves the invoice.
I know this is not how web apps work, but this is the task I am facing.
I can think of branching to the report page after the invoice is saved and setting the PK value to the corresponding page item in the "search criteria" region to get the corresponding data then execute "window.print()". But there will be two problems then. 1- criteria region would be printed too, unless I hide it with a dynamic action or else. 2- The "print dialog box" of the browser will be displayed.
APEX 20.1 added native support for PDF printing of Interactive Grid regions. See this video: https://www.youtube.com/watch?v=e1yIFcEdW_o
If you can't upgrade, or if that support isn't sufficient for your needs, I suggest taking a look at APEX Office Print: https://www.apexofficeprint.com/index.html
APEX Office Print(AOP) can provide you the right solution.
Please try out the solution posted in the below link.
http://dgielis.blogspot.com/2020/01/print-pdf-from-oracle-apex-to-local.html
Few more examples:
How to print to an IP printer:
https://www.apexofficeprint.com/ords/aop_web/r/aop_sample_app_web/5034?session=13740999314649
How to print directly to a zebra printer
https://www.apexofficeprint.com/ords/aop_web/r/aop_sample_app_web/zebra-printer?session=6208952429228
(OR)
https://dgielis.blogspot.com/2020/01/printing-to-local-zebra-printer-from.html
If you are redirected to the Home page,
-> Click on examples in the left side menu.
-> Click on Print(highlighted in yellow).

Using Sitecore publishing agent and publishing an item at specific time

In web.config publishing agent Job is running every 2 minutes. For one item I have added publishing restriction. I have added Publishing from date and time .But the item is getting deleted from web database till that time.
Is this the behavior of sitecore?
Also I tried creating a new version of item and added publishing restriction on that. And it was working as expected. i.e item is not deleted from web database and after specified time it is getting published. Is this solution proper?
Yes, this is how it is supposed to work.
If you specify Publishable From and the Publishable To dates, item will be allowed in web database only between those 2 dates. That means, if you try to publish this item outside that date range, you will in fact unpublish the item. Similarly, if you set only one of those dates or if you clear the Publishable check box.
You can specify date ranges for particular item versions as well. In that scenario, Sitecore will only allow in web database the most recent version with either empty publishing restrictions or with publishing restrictions matching actual time.
You can find more information in Sitecore Content Author's Reference and Cookbook, in the Setting up Publishing Restrictions chapter.
Screenshots and cookbook relate to Sitecore 7.2, but it works in the same way in Sitecore 8.

Sitecore instance showing incorrect workflow state in Page Editor

On our test CM server in content editor, I click Lock and Edit, which moves the page item out of the final workflow state and moves it to the first (in our case "Draft"). I then click Publish > Page Editor. In the Page Editor window, the blue workflow bar, shows the page as still being in the final workflow state. If I make a change to the page in Page Editor and press save, a new version is created...every time I save a new version is created. Back in Content Editor, it still shows as being in Draft. If I login as Admin and look at the workflow fields, it shows as in Draft.
This is only happening in our test CM server. Everything works as expected in our dev environments. To make it even more fun, it appears to not happen everytime...still can't nail down the pattern on when it does work.
Anyone know what could be causing this? It's kinda ruining my day.
I'll also add that I've compared all config files between servers and aside from connection strings, they are identical. I've also checked workflow permissions and those are identical as well.
UPDATE: I've figured out what was causing this behavior, but it opens up a bigger question. What's happening is that time in the Experience tab determines what you see in Page Editor. So, for the pages I was testing, the "version" I was seeing in Content Editor is not the same one I'm seeing Page Editor. The Date on the Experience tab is set to a date prior to the Publishing Restriction which was set when the new version was created.
What is the expected experience of an author in relation to the Date field on the Experience tab? If I set that date, then the date I set it to sticks there forever. If I come back to that page tomorrow, it will still have the last date which was set. This means that authors need to be constantly, manually changing that date to keep it current, which is not a great experience. Is there something I'm missing?

Only allowing Sitecore users to see their own items in Workflow

Is there a way to allow users to see workflow, but only allow them to see their own items within the workflow?
This seems like a problem that would be common. You have a large number of content creators and you only would want them to see how their content is moving in workflow, not the content created by others.
Possible (approximate and messy) solution:
The only possibility I could think of would be to turn off rights inheritance so that I could explicitly deny viewing rights to workflow. Then with a custom action in workflow I could explicitly turn on view rights to each item a user submits.
Am I on the right track? I hope not. ;)
Question Clarification:
I want approvers to see everything, but I want authors to open workflow and only see their own items, not dozens of items from other authors.
This is not the default behaviour as the common use of workflow is for an approval process. In that case the approval team would log in and see the items waiting for approval from the authoring team, if they could only see the items they created then they wouldn't see anything at all.
One way I can think of doing this would be to override the codebeside for the workbox application. Take a look at this file Website\sitecore\shell\Applications\Workbox\Workbox.xml and it's codebeside class Sitecore.Shell.Applications.Workbox.WorkboxForm. If you put your own class in here you could probably add all the logic you need to the 'GetItems' method.
Attacking this from another angle, given you want visibility to the authors on if their items have been approved or not, instead of giving them access to the workbox, why not add a customised email action to the approved status (or the approve command) so that the authors receive an email when their item has been approved. You could also customise the email so that it includes a link to the approved item or includes details of the item so that the author can identify the individual item if they have authored multiple items.
There is a sample email action in the Sitecore.Workflows.Simple.EmailAction class in the Sitecore.Kernel assembly that you can use as a base to your customisations.
If you want to make sure that all items are being approved within a certain timeframe, you could also use the ASR shared source module to generate reports on items that have not been approved within a certain timeframe and have it automatically email this report on a regular basis.