how to customize publish action - sitecore - sitecore

I created a user in sitecore with 2 roles assigned to him i.e author and publisher
When this user who is both author and publisher creates any content he shouldn't be able to publish it.
Can i overwrite the publish action? check on the user who submitted the content and the roles he is assigned to and restrict him with a popup message or something like that? Any help is appreciated.
Thanks.

Follow the below steps to write custom publish actions
For customizing the publish action, Write a c# class and inherit
Sitecore.Shell.Applications.Dialogs.Publish.PublishForm.There
are override methods like ActivePageChanged and OnNext. You can
basically overwrite those classes and write your own alerts with
Sitecore.Web.UI.Sheer.SheerResponse like shown below.
SheerResponse.Alert("The current item will not be published.Please
select both staging and web database to publish the HOME item.");
Copy the Publish.xml file from (your
siteroot/)/sitecore\shell\Applications\Dialogs\Publish.
Create "sitecore\shell\Override\Applications\Dialogs\publish" in root of website
Paste publish.xml in the following folder in root of your site "sitecore\shell\Override\Applications\Dialogs\publish"
Open publish.xml file and modify the Wizard tag
CodeBeside="Sitecore.Shell.Applications.Dialogs.Publish.PublishForm,Sitecore.Cli
ent"
to
CodeBeside="your Class Name with name space here,your Assembly name"
Here is screenshot of how publishoverride form should look like

Related

Google Apps Script - "authorization required" occurring in every Document created from template

I have a Google Document that has a custom UI menu with an option to add a new page to the Doc and populate it with some data. I use this Doc as template for creating numerous other Docs for a single user via webapp.
So my user comes to my webapp, clicks to generate this Document, the document is created from the aforementioned template Doc (containing the bound script to allow the user to add more pages with additional data). The user clicks in the custom menu to create a new page, and before that chunk of code is executed, he gets the 'Authorization Required' screen. I've already prepared him for this so he know how to proceed - no big deal. he goes on to use the Document for his tasks and closes it when he's finished.
He now needs to generate a new Document from the same template and add additional pages just as before. Once again, he gets the 'Authorization Required' screen. Now he's thinking 'I just authorized this... what's gong on?' and is now confused.
Since these Docs are generated on the fly from within the webapp, I have no way to go in and authorize anything but the script in the template before the user gets to it. But is there really no way to authorize that script in the template doc and have it carry over to all the new docs created from it?
Instead of including the code as a bounded project publish it as an add-on. This way the user only will have to authorize the code once.
Related
How to avoid re-authorization request for a copied Google Spreadsheet + script

how to customize payment method in abantecart

I am new to abantecart. i need help with customising the payment method. On clicking on the checkout on the cart page, i'd like to go to a page with a form which the user should fill some payment information (this serves as the payment method). Then an email should be sent to the store owner for approval and when approved an email should be sent to the user on the approval status. Please how can i achieve this?
The best to create new payment is using of AbanteCart Developer Tools.
Just download pack, unpack some of subdirectories (for v.1.2.9 and you should use "1.3" folder) in to your "extensions" directory, then go to admin and install it. Then generate new project with extension type "payment".
You can look into default_pp_standart extension and use it as example to create your custom payment form.

How do I enable editing features in Sitecore page editor?

I'm using Sitecore 7.2 and trying to allow a user to set things like datasources and some custom parameters on sublayouts in page editor mode. The user is a member of sitecore\Designer and sitecore\Author, but when that user tries to edit the component properties, the fields appear grayed out/disabled.
I am able to enable these options by setting a user as an admin, but don't want to grant quite that much power to this particular user.
Here is how tried it and it works on Sitecore 7.2
Create a new user called cbarnes (and in your case if there are other content editors)
Create a new Role - call it say SP Content Editor Authoring
Make that role a member of sitecore\Author and sitecore\Designer. This way it inherits everything from those two roles.
Make the user cbarnes one of the members of that role.
Lastly go to the security editor and give Write permission on the item after selecting the SP Content Editor Authoring Role under Roles and Users section.
Login as cbarnes user and check if it work!
Let us know if this works for you. Happy Sitecoring!
I actually ran into this same issue today on a 7.2 project. While my user had both the sitecore\Designer and sitecore\Author roles as a part of a client-specific author role I created, they were not able to edit rendering parameters.
By default, users in these roles have read-only access the Sitecore\Templates folder. Within this folder I had an additional folder named "Rendering Parameters" where I stored all my rendering parameters templates. I added Write access to the client-specific role for my "Rendering Parameters" template folder and users in that role can now edit and save rendering parameters without elevated permissions.
Use "Access Viewer" tool from Sitecore start menu to define why your user does not have required rights.
By default both roles sitecore\Designer and sitecore\Author have field read and field write access to Layout template section fields. But, it seems that roles have only read access to item that you are trying to edit. You can add write access to that item.
For more details look at Security Administrator´s Cookbook

Populate current user display name in a text box in SharePoint 2013

I have created one custom list and customize it using Info path 2013.I have created data connection using User profile service UserprofileByName.I added one text box in which i want show the current user's display name(e.g. Das, Aditi).The name should populate when user open the form in SharePoint 2013.So I set the default vale of text box as "Value(Name=PreferredName)".
But this is not working.
Please help me to configure out this.
Thanks
You can find good step by step instruction how to achieve this on MSDN (Including User Information section).
One possible reason why your current code does not work could be that you didn't put "Automatically retrieve data when form is opened" in data connection to user profile service. Id you don't put it then you need to add additional rule to FormLoad event to query service.

WSO2 Governance Registry UI customization

Folks,
I'd like to have something like the following in our service registry.
I'd like to add a field to the UI that when I click on it in the UI, it does a select from the database and creates a popup with the data returned from that database select.
is this possible?
For instance, I'd like to have a button on the UI page for a service that when clicked, goes to the database and gets all "METHODS" of the service (I would have previously populated customized database fields after analyzing the service definition, and this button would execute a customized select statement to pull the required data out of the db).
I am not entirely clear about what your requirements is but i think this might help take look at the doc for RXT[1] and see if you can solve your requirement with that :).
[1] http://docs.wso2.org/wiki/pages/viewpage.action?pageId=22185121
Thanks,
Pulasthi