Can I associate custom metadata with an ALAsset? - ios4

I'm building an iPhone app that, among other things, allows the user to take and store photographs associated with locations. I am currently using the ALAssetLibrary to allow the photographs to be stored in Photos and be accessible outside the app (on a computer for instance via the built-in mechanisms). There is not a lot of technical content out there for working with the ALAssetLibrary but from what there is I have managed to cobble together a working version of this. I have had to resort to storing a dictionary of photo URLS in my app and manually detecting if the photo still exists when displaying lists of them because there does not seem to be a way to add custom metadata to an ALAsset.
What I would really like to do is add two custom metadata fields to each asset to provide it with a title and a custom id value that I can use to filter on when enumerating the asset library.
As a secondary task, I'd like the user to be able to update the title metadata.
Can it be done? At this point, I really don't think it can because the API really doesn't seem to provide the necessary methods to get/set custom metadata. I'm hoping against all odds that there is some other aspect to the AssetLibrary framework that I have not yet discovered.
At a minimum, if someone can authoritatively say "NO" then at least others might find this breadcrumb on their own trail of hope and change tack more quickly!
And, having 0 reputation I can't tag it with AssetLibrary :( wow, this day is just going downhill. FML

I've been looking over the documentation and I dont think it is possible to tack on additional fields to the ALAsset object, well you can create your own object or extend theirs but that wont help you when your pulling back assets because you'll need to init yours and populate it then.
Look I know this falls short of a really good answer but I had to try.

The ALAsset class documentation describes a property - customMetadata. This is documented to be an NSDictionary of whatever custom tags you want. Currently, however, it is not implemented in the class (I've raised a bug on Apple's developer site to bring the issue up).

Related

Assign multiple photos to blog article in Shopify

Is it possible to extend Shopify objects in Liquid? I'm trying to find a way to have there be more than 1 photo associated with articles belonging to a specific blog. I know I can allow users to upload more photos using the settings schema, but I need to access the photo URLs outside of the Blog template/section the same way I'm able to access its direct properties (something like article.images[2]). My understanding is that anything saved from Settings is only accessible from within the Section in which it was defined. Is that accurate?
I have the idea of saving a list of URLs as the article's content and just parse them out of article.content (and hide the list using CSS when the page is displayed), but I'm not seeing any way to do the parsing (no regEx).
I thought of using tags too, but there will be hundreds of articles and potentially several images associated with each article. I"m not sure if there is a max number of tags, but even if there isn't, it seems hack-y (and probably a bit inefficient to create tags that aren't shared by multiple articles. IDK...
Does anyone have any ideas for a good way to do this?
Metafields are done for these type of cases:
https://shopify.dev/api/storefront/2022-01/objects/metafield

2sxc Content App - Locations - How to convert to Canadian and US Addresses with region/state

I am using the latest versions on 2sxc (11.05) and the Content App on DNN 9.06. The Content-Type for Locations does not have a field for Region (or State). Is there already something in place to account for that to get Canadian or US addresses to output normally? I realize I can add the field and then maybe use the Dropdown from Query to hook it up to DNN's list of Regions, and then modify the Views accordingly...
But that seems like a lot of work for something that might already be built in (and I just don't see it?). Or is there another easy way to tackle this?
Truth be told - we never needed that so far, so it doesn't exist.
Is this necessary for maps to work, or just another field which a standard us-address needs? I'm curious because neither outlook nor SharePoint seem to require such a field, so I never really thought about it.
BUT: if you do implement it, please do share it back with us, so we can publish it.
Note that if this is important, a possibly nicer solution would be to use a public api somewhere which provides this information, as it's most certainly more complete & up to date for this purpose. If this is the case, ping me and I'll implement a string-dropdown-from-json or something like that :)

How can I make Content Items without a CommonPart appear in the content list?

