Issue with Content Versioning module

Topics: General, Troubleshooting
Aug 2, 2011 at 10:19 AM

Hi,

 

I've installed the Content Versioning module, but it is not working as expected.

When I click the "Versioning Report" of a particular page, its opening an empty tab called "Loaded" as shown in below image.

I'm not sure what configuration is misssing here.

Please help me.

 

Thanks

Kishore

Developer
Aug 2, 2011 at 10:53 AM

Hi Kishore

Could you please tell:

  1. your C1's build no. (Help > About Composite C1 > Build no.)
  2. Content Versioning's version?

Thanks

/Vitaly

 

Developer
Aug 2, 2011 at 11:41 AM

BTW, I can't see the image...

Developer
Aug 2, 2011 at 11:59 AM

There is a known issue like this with Internet Explorer. It will be fixed in the next version.

Can you try Firefox or Chrome and see if you still get the same issue?

Aug 2, 2011 at 12:34 PM

Thank wysocki

C1's Build NO:

Composite C1 2.1.1

Build no. 2.1.4113.99
Content Versioning: 2.2.4
Aug 2, 2011 at 12:36 PM

hi, it does work in firefox but not in IE.

thanks!

Aug 2, 2011 at 12:36 PM

do you have any idea when will the next verion released for this fix?

Developer
Aug 2, 2011 at 12:47 PM
kish_s wrote:

do you have any idea when will the next verion released for this fix?

I do hope later today or tomorrow the latest.

I'll let you know here.

Thank you for pointing out this bug

Aug 2, 2011 at 1:02 PM

Thanks for the update.

One another help which I can ask on this. I'm trying to extend the workflow context for "Send for Approval",... how do I query the publication status (old vs new), and how do I get the users list who are having approval permission.

Coordinator
Aug 2, 2011 at 5:42 PM
kish_s wrote:

Thanks for the update.

One another help which I can ask on this. I'm trying to extend the workflow context for "Send for Approval",... how do I query the publication status (old vs new), and how do I get the users list who are having approval permission.

  Please check example below:

using Composite.Data;
using Composite.Data.Types;
using Composite.Data.ProcessControlled.ProcessControllers.GenericPublishProcessController;
using Composite.C1Console.Security;
using System.Collections.Generic;
using System.Linq;

public static class MyEventRegistrator
{
    static MyEventRegistrator()
    {
        DataEventSystemFacade.SubscribeToDataAfterUpdate<IPage>(MyPageAfterUpdate, true);
    }

    public static void Initialize()
    {
        // initialization code is in the static constructor
    }

    private static void MyPageAfterUpdate(object sender, DataEventArgs dataEventArgs)
    {
        IPage page = (IPage)dataEventArgs.Data; // A page with data just updated

        //how do I query the publication status:
        if (page.PublicationStatus == GenericPublishProcessController.AwaitingApproval)
        {

            using (DataConnection conn = new DataConnection())
            {
                // how do I get the users list who are having approval permission:
                var allUsers = conn.Get<IUser>();
                var usersWithApprovePermissions = new List<IUser>();

                foreach (var user in allUsers)
                {
                    UserToken userToken = new UserToken(user.Username);
                    List<UserPermissionDefinition> userPermissionDefinitions = PermissionTypeFacade.GetUserPermissionDefinitions(userToken.Username).ToList();
                    List<UserGroupPermissionDefinition> userGroupPermissionDefinitions = PermissionTypeFacade.GetUserGroupPermissionDefinitions(userToken.Username).ToList();
                    DataEntityToken entityToken = page.GetDataEntityToken();

                    var permissions = PermissionTypeFacade.GetCurrentPermissionTypes(userToken, entityToken, userPermissionDefinitions, userGroupPermissionDefinitions).ToList();
                    if (permissions.Contains(PermissionType.Approve))
                    {
                        usersWithApprovePermissions.Add(user);
                    }

                }

                //    send Mail to usersToApprove:
            }
        }
    }
}

