WSO Micro Integrator getting system date during mapping - wso2

I want to get the system date using the Data Mapping operations, so I thought i can do that using the "properties" operation which is supposed to allow me to "uses product-specific runtime variables" as per the documentation, but I couldn't find what is theses variables anyone can guide me how to find the full list of these variables or how to get the system date in the first place?

For example
<property name="date" expression='get-property("SYSTEM_DATE", "yyyyMMddHHmmss")' scope="default"/>
You can check more properties here as well as the SYSTEM_DATE property documentation.

Related

Create SASLibrary Metadata with Extended Attributes Programmatically

Due to a requirement in creating multiple SAS libraries from time to time in the MC, I am trying to figure out how to do this programmatically. These libraries are pointing to external databases. So far, using the available examples I was able to use the following code to create library metadata.
proc metadata in='<AddMetadata>
<Metadata>
<SASLibrary
Name="Test Library"
Desc="This is a test"
Folder="\Shared Data\Test"
Engine="DB2"
IsDBMSLibname="1"
IsHidden="0"
Libref="testlib"
IsPreassigned="0"
PublicType="Library">
</SASLibrary>
</Metadata>
<Reposid>A0000001.A849HGWS</Reposid>
<NS>SAS</NS>
<Flags>268435456</Flags>
<Options/>
</AddMetadata>
';
However this is still missing the resource template, schema name, location (folder name). Is there any way we can add these programmatically as well? Also anyway to update the access templates? Any attributes that I can assign these values to when calling proc metadata? Thanks in advance.
You can use the DATA Step function metadata_newobj("SASLibrary", to programmatically create your libraries. Check the documentation for "METADATA_NEWOBJ Function" for further examples of setting the attributes of the library via rc=metadata_setattr(luri,
Functions are ok but troublesome since you must invoke bunch of them to get desired result. XML as a template works best.
If you have access to SAS Management Console I am recommending enabling Metadata Inspector plugin.
cp -r $SASHOME/SASManagementConsole/9.4/plugins/advanced/omitoolsmc $SASHOME/SASManagementConsole/9.4/plugins/
Then in SASMC you are able to browse metadata of all objects using XML queries. Just go to Tools -> XML Metadata Interface.
Below is example XML fetched using this tool. To place this library in specific folder you need to know folder metadata id (Tree association). Same goes to associating library with a server context (DeployedComponents association) and/or DB2 server.
Of course you need only necessary tags. You can ommit empty ones.
<SASLibrary Name="DB2 Library" Desc="Library description" Engine="DB2" IsDBMSLibname="1" IsHidden="0" IsPreassigned="0" Libref="DB2LIB" PublicType="Library">
<AccessControls/>
<Aliases/>
<AliasFor/>
<Changes/>
<CustomAssociations/>
<DefaultLogin/>
<DeployedComponents>
<ServerContext Id="associated context meta id" />
</DeployedComponents>
<Documents/>
(...)
<Timestamps/>
<Trees>
<Tree Id="folder meta id"/>
</Trees>
<TSObjectNamespace/>
<UsedByPackages/>
<UsedByPrototypes/>
<UsingPackages/>
<UsingPrototype/>
<Variables/>
</SASLibrary>

Sitecore 7 - Content editor error: String was not recognized as a valid DateTime

I'm working with Sitecore 7.0 rev 131127 and when I tried to go to the Content Editor I'm getting the following error:
But when I try to go to other modules such as Marketing Center, it is working.
I tried the following changing following value to false on Sitecore.Social.config but it didn't work for me.
<!-- Is Profile updating at user login functionality enabled. -->
<setting name="Social.ProfileUpdating.EnableProfileUpdating" value="true" />
Can anyone advise on this ?
This is a configuration issue if I'm not mistaken namely your Lucene Index Configrations files within the App_Config/Includes folder. Most likely the Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config file or a custom one created in your solution.
Usually you see these sorts of errors when a TypeConverter is missing from the config, as you can see its referencing the Typeconverter in the StackTrace. E.g. For the index to correctly convert DateTime this line is added to the DefaultIndexConfiguration.config file. Confirm the following line is in your *.DefaultIndexConfiguration.config file(s)
<converter handlesType="System.DateTime" typeConverter="Sitecore.ContentSearch.LuceneProvider.Converters.IndexFieldDateTimeValueConverter, Sitecore.ContentSearch.LuceneProvider" />
It's also worth identifying which Field is causing the error. Perhaps a new field has been added recently to a template or the raw value in a DateTime field is not in the correct format for a DateTime Sitecore stores its dates in ISO 8601 formatted i.e. yyyyMMddThhmmss

Sitecore media publishing to file system when not configured to do so

I have a SiteCore instance where the web.config values for media are as follows:
<setting name="Media.DisableFileMedia" value="false" />
<setting name="Media.UploadAsFiles" value="false" />
<setting name="Media.FileFolder" value="/App_Data/MediaFiles" />
<setting name="Media.UseItemPaths" value="true" />
So, this should mean that the item will be stored in the database and not the file system, correct? I ask because they are being stored on the file system, with a path that looks like this:
/App_Data/Replicated/MediaFiles/6/4/E/{64EC628B-9C94-4416-B9BD-5A90EA7D8971}220px-Liliumbulbiferumflowertop.jpg
Does anyone know why that would be? This is a small part of a larger puzzle I'm trying to understand.
I have learned that users can manually specify whether a file should be uploaded as files on the filesystem. I discovered that content editors on a site I have been developing were doing so out of habit based on past sites they had worked on. To prevent users from having this choice, you may set the Upload.UserSelectableDestination setting to false (default is true).
Media.DisableFileMedia is more to turn on or off the option of either storing the media item in SC or on the file system (in the actual SC UI)
Media.UploadAsFiles is used to indicate whether the media items are put in SC (if false) or on the file system (if true) - If you have DisableFileMedia set to true, then this is ignored and considered to be "true"
Media.FileFolder is obviously the location of where to put the files on the file system, should any the above be set to true.
Media.UseItemPaths actually has nothing to do with storing media items on the file system. It simply is a toggle between showing URLs like "~/media/[item id]" vs the full path of the media item.
I have met the same problem. After the 5 hours of investigation, i found that App_config\Include\ScalabilitySettings.config overrides the Media.FileFolder value. So disable the ScalabilitySettings.config and try again. It will store all file in the folder which was specified by the Media.FileFolder setting.
Answer for solving the problem:
disable App_config\Include\ScalabilitySettings.config or change value of Media.FileFolder in this config

Can YQL Open Data Tables make use of multiple URL fields that its XML scheme seems to support?

As I experiment more and more with making my own Open Data Tables for YQL I find what might be some gaps in the documentation. As I'm a hands-on learner and like to understand everything I use I probe these gaps to try to learn how everything works.
I've noticed that in the XML format for Open Data Tables, there is a <urls> "array" which usually contains just a single <url> element though sometimes there is no <url>. Here's the beginning of a typical ODT XML file:
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="true">
<meta>
<author>Paul Donnelly</author>
<documentationURL>http://developer.netflix.com/docs/REST_API_Reference#0_52696</documentationURL>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url env="all">http://api.netflix.com/catalog/titles/</url>
</urls>
But I can't seem to find in the documentation whether it can ever contain more than one. I can't find any examples that do but when I try adding more than one everything works and no errors are thrown, though I also can't find any way to access the <url> elements beyond the first one.
Is there any use for the url/urls fields being an XML array? Is there any way to make use of more than one url here? Or is it just a quirk of the format that has no real reason?
Is there any use for the url/urls fields being an XML array?
Is there any way to make use of more than one url here?
The <url> elements can have an env attribute. This env attribute can contain all, prod, int, dev, stable, nightly, perf, qaperf, gamma or beta.
When the table is executed, the current environment (the YQL environment, not the more familiar environment file) is checked and the first matching <url> (if any) is used. If no matching env is found (and there is no all, which is pretty self-descriptive) then an error will be issued; for example, "Table not defined in this environment prod".
Note that for public-facing YQL, the environment is prod; only prod and all make sense to be used in your Open Data Tables.
Or is it just a quirk of the format that has no real reason?
Not at all.
I assume that this information is "missing" from the online documentation purely because it is only useful internally within Yahoo!, but equally it could just be another place where the docs are somewhat out-of-date.
Finally, none of the 1,100 or so Community Open Data Tables specify more than one <url>, and only a handful (55) make use of the env attribute (all using the value all).

web service pattern that supports lazy loading of all properties

I am trying to design an endpoint template for a web service. My main requirement is that the caller is able to specify which properties should be populated in the returned result set.
My service returns large lists (up to 1M records) of partial objects as well as individual full objects such as (rough example XML, sorry it's a little verbose)
List:
<items>
<item>
<a>aaa</a>
<b>bbb</b>
</item>
<item>
<a>aaaA</a>
<b>bbbB</b>
</item>
</items>
Detail:
<item>
<a>aaa</a>
<b>bbb</b>
<c>ccc</c>
...
<w>
<x>xxx</x>
<y>yyy</y>
</w>
<z>zzz</z>
</item>
I have considered the following ideas:
Returning the full detail items in the list
Creating a 'list' item type that is shorter
passing a string array of property names that the caller wants to be returned
I am leaning towards the 3rd option but I want something different to that it doesn't support sub objects, I have considered passing the xml schema that you want returned instead of an array.
I would like the API to support lazy loading which is why the 3rd way seems viable as well.
Here's an example of what a function for 3. would look like:
public User GetUser(long ID, string[] properties)
And then the caller could just go:
User.Email = GetUser(User.ID, "Email").Email
Through extensive use of default values and hiding nulls, the returned XML for that would be:
<User>
<ID>123</ID>
<Email>example#example.com</Email>
</User>
Now the problem as mentioned above is trying to make it play nice with things like <w> far above, which itself has sub items as well as the possibility for lists to have sub items.
As I have far too many properties, I cannot have just a ws method for each property.
I am considering option 3. but using an xml schema instead of a string[].. But I can't think of an easy way to define this, I would also like to not have to use String names for properties such as "Email".
The final plan is to have a series of pre-defined schemas that are used commonly and only in advanced cases would we need to actually define the requested properties. But I have no idea of all the systems that will be talking to my API, let alone what properties they might each want (it's not going to be feasible for us to tailor the API for every caller).
Or am I over complicating everything too much?
I found the documentation for the Google APIs on Partial Responses and Partial Updates:
http://googlecode.blogspot.com/2011/07/lightning-fast-performance-tips-for.html
This seems to answer my question.