I created a custom Type that has a UserPart attached to it.
According to this issue on GitHub you can't add a CommonPart to content that also has a UserPart because it causes a StackOverflowException but I would still like items of my custom Type to show up in the content list. I already store CreatedUtc and PublishedUtc in the custom PartRecord, can I manually plug these in somewhere?
EDIT: For clarification, my specific scenario is that I am building a public facing Orchard website based on existing data that was used in a private application up to this point. I have a legacy table with user accounts that need to be mapped to Orchard Users but they also represent travel agencies that visitors should be able to browse and that Orchard admins should easily be able to edit and create through the Dashboard. I got the idea to create a TravelAgency type with a UserPart from Sipke's webshop tutorial
Content Types do not require to have a CommonPart to show in the Content List. If i remember properly its done by triggering the Creatable() in your migrations.
Also if you have a UserPart, you could Lazy loaded or just reference it via Foreign Key.
Why would you like something like that to be part of the Content List? I usually keep my business-specific Content Types tucked away in a nice section, so there are easier to visualise and use for users.
There is definitely a bug but as they comment you could extend taxonomies to accomplish your task and keep in mind sometimes changing the Orchard Codebase might fit your purposes, you only have to keep track of your changes when you upgrade next time. I have done it a couple of occasions to fit my projects.
If i remember properly, its been a while.. If you look in the core code where the Content List is created it looks for Creatable() Types. digging even more inside the code, chances are the Query in charge will join the CommonPart, hence your problem. You could easily add another query in the controller and add whatever you are after. The problem though, will be refactoring the rest of actions to accommodate your your type too. Way easier isolating your new Type. had to look at it for you, check this baby: Orchard.Core.Contents.Controllers.AdminController

Access to document web parts and widgets in code for a given Kentico TreeNode

I asked this question over on the Kentico devnet but haven't had a definitive answer.
I have a particular requirement for a Kentico 8.2 implementation where in code, given a specific TreeNode, I'd like to find first all the zones on the template being used then, for each zone, get the details of all web parts and widgets used in those zones.
In my case I do not need to worry about template inheritance. None of my pages implement template inheritance.
I found this post on the old Kentico forums which suggested I might be able to do use PageInfoProvider to get a PageInfo object for the relevant TreeNode then use its PageTemplateInfo property to gain access to what I need.
However, I don't see a PageTemplateInfo property of CMS.DocumentEngine.PageInfo. There is DesignPageTemplateInfo and UsedPageTemplateInfo. I thought maybe UsedPageTemplateInfo would be the one, and it does indeed include the correct zones in its WebPartZones collection. But I don't see the web parts (actually, widgets) I'm expecting in the zones' WebParts collections.
I guess what I'm asking is, how can I use API to gain access to the content of the DocumentWebParts column from dbo.CMS_Document as a structured object? I've realised I can get access to the information I need by calling .GetProperty("DocumentWebParts") on TreeNode, but this is unstructured XML. I presume somewhere in the API I can get this information as a structured object.
Does anyone know how I might access the details I need? Thanks.
P.S. My template uses the ASPX+portal model.
As I mentioned in my second answer on the DevNet, you cannot specifically use the cms_document table simply because webparts function within templates and not with a specific page. Widgets on the other hand are specific per page even if the page has the same template as another page. Take a look at the example on the DevNet I provided, it should get you what you're looking for.

Search a specific search of a journal article based on the user type

I have this requirement:
We have a journalarticle and we wish to have sections which have content for internal and external users for the application.
We are able to hide the content from rendering by implementing custom template on web content display and using a simple custom-field for a user which helps us to classify it.
Having said that when we search something as an external user, the search portlet is able to fetch an article where the search text is a part of internal user content, and due to the above mentioned template the content is not visible.
In short, from the user's perspective the resultant article does not match the searched term.
I wish to seek some pointer to check whether there is a mechanism to ensure that when an external user searches something then we only search the dynamic-element of the doc which matches the user type?
We have thousands of such articles and create multiple copy of the same article does not seems viable solution.. so any pointers would be a great help.
Liferay version : 6.2 GA4 CE
Thanks!
AJ
First of all: Not finding a search term in a document can be a sign of good working synonym resolution in the search engine. It's questionable if this behaviour is always wrong or only in this particular case. Remember google bombs?
That being said, I believe that this architecture of half-visible documents is flawed from the beginning. Ideally I'd suggest to change it, for example by splitting the information to two articles, so that you can use the standard permissions to resolve. If you link both, you can determine how/which article or template to use. It's not an ideal solution, but might be a workaround.
Another workaround might be to change Liferay's indexer component and index two different versions of the article, with two different permissions. Of course, you'll have to change the search side as well, so that you'll find each article at most once, even if it's now twice in the search engine.
Again - not ideal, but might be the quickest fix that you can get right now without changing the underlying architecture. However, to change the underlying architecture is my actual recommendation.

Resources