Developer
Aug 3, 2011 at 7:41 AM
wysocki wrote:
kish_s wrote:

do you have any idea when will the next verion released for this fix?

I do hope later today or tomorrow the latest.

I'll let you know here.

Thank you for pointing out this bug


v. 2.2.6 with the fix has been just published.

Must be working in IE now.

Aug 3, 2011 at 9:04 AM

Thanks so much for the quick response. you saved my day.

Aug 3, 2011 at 1:18 PM

hi wysocki,

How do we retrieve the Admin URL for preview?

And also how do we send the confirmation message to user once its been approved or published by the approver?

Please help me on this.

Thanks in advance

Kishore

Coordinator
Aug 3, 2011 at 2:38 PM

Hello,

>> How do we retrieve the Admin URL for preview?

	using (DataConnection conn = new DataConnection(PublicationScope.Unpublished))
			{
				var adminPageUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, conn.SitemapNavigator.GetPageNodeById(page.Id).Url);
			}

Just include this link into Email and the content end Editor can  copy/paste the URL into the C1 console's page  browser address bar and instantly get to the page in question.

This link could also work for quick previews unpublished pages by users logged in to the C1 console.

>> And also how do we send the confirmation message to user once its been approved or published by the approver?

You can consider next solution: Get current logged user and then send notification about "Send for Approve" action from this user Email. And then the Approver can answer back from its Email client to this user:

using Composite.Data;
using Composite.Data.Types;
using Composite.Data.ProcessControlled.ProcessControllers.GenericPublishProcessController;
using Composite.C1Console.Security;
using System.Collections.Generic;
using System.Linq;
using System.Web;

public static class MyEventRegistrator
{
	static MyEventRegistrator()
	{
		DataEventSystemFacade.SubscribeToDataAfterUpdate<IPage>(MyPageAfterUpdate, true);
	}

	public static void Initialize()
	{
		// initialization code is in the static constructor
	}

	private static void MyPageAfterUpdate(object sender, DataEventArgs dataEventArgs)
	{
		IPage page = (IPage)dataEventArgs.Data; // A page with data just updated
		
		//how do I query the publication status:
		if (page.PublicationStatus == GenericPublishProcessController.AwaitingApproval)
		{

			using (DataConnection conn = new DataConnection(PublicationScope.Unpublished))
			{
				// how do I get the users list who are having approval permission:
				var allUsers = conn.Get<IUser>().ToList();
				var usersWithApprovePermissions = new List<IUser>();

				foreach (var user in allUsers)
				{
					UserToken userToken = new UserToken(user.Username);
					List<UserPermissionDefinition> userPermissionDefinitions = PermissionTypeFacade.GetUserPermissionDefinitions(userToken.Username).ToList();
					List<UserGroupPermissionDefinition> userGroupPermissionDefinitions = PermissionTypeFacade.GetUserGroupPermissionDefinitions(userToken.Username).ToList();
					DataEntityToken entityToken = page.GetDataEntityToken();

					var permissions = PermissionTypeFacade.GetCurrentPermissionTypes(userToken, entityToken, userPermissionDefinitions, userGroupPermissionDefinitions).ToList();
					if (permissions.Contains(PermissionType.Approve))
					{
						usersWithApprovePermissions.Add(user);
					}

				}

				var currentUserName = UserValidationFacade.GetUsername();
				var currentUser = allUsers.Find(u => u.Username == currentUserName);
				
				// use this Email as MailFrom and then the Approver can answer to this Email with the Status
				string mailFrom = currentUser.Email;

				// How do we retrieve the Admin URL for preview? (Note: need to open connection in Unpublished scope)
				var adminPageUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, conn.SitemapNavigator.GetPageNodeById(page.Id).Url);

				//    send Mail to usersWithApprovePermissions:
			}
		}
	}
}

Aug 3, 2011 at 4:17 PM

Thanks Inna!