Multiple resources with the same id - android-layout

Although I cannot find a specific reference I assume that you cannot give the same id to resources in two different activities. eg. myTextView in Activity 1 and myTextView (with nothing to link them) in Activity 2. If this is so, how is a ListView in a ListActivity, which has to be called "list", handled when you have two or more ListActivities?

The first thing I would like to tell you is, you can give id's in the XML files not in Activities. However we access those elements in activities via their ids.
You can have same id for two or more elements in different XML files
But you cannot give same id to two or more elements in same XML file
In your activity find out a line in the onCreate method,
setContentView(R.layout.YOUR_XML_FILE);
So whenever you will access any element with an id, it will search only in the above mentioned XML file, not in any other.
So as you will be having different XML files in different activities, so each activity will look for resource in its own XML file. It will have no effect on any other resource in any other XML file.

Related

Passing File Data from Parent Flow to Child Flow

I am struggling with passing file data from a Parent Flow to a Child Flow.
In the parent flow, I use SharePoint Get Items to pull a list containing the individual SharePoint sites within our domain. At the moment, this is running about 230 individual sites. Using Apply to Each, I peruse through the sites using Get Files (properties only) to locate any files created in the last 20 minutes. If there are files created, I again use the Apply to Each, and pass the information to my Child Flow.
The child flow is pretty simple. It responds to the parent; SharePoint Copy File to a new location in SharePoint; Logs the entry into an excel table; then sends an email.
Copies of the flow are below. HOWEVER, here is the challenge. I can not figure out how to identify the file that needs to be passed into the Child. I have played with this for hours.
I beleive the challenge is, I am unable to select the File Identifier from the Get Files Properties Only step in my Dynamic Content Menu...only from the orginal Get Items step. But I might be wrong. Not finding much in my research.
Here is the Detailed View of the Parent Flow
Here is the Detailed view of my Child Flow
In my opinion, the File Identifier is just used to identify the specific file, which is always a necessary parameter in the flow with "*". In the child flow, there are "SharePoint Site", "Hotel" and "Acctfile" to specific which file to use. So there is no need to fill File Identifier in "File Content Name".
What's more, the type of File Identifier data may not match what it should be in "File Content Name".
You could also check what is wrong with this flow from the flow error details.

How to display the folder's columns for a document in a view in Sharepoint 2013 foundation?

