WebSphere Portal 8 Remote Action - websphere-portal

I'm setting up a remote action, but I want to specify the authoring template.
How do I find the atid (or Authoring Template ID)?
Here's the example int he docs:
[plugin:RemoteAction action="new" type="com.ibm.workplace.wcm.api.Content" atid="ID1"]
Here's a link to the docs: http://www-10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Web+Content+Manager+8+Product+Documentation#action=openDocument&res_title=Using_remote_actions_wcm8&content=pdcontent
Name doesn't work, it's looking for an object ID (I think). I tried digging through a WCM data export and I tried following the HTTP requests when accessing authoring templates, but I just can't figure out how to get that ID.
Am I making this more complex than it is?
Any help is greatly appreciated.

I moved the specific elements I needed to get a UUID for and put them in a new library. Then I exported that library by itself and used grep to find references to the Authoring Template and Sie Area I needed.
That did the trick.
-p

If you don't provide the AT id in the remote action call, the URL will direct you to a page with a list of AT's. On that page, if you firebug/inspect element by clicking that specific AT, you'll see its ID in the HTML.

Related

2sxc - Getting URL path from DNN link parameter / Tab ID

I am working on integrating a 2sxc content WebAPI feed into a ReactJS application.
I have managed to get a JSON feed of data into the application, and am in the process of mapping out the data.
I'm wondering what the best practice would be to "resolve" a URL which is coming through as a DNN Page/ Tab ID.
Below I will showcase the various points this is referenced...
First the Setup of the entity / data types...
Then this is an example entry with the data filled out... The page link / URL is set up to point to another internal page on the DNN website:
Finally you can see this data item come through as a JSON feed via the 2sxc API:
What is the best way to convert this piece of data into a URL which can be used in a SPA type application?
There isn't any "server-side" code going on, just reading a JSON feed on the client side...
My initial idea would be to parse this piece of data in JS, to extract the number then use something like this:
http://www.dotnetnuke.com/tabid/85/default.aspx
http://www.dotnetnuke.com/default.aspx?tabid=85
I was hoping someone with more experience would be able to suggest a better / cleaner approach.
Thanks in advance
If you were server-side in Razor you'd be doing something like this:
#using DotNetNuke.Common
View List
XXXX = Dnn.Tab.TabID or define a string with the tab id you want
I seem to have a vague memory that I saw somewhere that Daniel (2sxc) has a way to use Globals.NavigateUrl() or similar on the client side, but I have no idea where or if I did see that.
The Default.aspx?tabid=xx format will certainly work, as it's the oldest DNN convention and is still used in fallbacks. The urls aren't nice, but it's ok.
The reason you're seeing this is because the query doesn't perform the automatic lookup with the AsDynamic(...) does for you. There is an endpoint to look them up, but they are not official, so they could change and therefor I don't want to suggest that you use them.
So if you really want a nicer url, you should either see if DNN has a REST API for this, or you could create a small own 2sxc-api endpoint (in the api folder) just to look that up, then using the NavigateURL. Would be cool if you shared your work.

Loopback : How to get one model data from other mode service method?

I'm using loopback angular sdk I'm having two models Tags and Project. I want to get Tags related to that project. I'm having lb-services. I don't know what method to call and how to call it from services. please help. I've tried this code to get tags which is related to project who's id is 1.
Project.Tag.find(
{ id: 1 }
);
Here's an example from a live app ... For a relationship described like so:
https://github.com/ShoppinPal/warehouse/blob/490cbaccfb60922645173a34d53327629b989028/common/models/user-model.json#L28
I can pull the related models on the angular side like so:
https://github.com/ShoppinPal/warehouse/blob/dbf8d1e25592ec9e76d9f6a5f2af6ba6ca74fd9c/client/app/scripts/controllers/login.js#L57
If your problem is purely syntactical then please paste code from model.json file as well so the community can help detect & fix it.

How to determine (with Salesforce API) in which component a custom field is referenced?

I am new to Salesforce and trying to figure out a way to determine all the components such as ApexPages, ApexClasses, Triggers etc. in which a custom field is referenced.
Is there any API available for this ?
Can metadata API fetch such references of a custom field/object in all components ?
There isn't an elegant way of doing this.
If you have a sandbox, you can attempt to delete the field. If it's referenced in other parts of your org, it will usually not allow you to delete the field and I believe it also gives you a link to where it is referenced. This isn't a complete solution, however, because if you have a field referenced in Javascipt in a VF page or as a field in a dynamic SOQL query (ie. Database.query('Select Id, Custom_Field__c from Account'), Salesforce won't be able to detect that the field is referenced.
A more complete solution requires more effort. I suggest using the Eclipse Plugin or the Ant Migration Tool to download all of your items (Pages, Classes, Triggers) locally. Then you can perform a simple search/find across the text files to find reference to your file.
Finally, a newer option that is probably even easier is to use the Developer Console. It has recently gained the ability to 'Search in Files.' You can open it from inside Developer Console under the 'File' menu option.

href links to old fire version on the server

I have a href link which points to a file on the server but the problem is that it sometimes links to an older version of the file. To be able to access the up-to-date version, i need to clear browsing history/cache. I have tried to clear cache with php, but it doesn't help. Any idea why this is happening, and how to get rid of this problem?
You can add a param to link and force the file download.
link
Multiple ways based on scenarios
Apache Caching directives - If you are the server admin you could use apache's mod_cache to manage caching for specific file(types)
Pass the correct HTML header to the browser directing it not to cache it(its its HTML, PHP etc file where you can control the headers of the request)
Pass a randomly generated number in the end of the url like - url-to-file?1234. where 1234 is a randomly generated number(you could use timestamp also instead of the random number)

Prepopulate fields in Salesforce.com

I have a doubt, i've been working with salesforce for a while and now i have a requirement from a customer.
They need that some custom fields be populated with a value of parent object, making some research on stackoverflow, i found this post, but this isn't working for me because my project is a manage package and when this is installed on a another salesforce instance the id of custom field change.
if someone could help me, I will be grateful.
Thanks!.
I can't see any way of doing the same as that post without using the IDs, I was thinking you could route via a VF page and build up the URL in the controller but it doesn't seem as though you can get the IDs of fields, just their type etc..
I think the best you could do in this instance is to override the default new recordpage with a visualforce page. In the constructor of your controller you could then loop through the page parameters and pre-fill the corresponding fields on the new record before it's displayed on screen. Using fieldsets or just an <apex:Detail> component would keep the level of effort down and also maximise the flexibility of the page for the end users.

Resources