I have created a query in my module with this code:
var myName = "something"
var theQuery = _contentManager.Create("Query");
theQuery.As<TitlePart>().Title = myName + "Query";
var filterGroupRecord = new FilterGroupRecord();
var filterRecord = new FilterRecord()
{
Category = "Content", Type = "ContentTypes",
Description = myName , Position = 1,
State = "<Form><Description>" + myName
+ "</Description> <ContentTypes>" + myName + "</ContentTypes></Form>"
};
filterGroupRecord.Filters.Insert(0, filterRecord);
theQuery.As<QueryPart>().FilterGroups.Clear();
theQuery.As<QueryPart>().FilterGroups.Insert(0, filterGroupRecord);
And I know to create a projection widget I should use below code :
var theProjectionWidget = _contentManager.Create("ProjectionWidget");
theProjectionWidget .As<WidgetPart>().Title = myName + "ProjectionWidget";
theProjectionWidget .As<WidgetPart>().RenderTitle = false;
theProjectionWidget .As<WidgetPart>().Zone = "Content";
theProjectionWidget .As<WidgetPart>().Position = "1";
theProjectionWidget .As<WidgetPart>().LayerPart.Name = myName;
But I don't know how to assign the above query to this new projection widget.
How to assign query id to ProjectionPart.QueryLayoutRecordId???!!
I would appreciate any help.
These are links to this discussion in codeproject & codeplex:
http://www.codeproject.com/Questions/876128/How-to-create-a-projection-widget-programmatically
https://orchard.codeplex.com/discussions/580735
After some wrestling with code and debug I found solution for my question.
Anybody with my problem can use this code:
theProjectionWidget.As<ProjectionPart>().Record.QueryPartRecord = new QueryPartRecord(){
ContentItemRecord = theQuery.As<QueryPart>().ContentItem.Record,
FilterGroups = theQuery.As<QueryPart>().FilterGroups,
Id = theQuery.As<QueryPart>().Id,
Layouts = theQuery.As<QueryPart>().Layouts,
SortCriteria = theQuery.As<QueryPart>().SortCriteria
};
Related
The Firefox file sessionstore-backups/recovery.jsonlz4 contains information about the current Firefox windows in (compressed) JSON format. This is a simplified format representative of that file:
{
"index": 2,
"entries": [
{
"title": "Foo bar 0",
"url": "https://example.com/bar"
},
{
"title": "Foo bar 1",
"url": "https://example.com/bar"
},
{
"title": "Foo bar 2",
"url": "https://example.com/bar"
}
]
}
The index field represents the currently-displayed history item per tab. Being 1-indexed, in the example above it represents the "Foo bar 1" entry.
How can I use that value in jq to get that tab?
For testing on your own system, the following bash line will get you to this point on most modern Linux systems:
lz4jsoncat ~/.mozilla/firefox/t6e99qbe.default-release/sessionstore-backups/recovery.jsonlz4 | jq '.windows[0].tabs' | jq 'sort_by(.lastAccessed)[-1]'
This returns the most recent tab, but with all history items in the entries array. As the user could have navigated back in the history, we need the index value to determine which entry to return. Piped through gron, it looks like this:
json = {};
json.attributes = {};
json.entries = [];
json.entries[0] = {};
json.entries[0].ID = 504;
json.entries[0].cacheKey = 0;
json.entries[0].docIdentifier = 586;
json.entries[0].docshellUUID = "{b6c1e18a-d0f5-4ba2-996e-ddd9fc28322a}";
json.entries[0].hasUserInteraction = true;
json.entries[0].persist = true;
json.entries[0].principalToInherit_base64 = "eyIxIjp7IjAiOiJtb3otZXh0ZW5zaW9uOi8vOTAzYWU2NDgtMzRlNi00NGQ3LTg0NjYtYzgxMWQyMTg2YjBkLyJ9fQ==";
json.entries[0].resultPrincipalURI = null;
json.entries[0].title = "Tridactyl Top Tips & New Tab Page";
json.entries[0].triggeringPrincipal_base64 = "eyIxIjp7IjAiOiJtb3otZXh0ZW5zaW9uOi8vOTAzYWU2NDgtMzRlNi00NGQ3LTg0NjYtYzgxMWQyMTg2YjBkLyJ9fQ==";
json.entries[0].url = "moz-extension://7ba85bcd-8d63-4e74-a723-e627a31d6274/static/newtab.html";
json.entries[1] = {};
json.entries[1].ID = 506;
json.entries[1].cacheKey = 0;
json.entries[1].docIdentifier = 588;
json.entries[1].docshellUUID = "{b6c1e18a-d0f5-4ba2-996e-ddd9fc28322a}";
json.entries[1].hasUserInteraction = true;
json.entries[1].persist = true;
json.entries[1].referrerInfo = "BBoSnxDOS9qmDeAnom1e0AAAAAAAAAAAwAAAAAAAAEYAAAAAAAEBAAAAAAEA";
json.entries[1].resultPrincipalURI = null;
json.entries[1].title = "Stack Overflow - Where Developers Learn, Share, & Build Careers";
json.entries[1].triggeringPrincipal_base64 = "eyIzIjp7fX0=";
json.entries[1].url = "https://stackoverflow.com/";
json.entries[2] = {};
json.entries[2].ID = 508;
json.entries[2].cacheKey = 0;
json.entries[2].csp = "CdntGuXUQAS/4CfOuSPZrAAAAAAAAAAAwAAAAAAAAEYB3pRy0IA0EdOTmQAQS6D9QJIHOlRteE8wkTq4cYEyCMYAAAAC/////wAAAbsBAAAAGmh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vAAAAAAAAAAUAAAAIAAAAEQAAAAj/////AAAACP////8AAAAIAAAAEQAAABkAAAABAAAAGQAAAAEAAAAZAAAAAQAAABoAAAAAAAAAGv////8AAAAA/////wAAABn/////AAAAGf////8BAAAAAAAAAAAAKHsiMSI6eyIwIjoiaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS8ifX0AAAABAAAASwB1AHAAZwByAGEAZABlAC0AaQBuAHMAZQBjAHUAcgBlAC0AcgBlAHEAdQBlAHMAdABzADsAIABmAHIAYQBtAGUALQBhAG4AYwBlAHMAdABvAHIAcwAgACcAcwBlAGwAZgAnACAAaAB0AHQAcABzADoALwAvAHMAdABhAGMAawBlAHgAYwBoAGEAbgBnAGUALgBjAG8AbQAA";
json.entries[2].docIdentifier = 590;
json.entries[2].docshellUUID = "{b6c1e18a-d0f5-4ba2-996e-ddd9fc28322a}";
json.entries[2].hasUserInteraction = true;
json.entries[2].persist = true;
json.entries[2].principalToInherit_base64 = "eyIxIjp7IjAiOiJodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tLyJ9fQ==";
json.entries[2].referrerInfo = "BBoSnxDOS9qmDeAnom1e0AAAAAAAAAAAwAAAAAAAAEYBAAAAGmh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vAAAACAEBAAAAGmh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vAQE=";
json.entries[2].resultPrincipalURI = null;
json.entries[2].title = "Highest scored questions - Stack Overflow";
json.entries[2].triggeringPrincipal_base64 = "eyIxIjp7IjAiOiJodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tLyJ9fQ==";
json.entries[2].url = "https://stackoverflow.com/questions";
json.entries[3] = {};
json.entries[3].ID = 510;
json.entries[3].cacheKey = 0;
json.entries[3].csp = "CdntGuXUQAS/4CfOuSPZrAAAAAAAAAAAwAAAAAAAAEYB3pRy0IA0EdOTmQAQS6D9QJIHOlRteE8wkTq4cYEyCMYAAAAC/////wAAAbsBAAAAI2h0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zAAAAAAAAAAUAAAAIAAAAEQAAAAj/////AAAACP////8AAAAIAAAAEQAAABkAAAAKAAAAGQAAAAoAAAAZAAAAAQAAABoAAAAJAAAAGv////8AAAAA/////wAAABn/////AAAAGf////8BAAAAAAAAAAAAMXsiMSI6eyIwIjoiaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMifX0AAAABAAAASwB1AHAAZwByAGEAZABlAC0AaQBuAHMAZQBjAHUAcgBlAC0AcgBlAHEAdQBlAHMAdABzADsAIABmAHIAYQBtAGUALQBhAG4AYwBlAHMAdABvAHIAcwAgACcAcwBlAGwAZgAnACAAaAB0AHQAcABzADoALwAvAHMAdABhAGMAawBlAHgAYwBoAGEAbgBnAGUALgBjAG8AbQAA";
json.entries[3].docIdentifier = 592;
json.entries[3].docshellUUID = "{b6c1e18a-d0f5-4ba2-996e-ddd9fc28322a}";
json.entries[3].hasUserInteraction = true;
json.entries[3].persist = true;
json.entries[3].principalToInherit_base64 = "eyIxIjp7IjAiOiJodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL3F1ZXN0aW9ucyJ9fQ==";
json.entries[3].referrerInfo = "BBoSnxDOS9qmDeAnom1e0AAAAAAAAAAAwAAAAAAAAEYBAAAAI2h0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zAAAACAEBAAAAI2h0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zAQE=";
json.entries[3].resultPrincipalURI = null;
json.entries[3].title = "Tags - Stack Overflow";
json.entries[3].triggeringPrincipal_base64 = "eyIxIjp7IjAiOiJodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL3F1ZXN0aW9ucyJ9fQ==";
json.entries[3].url = "https://stackoverflow.com/tags";
json.entries[4] = {};
json.entries[4].ID = 512;
json.entries[4].cacheKey = 0;
json.entries[4].csp = "CdntGuXUQAS/4CfOuSPZrAAAAAAAAAAAwAAAAAAAAEYB3pRy0IA0EdOTmQAQS6D9QJIHOlRteE8wkTq4cYEyCMYAAAAC/////wAAAbsBAAAAHmh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vdGFncwAAAAAAAAAFAAAACAAAABEAAAAI/////wAAAAj/////AAAACAAAABEAAAAZAAAABQAAABkAAAAFAAAAGQAAAAEAAAAaAAAABAAAABr/////AAAAAP////8AAAAZ/////wAAABn/////AQAAAAAAAAAAACx7IjEiOnsiMCI6Imh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vdGFncyJ9fQAAAAEAAABLAHUAcABnAHIAYQBkAGUALQBpAG4AcwBlAGMAdQByAGUALQByAGUAcQB1AGUAcwB0AHMAOwAgAGYAcgBhAG0AZQAtAGEAbgBjAGUAcwB0AG8AcgBzACAAJwBzAGUAbABmACcAIABoAHQAdABwAHMAOgAvAC8AcwB0AGEAYwBrAGUAeABjAGgAYQBuAGcAZQAuAGMAbwBtAAA=";
json.entries[4].docIdentifier = 594;
json.entries[4].docshellUUID = "{b6c1e18a-d0f5-4ba2-996e-ddd9fc28322a}";
json.entries[4].hasUserInteraction = false;
json.entries[4].persist = true;
json.entries[4].principalToInherit_base64 = "eyIxIjp7IjAiOiJodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL3RhZ3MifX0=";
json.entries[4].referrerInfo = "BBoSnxDOS9qmDeAnom1e0AAAAAAAAAAAwAAAAAAAAEYBAAAAHmh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vdGFncwAAAAgBAQAAAB5odHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL3RhZ3MBAQ==";
json.entries[4].resultPrincipalURI = null;
json.entries[4].title = "Users - Stack Overflow";
json.entries[4].triggeringPrincipal_base64 = "eyIxIjp7IjAiOiJodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL3RhZ3MifX0=";
json.entries[4].url = "https://stackoverflow.com/users";
json.hidden = false;
json.index = 3;
json.lastAccessed = 1651407567904;
json.requestedIndex = 0;
json.searchMode = null;
json.userContextId = 0
Just index entries by index minus one?
.entries[.index - 1]
Online demo
The last item in entries is not necessarily the tab that was opened. [.index - 1] only works if user_pref("browser.sessionstore.max_serialize_forward", 0); cf. https://wiki.mozilla.org/Firefox/session_restore#Browser_settings
I am facing a problem in updating wide live tile while switching from Square Tile to Wide Tile in windows universal app development. It is working fine in Windows surface and Desktop but not on the phone. It is not updating Wide tile could someone please help me?
By default Wide Tile is working fine for us but when we change it from Square Tile to wide tile it is not working in emulator.
Here is our total Sample code:
TileUpdateManager.CreateTileUpdaterForApplication().Clear();
TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
var _tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150PeekImageAndText03);
var tileImage = _tileXml.GetElementsByTagName("image")[0] as Windows.Data.Xml.Dom.XmlElement;
tileImage.SetAttribute("src", "ms-appx:///Assets/Logo.png");
var tileText = _tileXml.GetElementsByTagName("text");
(tileText[0] as Windows.Data.Xml.Dom.XmlElement).InnerText = "xyz";
(tileText[1] as Windows.Data.Xml.Dom.XmlElement).InnerText = "ABC";
(tileText[2] as Windows.Data.Xml.Dom.XmlElement).InnerText = "EFGH";
(tileText[3] as Windows.Data.Xml.Dom.XmlElement).InnerText = "IJKL";
var tileNotification = new TileNotification(_tileXml);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
Windows.Data.Xml.Dom.XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150PeekImageAndText02);
var tileText1 = tileXml.GetElementsByTagName("text");
(tileText1[0] as Windows.Data.Xml.Dom.XmlElement).InnerText ="xyz";
(tileText1[1] as Windows.Data.Xml.Dom.XmlElement).InnerText = "ABC";
(tileText1[2] as Windows.Data.Xml.Dom.XmlElement).InnerText = "EFGH";
(tileText1[3] as Windows.Data.Xml.Dom.XmlElement).InnerText ="IJKL";
(tileText1[4] as Windows.Data.Xml.Dom.XmlElement).InnerText = "Sample App";
var tileImage = tileXml.GetElementsByTagName("image")[0] as Windows.Data.Xml.Dom.XmlElement;
tileImage1.SetAttribute("src", "ms-appx:///Assets/Wide310x150Logo.Scale-100.png");//Assets\Wide310x150Logo.png
TileUpdateManager.CreateTileUpdaterForApplication().Update(new TileNotification(tileXml));
Thanks,
Madhu.
First of all, you better use NotificationsExtensions instead of using xml pattern, which is pretty easier to use.
Then, your code has an issue. By using the official library NotificationsExtensions , the code to update tile should like this:
//small
var smallTileContent = TileContentFactory.CreateTileSquare71x71Image();
smallTileContent.Image.Src = "ms-appdata:///local/" + smallName;
//medium
var mediumTileContent = TileContentFactory.CreateTileSquare150x150Image();
mediumTileContent.RequireSquare71x71Content = true;
mediumTileContent.Square71x71Content = smallTileContent;
mediumTileContent.Image.Src = "ms-appdata:///local/" + middleName;
mediumTileContent.Branding = TileBranding.Logo;
//wide
var wideTileContent = TileContentFactory.CreateTileWide310x150Image();
wideTileContent.RequireSquare150x150Content = true;
wideTileContent.Square150x150Content = mediumTileContent;
wideTileContent.Image.Src = "ms-appdata:///local/" + wideName;
wideTileContent.Branding = TileBranding.Logo;
var largeTileContent = TileContentFactory.CreateTileSquare310x310Image();
largeTileContent.RequireWide310x150Content = true;
largeTileContent.Wide310x150Content = wideTileContent;
largeTileContent.Image.Src = "ms-appdata:///local/" + largeName;
largeTileContent.Branding = TileBranding.Logo;
//Enable notification queue
TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
var notification = largeTileContent.CreateNotification();
TileUpdateManager.CreateTileUpdaterForApplication().Update(notification);
I'm creating a photoshop extension where I need to save the file people are working on and upload it to a server. So I want the extension to be able to automatically choose the current file and upload it to my server.
Problem is I don't know how to pre-select a file for people. Here's my code so far:
var app:Application = Photoshop.app;
var doc:Document = app.documents.add();
doc.selection.selectAll();
var color:RGBColor = new RGBColor();
color.red = 0;
color.green = 0;
color.blue = 255;
doc.selection.fill(color);
var saveOptions:JPEGSaveOptions = new JPEGSaveOptions();
//Add other PDF save options here.
doc.saveAs(File.applicationStorageDirectory, saveOptions);
var jsonOBJ:Object = {};
jsonOBJ.option = "iphone";
jsonOBJ.title = "c";
jsonOBJ.description = "s";
jsonOBJ.app_store_url = "iphone";
jsonOBJ.tags = "c";
jsonOBJ.temp_number = 1;
var _service:HTTPService = new HTTPService();
_service.url = "http://localhost:3000/designs";
_service.method = "POST";
_service.contentType = "application/json";
_service.resultFormat = "text";
_service.useProxy = false;
_service.makeObjectsBindable = true;
_service.addEventListener(FaultEvent.FAULT,faultRX);
_service.addEventListener(ResultEvent.RESULT,resultRX);
_service.showBusyCursor = true;
_service.send( JSON.encode( jsonOBJ ) );
function resultRX():void
{
trace(ResultEvent.RESULT);
}
function faultRX():void
{
trace(FaultEvent.FAULT);
}
var file:FileReference;
var filefilters:Array;
var req:URLRequest;
filefilters = [ new FileFilter('Images', '*.jpg') ]; // add other file filters
file.browse(filefilters);
It's a photoshop extension. I ended up using FileReference and link to the file. it worked. I dunno how to actually upload the image though. When I use file.upload(requestUrl), it sends along a wrong content type. –
Does anyone know how to get all the items that are flagged inside the Inbox using Microsoft Exchange Web-Services?
Apparently they are neither inside Tasks folder (even though they appear there in Outlook), nor do they have IsReminderSet set to true.
Following attempts either return only appointments or true tasks only, but not flagged messages:
var msgsView = new ItemView(100);
var msgsFilter = new SearchFilter.IsEqualTo(ItemSchema.IsReminderSet, true);
var flagged = exSvc.FindItems(WellKnownFolderName.Inbox, msgsFilter, msgsView);
or
var taskView = new ItemView(100);
var tasks = exSvc.FindItems(WellKnownFolderName.Tasks, taskView);
neither work.
I know this question is old, but I just found list sample code which looks like it might do the trick (I haven't tested it myself yet)
source: http://independentsoft.de/exchangewebservices/tutorial/findmessageswithflag.html
IsEqualTo restriction1 = new IsEqualTo(MessagePropertyPath.FlagStatus, "1"); //FlagStatus.Complete
IsEqualTo restriction2 = new IsEqualTo(MessagePropertyPath.FlagStatus, "2"); //FlagStatus.Marked
Or restriction3 = new Or(restriction1, restriction2);
FindItemResponse response = service.FindItem(StandardFolder.Inbox
, MessagePropertyPath.AllPropertyPaths, restriction3);
for (int i = 0; i < response.Items.Count; i++)
{
if (response.Items[i] is Message)
{
Message message = (Message)response.Items[i];
Console.WriteLine("Subject = " + message.Subject);
Console.WriteLine("FlagStatus = " + message.FlagStatus);
Console.WriteLine("FlagIcon = " + message.FlagIcon);
Console.WriteLine("FlagCompleteTime = " + message.FlagCompleteTime);
Console.WriteLine("FlagRequest = " + message.FlagRequest);
Console.WriteLine("-----------------------------------------------");
}
}
I load label and icon from mysql database.
and i'd like to create a list with label and icon field.
So I try to do something like that but it doesn't work indeed each line contain label but icon is empty.
var xmllisteFamille:XMLList = XML(event.result).famille;
var xmlListCollFami = new XMLListCollection(xmllisteFamille);
for each (var item:Object in xmlListCollFami){
var vbox:VBox = new VBox;
vbox.label = item.sdfNom;
trace(vbox.label);
vbox.percentHeight=100;
vbox.percentWidth=100;
var xmlItem2:XMLList = item.commDent;
if(xmlItem2.length()>0){
/*
var listAcc:List = new List();
listAcc.percentHeight = 100;
listAcc.percentWidth =100;
listAcc.labelField = "name";
listAcc.dataProvider = xmlItem2;
vbox.addChild(listAcc);
accOnglet1.addChild(vbox); */
var urlImageRoot : urlManager = new urlManager();
var urlRootDental:String = urlImageRoot.urlDental();
trace(urlRootDental);
var list:Array = new Array();
var object:Object;
var xmlListdetail:XMLListCollection = new XMLListCollection(xmlItem2);
for each (var item2:Object in xmlListdetail)
{
object = new Object();
// -- --
object.label = item2.name;
var rootIcon:String= "http://127.0.0.1:10088/Sys/OEMySQL/Dental/"+item2.photo;
trace("rootIcon " + rootIcon);
object.icon = rootIcon;
trace("object.icon " + object.icon);
list.push(object);
}
/* var aNode:XML;
for each (aNode in xmlItem2)
{
object = new Object();
// -- --
object.label = aNode.name;
object.icon = new urlManager().urlDental()+aNode.photo;
list.push(object);
} */
var arrList:ArrayList;
arrList = new ArrayList(list);
var listAcc:List = new List();
listAcc.percentHeight = 100;
listAcc.percentWidth =100;
listAcc.labelField = "label";
listAcc.iconField="icon";
//listAcc.dataProvider = xmlItem2;
listAcc.dataProvider = arrList;
vbox.addChild(listAcc);
accOnglet1.addChild(vbox);
}
}
}
}
I hope that you can help me.
Thanks
it may be crossdomain issue
you need to know if flash player requires crossdomain.xml in this case
use charles proxy to check what exactly you are sending to server (request) and getting back from server (response)
charles proxy website
I found the solution.
I had to create an itemrenderer and add it in as3 to my list.
thanks