I'm trying to create a flat view that shows all documents in a list without folders, but I can't figure out how to get for each document the columns of the parent folder.
We have to keep the folders system, but be able to use filters on this view.
View screenshot with folders
View Screenshot without folders, where I need to get the folder columns
I think this is a misunderstanding of the columns behavior, in fact you are displaying the same columns in both views (except for Modified, Index, ISO Language), however I assume what you really want is to display the same Field Values of the parent folder for each child item, that kind of behavior (values inheritance between folders and child items) isn't possible by just editing the view neither by applying some list settings.
First of all you need to understand that list items, documents and folders are all list items from the system perspective so they have individual properties for each one of them, a folder is just a special type of item that is able to contain other items (strictly speaking is just simulating a container).
In your case the Field Values that are being displayed in the columns of the folders view are values that belong to the folder itself but not to his child items. If you want to propagate those field values for the child items of each folder then you have two options:
Manually: Assign the values to each child item by editing their
properties using the Edit Form or using a Grid View to edit multiple
items faster.
Automatically: Create a Workflow or Event Receiver to copy the values
of the parent folder to each new item/document that is added to the
list/library.
However, as I can see your library is not being used in production yet, so my personal recommendation is to change your approach and use something similar to a Managed Metadata term store instead of folders (folders should be your last option to categorize items/documents, just for cases when you really don't have another way to achieve your goal), with the Managed Metadata approach you are able to apply tags to the items allowing them to belong to multiple categories and being filtered and searched more efficiently, but I know what you may be thinking "how can I do this if the Managed Metadata Service is not available in SharePoint Foundation", well thats why I said "use something similar", there should be more than one third party solution out there that will provide a similar functionality, but if you want to choose the less effort path, just use out-of-the-box Multi-choice field or Multi-lookup field, that you can start to using right now and assign the categories that you want to your items and create different views and filter them.
To achieve this you need to create a new view, or modify an already existing one, in your library.
When you edit or create a new view you are presented with the "Edit view" screen, here you can choose to "Show all files without folders" in the "Folders" section.
See e.g. for more details http://www.bloggedbychris.com/2013/10/19/flatten-document-library-list-sharepoint-2013-2010/ on this particular problem.

How to use a list of values for a parameter?

I am using the test plugin for VS 2012 (although have just installed 2013), and need to know:
Is it possible to have a parameter pass a different value from a selected list while load testing?
I have used the sample load test located here: http://www.visualstudio.com/get-started/load-test-your-app-vs and created a new web test that meets my needs as below.
I have a simple journey recorded that is an email registration web page. The journey is essentially completing name & address, email, conf email, password, conf password. On submission of the form, a verification email is sent.
I need to check that this process can handle around 3000 users. The email to actually send the verification has been hardcoded for test purposes, but I need a unique email to submit the form. I would essentially like to run 3000 test cases through, and just change the email address each time.
What is the best way to do this?
The simple answer is do a web search for data driving (or data driven) Visual Studio web performance tests. You should find many articles and tutorials.
In more detail:
Outline of how to data drive a test
Firstly, Visual Studio distinguishes different types of test. A Load Test is a way of running individual test cases many times, as if by many simultaneous users, gathering data about the test executions and producing a report. The test cases that a load test can execute include Web Performance Tests and Coded UI Tests; both of these can be data driven.
Data driving a Web Performance Test requires a data source. The data can be CSV, XML, Spreadsheet, database and in TFS. I will describe using CSV.
Create a CSV file, containing something similar to the following. Note that the top line of field names is required and those names are used within the test.
Name,Email,Telephone
Fred,fred#example.com,0123 456789
George,george#example.com,0123 456790
Harry,harry#example.com,0123 456791
See also CodedUI test does not read data from CSV input file for some notes CSV file creation.
Open the test project in Visual Studio and open the .webtest file for the test. Use the context (right-click) menu of the top node of the test, ie the test's name (or use the corresponding icon) and select "Add data source ...". Follow the prompts to add the CSV file into the project.
Within the Web Performance Test expand the request to show the form parameters or query string or whatever that is to use the data. View the properties panel of the relevant field and select the appropriate property, in many cases it is the Value property. Click the little triangle for choosing a value for the property. The popup should show the data source, expand the items shown and select the required field. After selecting the field the property will show a value such as {{DataSource1.FileName#csv.Email}}. The doubled curly braces ({{ and }}) indicate the use of a context parameter. All the used data source fields are available as context parameters. All of the data source fields can be made available by altering the Select Columns property of the data source file. Data source field can be used as part of a property value by using values such as
SomeText{{DataSource1.FileName#csv.Email}}AndMoreText
Data source access methods
The data from the datasource can be read and used in four ways. The default is Sequential. Other orders are selected using Solution Explorer to access the properties of the file (eg FileName#csv). The Access Method property can be set to one of:
Sequential data is read sequentially through the file. After the last line of the file is read, the first line of the file will be next line to be read. Thus each line may be read more than once.
Random data is read randomly.
Unique data is read sequentially through the file. After the end of the file is read the test will not be executed again. Thus each line in can only be read once.
Do not move cursor automatically intended for more complex tests where the cursor is moved via calls from plugins.
A web test may use more than one data source file. These files may have different access methods. For example one file containing login names and passwords could be accessed Sequentially and another file with other data could be accessed Randomly. This would allow each login to try many different sets of the other data.
Data sources and loops
Web performance tests may contain loops. The properties of a loop include Advance data cursors. This allows, for example, a data source file to contain items to be found and added to a shopping basket such that each loop iteration adds a new item.

Get sum of values from core data attributes displayed in an outline view populated from a tree controller

I am attempting to learn more about creating apps for OS X and have run into an issue that google has not been able to provide an answer for. The example app I am creating is an RSS reader. I have Core Data Entities of Folder and Feed, with Feed inheriting from Folder.
One attribute of Folder is unreadCount, with type Integer64. Feed inherits this attribute from Folder. The idea is that a display of the count of unread articles in a feed will be displayed and the total number of unread articles of all feeds contained in a folder will be displayed with that folder.
I have an NSTreeController that is managing the Entity Folder. This tree controller populates an outline view with the titles of the folders/feeds and the unreadCount for each feed and folder (right now folder is just defaulting to 0). The unreadCount is getting displayed via a value transformer that takes the integer count and returns its string version. All of this has bee set up with bindings and is working fine.
The issue I am having is in getting the unreadCount of a folder to be the sum of all the unread counts in its feeds. I have Googled for several hours and come across what appears to be a solution for tables populated from array controllers with the #sum.value, but this obviously does not work with tree controllers (from what I can determine anyway).
So, my question, how do I get the displayed unreadCount for a Folder to be the sum of the unreadCounts of the Feeds the Folder contains when the display is an outline view populated from a tree controller?
I suggest you rethink your data model. Instead of having Feed inherit from Folder, use two separate entities connected by a relationship: one Folder has many Feed instances.
Your count can then be supplied by the Model layer: #sum.self.feeds. This gives you the ability to write automated tests, too, and will simplify your life when you need something like the number of unread articles in a particular folder.

get document by id in modx

Very simply I want to have multiple content regions on a single page. Note this is my first Modx site.
So far I have the home page and created child documents for the sub regions on the home page. All I want is to call them in the template.
For example there is a document with an id of 2, and I want the long title on the home page (id of 1).
Something like :
[[~2*longtitle]]
Unfortunately the above just returns the url to that sub document and not the longtitle of that document itself.
So far I've found no documentation on doing so. Does anyone know how to accomplish this?
You have 2 options, the hard way ~ the route you have chosen ;) and the easy way... which I will outline as well.
For what you are trying to do you are going to want to use either getResources http://rtfm.modx.com/display/ADDON/getResources which will allow you to loop over a collection of resources & extract the fields you need [in this case 'content'] or getresourceField http://rtfm.modx.com/display/ADDON/getResourceField which will allow you to specify a single resource & the field to extract, just call it multiple times in your template.
You might try:
[[getResources? &parents='[[*id]]' &tpl='myTpl' &includeContent='1']]
Should get all the child resources [up to default ~ 10] of the current resource, then you would create a template for get resources to loop over:
<h1>[[+longtitle]]</h1>
<p>[[+content]]</p>
notice the use of + instead of * for the resource fields
OR
the easy way, create template variables for your extra content areas, you can set them up as rich text areas as well. that way all your content for any given page is within the one resource ~ no need for you to create child resources to hold content for your header/footer/sidebar/etc
Either way will work, the TV method may use less overhead though.
you can use fastfield
[[#12.pagetitle]]
or in a call
[[#[[+id]].pagetitle]]
You can also grab all TVs of that resource, like
[[#12.myTv]]
see also: http://rtfm.modx.com/extras/revo/fastfield

Resources