Im trying to make new doc type in mfc that reads data from another document type when needed. And my question is- Is this possible and how it should be done ?
You can use CWinApp::GetFirstDocTemplatePosition() and CWinApp::GetNextDocTemplate() to iterate through the doc templates.
Then, for each doc template, use CDocTemplate::GetFirstDocPosition() and CDocTemplate::GetNextDoc() to iterate through the documents.
You will need to make the document data public or provide getters/setters.
Related
I am currently in the process of writing a custom DataProvider. Using the Intergrate External Data documentation.
I've managed to show the external data in the Sitecore back end. However whenever I try to view the data in the items I created, I am getting an error
Null ids are not allowed. <br> Parameter name: displayName
There seems to be precious little on the subject on how to create a custom DataProvider on the Sitecore Developer Network.
The example on their website seems to only show how to import a SINGLE item into a static database. However I am simply trying to merge some items into the hierarchy and I can't find any useful documentation.
It seems that one of your methods that should return an ID doesn't. It might be GetChildIds and/or GetParentId.
Nick Wesselman wrote a good article about it gathering all the information including an example on the Marketplace. I think that is your best start. You can read it here.
Turns out I needed to include at the very least, the Fields->Section->Template in the GetParent method. To be on the safe side I included the Fields/Sections/Templates into my implementations of
GetChildIDs
GetItemDefinition
GetParentID
It wasn't obvious that this was the case, since I had in fact implemented the GetTemplates method correctly, and I had expected that should be enough.
I know "MediaLinkPrefix" can be changed in web.config. But is it possible to change "MediaLinkPrefix" Programmatically? Thanks!
To answer your specific question. No. You cannot programmatically change the value of that setting.
If you are trying to use Sitecore.Resources.Media.MediaManager.GetMediaUrl(mediaItem) to get the URL of a MediaItem then that is leveraging the Sitecore.Resources.Media.MediaProvider, which pulls the value of the MediaLinkPrefixfrom the Sitecore.Resources.Media.MediaConfig class. That property does not have a 'setter'. Furthermore, the value of that property actually comes from Sitecore.Configuration.Settings.Media.MediaLinkPrefix, which also doesn't have a setter and is pulled directly from the config file.
The MediaManager is a static class that I believe isn't able to be swapped out with a custom implementation. And, unlike the LinkManager, the MediaManager is hard coded to use the Sitecore.Resources.Media.MediaProvider so you can't write a custom provider either.
You can do this by creating your own implementation of Sitecore.Links.LinkProvider and set it up in your web.config under the <linkManager> section.
I don't know the exact implementation, but you can inherit a class from Sitecore.Links.LinkProvider and then override the GetItemUrl() method.
Then configure your class to be used as LinkManager.
I would like to have "realtime" like map.
My main question is:
How to use django-olwidget with openlayers OpenLayers.Strategy.Refresh?
Do I need to start back "from scratch" to use manually openlayers?
With django-olwidget, the data is on the web page so the args which define data-source, protocol.
My "second" question is about which format should I choose...
geoJSON? kml? other?
Can those formats contain openlayers point specific "style" specifications like:
{'graphic_name': 'square', 'point_radius': 10, 'fill_color': "#ABBAAB', 'stroke_color':'#BAABBA'}.
I already overriden the default map template olwidget/multi_layer_map.html to access my map object in JS. I think it should be rather simple to apply a js function on each data layers before passing it to the map.
Thanx in advance.
PS: I'm french speaker.
PS2: I asked this question as a feature request on github: https://github.com/yourcelf/olwidget/issues/89
If you're going to use regularly-refreshing data (without refreshing the page) and serialization formats like geoJSON and KML, django-olwidget won't help you very much out of the box. You might find it easier just to use OpenLayers from scratch.
But if you really wanted to use django-olwidget, here's what I would do:
Subclass olwidget.InfoLayer to create a new vector layer type that uses a network-native format like geoJSON or KML to acquire its data.
Add a corresponding python subclass to be able to use it with Django forms or whatever the use case is. You'll probably need to specify things like the URL from which the map will poll its data.
This is a lot of work beyond writing for OpenLayers directly. The advantages would be that you would get easy Django form integration with the same map.
As to which serialization format to use: I'm partial to JSON flavors over XML flavors such as KML, but it really doesn't matter much -- Django and OpenLayers both speak both fluently.
About the styling,you should take a look at the StyleMap[1] where you can set style properties according to attributes.
For the main question, I’m sorry I don’t know django-olwidget…
1 - http://openlayers.org/dev/examples/stylemap.html
I have a custom XML format that needs to be serialized to objects.
I only need to serialize certain tags and ignore the rest.
I have the impression that I need to write my own archive class but there is no documentation that explains how can it be done.
I do not need to save anything, just load the initial state of the object.
Anyone got a pointer for me?
How would I go about creating multiple documents when a single file is opening in a MFC application?
We have an aggregate file format which can contain information for multiple documents. When this file is opened, I would like multiple CDocuments created for each record in the file. We already have a extended CDocManager, so I'm guessing this could be implemented by some logic in OpenDocumentFile. The question is how to pass the information about "I am record x of y" back up from the CDocument class to the doc manager?
If you have several CDocument derived types that store different information, you need a seperate CMultiDocTemplate for each type, typically stored in your CApp derived class. When you call App.Initinstance you initialise each template using something like
m_MyTempate1 = new CAtlasMDITemplate(IDR_RES_TYPE1,
RUNTIME_CLASS(CDocumentType1),
RUNTIME_CLASS(CChildFrameSplitter),
RUNTIME_CLASS(CViewType1));
When you open your base document, you then create and retrieve your additional documents. There are a number of places you could do this in, Serialize probably being the easiest, e.g.
void CDocumentType1::Serialize(CArchive& ar)
{
//
// Do all the document type 1 serialisation
//
// Create second doc
CDocumentType2 *pDoc2 = theApp.m_MyTempate2->OpenDocumentFile(NULL);
pDoc2->Serialize(ar);
}
The more conventional way of doing this though would be to have a single document, with multiple views for accessing the different parts of the aggregate document.